noty-rails 2.2.2 → 2.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/noty-rails/version.rb +1 -1
- data/vendor/assets/javascripts/noty/jquery.noty.js +180 -166
- data/vendor/assets/javascripts/noty/layouts/bottom.js +30 -30
- data/vendor/assets/javascripts/noty/layouts/bottomCenter.js +35 -35
- data/vendor/assets/javascripts/noty/layouts/bottomLeft.js +38 -38
- data/vendor/assets/javascripts/noty/layouts/bottomRight.js +38 -38
- data/vendor/assets/javascripts/noty/layouts/center.js +51 -50
- data/vendor/assets/javascripts/noty/layouts/centerLeft.js +53 -52
- data/vendor/assets/javascripts/noty/layouts/centerRight.js +53 -52
- data/vendor/assets/javascripts/noty/layouts/inline.js +27 -27
- data/vendor/assets/javascripts/noty/layouts/top.js +30 -30
- data/vendor/assets/javascripts/noty/layouts/topCenter.js +35 -35
- data/vendor/assets/javascripts/noty/layouts/topLeft.js +38 -38
- data/vendor/assets/javascripts/noty/layouts/topRight.js +38 -38
- data/vendor/assets/javascripts/noty/packaged/jquery.noty.packaged.js +879 -767
- data/vendor/assets/javascripts/noty/packaged/jquery.noty.packaged.min.js +10 -1
- data/vendor/assets/javascripts/noty/themes/bootstrap.js +62 -0
- data/vendor/assets/javascripts/noty/themes/default.js +175 -143
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca580a2be55891d4803c5de65cae38a3909c1333
|
4
|
+
data.tar.gz: bc39145e91daa32bf7466f7144b23d0f312d076f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0c4413685ca93c8f3454c5fd3bcc353da2dc972671221642d0fd112a5c8a3839dda57029585d6c89b716c334f75d84f71b09b5033271d0fd68b92d002e7fb53
|
7
|
+
data.tar.gz: 2e434fb2bef47217773f17d00622fc2a32ab3f6487e98e967102ee5834b2f933c3181ca6cd891fd91184aff7ef47aaecd9cfe75c015375d9bc65321665b69ec9
|
data/README.md
CHANGED
data/lib/noty-rails/version.rb
CHANGED
@@ -1,16 +1,15 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
Object.create = function (o) {
|
1
|
+
/*!
|
2
|
+
@package noty - jQuery Notification Plugin
|
3
|
+
@version version: 2.2.9
|
4
|
+
@contributors https://github.com/needim/noty/graphs/contributors
|
5
|
+
|
6
|
+
@documentation Examples and Documentation - http://needim.github.com/noty/
|
7
|
+
|
8
|
+
@license Licensed under the MIT licenses: http://www.opensource.org/licenses/mit-license.php
|
9
|
+
*/
|
10
|
+
|
11
|
+
if(typeof Object.create !== 'function') {
|
12
|
+
Object.create = function(o) {
|
14
13
|
function F() {
|
15
14
|
}
|
16
15
|
|
@@ -19,21 +18,21 @@ if (typeof Object.create !== 'function') {
|
|
19
18
|
};
|
20
19
|
}
|
21
20
|
|
22
|
-
(function
|
21
|
+
(function($) {
|
23
22
|
|
24
23
|
var NotyObject = {
|
25
24
|
|
26
|
-
init:function
|
25
|
+
init: function(options) {
|
27
26
|
|
28
27
|
// Mix in the passed in options with the default options
|
29
28
|
this.options = $.extend({}, $.noty.defaults, options);
|
30
29
|
|
31
30
|
this.options.layout = (this.options.custom) ? $.noty.layouts['inline'] : $.noty.layouts[this.options.layout];
|
32
31
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
if($.noty.themes[this.options.theme])
|
33
|
+
this.options.theme = $.noty.themes[this.options.theme];
|
34
|
+
else
|
35
|
+
options.themeClassName = this.options.theme;
|
37
36
|
|
38
37
|
delete options.layout;
|
39
38
|
delete options.theme;
|
@@ -50,7 +49,7 @@ if (typeof Object.create !== 'function') {
|
|
50
49
|
return this;
|
51
50
|
}, // end init
|
52
51
|
|
53
|
-
_build:function
|
52
|
+
_build: function() {
|
54
53
|
|
55
54
|
// Generating noty bar
|
56
55
|
var $bar = $('<div class="noty_bar noty_type_' + this.options.type + '"></div>').attr('id', this.options.id);
|
@@ -58,11 +57,11 @@ if (typeof Object.create !== 'function') {
|
|
58
57
|
|
59
58
|
this.$bar = (this.options.layout.parent.object !== null) ? $(this.options.layout.parent.object).css(this.options.layout.parent.css).append($bar) : $bar;
|
60
59
|
|
61
|
-
|
62
|
-
|
60
|
+
if(this.options.themeClassName)
|
61
|
+
this.$bar.addClass(this.options.themeClassName).addClass('noty_container_type_' + this.options.type);
|
63
62
|
|
64
63
|
// Set buttons if available
|
65
|
-
if
|
64
|
+
if(this.options.buttons) {
|
66
65
|
|
67
66
|
// If we have button disable closeWith & timeout options
|
68
67
|
this.options.closeWith = [];
|
@@ -74,11 +73,11 @@ if (typeof Object.create !== 'function') {
|
|
74
73
|
|
75
74
|
var self = this;
|
76
75
|
|
77
|
-
$.each(this.options.buttons, function
|
76
|
+
$.each(this.options.buttons, function(i, button) {
|
78
77
|
var $button = $('<button/>').addClass((button.addClass) ? button.addClass : 'gray').html(button.text).attr('id', button.id ? button.id : 'button-' + i)
|
79
78
|
.appendTo(self.$bar.find('.noty_buttons'))
|
80
|
-
.
|
81
|
-
if
|
79
|
+
.on('click', function() {
|
80
|
+
if($.isFunction(button.onClick)) {
|
82
81
|
button.onClick.call($button, self);
|
83
82
|
}
|
84
83
|
});
|
@@ -94,14 +93,14 @@ if (typeof Object.create !== 'function') {
|
|
94
93
|
|
95
94
|
}, // end _build
|
96
95
|
|
97
|
-
show:function
|
96
|
+
show: function() {
|
98
97
|
|
99
98
|
var self = this;
|
100
99
|
|
101
|
-
|
100
|
+
(self.options.custom) ? self.options.custom.find(self.options.layout.container.selector).append(self.$bar) : $(self.options.layout.container.selector).append(self.$bar);
|
102
101
|
|
103
|
-
|
104
|
-
|
102
|
+
if(self.options.theme && self.options.theme.style)
|
103
|
+
self.options.theme.style.apply(self);
|
105
104
|
|
106
105
|
($.type(self.options.layout.css) === 'function') ? this.options.layout.css.apply(self.$bar) : self.$bar.css(this.options.layout.css || {});
|
107
106
|
|
@@ -111,48 +110,48 @@ if (typeof Object.create !== 'function') {
|
|
111
110
|
|
112
111
|
self.showing = true;
|
113
112
|
|
114
|
-
|
115
|
-
|
113
|
+
if(self.options.theme && self.options.theme.style)
|
114
|
+
self.options.theme.callback.onShow.apply(this);
|
116
115
|
|
117
|
-
if
|
118
|
-
self.$bar.css('cursor', 'pointer').one('click', function
|
116
|
+
if($.inArray('click', self.options.closeWith) > -1)
|
117
|
+
self.$bar.css('cursor', 'pointer').one('click', function(evt) {
|
119
118
|
self.stopPropagation(evt);
|
120
|
-
if
|
119
|
+
if(self.options.callback.onCloseClick) {
|
121
120
|
self.options.callback.onCloseClick.apply(self);
|
122
121
|
}
|
123
122
|
self.close();
|
124
123
|
});
|
125
124
|
|
126
|
-
if
|
127
|
-
self.$bar.one('mouseenter', function
|
125
|
+
if($.inArray('hover', self.options.closeWith) > -1)
|
126
|
+
self.$bar.one('mouseenter', function() {
|
128
127
|
self.close();
|
129
128
|
});
|
130
129
|
|
131
|
-
if
|
132
|
-
self.$closeButton.one('click', function
|
130
|
+
if($.inArray('button', self.options.closeWith) > -1)
|
131
|
+
self.$closeButton.one('click', function(evt) {
|
133
132
|
self.stopPropagation(evt);
|
134
133
|
self.close();
|
135
134
|
});
|
136
135
|
|
137
|
-
if
|
136
|
+
if($.inArray('button', self.options.closeWith) == -1)
|
138
137
|
self.$closeButton.remove();
|
139
138
|
|
140
|
-
if
|
139
|
+
if(self.options.callback.onShow)
|
141
140
|
self.options.callback.onShow.apply(self);
|
142
141
|
|
143
142
|
self.$bar.animate(
|
144
143
|
self.options.animation.open,
|
145
144
|
self.options.animation.speed,
|
146
145
|
self.options.animation.easing,
|
147
|
-
function
|
148
|
-
if
|
146
|
+
function() {
|
147
|
+
if(self.options.callback.afterShow) self.options.callback.afterShow.apply(self);
|
149
148
|
self.showing = false;
|
150
149
|
self.shown = true;
|
151
150
|
});
|
152
151
|
|
153
152
|
// If noty is have a timeout option
|
154
|
-
if
|
155
|
-
self.$bar.delay(self.options.timeout).promise().done(function
|
153
|
+
if(self.options.timeout)
|
154
|
+
self.$bar.delay(self.options.timeout).promise().done(function() {
|
156
155
|
self.close();
|
157
156
|
});
|
158
157
|
|
@@ -160,26 +159,28 @@ if (typeof Object.create !== 'function') {
|
|
160
159
|
|
161
160
|
}, // end show
|
162
161
|
|
163
|
-
close:function
|
162
|
+
close: function() {
|
164
163
|
|
165
|
-
if
|
166
|
-
if
|
164
|
+
if(this.closed) return;
|
165
|
+
if(this.$bar && this.$bar.hasClass('i-am-closing-now')) return;
|
167
166
|
|
168
167
|
var self = this;
|
169
168
|
|
170
|
-
if
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
169
|
+
if(this.showing) {
|
170
|
+
self.$bar.queue(
|
171
|
+
function() {
|
172
|
+
self.close.apply(self);
|
173
|
+
}
|
174
|
+
);
|
175
|
+
return;
|
177
176
|
}
|
178
177
|
|
179
|
-
|
178
|
+
this.$bar.dequeue();
|
179
|
+
|
180
|
+
if(!this.shown && !this.showing) { // If we are still waiting in the queue just delete from queue
|
180
181
|
var queue = [];
|
181
|
-
$.each($.noty.queue, function
|
182
|
-
if
|
182
|
+
$.each($.noty.queue, function(i, n) {
|
183
|
+
if(n.options.id != self.options.id) {
|
183
184
|
queue.push(n);
|
184
185
|
}
|
185
186
|
});
|
@@ -189,7 +190,7 @@ if (typeof Object.create !== 'function') {
|
|
189
190
|
|
190
191
|
self.$bar.addClass('i-am-closing-now');
|
191
192
|
|
192
|
-
if
|
193
|
+
if(self.options.callback.onClose) {
|
193
194
|
self.options.callback.onClose.apply(self);
|
194
195
|
}
|
195
196
|
|
@@ -197,25 +198,25 @@ if (typeof Object.create !== 'function') {
|
|
197
198
|
self.options.animation.close,
|
198
199
|
self.options.animation.speed,
|
199
200
|
self.options.animation.easing,
|
200
|
-
function
|
201
|
-
if
|
201
|
+
function() {
|
202
|
+
if(self.options.callback.afterClose) self.options.callback.afterClose.apply(self);
|
202
203
|
})
|
203
|
-
.promise().done(function
|
204
|
+
.promise().done(function() {
|
204
205
|
|
205
206
|
// Modal Cleaning
|
206
|
-
if
|
207
|
+
if(self.options.modal) {
|
207
208
|
$.notyRenderer.setModalCount(-1);
|
208
|
-
if
|
209
|
+
if($.notyRenderer.getModalCount() == 0) $('.noty_modal').fadeOut('fast', function() {
|
209
210
|
$(this).remove();
|
210
211
|
});
|
211
212
|
}
|
212
213
|
|
213
214
|
// Layout Cleaning
|
214
215
|
$.notyRenderer.setLayoutCountFor(self, -1);
|
215
|
-
if
|
216
|
+
if($.notyRenderer.getLayoutCountFor(self) == 0) $(self.options.layout.container.selector).remove();
|
216
217
|
|
217
218
|
// Make sure self.$bar has not been removed before attempting to remove it
|
218
|
-
if
|
219
|
+
if(typeof self.$bar !== 'undefined' && self.$bar !== null) {
|
219
220
|
self.$bar.remove();
|
220
221
|
self.$bar = null;
|
221
222
|
self.closed = true;
|
@@ -227,30 +228,30 @@ if (typeof Object.create !== 'function') {
|
|
227
228
|
self.options.theme.callback.onClose.apply(self);
|
228
229
|
}
|
229
230
|
|
230
|
-
if
|
231
|
+
if(!self.options.dismissQueue) {
|
231
232
|
// Queue render
|
232
233
|
$.noty.ontap = true;
|
233
234
|
|
234
235
|
$.notyRenderer.render();
|
235
236
|
}
|
236
237
|
|
237
|
-
|
238
|
-
|
239
|
-
|
238
|
+
if(self.options.maxVisible > 0 && self.options.dismissQueue) {
|
239
|
+
$.notyRenderer.render();
|
240
|
+
}
|
240
241
|
})
|
241
242
|
|
242
243
|
}, // end close
|
243
244
|
|
244
|
-
setText:function
|
245
|
-
if
|
245
|
+
setText: function(text) {
|
246
|
+
if(!this.closed) {
|
246
247
|
this.options.text = text;
|
247
248
|
this.$bar.find('.noty_text').html(text);
|
248
249
|
}
|
249
250
|
return this;
|
250
251
|
},
|
251
252
|
|
252
|
-
setType:function
|
253
|
-
if
|
253
|
+
setType: function(type) {
|
254
|
+
if(!this.closed) {
|
254
255
|
this.options.type = type;
|
255
256
|
this.options.theme.style.apply(this);
|
256
257
|
this.options.theme.callback.onShow.apply(this);
|
@@ -258,41 +259,42 @@ if (typeof Object.create !== 'function') {
|
|
258
259
|
return this;
|
259
260
|
},
|
260
261
|
|
261
|
-
setTimeout:function
|
262
|
-
if
|
262
|
+
setTimeout: function(time) {
|
263
|
+
if(!this.closed) {
|
263
264
|
var self = this;
|
264
265
|
this.options.timeout = time;
|
265
|
-
self.$bar.delay(self.options.timeout).promise().done(function
|
266
|
+
self.$bar.delay(self.options.timeout).promise().done(function() {
|
266
267
|
self.close();
|
267
268
|
});
|
268
269
|
}
|
269
270
|
return this;
|
270
271
|
},
|
271
272
|
|
272
|
-
stopPropagation:function
|
273
|
+
stopPropagation: function(evt) {
|
273
274
|
evt = evt || window.event;
|
274
|
-
if
|
275
|
+
if(typeof evt.stopPropagation !== "undefined") {
|
275
276
|
evt.stopPropagation();
|
276
|
-
}
|
277
|
+
}
|
278
|
+
else {
|
277
279
|
evt.cancelBubble = true;
|
278
280
|
}
|
279
281
|
},
|
280
282
|
|
281
|
-
closed:false,
|
282
|
-
showing:false,
|
283
|
-
shown:false
|
283
|
+
closed : false,
|
284
|
+
showing: false,
|
285
|
+
shown : false
|
284
286
|
|
285
287
|
}; // end NotyObject
|
286
288
|
|
287
289
|
$.notyRenderer = {};
|
288
290
|
|
289
|
-
$.notyRenderer.init = function
|
291
|
+
$.notyRenderer.init = function(options) {
|
290
292
|
|
291
293
|
// Renderer creates a new noty
|
292
294
|
var notification = Object.create(NotyObject).init(options);
|
293
295
|
|
294
|
-
|
295
|
-
|
296
|
+
if(notification.options.killer)
|
297
|
+
$.noty.closeAll();
|
296
298
|
|
297
299
|
(notification.options.force) ? $.noty.queue.unshift(notification) : $.noty.queue.push(notification);
|
298
300
|
|
@@ -301,89 +303,101 @@ if (typeof Object.create !== 'function') {
|
|
301
303
|
return ($.noty.returns == 'object') ? notification : notification.options.id;
|
302
304
|
};
|
303
305
|
|
304
|
-
$.notyRenderer.render = function
|
306
|
+
$.notyRenderer.render = function() {
|
305
307
|
|
306
308
|
var instance = $.noty.queue[0];
|
307
309
|
|
308
|
-
if
|
309
|
-
if
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
310
|
+
if($.type(instance) === 'object') {
|
311
|
+
if(instance.options.dismissQueue) {
|
312
|
+
if(instance.options.maxVisible > 0) {
|
313
|
+
if($(instance.options.layout.container.selector + ' li').length < instance.options.maxVisible) {
|
314
|
+
$.notyRenderer.show($.noty.queue.shift());
|
315
|
+
}
|
316
|
+
else {
|
317
|
+
|
318
|
+
}
|
319
|
+
}
|
320
|
+
else {
|
321
|
+
$.notyRenderer.show($.noty.queue.shift());
|
322
|
+
}
|
323
|
+
}
|
324
|
+
else {
|
325
|
+
if($.noty.ontap) {
|
321
326
|
$.notyRenderer.show($.noty.queue.shift());
|
322
327
|
$.noty.ontap = false;
|
323
328
|
}
|
324
329
|
}
|
325
|
-
}
|
330
|
+
}
|
331
|
+
else {
|
326
332
|
$.noty.ontap = true; // Queue is over
|
327
333
|
}
|
328
334
|
|
329
335
|
};
|
330
336
|
|
331
|
-
$.notyRenderer.show = function
|
337
|
+
$.notyRenderer.show = function(notification) {
|
332
338
|
|
333
|
-
if
|
339
|
+
if(notification.options.modal) {
|
334
340
|
$.notyRenderer.createModalFor(notification);
|
335
341
|
$.notyRenderer.setModalCount(+1);
|
336
342
|
}
|
337
343
|
|
338
344
|
// Where is the container?
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
345
|
+
if(notification.options.custom) {
|
346
|
+
if(notification.options.custom.find(notification.options.layout.container.selector).length == 0) {
|
347
|
+
notification.options.custom.append($(notification.options.layout.container.object).addClass('i-am-new'));
|
348
|
+
}
|
349
|
+
else {
|
350
|
+
notification.options.custom.find(notification.options.layout.container.selector).removeClass('i-am-new');
|
351
|
+
}
|
352
|
+
}
|
353
|
+
else {
|
354
|
+
if($(notification.options.layout.container.selector).length == 0) {
|
355
|
+
$('body').append($(notification.options.layout.container.object).addClass('i-am-new'));
|
356
|
+
}
|
357
|
+
else {
|
358
|
+
$(notification.options.layout.container.selector).removeClass('i-am-new');
|
359
|
+
}
|
360
|
+
}
|
352
361
|
|
353
362
|
$.notyRenderer.setLayoutCountFor(notification, +1);
|
354
363
|
|
355
364
|
notification.show();
|
356
365
|
};
|
357
366
|
|
358
|
-
$.notyRenderer.createModalFor = function
|
359
|
-
if
|
360
|
-
|
367
|
+
$.notyRenderer.createModalFor = function(notification) {
|
368
|
+
if($('.noty_modal').length == 0) {
|
369
|
+
var modal = $('<div/>').addClass('noty_modal').addClass(notification.options.theme).data('noty_modal_count', 0);
|
361
370
|
|
362
|
-
|
363
|
-
|
371
|
+
if(notification.options.theme.modal && notification.options.theme.modal.css)
|
372
|
+
modal.css(notification.options.theme.modal.css);
|
364
373
|
|
365
|
-
|
366
|
-
|
374
|
+
modal.prependTo($('body')).fadeIn('fast');
|
375
|
+
|
376
|
+
if($.inArray('backdrop', notification.options.closeWith) > -1)
|
377
|
+
modal.on('click', function(e) {
|
378
|
+
$.noty.closeAll();
|
379
|
+
});
|
380
|
+
}
|
367
381
|
};
|
368
382
|
|
369
|
-
$.notyRenderer.getLayoutCountFor = function
|
383
|
+
$.notyRenderer.getLayoutCountFor = function(notification) {
|
370
384
|
return $(notification.options.layout.container.selector).data('noty_layout_count') || 0;
|
371
385
|
};
|
372
386
|
|
373
|
-
$.notyRenderer.setLayoutCountFor = function
|
387
|
+
$.notyRenderer.setLayoutCountFor = function(notification, arg) {
|
374
388
|
return $(notification.options.layout.container.selector).data('noty_layout_count', $.notyRenderer.getLayoutCountFor(notification) + arg);
|
375
389
|
};
|
376
390
|
|
377
|
-
$.notyRenderer.getModalCount = function
|
391
|
+
$.notyRenderer.getModalCount = function() {
|
378
392
|
return $('.noty_modal').data('noty_modal_count') || 0;
|
379
393
|
};
|
380
394
|
|
381
|
-
$.notyRenderer.setModalCount = function
|
395
|
+
$.notyRenderer.setModalCount = function(arg) {
|
382
396
|
return $('.noty_modal').data('noty_modal_count', $.notyRenderer.getModalCount() + arg);
|
383
397
|
};
|
384
398
|
|
385
399
|
// This is for custom container
|
386
|
-
$.fn.noty = function
|
400
|
+
$.fn.noty = function(options) {
|
387
401
|
options.custom = $(this);
|
388
402
|
return $.notyRenderer.init(options);
|
389
403
|
};
|
@@ -396,86 +410,86 @@ if (typeof Object.create !== 'function') {
|
|
396
410
|
$.noty.returns = 'object';
|
397
411
|
$.noty.store = {};
|
398
412
|
|
399
|
-
$.noty.get = function
|
413
|
+
$.noty.get = function(id) {
|
400
414
|
return $.noty.store.hasOwnProperty(id) ? $.noty.store[id] : false;
|
401
415
|
};
|
402
416
|
|
403
|
-
$.noty.close = function
|
417
|
+
$.noty.close = function(id) {
|
404
418
|
return $.noty.get(id) ? $.noty.get(id).close() : false;
|
405
419
|
};
|
406
420
|
|
407
|
-
$.noty.setText = function
|
421
|
+
$.noty.setText = function(id, text) {
|
408
422
|
return $.noty.get(id) ? $.noty.get(id).setText(text) : false;
|
409
423
|
};
|
410
424
|
|
411
|
-
$.noty.setType = function
|
425
|
+
$.noty.setType = function(id, type) {
|
412
426
|
return $.noty.get(id) ? $.noty.get(id).setType(type) : false;
|
413
427
|
};
|
414
428
|
|
415
|
-
$.noty.clearQueue = function
|
429
|
+
$.noty.clearQueue = function() {
|
416
430
|
$.noty.queue = [];
|
417
431
|
};
|
418
432
|
|
419
|
-
$.noty.closeAll = function
|
433
|
+
$.noty.closeAll = function() {
|
420
434
|
$.noty.clearQueue();
|
421
|
-
$.each($.noty.store, function
|
435
|
+
$.each($.noty.store, function(id, noty) {
|
422
436
|
noty.close();
|
423
437
|
});
|
424
438
|
};
|
425
439
|
|
426
440
|
var windowAlert = window.alert;
|
427
441
|
|
428
|
-
$.noty.consumeAlert = function
|
429
|
-
window.alert = function
|
430
|
-
if
|
442
|
+
$.noty.consumeAlert = function(options) {
|
443
|
+
window.alert = function(text) {
|
444
|
+
if(options)
|
431
445
|
options.text = text;
|
432
446
|
else
|
433
|
-
options = {text:text};
|
447
|
+
options = {text: text};
|
434
448
|
|
435
449
|
$.notyRenderer.init(options);
|
436
450
|
};
|
437
451
|
};
|
438
452
|
|
439
|
-
$.noty.stopConsumeAlert = function
|
453
|
+
$.noty.stopConsumeAlert = function() {
|
440
454
|
window.alert = windowAlert;
|
441
455
|
};
|
442
456
|
|
443
457
|
$.noty.defaults = {
|
444
|
-
layout:'top',
|
445
|
-
theme:'defaultTheme',
|
446
|
-
type:'alert',
|
447
|
-
text:'',
|
448
|
-
dismissQueue:true,
|
449
|
-
template:'<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>',
|
450
|
-
animation:{
|
451
|
-
open:{height:'toggle'},
|
452
|
-
close:{height:'toggle'},
|
453
|
-
easing:'swing',
|
454
|
-
speed:500
|
458
|
+
layout : 'top',
|
459
|
+
theme : 'defaultTheme',
|
460
|
+
type : 'alert',
|
461
|
+
text : '',
|
462
|
+
dismissQueue: true,
|
463
|
+
template : '<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>',
|
464
|
+
animation : {
|
465
|
+
open : {height: 'toggle'},
|
466
|
+
close : {height: 'toggle'},
|
467
|
+
easing: 'swing',
|
468
|
+
speed : 500
|
455
469
|
},
|
456
|
-
timeout:false,
|
457
|
-
force:false,
|
458
|
-
modal:false,
|
459
|
-
maxVisible:5,
|
460
|
-
|
461
|
-
closeWith:['click'],
|
462
|
-
callback:{
|
463
|
-
onShow:function
|
470
|
+
timeout : false,
|
471
|
+
force : false,
|
472
|
+
modal : false,
|
473
|
+
maxVisible : 5,
|
474
|
+
killer : false,
|
475
|
+
closeWith : ['click'],
|
476
|
+
callback : {
|
477
|
+
onShow : function() {
|
464
478
|
},
|
465
|
-
afterShow:function
|
479
|
+
afterShow : function() {
|
466
480
|
},
|
467
|
-
onClose:function
|
481
|
+
onClose : function() {
|
468
482
|
},
|
469
|
-
afterClose:function
|
483
|
+
afterClose : function() {
|
470
484
|
},
|
471
|
-
onCloseClick:function
|
485
|
+
onCloseClick: function() {
|
472
486
|
}
|
473
487
|
},
|
474
|
-
buttons:false
|
488
|
+
buttons : false
|
475
489
|
};
|
476
490
|
|
477
|
-
$(window).resize
|
478
|
-
$.each($.noty.layouts, function
|
491
|
+
$(window).on('resize', function() {
|
492
|
+
$.each($.noty.layouts, function(index, layout) {
|
479
493
|
layout.container.style.apply($(layout.container.selector));
|
480
494
|
});
|
481
495
|
});
|