dry-ux 1.49.0 → 1.51.0

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.
@@ -1,1272 +0,0 @@
1
- !function (root, factory) {
2
- if (typeof define === 'function' && define.amd) {
3
- define(['jquery'], factory);
4
- }
5
- else if (typeof exports === 'object') {
6
- module.exports = factory(require('jquery'));
7
- }
8
- else {
9
- factory(root.jQuery);
10
- }
11
- }(this, function ($) {
12
- /*!
13
- @package noty - jQuery Notification Plugin
14
- @version version: 2.3.8
15
- @contributors https://github.com/needim/noty/graphs/contributors
16
-
17
- @documentation Examples and Documentation - http://needim.github.com/noty/
18
-
19
- @license Licensed under the MIT licenses: http://www.opensource.org/licenses/mit-license.php
20
- */
21
- if (typeof Object.create !== 'function') {
22
- Object.create = function (o) {
23
- function F() {
24
- }
25
- F.prototype = o;
26
- return new F();
27
- };
28
- }
29
- var NotyObject = {
30
- init: function (options) {
31
- // Mix in the passed in options with the default options
32
- this.options = $.extend({}, $.noty.defaults, options);
33
- this.options.layout = (this.options.custom) ? $.noty.layouts['inline'] : $.noty.layouts[this.options.layout];
34
- if ($.noty.themes[this.options.theme])
35
- this.options.theme = $.noty.themes[this.options.theme];
36
- else
37
- this.options.themeClassName = this.options.theme;
38
- this.options = $.extend({}, this.options, this.options.layout.options);
39
- this.options.id = 'noty_' + (new Date().getTime() * Math.floor(Math.random() * 1000000));
40
- // Build the noty dom initial structure
41
- this._build();
42
- // return this so we can chain/use the bridge with less code.
43
- return this;
44
- },
45
- _build: function () {
46
- // Generating noty bar
47
- var $bar = $('<div class="noty_bar noty_type_' + this.options.type + '"></div>').attr('id', this.options.id);
48
- $bar.append(this.options.template).find('.noty_text').html(this.options.text);
49
- this.$bar = (this.options.layout.parent.object !== null) ? $(this.options.layout.parent.object).css(this.options.layout.parent.css).append($bar) : $bar;
50
- if (this.options.themeClassName)
51
- this.$bar.addClass(this.options.themeClassName).addClass('noty_container_type_' + this.options.type);
52
- // Set buttons if available
53
- if (this.options.buttons) {
54
- // If we have button disable closeWith & timeout options
55
- this.options.closeWith = [];
56
- this.options.timeout = false;
57
- var $buttons = $('<div/>').addClass('noty_buttons');
58
- (this.options.layout.parent.object !== null) ? this.$bar.find('.noty_bar').append($buttons) : this.$bar.append($buttons);
59
- var self = this;
60
- $.each(this.options.buttons, function (i, button) {
61
- var $button = $('<button/>').addClass((button.addClass) ? button.addClass : 'gray').html(button.text).attr('id', button.id ? button.id : 'button-' + i)
62
- .attr('title', button.title)
63
- .appendTo(self.$bar.find('.noty_buttons'))
64
- .on('click', function (event) {
65
- if ($.isFunction(button.onClick)) {
66
- button.onClick.call($button, self, event);
67
- }
68
- });
69
- });
70
- }
71
- // For easy access
72
- this.$message = this.$bar.find('.noty_message');
73
- this.$closeButton = this.$bar.find('.noty_close');
74
- this.$buttons = this.$bar.find('.noty_buttons');
75
- $.noty.store[this.options.id] = this; // store noty for api
76
- },
77
- show: function () {
78
- var self = this;
79
- (self.options.custom) ? self.options.custom.find(self.options.layout.container.selector).append(self.$bar) : $(self.options.layout.container.selector).append(self.$bar);
80
- if (self.options.theme && self.options.theme.style)
81
- self.options.theme.style.apply(self);
82
- ($.type(self.options.layout.css) === 'function') ? this.options.layout.css.apply(self.$bar) : self.$bar.css(this.options.layout.css || {});
83
- self.$bar.addClass(self.options.layout.addClass);
84
- self.options.layout.container.style.apply($(self.options.layout.container.selector), [self.options.within]);
85
- self.showing = true;
86
- if (self.options.theme && self.options.theme.style)
87
- self.options.theme.callback.onShow.apply(this);
88
- if ($.inArray('click', self.options.closeWith) > -1)
89
- self.$bar.css('cursor', 'pointer').one('click', function (evt) {
90
- self.stopPropagation(evt);
91
- if (self.options.callback.onCloseClick) {
92
- self.options.callback.onCloseClick.apply(self);
93
- }
94
- self.close();
95
- });
96
- if ($.inArray('hover', self.options.closeWith) > -1)
97
- self.$bar.one('mouseenter', function () {
98
- self.close();
99
- });
100
- if ($.inArray('button', self.options.closeWith) > -1)
101
- self.$closeButton.one('click', function (evt) {
102
- self.stopPropagation(evt);
103
- self.close();
104
- });
105
- if ($.inArray('button', self.options.closeWith) == -1)
106
- self.$closeButton.remove();
107
- if (self.options.callback.onShow)
108
- self.options.callback.onShow.apply(self);
109
- if (typeof self.options.animation.open == 'string') {
110
- self.$bar.css('height', self.$bar.innerHeight());
111
- self.$bar.on('click', function (e) {
112
- self.wasClicked = true;
113
- });
114
- self.$bar.show().addClass(self.options.animation.open).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
115
- if (self.options.callback.afterShow)
116
- self.options.callback.afterShow.apply(self);
117
- self.showing = false;
118
- self.shown = true;
119
- if (self.hasOwnProperty('wasClicked')) {
120
- self.$bar.off('click', function (e) {
121
- self.wasClicked = true;
122
- });
123
- self.close();
124
- }
125
- });
126
- }
127
- else {
128
- self.$bar.animate(self.options.animation.open, self.options.animation.speed, self.options.animation.easing, function () {
129
- if (self.options.callback.afterShow)
130
- self.options.callback.afterShow.apply(self);
131
- self.showing = false;
132
- self.shown = true;
133
- });
134
- }
135
- // If noty is have a timeout option
136
- if (self.options.timeout)
137
- self.$bar.delay(self.options.timeout).promise().done(function () {
138
- self.close();
139
- });
140
- return this;
141
- },
142
- close: function () {
143
- if (this.closed)
144
- return;
145
- if (this.$bar && this.$bar.hasClass('i-am-closing-now'))
146
- return;
147
- var self = this;
148
- if (this.showing) {
149
- self.$bar.queue(function () {
150
- self.close.apply(self);
151
- });
152
- return;
153
- }
154
- if (!this.shown && !this.showing) { // If we are still waiting in the queue just delete from queue
155
- var queue = [];
156
- $.each($.noty.queue, function (i, n) {
157
- if (n.options.id != self.options.id) {
158
- queue.push(n);
159
- }
160
- });
161
- $.noty.queue = queue;
162
- return;
163
- }
164
- self.$bar.addClass('i-am-closing-now');
165
- if (self.options.callback.onClose) {
166
- self.options.callback.onClose.apply(self);
167
- }
168
- if (typeof self.options.animation.close == 'string') {
169
- self.$bar.addClass(self.options.animation.close).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
170
- if (self.options.callback.afterClose)
171
- self.options.callback.afterClose.apply(self);
172
- self.closeCleanUp();
173
- });
174
- }
175
- else {
176
- self.$bar.clearQueue().stop().animate(self.options.animation.close, self.options.animation.speed, self.options.animation.easing, function () {
177
- if (self.options.callback.afterClose)
178
- self.options.callback.afterClose.apply(self);
179
- })
180
- .promise().done(function () {
181
- self.closeCleanUp();
182
- });
183
- }
184
- },
185
- closeCleanUp: function () {
186
- var self = this;
187
- // Modal Cleaning
188
- if (self.options.modal) {
189
- $.notyRenderer.setModalCount(-1);
190
- if ($.notyRenderer.getModalCount() == 0)
191
- $('.noty_modal').fadeOut(self.options.animation.fadeSpeed, function () {
192
- $(this).remove();
193
- });
194
- }
195
- // Layout Cleaning
196
- $.notyRenderer.setLayoutCountFor(self, -1);
197
- if ($.notyRenderer.getLayoutCountFor(self) == 0)
198
- $(self.options.layout.container.selector).remove();
199
- // Make sure self.$bar has not been removed before attempting to remove it
200
- if (typeof self.$bar !== 'undefined' && self.$bar !== null) {
201
- if (typeof self.options.animation.close == 'string') {
202
- self.$bar.css('transition', 'all 100ms ease').css('border', 0).css('margin', 0).height(0);
203
- self.$bar.one('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function () {
204
- self.$bar.remove();
205
- self.$bar = null;
206
- self.closed = true;
207
- if (self.options.theme.callback && self.options.theme.callback.onClose) {
208
- self.options.theme.callback.onClose.apply(self);
209
- }
210
- });
211
- }
212
- else {
213
- self.$bar.remove();
214
- self.$bar = null;
215
- self.closed = true;
216
- }
217
- }
218
- delete $.noty.store[self.options.id]; // deleting noty from store
219
- if (self.options.theme.callback && self.options.theme.callback.onClose) {
220
- self.options.theme.callback.onClose.apply(self);
221
- }
222
- if (!self.options.dismissQueue) {
223
- // Queue render
224
- $.noty.ontap = true;
225
- $.notyRenderer.render();
226
- }
227
- if (self.options.maxVisible > 0 && self.options.dismissQueue) {
228
- $.notyRenderer.render();
229
- }
230
- },
231
- setText: function (text) {
232
- if (!this.closed) {
233
- this.options.text = text;
234
- this.$bar.find('.noty_text').html(text);
235
- }
236
- return this;
237
- },
238
- setType: function (type) {
239
- if (!this.closed) {
240
- this.options.type = type;
241
- this.options.theme.style.apply(this);
242
- this.options.theme.callback.onShow.apply(this);
243
- }
244
- return this;
245
- },
246
- setTimeout: function (time) {
247
- if (!this.closed) {
248
- var self = this;
249
- this.options.timeout = time;
250
- self.$bar.delay(self.options.timeout).promise().done(function () {
251
- self.close();
252
- });
253
- }
254
- return this;
255
- },
256
- stopPropagation: function (evt) {
257
- evt = evt || window.event;
258
- if (typeof evt.stopPropagation !== "undefined") {
259
- evt.stopPropagation();
260
- }
261
- else {
262
- evt.cancelBubble = true;
263
- }
264
- },
265
- closed: false,
266
- showing: false,
267
- shown: false
268
- }; // end NotyObject
269
- $.notyRenderer = {};
270
- $.notyRenderer.init = function (options) {
271
- // Renderer creates a new noty
272
- var notification = Object.create(NotyObject).init(options);
273
- if (notification.options.killer)
274
- $.noty.closeAll();
275
- (notification.options.force) ? $.noty.queue.unshift(notification) : $.noty.queue.push(notification);
276
- $.notyRenderer.render();
277
- return ($.noty.returns == 'object') ? notification : notification.options.id;
278
- };
279
- $.notyRenderer.render = function () {
280
- var instance = $.noty.queue[0];
281
- if ($.type(instance) === 'object') {
282
- if (instance.options.dismissQueue) {
283
- if (instance.options.maxVisible > 0) {
284
- if ($(instance.options.layout.container.selector + ' > li').length < instance.options.maxVisible) {
285
- $.notyRenderer.show($.noty.queue.shift());
286
- }
287
- else {
288
- }
289
- }
290
- else {
291
- $.notyRenderer.show($.noty.queue.shift());
292
- }
293
- }
294
- else {
295
- if ($.noty.ontap) {
296
- $.notyRenderer.show($.noty.queue.shift());
297
- $.noty.ontap = false;
298
- }
299
- }
300
- }
301
- else {
302
- $.noty.ontap = true; // Queue is over
303
- }
304
- };
305
- $.notyRenderer.show = function (notification) {
306
- if (notification.options.modal) {
307
- $.notyRenderer.createModalFor(notification);
308
- $.notyRenderer.setModalCount(+1);
309
- }
310
- // Where is the container?
311
- if (notification.options.custom) {
312
- if (notification.options.custom.find(notification.options.layout.container.selector).length == 0) {
313
- notification.options.custom.append($(notification.options.layout.container.object).addClass('i-am-new'));
314
- }
315
- else {
316
- notification.options.custom.find(notification.options.layout.container.selector).removeClass('i-am-new');
317
- }
318
- }
319
- else {
320
- if ($(notification.options.layout.container.selector).length == 0) {
321
- $('body').append($(notification.options.layout.container.object).addClass('i-am-new'));
322
- }
323
- else {
324
- $(notification.options.layout.container.selector).removeClass('i-am-new');
325
- }
326
- }
327
- $.notyRenderer.setLayoutCountFor(notification, +1);
328
- notification.show();
329
- };
330
- $.notyRenderer.createModalFor = function (notification) {
331
- if ($('.noty_modal').length == 0) {
332
- var modal = $('<div/>').addClass('noty_modal').addClass(notification.options.theme).data('noty_modal_count', 0);
333
- if (notification.options.theme.modal && notification.options.theme.modal.css)
334
- modal.css(notification.options.theme.modal.css);
335
- modal.prependTo($('body')).fadeIn(notification.options.animation.fadeSpeed);
336
- if ($.inArray('backdrop', notification.options.closeWith) > -1)
337
- modal.on('click', function (e) {
338
- $.noty.closeAll();
339
- });
340
- }
341
- };
342
- $.notyRenderer.getLayoutCountFor = function (notification) {
343
- return $(notification.options.layout.container.selector).data('noty_layout_count') || 0;
344
- };
345
- $.notyRenderer.setLayoutCountFor = function (notification, arg) {
346
- return $(notification.options.layout.container.selector).data('noty_layout_count', $.notyRenderer.getLayoutCountFor(notification) + arg);
347
- };
348
- $.notyRenderer.getModalCount = function () {
349
- return $('.noty_modal').data('noty_modal_count') || 0;
350
- };
351
- $.notyRenderer.setModalCount = function (arg) {
352
- return $('.noty_modal').data('noty_modal_count', $.notyRenderer.getModalCount() + arg);
353
- };
354
- // This is for custom container
355
- $.fn.noty = function (options) {
356
- options.custom = $(this);
357
- return $.notyRenderer.init(options);
358
- };
359
- $.noty = {};
360
- $.noty.queue = [];
361
- $.noty.ontap = true;
362
- $.noty.layouts = {};
363
- $.noty.themes = {};
364
- $.noty.returns = 'object';
365
- $.noty.store = {};
366
- $.noty.get = function (id) {
367
- return $.noty.store.hasOwnProperty(id) ? $.noty.store[id] : false;
368
- };
369
- $.noty.close = function (id) {
370
- return $.noty.get(id) ? $.noty.get(id).close() : false;
371
- };
372
- $.noty.setText = function (id, text) {
373
- return $.noty.get(id) ? $.noty.get(id).setText(text) : false;
374
- };
375
- $.noty.setType = function (id, type) {
376
- return $.noty.get(id) ? $.noty.get(id).setType(type) : false;
377
- };
378
- $.noty.clearQueue = function () {
379
- $.noty.queue = [];
380
- };
381
- $.noty.closeAll = function () {
382
- $.noty.clearQueue();
383
- $.each($.noty.store, function (id, noty) {
384
- noty.close();
385
- });
386
- };
387
- var windowAlert = window.alert;
388
- $.noty.consumeAlert = function (options) {
389
- window.alert = function (text) {
390
- if (options)
391
- options.text = text;
392
- else
393
- options = { text: text };
394
- $.notyRenderer.init(options);
395
- };
396
- };
397
- $.noty.stopConsumeAlert = function () {
398
- window.alert = windowAlert;
399
- };
400
- $.noty.defaults = {
401
- layout: 'top',
402
- theme: 'defaultTheme',
403
- type: 'alert',
404
- text: '',
405
- dismissQueue: true,
406
- template: '<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>',
407
- animation: {
408
- open: { height: 'toggle' },
409
- close: { height: 'toggle' },
410
- easing: 'swing',
411
- speed: 500,
412
- fadeSpeed: 'fast',
413
- },
414
- timeout: false,
415
- force: false,
416
- modal: false,
417
- maxVisible: 5,
418
- killer: false,
419
- closeWith: ['click'],
420
- callback: {
421
- onShow: function () {
422
- },
423
- afterShow: function () {
424
- },
425
- onClose: function () {
426
- },
427
- afterClose: function () {
428
- },
429
- onCloseClick: function () {
430
- }
431
- },
432
- buttons: false
433
- };
434
- $(window).on('resize', function () {
435
- $.each($.noty.layouts, function (index, layout) {
436
- layout.container.style.apply($(layout.container.selector));
437
- });
438
- });
439
- // Helpers
440
- window.noty = function noty(options) {
441
- return $.notyRenderer.init(options);
442
- };
443
- $.noty.layouts.bottom = {
444
- name: 'bottom',
445
- options: {},
446
- container: {
447
- object: '<ul id="noty_bottom_layout_container" />',
448
- selector: 'ul#noty_bottom_layout_container',
449
- style: function () {
450
- $(this).css({
451
- bottom: 0,
452
- left: '5%',
453
- position: 'fixed',
454
- width: '90%',
455
- height: 'auto',
456
- margin: 0,
457
- padding: 0,
458
- listStyleType: 'none',
459
- zIndex: 9999999
460
- });
461
- }
462
- },
463
- parent: {
464
- object: '<li />',
465
- selector: 'li',
466
- css: {}
467
- },
468
- css: {
469
- display: 'none'
470
- },
471
- addClass: ''
472
- };
473
- $.noty.layouts.bottomCenter = {
474
- name: 'bottomCenter',
475
- options: { // overrides options
476
- },
477
- container: {
478
- object: '<ul id="noty_bottomCenter_layout_container" />',
479
- selector: 'ul#noty_bottomCenter_layout_container',
480
- style: function () {
481
- $(this).css({
482
- bottom: 20,
483
- left: 0,
484
- position: 'fixed',
485
- width: '310px',
486
- height: 'auto',
487
- margin: 0,
488
- padding: 0,
489
- listStyleType: 'none',
490
- zIndex: 10000000
491
- });
492
- $(this).css({
493
- left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px'
494
- });
495
- }
496
- },
497
- parent: {
498
- object: '<li />',
499
- selector: 'li',
500
- css: {}
501
- },
502
- css: {
503
- display: 'none',
504
- width: '310px'
505
- },
506
- addClass: ''
507
- };
508
- $.noty.layouts.bottomLeft = {
509
- name: 'bottomLeft',
510
- options: { // overrides options
511
- },
512
- container: {
513
- object: '<ul id="noty_bottomLeft_layout_container" />',
514
- selector: 'ul#noty_bottomLeft_layout_container',
515
- style: function () {
516
- $(this).css({
517
- bottom: 20,
518
- left: 20,
519
- position: 'fixed',
520
- width: '310px',
521
- height: 'auto',
522
- margin: 0,
523
- padding: 0,
524
- listStyleType: 'none',
525
- zIndex: 10000000
526
- });
527
- if (window.innerWidth < 600) {
528
- $(this).css({
529
- left: 5
530
- });
531
- }
532
- }
533
- },
534
- parent: {
535
- object: '<li />',
536
- selector: 'li',
537
- css: {}
538
- },
539
- css: {
540
- display: 'none',
541
- width: '310px'
542
- },
543
- addClass: ''
544
- };
545
- $.noty.layouts.bottomRight = {
546
- name: 'bottomRight',
547
- options: { // overrides options
548
- },
549
- container: {
550
- object: '<ul id="noty_bottomRight_layout_container" />',
551
- selector: 'ul#noty_bottomRight_layout_container',
552
- style: function () {
553
- $(this).css({
554
- bottom: 20,
555
- right: 20,
556
- position: 'fixed',
557
- width: '310px',
558
- height: 'auto',
559
- margin: 0,
560
- padding: 0,
561
- listStyleType: 'none',
562
- zIndex: 10000000
563
- });
564
- if (window.innerWidth < 600) {
565
- $(this).css({
566
- right: 5
567
- });
568
- }
569
- }
570
- },
571
- parent: {
572
- object: '<li />',
573
- selector: 'li',
574
- css: {}
575
- },
576
- css: {
577
- display: 'none',
578
- width: '310px'
579
- },
580
- addClass: ''
581
- };
582
- $.noty.layouts.center = {
583
- name: 'center',
584
- options: { // overrides options
585
- },
586
- container: {
587
- object: '<ul id="noty_center_layout_container" />',
588
- selector: 'ul#noty_center_layout_container',
589
- style: function () {
590
- $(this).css({
591
- position: 'fixed',
592
- width: '310px',
593
- height: 'auto',
594
- margin: 0,
595
- padding: 0,
596
- listStyleType: 'none',
597
- zIndex: 10000000
598
- });
599
- // getting hidden height
600
- var dupe = $(this).clone().css({ visibility: "hidden", display: "block", position: "absolute", top: 0, left: 0 }).attr('id', 'dupe');
601
- $("body").append(dupe);
602
- dupe.find('.i-am-closing-now').remove();
603
- dupe.find('li').css('display', 'block');
604
- var actual_height = dupe.height();
605
- dupe.remove();
606
- if ($(this).hasClass('i-am-new')) {
607
- $(this).css({
608
- left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px',
609
- top: ($(window).height() - actual_height) / 2 + 'px'
610
- });
611
- }
612
- else {
613
- $(this).animate({
614
- left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px',
615
- top: ($(window).height() - actual_height) / 2 + 'px'
616
- }, 500);
617
- }
618
- }
619
- },
620
- parent: {
621
- object: '<li />',
622
- selector: 'li',
623
- css: {}
624
- },
625
- css: {
626
- display: 'none',
627
- width: '310px'
628
- },
629
- addClass: ''
630
- };
631
- $.noty.layouts.centerLeft = {
632
- name: 'centerLeft',
633
- options: { // overrides options
634
- },
635
- container: {
636
- object: '<ul id="noty_centerLeft_layout_container" />',
637
- selector: 'ul#noty_centerLeft_layout_container',
638
- style: function () {
639
- $(this).css({
640
- left: 20,
641
- position: 'fixed',
642
- width: '310px',
643
- height: 'auto',
644
- margin: 0,
645
- padding: 0,
646
- listStyleType: 'none',
647
- zIndex: 10000000
648
- });
649
- // getting hidden height
650
- var dupe = $(this).clone().css({ visibility: "hidden", display: "block", position: "absolute", top: 0, left: 0 }).attr('id', 'dupe');
651
- $("body").append(dupe);
652
- dupe.find('.i-am-closing-now').remove();
653
- dupe.find('li').css('display', 'block');
654
- var actual_height = dupe.height();
655
- dupe.remove();
656
- if ($(this).hasClass('i-am-new')) {
657
- $(this).css({
658
- top: ($(window).height() - actual_height) / 2 + 'px'
659
- });
660
- }
661
- else {
662
- $(this).animate({
663
- top: ($(window).height() - actual_height) / 2 + 'px'
664
- }, 500);
665
- }
666
- if (window.innerWidth < 600) {
667
- $(this).css({
668
- left: 5
669
- });
670
- }
671
- }
672
- },
673
- parent: {
674
- object: '<li />',
675
- selector: 'li',
676
- css: {}
677
- },
678
- css: {
679
- display: 'none',
680
- width: '310px'
681
- },
682
- addClass: ''
683
- };
684
- $.noty.layouts.centerRight = {
685
- name: 'centerRight',
686
- options: { // overrides options
687
- },
688
- container: {
689
- object: '<ul id="noty_centerRight_layout_container" />',
690
- selector: 'ul#noty_centerRight_layout_container',
691
- style: function () {
692
- $(this).css({
693
- right: 20,
694
- position: 'fixed',
695
- width: '310px',
696
- height: 'auto',
697
- margin: 0,
698
- padding: 0,
699
- listStyleType: 'none',
700
- zIndex: 10000000
701
- });
702
- // getting hidden height
703
- var dupe = $(this).clone().css({ visibility: "hidden", display: "block", position: "absolute", top: 0, left: 0 }).attr('id', 'dupe');
704
- $("body").append(dupe);
705
- dupe.find('.i-am-closing-now').remove();
706
- dupe.find('li').css('display', 'block');
707
- var actual_height = dupe.height();
708
- dupe.remove();
709
- if ($(this).hasClass('i-am-new')) {
710
- $(this).css({
711
- top: ($(window).height() - actual_height) / 2 + 'px'
712
- });
713
- }
714
- else {
715
- $(this).animate({
716
- top: ($(window).height() - actual_height) / 2 + 'px'
717
- }, 500);
718
- }
719
- if (window.innerWidth < 600) {
720
- $(this).css({
721
- right: 5
722
- });
723
- }
724
- }
725
- },
726
- parent: {
727
- object: '<li />',
728
- selector: 'li',
729
- css: {}
730
- },
731
- css: {
732
- display: 'none',
733
- width: '310px'
734
- },
735
- addClass: ''
736
- };
737
- $.noty.layouts.inline = {
738
- name: 'inline',
739
- options: {},
740
- container: {
741
- object: '<ul class="noty_inline_layout_container" />',
742
- selector: 'ul.noty_inline_layout_container',
743
- style: function () {
744
- $(this).css({
745
- width: '100%',
746
- height: 'auto',
747
- margin: 0,
748
- padding: 0,
749
- listStyleType: 'none',
750
- zIndex: 9999999
751
- });
752
- }
753
- },
754
- parent: {
755
- object: '<li />',
756
- selector: 'li',
757
- css: {}
758
- },
759
- css: {
760
- display: 'none'
761
- },
762
- addClass: ''
763
- };
764
- $.noty.layouts.top = {
765
- name: 'top',
766
- options: {},
767
- container: {
768
- object: '<ul id="noty_top_layout_container" />',
769
- selector: 'ul#noty_top_layout_container',
770
- style: function () {
771
- $(this).css({
772
- top: 0,
773
- left: '5%',
774
- position: 'fixed',
775
- width: '90%',
776
- height: 'auto',
777
- margin: 0,
778
- padding: 0,
779
- listStyleType: 'none',
780
- zIndex: 9999999
781
- });
782
- }
783
- },
784
- parent: {
785
- object: '<li />',
786
- selector: 'li',
787
- css: {}
788
- },
789
- css: {
790
- display: 'none'
791
- },
792
- addClass: ''
793
- };
794
- $.noty.layouts.topCenter = {
795
- name: 'topCenter',
796
- options: { // overrides options
797
- },
798
- container: {
799
- object: '<ul id="noty_topCenter_layout_container" />',
800
- selector: 'ul#noty_topCenter_layout_container',
801
- style: function () {
802
- $(this).css({
803
- top: 20,
804
- left: 0,
805
- position: 'fixed',
806
- width: '310px',
807
- height: 'auto',
808
- margin: 0,
809
- padding: 0,
810
- listStyleType: 'none',
811
- zIndex: 10000000
812
- });
813
- $(this).css({
814
- left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px'
815
- });
816
- }
817
- },
818
- parent: {
819
- object: '<li />',
820
- selector: 'li',
821
- css: {}
822
- },
823
- css: {
824
- display: 'none',
825
- width: '310px'
826
- },
827
- addClass: ''
828
- };
829
- $.noty.layouts.topLeft = {
830
- name: 'topLeft',
831
- options: { // overrides options
832
- },
833
- container: {
834
- object: '<ul id="noty_topLeft_layout_container" />',
835
- selector: 'ul#noty_topLeft_layout_container',
836
- style: function () {
837
- $(this).css({
838
- top: 20,
839
- left: 20,
840
- position: 'fixed',
841
- width: '310px',
842
- height: 'auto',
843
- margin: 0,
844
- padding: 0,
845
- listStyleType: 'none',
846
- zIndex: 10000000
847
- });
848
- if (window.innerWidth < 600) {
849
- $(this).css({
850
- left: 5
851
- });
852
- }
853
- }
854
- },
855
- parent: {
856
- object: '<li />',
857
- selector: 'li',
858
- css: {}
859
- },
860
- css: {
861
- display: 'none',
862
- width: '310px'
863
- },
864
- addClass: ''
865
- };
866
- $.noty.layouts.topRight = {
867
- name: 'topRight',
868
- options: { // overrides options
869
- },
870
- container: {
871
- object: '<ul id="noty_topRight_layout_container" />',
872
- selector: 'ul#noty_topRight_layout_container',
873
- style: function () {
874
- $(this).css({
875
- top: 20,
876
- right: 20,
877
- position: 'fixed',
878
- width: '310px',
879
- height: 'auto',
880
- margin: 0,
881
- padding: 0,
882
- listStyleType: 'none',
883
- zIndex: 10000000
884
- });
885
- if (window.innerWidth < 600) {
886
- $(this).css({
887
- right: 5
888
- });
889
- }
890
- }
891
- },
892
- parent: {
893
- object: '<li />',
894
- selector: 'li',
895
- css: {}
896
- },
897
- css: {
898
- display: 'none',
899
- width: '310px'
900
- },
901
- addClass: ''
902
- };
903
- $.noty.themes.bootstrapTheme = {
904
- name: 'bootstrapTheme',
905
- modal: {
906
- css: {
907
- position: 'fixed',
908
- width: '100%',
909
- height: '100%',
910
- backgroundColor: '#000',
911
- zIndex: 10000,
912
- opacity: 0.6,
913
- display: 'none',
914
- left: 0,
915
- top: 0
916
- }
917
- },
918
- style: function () {
919
- var containerSelector = this.options.layout.container.selector;
920
- $(containerSelector).addClass('list-group');
921
- this.$closeButton.append('<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>');
922
- this.$closeButton.addClass('close');
923
- this.$bar.addClass("list-group-item").css('padding', '0px');
924
- switch (this.options.type) {
925
- case 'alert':
926
- case 'notification':
927
- this.$bar.addClass("list-group-item-info");
928
- break;
929
- case 'warning':
930
- this.$bar.addClass("list-group-item-warning");
931
- break;
932
- case 'error':
933
- this.$bar.addClass("list-group-item-danger");
934
- break;
935
- case 'information':
936
- this.$bar.addClass("list-group-item-info");
937
- break;
938
- case 'success':
939
- this.$bar.addClass("list-group-item-success");
940
- break;
941
- }
942
- this.$message.css({
943
- fontSize: '13px',
944
- lineHeight: '16px',
945
- textAlign: 'center',
946
- padding: '8px 10px 9px',
947
- width: 'auto',
948
- position: 'relative'
949
- });
950
- },
951
- callback: {
952
- onShow: function () { },
953
- onClose: function () { }
954
- }
955
- };
956
- $.noty.themes.defaultTheme = {
957
- name: 'defaultTheme',
958
- helpers: {
959
- borderFix: function () {
960
- if (this.options.dismissQueue) {
961
- var selector = this.options.layout.container.selector + ' ' + this.options.layout.parent.selector;
962
- switch (this.options.layout.name) {
963
- case 'top':
964
- $(selector).css({ borderRadius: '0px 0px 0px 0px' });
965
- $(selector).last().css({ borderRadius: '0px 0px 5px 5px' });
966
- break;
967
- case 'topCenter':
968
- case 'topLeft':
969
- case 'topRight':
970
- case 'bottomCenter':
971
- case 'bottomLeft':
972
- case 'bottomRight':
973
- case 'center':
974
- case 'centerLeft':
975
- case 'centerRight':
976
- case 'inline':
977
- $(selector).css({ borderRadius: '0px 0px 0px 0px' });
978
- $(selector).first().css({ 'border-top-left-radius': '5px', 'border-top-right-radius': '5px' });
979
- $(selector).last().css({ 'border-bottom-left-radius': '5px', 'border-bottom-right-radius': '5px' });
980
- break;
981
- case 'bottom':
982
- $(selector).css({ borderRadius: '0px 0px 0px 0px' });
983
- $(selector).first().css({ borderRadius: '5px 5px 0px 0px' });
984
- break;
985
- default:
986
- break;
987
- }
988
- }
989
- }
990
- },
991
- modal: {
992
- css: {
993
- position: 'fixed',
994
- width: '100%',
995
- height: '100%',
996
- backgroundColor: '#000',
997
- zIndex: 10000,
998
- opacity: 0.6,
999
- display: 'none',
1000
- left: 0,
1001
- top: 0
1002
- }
1003
- },
1004
- style: function () {
1005
- this.$bar.css({
1006
- overflow: 'hidden',
1007
- background: "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAoCAQAAAClM0ndAAAAhklEQVR4AdXO0QrCMBBE0bttkk38/w8WRERpdyjzVOc+HxhIHqJGMQcFFkpYRQotLLSw0IJ5aBdovruMYDA/kT8plF9ZKLFQcgF18hDj1SbQOMlCA4kao0iiXmah7qBWPdxpohsgVZyj7e5I9KcID+EhiDI5gxBYKLBQYKHAQoGFAoEks/YEGHYKB7hFxf0AAAAASUVORK5CYII=') repeat-x scroll left top #fff"
1008
- });
1009
- this.$message.css({
1010
- fontSize: '13px',
1011
- lineHeight: '16px',
1012
- textAlign: 'center',
1013
- padding: '8px 10px 9px',
1014
- width: 'auto',
1015
- position: 'relative'
1016
- });
1017
- this.$closeButton.css({
1018
- position: 'absolute',
1019
- top: 4, right: 4,
1020
- width: 10, height: 10,
1021
- background: "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAxUlEQVR4AR3MPUoDURSA0e++uSkkOxC3IAOWNtaCIDaChfgXBMEZbQRByxCwk+BasgQRZLSYoLgDQbARxry8nyumPcVRKDfd0Aa8AsgDv1zp6pYd5jWOwhvebRTbzNNEw5BSsIpsj/kurQBnmk7sIFcCF5yyZPDRG6trQhujXYosaFoc+2f1MJ89uc76IND6F9BvlXUdpb6xwD2+4q3me3bysiHvtLYrUJto7PD/ve7LNHxSg/woN2kSz4txasBdhyiz3ugPGetTjm3XRokAAAAASUVORK5CYII=)",
1022
- display: 'none',
1023
- cursor: 'pointer'
1024
- });
1025
- this.$buttons.css({
1026
- padding: 5,
1027
- textAlign: 'right',
1028
- borderTop: '1px solid #ccc',
1029
- backgroundColor: '#fff'
1030
- });
1031
- this.$buttons.find('button').css({
1032
- marginLeft: 5
1033
- });
1034
- this.$buttons.find('button:first').css({
1035
- marginLeft: 0
1036
- });
1037
- this.$bar.on({
1038
- mouseenter: function () {
1039
- $(this).find('.noty_close').stop().fadeTo('normal', 1);
1040
- },
1041
- mouseleave: function () {
1042
- $(this).find('.noty_close').stop().fadeTo('normal', 0);
1043
- }
1044
- });
1045
- switch (this.options.layout.name) {
1046
- case 'top':
1047
- this.$bar.css({
1048
- borderRadius: '0px 0px 5px 5px',
1049
- borderBottom: '2px solid #eee',
1050
- borderLeft: '2px solid #eee',
1051
- borderRight: '2px solid #eee',
1052
- boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
1053
- });
1054
- break;
1055
- case 'topCenter':
1056
- case 'center':
1057
- case 'bottomCenter':
1058
- case 'inline':
1059
- this.$bar.css({
1060
- borderRadius: '5px',
1061
- border: '1px solid #eee',
1062
- boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
1063
- });
1064
- this.$message.css({ fontSize: '13px', textAlign: 'center' });
1065
- break;
1066
- case 'topLeft':
1067
- case 'topRight':
1068
- case 'bottomLeft':
1069
- case 'bottomRight':
1070
- case 'centerLeft':
1071
- case 'centerRight':
1072
- this.$bar.css({
1073
- borderRadius: '5px',
1074
- border: '1px solid #eee',
1075
- boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
1076
- });
1077
- this.$message.css({ fontSize: '13px', textAlign: 'left' });
1078
- break;
1079
- case 'bottom':
1080
- this.$bar.css({
1081
- borderRadius: '5px 5px 0px 0px',
1082
- borderTop: '2px solid #eee',
1083
- borderLeft: '2px solid #eee',
1084
- borderRight: '2px solid #eee',
1085
- boxShadow: "0 -2px 4px rgba(0, 0, 0, 0.1)"
1086
- });
1087
- break;
1088
- default:
1089
- this.$bar.css({
1090
- border: '2px solid #eee',
1091
- boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
1092
- });
1093
- break;
1094
- }
1095
- switch (this.options.type) {
1096
- case 'alert':
1097
- case 'notification':
1098
- this.$bar.css({ backgroundColor: '#FFF', borderColor: '#CCC', color: '#444' });
1099
- break;
1100
- case 'warning':
1101
- this.$bar.css({ backgroundColor: '#FFEAA8', borderColor: '#FFC237', color: '#826200' });
1102
- this.$buttons.css({ borderTop: '1px solid #FFC237' });
1103
- break;
1104
- case 'error':
1105
- this.$bar.css({ backgroundColor: 'red', borderColor: 'darkred', color: '#FFF' });
1106
- this.$message.css({ fontWeight: 'bold' });
1107
- this.$buttons.css({ borderTop: '1px solid darkred' });
1108
- break;
1109
- case 'information':
1110
- this.$bar.css({ backgroundColor: '#57B7E2', borderColor: '#0B90C4', color: '#FFF' });
1111
- this.$buttons.css({ borderTop: '1px solid #0B90C4' });
1112
- break;
1113
- case 'success':
1114
- this.$bar.css({ backgroundColor: 'lightgreen', borderColor: '#50C24E', color: 'darkgreen' });
1115
- this.$buttons.css({ borderTop: '1px solid #50C24E' });
1116
- break;
1117
- default:
1118
- this.$bar.css({ backgroundColor: '#FFF', borderColor: '#CCC', color: '#444' });
1119
- break;
1120
- }
1121
- },
1122
- callback: {
1123
- onShow: function () {
1124
- $.noty.themes.defaultTheme.helpers.borderFix.apply(this);
1125
- },
1126
- onClose: function () {
1127
- $.noty.themes.defaultTheme.helpers.borderFix.apply(this);
1128
- }
1129
- }
1130
- };
1131
- $.noty.themes.relax = {
1132
- name: 'relax',
1133
- helpers: {},
1134
- modal: {
1135
- css: {
1136
- position: 'fixed',
1137
- width: '100%',
1138
- height: '100%',
1139
- backgroundColor: '#000',
1140
- zIndex: 10000,
1141
- opacity: 0.6,
1142
- display: 'none',
1143
- left: 0,
1144
- top: 0
1145
- }
1146
- },
1147
- style: function () {
1148
- this.$bar.css({
1149
- overflow: 'hidden',
1150
- margin: '4px 0',
1151
- borderRadius: '2px'
1152
- });
1153
- this.$message.css({
1154
- fontSize: '14px',
1155
- lineHeight: '16px',
1156
- textAlign: 'center',
1157
- padding: '10px',
1158
- width: 'auto',
1159
- position: 'relative'
1160
- });
1161
- this.$closeButton.css({
1162
- position: 'absolute',
1163
- top: 4, right: 4,
1164
- width: 10, height: 10,
1165
- background: "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAxUlEQVR4AR3MPUoDURSA0e++uSkkOxC3IAOWNtaCIDaChfgXBMEZbQRByxCwk+BasgQRZLSYoLgDQbARxry8nyumPcVRKDfd0Aa8AsgDv1zp6pYd5jWOwhvebRTbzNNEw5BSsIpsj/kurQBnmk7sIFcCF5yyZPDRG6trQhujXYosaFoc+2f1MJ89uc76IND6F9BvlXUdpb6xwD2+4q3me3bysiHvtLYrUJto7PD/ve7LNHxSg/woN2kSz4txasBdhyiz3ugPGetTjm3XRokAAAAASUVORK5CYII=)",
1166
- display: 'none',
1167
- cursor: 'pointer'
1168
- });
1169
- this.$buttons.css({
1170
- padding: 5,
1171
- textAlign: 'right',
1172
- borderTop: '1px solid #ccc',
1173
- backgroundColor: '#fff'
1174
- });
1175
- this.$buttons.find('button').css({
1176
- marginLeft: 5
1177
- });
1178
- this.$buttons.find('button:first').css({
1179
- marginLeft: 0
1180
- });
1181
- this.$bar.on({
1182
- mouseenter: function () {
1183
- $(this).find('.noty_close').stop().fadeTo('normal', 1);
1184
- },
1185
- mouseleave: function () {
1186
- $(this).find('.noty_close').stop().fadeTo('normal', 0);
1187
- }
1188
- });
1189
- switch (this.options.layout.name) {
1190
- case 'top':
1191
- this.$bar.css({
1192
- borderBottom: '2px solid #eee',
1193
- borderLeft: '2px solid #eee',
1194
- borderRight: '2px solid #eee',
1195
- borderTop: '2px solid #eee',
1196
- boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
1197
- });
1198
- break;
1199
- case 'topCenter':
1200
- case 'center':
1201
- case 'bottomCenter':
1202
- case 'inline':
1203
- this.$bar.css({
1204
- border: '1px solid #eee',
1205
- boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
1206
- });
1207
- this.$message.css({ fontSize: '13px', textAlign: 'center' });
1208
- break;
1209
- case 'topLeft':
1210
- case 'topRight':
1211
- case 'bottomLeft':
1212
- case 'bottomRight':
1213
- case 'centerLeft':
1214
- case 'centerRight':
1215
- this.$bar.css({
1216
- border: '1px solid #eee',
1217
- boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
1218
- });
1219
- this.$message.css({ fontSize: '13px', textAlign: 'left' });
1220
- break;
1221
- case 'bottom':
1222
- this.$bar.css({
1223
- borderTop: '2px solid #eee',
1224
- borderLeft: '2px solid #eee',
1225
- borderRight: '2px solid #eee',
1226
- borderBottom: '2px solid #eee',
1227
- boxShadow: "0 -2px 4px rgba(0, 0, 0, 0.1)"
1228
- });
1229
- break;
1230
- default:
1231
- this.$bar.css({
1232
- border: '2px solid #eee',
1233
- boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
1234
- });
1235
- break;
1236
- }
1237
- switch (this.options.type) {
1238
- case 'alert':
1239
- case 'notification':
1240
- this.$bar.css({ backgroundColor: '#FFF', borderColor: '#dedede', color: '#444' });
1241
- break;
1242
- case 'warning':
1243
- this.$bar.css({ backgroundColor: '#FFEAA8', borderColor: '#FFC237', color: '#826200' });
1244
- this.$buttons.css({ borderTop: '1px solid #FFC237' });
1245
- break;
1246
- case 'error':
1247
- this.$bar.css({ backgroundColor: '#FF8181', borderColor: '#e25353', color: '#FFF' });
1248
- this.$message.css({ fontWeight: 'bold' });
1249
- this.$buttons.css({ borderTop: '1px solid darkred' });
1250
- break;
1251
- case 'information':
1252
- this.$bar.css({ backgroundColor: '#78C5E7', borderColor: '#3badd6', color: '#FFF' });
1253
- this.$buttons.css({ borderTop: '1px solid #0B90C4' });
1254
- break;
1255
- case 'success':
1256
- this.$bar.css({ backgroundColor: '#BCF5BC', borderColor: '#7cdd77', color: 'darkgreen' });
1257
- this.$buttons.css({ borderTop: '1px solid #50C24E' });
1258
- break;
1259
- default:
1260
- this.$bar.css({ backgroundColor: '#FFF', borderColor: '#CCC', color: '#444' });
1261
- break;
1262
- }
1263
- },
1264
- callback: {
1265
- onShow: function () {
1266
- },
1267
- onClose: function () {
1268
- }
1269
- }
1270
- };
1271
- return window.noty;
1272
- });