alertifyjs-rails 1.4.1 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/alertify.js +97 -8
- data/app/assets/stylesheets/alertify.css +1 -1
- data/app/assets/stylesheets/alertify.rtl.css +1 -1
- data/app/assets/stylesheets/alertify/bootstrap.css +1 -1
- data/app/assets/stylesheets/alertify/bootstrap.rtl.css +1 -1
- data/app/assets/stylesheets/alertify/default.css +1 -1
- data/app/assets/stylesheets/alertify/default.rtl.css +1 -1
- data/app/assets/stylesheets/alertify/semantic.css +1 -1
- data/app/assets/stylesheets/alertify/semantic.rtl.css +1 -1
- data/lib/alertifyjs/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abf9dd50f7fafadaf48d8122fa922179afa2daa7
|
4
|
+
data.tar.gz: 1862091b09d7bd845250ac12da1eeb32c11403cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e041d1c63691dfcd1017b32290437e9120d9dafa854f116ed099f16bc0db4ae29fff2456fd8dec7e11bd81baef2d620b3206107853a0b4864f1f04227869790e
|
7
|
+
data.tar.gz: ba4cc04a0651cf36d73a4be6fbfbd194a8554a8d6dd35f244173f2357607736cb9a68b9b9bc037cc91dade84573ac1763a5b7563181118620df89cc5bd51ac44
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* alertifyjs 1.
|
2
|
+
* alertifyjs 1.5.0 http://alertifyjs.com
|
3
3
|
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
|
4
4
|
* Copyright 2015 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
|
5
5
|
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/
|
@@ -127,7 +127,68 @@
|
|
127
127
|
element.removeChild(element.lastChild);
|
128
128
|
}
|
129
129
|
}
|
130
|
+
/**
|
131
|
+
* Extends a given prototype by merging properties from base into sub.
|
132
|
+
*
|
133
|
+
* @sub {Object} sub The prototype being overwritten.
|
134
|
+
* @base {Object} base The prototype being written.
|
135
|
+
*
|
136
|
+
* @return {Object} The extended prototype.
|
137
|
+
*/
|
138
|
+
function copy(src) {
|
139
|
+
if(null === src)
|
140
|
+
return src;
|
130
141
|
|
142
|
+
if(Array.isArray(src)){
|
143
|
+
var cpy = [];
|
144
|
+
for(var x=0;x<src.length;x+=1){
|
145
|
+
cpy.push(copy(src[x]));
|
146
|
+
}
|
147
|
+
return cpy;
|
148
|
+
}
|
149
|
+
|
150
|
+
if(src instanceof Date){
|
151
|
+
return new Date(src.getTime());
|
152
|
+
}
|
153
|
+
|
154
|
+
if(src instanceof RegExp){
|
155
|
+
var cpy = new RegExp(src.source);
|
156
|
+
cpy.global = src.global;
|
157
|
+
cpy.ignoreCase = src.ignoreCase;
|
158
|
+
cpy.multiline = src.multiline;
|
159
|
+
cpy.lastIndex = src.lastIndex;
|
160
|
+
return cpy;
|
161
|
+
}
|
162
|
+
|
163
|
+
if(typeof src === 'object'){
|
164
|
+
var cpy = {};
|
165
|
+
// copy dialog pototype over definition.
|
166
|
+
for (var prop in src) {
|
167
|
+
if (src.hasOwnProperty(prop)) {
|
168
|
+
cpy[prop] = copy(src[prop]);
|
169
|
+
}
|
170
|
+
}
|
171
|
+
return cpy;
|
172
|
+
}
|
173
|
+
|
174
|
+
return src;
|
175
|
+
}
|
176
|
+
/**
|
177
|
+
* Helper: destruct the dialog
|
178
|
+
*
|
179
|
+
*/
|
180
|
+
function destruct(instance, initialize){
|
181
|
+
//delete the dom and it's references.
|
182
|
+
var root = instance.elements.root;
|
183
|
+
root.parentNode.removeChild(root);
|
184
|
+
delete instance.elements;
|
185
|
+
//copy back initial settings.
|
186
|
+
instance.settings = copy(instance.__settings);
|
187
|
+
//re-reference init function.
|
188
|
+
instance.__init = initialize;
|
189
|
+
//delete __internal variable to allow re-initialization.
|
190
|
+
delete instance.__internal;
|
191
|
+
}
|
131
192
|
|
132
193
|
/**
|
133
194
|
* Use a closure to return proper event listener method. Try to use
|
@@ -315,6 +376,10 @@
|
|
315
376
|
|
316
377
|
//no need to expose init after this.
|
317
378
|
delete instance.__init;
|
379
|
+
|
380
|
+
//keep a copy of initial dialog settings
|
381
|
+
if(!this.__settings)
|
382
|
+
this.__settings = copy(this.settings);
|
318
383
|
|
319
384
|
//in case the script was included before body.
|
320
385
|
//after first dialog gets initialized, it won't be null anymore!
|
@@ -352,13 +417,13 @@
|
|
352
417
|
if(Array.isArray(setup.buttons)){
|
353
418
|
for(var b=0;b<setup.buttons.length;b+=1){
|
354
419
|
var ref = setup.buttons[b],
|
355
|
-
|
420
|
+
cpy = {};
|
356
421
|
for (var i in ref) {
|
357
422
|
if (ref.hasOwnProperty(i)) {
|
358
|
-
|
423
|
+
cpy[i] = ref[i];
|
359
424
|
}
|
360
425
|
}
|
361
|
-
buttonsDefinition.push(
|
426
|
+
buttonsDefinition.push(cpy);
|
362
427
|
}
|
363
428
|
}
|
364
429
|
|
@@ -410,7 +475,8 @@
|
|
410
475
|
buttonsClickHandler:undefined,
|
411
476
|
commandsClickHandler:undefined,
|
412
477
|
transitionInHandler:undefined,
|
413
|
-
transitionOutHandler:undefined
|
478
|
+
transitionOutHandler:undefined,
|
479
|
+
destroy:undefined
|
414
480
|
};
|
415
481
|
|
416
482
|
|
@@ -547,8 +613,8 @@
|
|
547
613
|
*/
|
548
614
|
var scrollX, scrollY;
|
549
615
|
function saveScrollPosition(){
|
550
|
-
scrollX =
|
551
|
-
scrollY =
|
616
|
+
scrollX = getScrollLeft();
|
617
|
+
scrollY = getScrollTop();
|
552
618
|
}
|
553
619
|
function restoreScrollPosition(){
|
554
620
|
window.scrollTo(scrollX, scrollY);
|
@@ -1376,6 +1442,11 @@
|
|
1376
1442
|
instance.__internal.activeElement.focus();
|
1377
1443
|
instance.__internal.activeElement = null;
|
1378
1444
|
}
|
1445
|
+
|
1446
|
+
//destory the instance
|
1447
|
+
if (typeof instance.__internal.destroy === 'function') {
|
1448
|
+
instance.__internal.destroy.apply(instance);
|
1449
|
+
}
|
1379
1450
|
}
|
1380
1451
|
/* Controls moving a dialog around */
|
1381
1452
|
//holde the current moving instance
|
@@ -2296,7 +2367,25 @@
|
|
2296
2367
|
closeOthers:function(){
|
2297
2368
|
alertify.closeAll(this);
|
2298
2369
|
return this;
|
2299
|
-
}
|
2370
|
+
},
|
2371
|
+
/**
|
2372
|
+
* Destroys this dialog instance
|
2373
|
+
*
|
2374
|
+
* @return {undefined}
|
2375
|
+
*/
|
2376
|
+
destroy:function(){
|
2377
|
+
if (this.__internal.isOpen ) {
|
2378
|
+
//mark dialog for destruction, this will be called on tranistionOut event.
|
2379
|
+
this.__internal.destroy = function(){
|
2380
|
+
destruct(this, initialize);
|
2381
|
+
}
|
2382
|
+
//close the dialog to unbind all events.
|
2383
|
+
this.close();
|
2384
|
+
}else{
|
2385
|
+
destruct(this, initialize);
|
2386
|
+
}
|
2387
|
+
return this;
|
2388
|
+
},
|
2300
2389
|
};
|
2301
2390
|
} () );
|
2302
2391
|
var notifier = (function () {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* alertifyjs 1.
|
2
|
+
* alertifyjs 1.5.0 http://alertifyjs.com
|
3
3
|
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
|
4
4
|
* Copyright 2015 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
|
5
5
|
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* alertifyjs 1.
|
2
|
+
* alertifyjs 1.5.0 http://alertifyjs.com
|
3
3
|
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
|
4
4
|
* Copyright 2015 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
|
5
5
|
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* alertifyjs 1.
|
2
|
+
* alertifyjs 1.5.0 http://alertifyjs.com
|
3
3
|
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
|
4
4
|
* Copyright 2015 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
|
5
5
|
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* alertifyjs 1.
|
2
|
+
* alertifyjs 1.5.0 http://alertifyjs.com
|
3
3
|
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
|
4
4
|
* Copyright 2015 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
|
5
5
|
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* alertifyjs 1.
|
2
|
+
* alertifyjs 1.5.0 http://alertifyjs.com
|
3
3
|
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
|
4
4
|
* Copyright 2015 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
|
5
5
|
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* alertifyjs 1.
|
2
|
+
* alertifyjs 1.5.0 http://alertifyjs.com
|
3
3
|
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
|
4
4
|
* Copyright 2015 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
|
5
5
|
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* alertifyjs 1.
|
2
|
+
* alertifyjs 1.5.0 http://alertifyjs.com
|
3
3
|
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
|
4
4
|
* Copyright 2015 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
|
5
5
|
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* alertifyjs 1.
|
2
|
+
* alertifyjs 1.5.0 http://alertifyjs.com
|
3
3
|
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
|
4
4
|
* Copyright 2015 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
|
5
5
|
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alertifyjs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mkhairi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Use Alertify.js (alertifyjs.com) with Rails 3 and 4
|
14
14
|
email:
|