1!function(root, factory) { 2 if (typeof define === 'function' && define.amd) { 3 define(['jquery'], factory); 4 } else if (typeof exports === 'object') { 5 module.exports = factory(require('jquery')); 6 } else { 7 factory(root.jQuery); 8 } 9}(this, function($) { 10 11/*! 12 @package noty - jQuery Notification Plugin 13 @version version: 2.4.0 14 @contributors https://github.com/needim/noty/graphs/contributors 15 16 @documentation Examples and Documentation - http://needim.github.com/noty/ 17 18 @license Licensed under the MIT licenses: http://www.opensource.org/licenses/mit-license.php 19 */ 20 21if (typeof Object.create !== 'function') { 22 Object.create = function (o) { 23 function F() { 24 } 25 26 F.prototype = o; 27 return new F(); 28 }; 29} 30 31var NotyObject = { 32 33 init: function (options) { 34 35 // Mix in the passed in options with the default options 36 this.options = $.extend({}, $.noty.defaults, options); 37 38 this.options.layout = (this.options.custom) ? $.noty.layouts['inline'] : $.noty.layouts[this.options.layout]; 39 40 if ($.noty.themes[this.options.theme]) { 41 this.options.theme = $.noty.themes[this.options.theme]; 42 if (this.options.theme.template) 43 this.options.template = this.options.theme.template; 44 45 if (this.options.theme.animation) 46 this.options.animation = this.options.theme.animation; 47 } 48 else { 49 this.options.themeClassName = this.options.theme; 50 } 51 52 this.options = $.extend({}, this.options, this.options.layout.options); 53 54 if (this.options.id) { 55 if ($.noty.store[this.options.id]) { 56 return $.noty.store[this.options.id]; 57 } 58 } else { 59 this.options.id = 'noty_' + (new Date().getTime() * Math.floor(Math.random() * 1000000)); 60 } 61 62 // Build the noty dom initial structure 63 this._build(); 64 65 // return this so we can chain/use the bridge with less code. 66 return this; 67 }, // end init 68 69 _build: function () { 70 71 // Generating noty bar 72 var $bar = $('<div class="noty_bar noty_type_' + this.options.type + '"></div>').attr('id', this.options.id); 73 $bar.append(this.options.template).find('.noty_text').html(this.options.text); 74 75 this.$bar = (this.options.layout.parent.object !== null) ? $(this.options.layout.parent.object).css(this.options.layout.parent.css).append($bar) : $bar; 76 77 if (this.options.themeClassName) 78 this.$bar.addClass(this.options.themeClassName).addClass('noty_container_type_' + this.options.type); 79 80 // Set buttons if available 81 if (this.options.buttons) { 82 83 var $buttons; 84 // Try find container for buttons in presented template, and create it if not found 85 if (this.$bar.find('.noty_buttons').length > 0) { 86 $buttons = this.$bar.find('.noty_buttons'); 87 } else { 88 $buttons = $('<div/>').addClass('noty_buttons'); 89 (this.options.layout.parent.object !== null) ? this.$bar.find('.noty_bar').append($buttons) : this.$bar.append($buttons); 90 } 91 92 var self = this; 93 94 $.each(this.options.buttons, function (i, button) { 95 var $button = $('<button/>').addClass((button.addClass) ? button.addClass : 'gray').html(button.text).attr('id', button.id ? button.id : 'button-' + i) 96 .attr('title', button.title) 97 .appendTo($buttons) 98 .on('click', function (event) { 99 if ($.isFunction(button.onClick)) { 100 button.onClick.call($button, self, event); 101 } 102 }); 103 }); 104 } else { 105 // If buttons is not available, then remove containers if exist 106 this.$bar.find('.noty_buttons').remove(); 107 } 108 109 if (this.options.progressBar && this.options.timeout) { 110 var $progressBar = $('<div/>').addClass('noty_progress_bar'); 111 (this.options.layout.parent.object !== null) ? this.$bar.find('.noty_bar').append($progressBar) : this.$bar.append($progressBar); 112 } 113 114 // For easy access 115 this.$message = this.$bar.find('.noty_message'); 116 this.$closeButton = this.$bar.find('.noty_close'); 117 this.$buttons = this.$bar.find('.noty_buttons'); 118 this.$progressBar = this.$bar.find('.noty_progress_bar'); 119 120 $.noty.store[this.options.id] = this; // store noty for api 121 122 }, // end _build 123 124 show: function () { 125 126 var self = this; 127 128 (self.options.custom) ? self.options.custom.find(self.options.layout.container.selector).append(self.$bar) : $(self.options.layout.container.selector).append(self.$bar); 129 130 if (self.options.theme && self.options.theme.style) 131 self.options.theme.style.apply(self); 132 133 ($.type(self.options.layout.css) === 'function') ? this.options.layout.css.apply(self.$bar) : self.$bar.css(this.options.layout.css || {}); 134 135 self.$bar.addClass(self.options.layout.addClass); 136 137 self.options.layout.container.style.apply($(self.options.layout.container.selector), [self.options.within]); 138 139 self.showing = true; 140 141 if (self.options.theme && self.options.theme.style) 142 self.options.theme.callback.onShow.apply(this); 143 144 if ($.inArray('click', self.options.closeWith) > -1) 145 self.$bar.css('cursor', 'pointer').on('click', function (evt) { 146 self.stopPropagation(evt); 147 if (self.options.callback.onCloseClick) { 148 self.options.callback.onCloseClick.apply(self); 149 } 150 self.close(); 151 }); 152 153 if ($.inArray('hover', self.options.closeWith) > -1) 154 self.$bar.one('mouseenter', function () { 155 self.close(); 156 }); 157 158 if ($.inArray('button', self.options.closeWith) > -1) 159 self.$closeButton.one('click', function (evt) { 160 self.stopPropagation(evt); 161 self.close(); 162 }); 163 164 if ($.inArray('button', self.options.closeWith) == -1) 165 self.$closeButton.remove(); 166 167 if (self.options.callback.beforeShow) 168 self.options.callback.beforeShow.apply(self); 169 170 if (typeof self.options.animation.open == 'string') { 171 self.animationTypeOpen = 'css';
172 self.$bar.css('min-height', self.$bar.innerHeight()); 173 self.$bar.on('click', function (e) { 174 self.wasClicked = true; 175 }); 176 self.$bar.show(); 177 178 if (self.options.callback.onShow) 179 self.options.callback.onShow.apply(self); 180 181 self.$bar.addClass(self.options.animation.open).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { 182 if (self.options.callback.afterShow) self.options.callback.afterShow.apply(self); 183 self.showing = false; 184 self.shown = true; 185 self.bindTimeout(); 186 if (self.hasOwnProperty('wasClicked')) { 187 self.$bar.off('click', function (e) { 188 self.wasClicked = true; 189 }); 190 self.close(); 191 } 192 }); 193 194 } else if (typeof self.options.animation.open == 'object' && self.options.animation.open == null) { 195 self.animationTypeOpen = 'none'; 196 self.showing = false; 197 self.shown = true; 198 self.$bar.show(); 199 self.bindTimeout(); 200 201 if (self.options.callback.onShow) 202 self.options.callback.onShow.apply(self); 203 204 self.$bar.queue(function () { 205 if (self.options.callback.afterShow) 206 self.options.callback.afterShow.apply(self); 207 }); 208 209 } else { 210 self.animationTypeOpen = 'anim'; 211 212 if (self.options.callback.onShow) 213 self.options.callback.onShow.apply(self); 214 215 self.$bar.animate( 216 self.options.animation.open, 217 self.options.animation.speed, 218 self.options.animation.easing, 219 function () { 220 if (self.options.callback.afterShow) self.options.callback.afterShow.apply(self); 221 self.showing = false; 222 self.shown = true; 223 self.bindTimeout(); 224 }); 225 } 226 227 return this; 228 229 }, // end show 230 231 bindTimeout: function() { 232 var self = this; 233 // If noty is have a timeout option 234 if (self.options.timeout) { 235 236 if (self.options.progressBar && self.$progressBar) { 237 self.$progressBar.css({ 238 transition: 'all 100ms linear' 239 }); 240 241 self.progressPercentage = (self.$progressBar.width() / (self.options.timeout / 100)); 242 243 self.intervalId = setInterval(function() { 244 self.$progressBar.width((self.$progressBar.width() - self.progressPercentage)); 245 }, 100); 246 } 247 248 self.queueClose(self.options.timeout); 249 self.$bar.on('mouseenter', self.dequeueClose.bind(self)); 250 self.$bar.on('mouseleave', self.queueClose.bind(self, self.options.timeout)); 251 } 252 253 }, 254 255 dequeueClose: function () { 256 if (this.intervalId) { 257 clearInterval(this.intervalId); 258 this.$progressBar.css('width', '100%'); 259 this.intervalId = null; 260 } 261 262 if (!this.closeTimer) return; 263 clearTimeout(this.closeTimer); 264 this.closeTimer = null; 265 }, 266 267 queueClose: function (timeout) { 268 var self = this; 269 270 if (!self.intervalId && self.options.progressBar) { 271 self.intervalId = setInterval(function() { 272 self.$progressBar.width((self.$progressBar.width() - self.progressPercentage)); 273 }, 100); 274 } 275 276 if (this.closeTimer) return; 277 self.closeTimer = window.setTimeout(function () { 278 self.close(); 279 }, timeout); 280 return self.closeTimer 281 }, 282 283 close: function () { 284 if (this.intervalId) { 285 clearInterval(this.intervalId); 286 this.intervalId = null; 287 288 if (this.$progressBar) { 289 this.$progressBar.css('width', '0%'); 290 } 291 } 292 293 if (this.closeTimer) this.dequeueClose(); 294 295 if (this.closed) return; 296 if (this.$bar && this.$bar.hasClass('i-am-closing-now')) return; 297 298 var self = this; 299 300 if (this.showing && (this.animationTypeOpen == 'anim' || this.animationTypeOpen == 'none')) { 301 self.$bar.queue( 302 function () { 303 self.close.apply(self); 304 } 305 ); 306 return; 307 } else if (this.showing && this.animationTypeOpen == 'css') { 308 self.$bar.on('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { 309 self.close(); 310 }); 311 } 312 313 if (!this.shown && !this.showing) { // If we are still waiting in the queue just delete from queue 314 var queue = []; 315 $.each($.noty.queue, function (i, n) { 316 if (n.options.id != self.options.id) { 317 queue.push(n); 318 } 319 }); 320 $.noty.queue = queue; 321 return; 322 } 323 324 self.$bar.addClass('i-am-closing-now'); 325 326 if (self.options.callback.onClose) { 327 self.options.callback.onClose.apply(self); 328 } 329 330 if (typeof self.options.animation.close == 'string') { 331 self.$bar.removeClass(self.options.animation.open).addClass(self.options.animation.close).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { 332 if (self.options.callback.afterClose) self.options.callback.afterClose.apply(self); 333 self.closeCleanUp(); 334 }); 335 336 } else if (typeof self.options.animation.close == 'object' && self.options.animation.close == null) { 337 self.$bar.dequeue().hide(0, function() { 338 if (self.options.callback.afterClose) self.options.callback.afterClose.apply(self); 339 self.closeCleanUp(); 340 }); 341 342 } else { 343 self.$bar.clearQueue().stop().animate( 344 self.options.animation.close, 345 self.options.animation.speed, 346 self.options.animation.easing, 347 function () { 348 if (self.options.callback.afterClose) self.options.callback.afterClose.apply(self); 349 }) 350 .promise().done(function () { 351 self.closeCleanUp(); 352 }); 353 } 354 355 }, // end close 356 357 closeCleanUp: function () { 358 359 var self = this; 360 361 // Modal Cleaning 362 if (self.options.modal) { 363 $.notyRenderer.setModalCount(-1); 364 if ($.notyRenderer.getModalCount() == 0 && !$.noty.queue.length) $('.noty_modal').fadeOut(self.options.animation.fadeSpeed, function () { 365 $(this).remove(); 366 }); 367 } 368 369 // Layout Cleaning 370 $.notyRenderer.setLayoutCountFor(self, -1); 371 if ($.notyRenderer.getLayoutCountFor(self) == 0) $(self.options.layout.container.selector).remove(); 372 373 // Make sure self.$bar has not been removed before attempting to remove it 374 if (typeof self.$bar !== 'undefined' && self.$bar !== null) { 375 376 if (typeof self.options.animation.close == 'string') { 377 self.$bar.css('transition', 'all 10ms ease').css('border', 0).css('margin', 0).height(0); 378 self.$bar.one('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function () { 379 self.$bar.remove(); 380 self.$bar = null; 381 self.closed = true; 382 383 if (self.options.theme.callback && self.options.theme.callback.onClose) { 384 self.options.theme.callback.onClose.apply(self); 385 } 386 387 self.handleNext(); 388 }); 389 } else { 390 self.$bar.remove(); 391 self.$bar = null; 392 self.closed = true; 393 394 self.handleNext(); 395 } 396 } else { 397 self.handleNext(); 398 } 399 400 }, // end close clean up 401 402 handleNext: function () { 403 var self = this; 404 405 delete $.noty.store[self.options.id]; // deleting noty from store 406 407 if (self.options.theme.callback && self.options.theme.callback.onClose) { 408 self.options.theme.callback.onClose.apply(self); 409 } 410 411 if (!self.options.dismissQueue) { 412 // Queue render 413 $.noty.ontap = true; 414 415 $.notyRenderer.render(); 416 } 417 418 if (self.options.maxVisible > 0 && self.options.dismissQueue) { 419 $.notyRenderer.render(); 420 } 421 }, 422 423 setText: function (text) { 424 if (!this.closed) { 425 this.options.text = text; 426 this.$bar.find('.noty_text').html(text); 427 } 428 return this; 429 }, 430 431 setType: function (type) { 432 if (!this.closed) { 433 this.options.type = type; 434 this.options.theme.style.apply(this); 435 this.options.theme.callback.onShow.apply(this); 436 } 437 return this; 438 }, 439 440 setTimeout: function (time) { 441 if (!this.closed) { 442 var self = this; 443 this.options.timeout = time; 444 self.$bar.delay(self.options.timeout).promise().done(function () { 445 self.close(); 446 }); 447 } 448 return this; 449 }, 450 451 stopPropagation: function (evt) { 452 evt = evt || window.event; 453 if (typeof evt.stopPropagation !== "undefined") { 454 evt.stopPropagation(); 455 } 456 else { 457 evt.cancelBubble = true; 458 } 459 }, 460 461 closed : false, 462 showing: false, 463 shown : false 464 465}; // end NotyObject 466 467$.notyRenderer = {}; 468 469$.notyRenderer.init = function (options) { 470 471 // Renderer creates a new noty 472 var notification = Object.create(NotyObject).init(options); 473 474 if (notification.options.killer) 475 $.noty.closeAll(); 476 477 (notification.options.force) ? $.noty.queue.unshift(notification) : $.noty.queue.push(notification); 478 479 $.notyRenderer.render(); 480 481 return ($.noty.returns == 'object') ? notification : notification.options.id; 482}; 483 484$.notyRenderer.render = function () { 485 486 var instance = $.noty.queue[0]; 487 488 if ($.type(instance) === 'object') { 489 if (instance.options.dismissQueue) { 490 if (instance.options.maxVisible > 0) { 491 if ($(instance.options.layout.container.selector + ' > li').length < instance.options.maxVisible) { 492 $.notyRenderer.show($.noty.queue.shift()); 493 } 494 else { 495 496 } 497 } 498 else { 499 $.notyRenderer.show($.noty.queue.shift()); 500 } 501 } 502 else { 503 if ($.noty.ontap) { 504 $.notyRenderer.show($.noty.queue.shift()); 505 $.noty.ontap = false;
506 } 507 } 508 } 509 else { 510 $.noty.ontap = true; // Queue is over 511 } 512 513}; 514 515$.notyRenderer.show = function (notification) { 516 517 if (notification.options.modal) { 518 $.notyRenderer.createModalFor(notification); 519 $.notyRenderer.setModalCount(+1); 520 } 521 522 // Where is the container? 523 if (notification.options.custom) { 524 if (notification.options.custom.find(notification.options.layout.container.selector).length == 0) { 525 notification.options.custom.append($(notification.options.layout.container.object).addClass('i-am-new')); 526 } 527 else { 528 notification.options.custom.find(notification.options.layout.container.selector).removeClass('i-am-new'); 529 } 530 } 531 else { 532 if ($(notification.options.layout.container.selector).length == 0) { 533 $('body').append($(notification.options.layout.container.object).addClass('i-am-new')); 534 } 535 else { 536 $(notification.options.layout.container.selector).removeClass('i-am-new'); 537 } 538 } 539 540 $.notyRenderer.setLayoutCountFor(notification, +1); 541 542 notification.show(); 543}; 544 545$.notyRenderer.createModalFor = function (notification) { 546 if ($('.noty_modal').length == 0) { 547 var modal = $('<div/>').addClass('noty_modal').addClass(notification.options.theme).data('noty_modal_count', 0); 548 549 if (notification.options.theme.modal && notification.options.theme.modal.css) 550 modal.css(notification.options.theme.modal.css); 551 552 modal.prependTo($('body')).fadeIn(notification.options.animation.fadeSpeed); 553 554 if ($.inArray('backdrop', notification.options.closeWith) > -1) 555 modal.on('click', function () { 556 $.noty.closeAll(); 557 }); 558 } 559}; 560 561$.notyRenderer.getLayoutCountFor = function (notification) { 562 return $(notification.options.layout.container.selector).data('noty_layout_count') || 0; 563}; 564 565$.notyRenderer.setLayoutCountFor = function (notification, arg) { 566 return $(notification.options.layout.container.selector).data('noty_layout_count', $.notyRenderer.getLayoutCountFor(notification) + arg); 567}; 568 569$.notyRenderer.getModalCount = function () { 570 return $('.noty_modal').data('noty_modal_count') || 0; 571}; 572 573$.notyRenderer.setModalCount = function (arg) { 574 return $('.noty_modal').data('noty_modal_count', $.notyRenderer.getModalCount() + arg); 575}; 576 577// This is for custom container 578$.fn.noty = function (options) { 579 options.custom = $(this); 580 return $.notyRenderer.init(options); 581}; 582 583$.noty = {}; 584$.noty.queue = []; 585$.noty.ontap = true; 586$.noty.layouts = {}; 587$.noty.themes = {}; 588$.noty.returns = 'object'; 589$.noty.store = {}; 590 591$.noty.get = function (id) { 592 return $.noty.store.hasOwnProperty(id) ? $.noty.store[id] : false; 593}; 594 595$.noty.close = function (id) { 596 return $.noty.get(id) ? $.noty.get(id).close() : false; 597}; 598 599$.noty.setText = function (id, text) { 600 return $.noty.get(id) ? $.noty.get(id).setText(text) : false; 601}; 602 603$.noty.setType = function (id, type) { 604 return $.noty.get(id) ? $.noty.get(id).setType(type) : false; 605}; 606 607$.noty.clearQueue = function () { 608 $.noty.queue = []; 609}; 610 611$.noty.closeAll = function () { 612 $.noty.clearQueue(); 613 $.each($.noty.store, function (id, noty) { 614 noty.close(); 615 }); 616}; 617 618var windowAlert = window.alert; 619 620$.noty.consumeAlert = function (options) { 621 window.alert = function (text) { 622 if (options) 623 options.text = text; 624 else 625 options = {text: text}; 626 627 $.notyRenderer.init(options); 628 }; 629}; 630 631$.noty.stopConsumeAlert = function () { 632 window.alert = windowAlert; 633}; 634 635$.noty.defaults = { 636 layout : 'topRight', 637 theme : 'relax', 638 type : 'alert', 639 text : '', 640 progressBar : false, 641 dismissQueue: true, 642 template : '<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>', 643 animation : { 644 open : {height: 'toggle'}, 645 close : {height: 'toggle'}, 646 easing : 'swing', 647 speed : 500, 648 fadeSpeed: 'fast' 649 }, 650 timeout : false, 651 force : false, 652 modal : false, 653 maxVisible : 5, 654 killer : false, 655 closeWith : ['click'], 656 callback : { 657 beforeShow : function () { 658 }, 659 onShow : function () { 660 }, 661 afterShow : function () { 662 }, 663 onClose : function () { 664 }, 665 afterClose : function () { 666 }, 667 onCloseClick: function () { 668 } 669 }, 670 buttons : false 671}; 672 673$(window).on('resize', function () { 674 $.each($.noty.layouts, function (index, layout) { 675 layout.container.style.apply($(layout.container.selector)); 676 }); 677}); 678 679// Helpers 680window.noty = function noty(options) { 681 return $.notyRenderer.init(options); 682}; 683 684$.noty.layouts.bottom = { 685 name : 'bottom', 686 options : {}, 687 container: { 688 object : '<ul id="noty_bottom_layout_container" />', 689 selector: 'ul#noty_bottom_layout_container', 690 style : function() { 691 $(this).css({ 692 bottom : 0, 693 left : '5%', 694 position : 'fixed', 695 width : '90%', 696 height : 'auto', 697 margin : 0, 698 padding : 0, 699 listStyleType: 'none', 700 zIndex : 9999999 701 }); 702 } 703 }, 704 parent : { 705 object : '<li />', 706 selector: 'li', 707 css : {} 708 }, 709 css : { 710 display: 'none' 711 }, 712 addClass : '' 713}; 714 715$.noty.layouts.bottomCenter = { 716 name : 'bottomCenter', 717 options : { // overrides options 718 719 }, 720 container: { 721 object : '<ul id="noty_bottomCenter_layout_container" />', 722 selector: 'ul#noty_bottomCenter_layout_container', 723 style : function() { 724 $(this).css({ 725 bottom : 20, 726 left : 0, 727 position : 'fixed', 728 width : '310px', 729 height : 'auto', 730 margin : 0, 731 padding : 0, 732 listStyleType: 'none', 733 zIndex : 10000000 734 }); 735 736 $(this).css({ 737 left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px' 738 }); 739 } 740 }, 741 parent : { 742 object : '<li />', 743 selector: 'li', 744 css : {} 745 }, 746 css : { 747 display: 'none', 748 width : '310px' 749 }, 750 addClass : '' 751}; 752 753 754$.noty.layouts.bottomLeft = { 755 name : 'bottomLeft', 756 options : { // overrides options 757 758 }, 759 container: { 760 object : '<ul id="noty_bottomLeft_layout_container" />', 761 selector: 'ul#noty_bottomLeft_layout_container', 762 style : function() { 763 $(this).css({ 764 bottom : 20, 765 left : 20, 766 position : 'fixed', 767 width : '310px', 768 height : 'auto', 769 margin : 0, 770 padding : 0, 771 listStyleType: 'none', 772 zIndex : 10000000 773 }); 774 775 if(window.innerWidth < 600) { 776 $(this).css({ 777 left: 5 778 }); 779 } 780 } 781 }, 782 parent : { 783 object : '<li />', 784 selector: 'li', 785 css : {} 786 }, 787 css : { 788 display: 'none', 789 width : '310px' 790 }, 791 addClass : '' 792}; 793$.noty.layouts.bottomRight = { 794 name : 'bottomRight', 795 options : { // overrides options 796 797 }, 798 container: { 799 object : '<ul id="noty_bottomRight_layout_container" />', 800 selector: 'ul#noty_bottomRight_layout_container', 801 style : function() { 802 $(this).css({ 803 bottom : 20, 804 right : 20, 805 position : 'fixed', 806 width : '310px', 807 height : 'auto', 808 margin : 0, 809 padding : 0, 810 listStyleType: 'none', 811 zIndex : 10000000 812 }); 813 814 if(window.innerWidth < 600) { 815 $(this).css({ 816 right: 5 817 }); 818 } 819 } 820 }, 821 parent : { 822 object : '<li />', 823 selector: 'li', 824 css : {} 825 }, 826 css : { 827 display: 'none', 828 width : '310px' 829 }, 830 addClass : '' 831}; 832$.noty.layouts.center = { 833 name : 'center', 834 options : { // overrides options 835 836 }, 837 container: { 838 object : '<ul id="noty_center_layout_container" />', 839 selector: 'ul#noty_center_layout_container', 840 style : function() { 841 $(this).css({ 842 position : 'fixed', 843 width : '310px', 844 height : 'auto', 845 margin : 0, 846 padding : 0, 847 listStyleType: 'none', 848 zIndex : 10000000 849 }); 850 851 // getting hidden height 852 var dupe = $(this).clone().css({visibility: "hidden", display: "block", position: "absolute", top: 0, left: 0}).attr('id', 'dupe'); 853 $("body").append(dupe); 854 dupe.find('.i-am-closing-now').remove(); 855 dupe.find('li').css('display', 'block'); 856 var actual_height = dupe.height(); 857 dupe.remove(); 858 859 if($(this).hasClass('i-am-new')) { 860 $(this).css({ 861 left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px', 862 top : ($(window).height() - actual_height) / 2 + 'px' 863 }); 864 } 865 else { 866 $(this).animate({ 867 left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px', 868 top : ($(window).height() - actual_height) / 2 + 'px' 869 }, 500); 870 } 871 872 } 873 }, 874 parent : { 875 object : '<li />', 876 selector: 'li', 877 css : {} 878 }, 879 css : { 880 display: 'none', 881 width : '310px' 882 }, 883 addClass : '' 884}; 885$.noty.layouts.centerLeft = { 886 name : 'centerLeft', 887 options : { // overrides options 888 889 }, 890 container: { 891 object : '<ul id="noty_centerLeft_layout_container" />', 892 selector: 'ul#noty_centerLeft_layout_container', 893 style : function() { 894 $(this).css({ 895 left : 20, 896 position : 'fixed', 897 width : '310px', 898 height : 'auto', 899 margin : 0, 900 padding : 0, 901 listStyleType: 'none', 902 zIndex : 10000000 903 }); 904 905 // getting hidden height 906 var dupe = $(this).clone().css({visibility: "hidden", display: "block", position: "absolute", top: 0, left: 0}).attr('id', 'dupe'); 907 $("body").append(dupe); 908 dupe.find('.i-am-closing-now').remove(); 909 dupe.find('li').css('display', 'block'); 910 var actual_height = dupe.height(); 911 dupe.remove(); 912 913 if($(this).hasClass('i-am-new')) { 914 $(this).css({ 915 top: ($(window).height() - actual_height) / 2 + 'px' 916 }); 917 } 918 else { 919 $(this).animate({ 920 top: ($(window).height() - actual_height) / 2 + 'px' 921 }, 500); 922 } 923 924 if(window.innerWidth < 600) { 925 $(this).css({ 926 left: 5 927 }); 928 } 929 930 } 931 }, 932 parent : { 933 object : '<li />', 934 selector: 'li', 935 css : {} 936 }, 937 css : { 938 display: 'none', 939 width : '310px' 940 }, 941 addClass : '' 942}; 943 944$.noty.layouts.centerRight = { 945 name : 'centerRight', 946 options : { // overrides options 947 948 }, 949 container: { 950 object : '<ul id="noty_centerRight_layout_container" />', 951 selector: 'ul#noty_centerRight_layout_container', 952 style : function() { 953 $(this).css({ 954 right : 20, 955 position : 'fixed', 956 width : '310px', 957 height : 'auto', 958 margin : 0, 959 padding : 0, 960 listStyleType: 'none', 961 zIndex : 10000000 962 }); 963 964 // getting hidden height 965 var dupe = $(this).clone().css({visibility: "hidden", display: "block", position: "absolute", top: 0, left: 0}).attr('id', 'dupe'); 966 $("body").append(dupe); 967 dupe.find('.i-am-closing-now').remove(); 968 dupe.find('li').css('display', 'block'); 969 var actual_height = dupe.height(); 970 dupe.remove(); 971 972 if($(this).hasClass('i-am-new')) { 973 $(this).css({ 974 top: ($(window).height() - actual_height) / 2 + 'px' 975 }); 976 } 977 else { 978 $(this).animate({ 979 top: ($(window).height() - actual_height) / 2 + 'px' 980 }, 500); 981 } 982 983 if(window.innerWidth < 600) { 984 $(this).css({ 985 right: 5 986 }); 987 } 988 989 } 990 }, 991 parent : { 992 object : '<li />', 993 selector: 'li', 994 css : {} 995 }, 996 css : { 997 display: 'none', 998 width : '310px' 999 }, 1000 addClass : '' 1001}; 1002$.noty.layouts.inline = { 1003 name : 'inline', 1004 options : {}, 1005 container: { 1006 object : '<ul class="noty_inline_layout_container" />', 1007 selector: 'ul.noty_inline_layout_container', 1008 style : function() { 1009 $(this).css({ 1010 width : '100%', 1011 height : 'auto', 1012 margin : 0, 1013 padding : 0, 1014 listStyleType: 'none', 1015 zIndex : 9999999 1016 }); 1017 } 1018 }, 1019 parent : { 1020 object : '<li />', 1021 selector: 'li', 1022 css : {} 1023 }, 1024 css : { 1025 display: 'none' 1026 }, 1027 addClass : '' 1028}; 1029$.noty.layouts.top = { 1030 name : 'top', 1031 options : {}, 1032 container: { 1033 object : '<ul id="noty_top_layout_container" />', 1034 selector: 'ul#noty_top_layout_container', 1035 style : function() { 1036 $(this).css({ 1037 top : 0, 1038 left : '5%', 1039 position : 'fixed', 1040 width : '90%', 1041 height : 'auto', 1042 margin : 0, 1043 padding : 0, 1044 listStyleType: 'none', 1045 zIndex : 9999999 1046 }); 1047 } 1048 }, 1049 parent : { 1050 object : '<li />', 1051 selector: 'li', 1052 css : {} 1053 }, 1054 css : { 1055 display: 'none' 1056 }, 1057 addClass : '' 1058}; 1059$.noty.layouts.topCenter = { 1060 name : 'topCenter', 1061 options : { // overrides options 1062 1063 }, 1064 container: { 1065 object : '<ul id="noty_topCenter_layout_container" />', 1066 selector: 'ul#noty_topCenter_layout_container', 1067 style : function() { 1068 $(this).css({ 1069 top : 20, 1070 left : 0, 1071 position : 'fixed', 1072 width : '310px', 1073 height : 'auto', 1074 margin : 0, 1075 padding : 0, 1076 listStyleType: 'none', 1077 zIndex : 10000000 1078 }); 1079 1080 $(this).css({ 1081 left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px' 1082 }); 1083 } 1084 }, 1085 parent : { 1086 object : '<li />', 1087 selector: 'li', 1088 css : {} 1089 }, 1090 css : { 1091 display: 'none', 1092 width : '310px' 1093 }, 1094 addClass : '' 1095}; 1096 1097$.noty.layouts.topLeft = { 1098 name : 'topLeft', 1099 options : { // overrides options 1100 1101 }, 1102 container: { 1103 object : '<ul id="noty_topLeft_layout_container" />', 1104 selector: 'ul#noty_topLeft_layout_container', 1105 style : function() { 1106 $(this).css({ 1107 top : 20, 1108 left : 20, 1109 position : 'fixed', 1110 width : '310px', 1111 height
1111 : 'auto', 1112 margin : 0, 1113 padding : 0, 1114 listStyleType: 'none', 1115 zIndex : 10000000 1116 }); 1117 1118 if(window.innerWidth < 600) { 1119 $(this).css({ 1120 left: 5 1121 }); 1122 } 1123 } 1124 }, 1125 parent : { 1126 object : '<li />', 1127 selector: 'li', 1128 css : {} 1129 }, 1130 css : { 1131 display: 'none', 1132 width : '310px' 1133 }, 1134 addClass : '' 1135}; 1136$.noty.layouts.topRight = { 1137 name : 'topRight', 1138 options : { // overrides options 1139 1140 }, 1141 container: { 1142 object : '<ul id="noty_topRight_layout_container" />', 1143 selector: 'ul#noty_topRight_layout_container', 1144 style : function() { 1145 $(this).css({ 1146 top : 20, 1147 right : 20, 1148 position : 'fixed', 1149 width : '310px', 1150 height : 'auto', 1151 margin : 0, 1152 padding : 0, 1153 listStyleType: 'none', 1154 zIndex : 10000000 1155 }); 1156 1157 if(window.innerWidth < 600) { 1158 $(this).css({ 1159 right: 5 1160 }); 1161 } 1162 } 1163 }, 1164 parent : { 1165 object : '<li />', 1166 selector: 'li', 1167 css : {} 1168 }, 1169 css : { 1170 display: 'none', 1171 width : '310px' 1172 }, 1173 addClass : '' 1174}; 1175$.noty.themes.bootstrapTheme = { 1176 name : 'bootstrapTheme', 1177 modal : { 1178 css: { 1179 position : 'fixed', 1180 width : '100%', 1181 height : '100%', 1182 backgroundColor: '#000', 1183 zIndex : 10000, 1184 opacity : 0.6, 1185 display : 'none', 1186 left : 0, 1187 top : 0, 1188 wordBreak : 'break-all' 1189 } 1190 }, 1191 style : function () { 1192 1193 var containerSelector = this.options.layout.container.selector; 1194 $(containerSelector).addClass('list-group'); 1195 1196 this.$closeButton.append('<span aria-hidden="true">×</span><span class="sr-only">Close</span>'); 1197 this.$closeButton.addClass('close'); 1198
1199 this.$bar.addClass("list-group-item").css('padding', '0px').css('position', 'relative'); 1200 1201 this.$progressBar.css({ 1202 position : 'absolute', 1203 left : 0, 1204 bottom : 0, 1205 height : 4, 1206 width : '100%', 1207 backgroundColor: '#000000', 1208 opacity : 0.2, 1209 '-ms-filter' : 'progid:DXImageTransform.Microsoft.Alpha(Opacity=20)', 1210 filter : 'alpha(opacity=20)' 1211 }); 1212 1213 switch (this.options.type) { 1214 case 'alert': 1215 case 'notification': 1216 this.$bar.addClass("list-group-item-info"); 1217 break; 1218 case 'warning': 1219 this.$bar.addClass("list-group-item-warning"); 1220 break; 1221 case 'error': 1222 this.$bar.addClass("list-group-item-danger"); 1223 break; 1224 case 'information': 1225 this.$bar.addClass("list-group-item-info"); 1226 break; 1227 case 'success': 1228 this.$bar.addClass("list-group-item-success"); 1229 break; 1230 } 1231 1232 this.$message.css({ 1233 textAlign: 'center', 1234 padding : '8px 10px 9px', 1235 width : 'auto', 1236 position : 'relative' 1237 }); 1238 }, 1239 callback: { 1240 onShow : function () { }, 1241 onClose: function () { } 1242 } 1243}; 1244 1245 1246$.noty.themes.defaultTheme = { 1247 name : 'defaultTheme', 1248 helpers : { 1249 borderFix: function () { 1250 if (this.options.dismissQueue) { 1251 var selector = this.options.layout.container.selector + ' ' + this.options.layout.parent.selector; 1252 switch (this.options.layout.name) { 1253 case 'top': 1254 $(selector).css({borderRadius: '0px 0px 0px 0px'}); 1255 $(selector).last().css({borderRadius: '0px 0px 5px 5px'}); 1256 break; 1257 case 'topCenter': 1258 case 'topLeft': 1259 case 'topRight': 1260 case 'bottomCenter': 1261 case 'bottomLeft': 1262 case 'bottomRight': 1263 case 'center': 1264 case 'centerLeft': 1265 case 'centerRight': 1266 case 'inline': 1267 $(selector).css({borderRadius: '0px 0px 0px 0px'}); 1268 $(selector).first().css({'border-top-left-radius': '5px', 'border-top-right-radius': '5px'}); 1269 $(selector).last().css({'border-bottom-left-radius': '5px', 'border-bottom-right-radius': '5px'}); 1270 break; 1271 case 'bottom': 1272 $(selector).css({borderRadius: '0px 0px 0px 0px'}); 1273 $(selector).first().css({borderRadius: '5px 5px 0px 0px'}); 1274 break; 1275 default: 1276 break; 1277 } 1278 } 1279 } 1280 }, 1281 modal : { 1282 css: { 1283 position : 'fixed', 1284 width : '100%', 1285 height : '100%', 1286 backgroundColor: '#000', 1287 zIndex : 10000, 1288 opacity : 0.6, 1289 display : 'none', 1290 left : 0, 1291 top : 0 1292 } 1293 }, 1294 style : function () { 1295 1296 this.$bar.css({ 1297 overflow : 'hidden', 1298 background: "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAoCAQAAAClM0ndAAAAhklEQVR4AdXO0QrCMBBE0bttkk38/w8WRERpdyjzVOc+HxhIHqJGMQcFFkpYRQotLLSw0IJ5aBdovruMYDA/kT8plF9ZKLFQcgF18hDj1SbQOMlCA4kao0iiXmah7qBWPdxpohsgVZyj7e5I9KcID+EhiDI5gxBYKLBQYKHAQoGFAoEks/YEGHYKB7hFxf0AAAAASUVORK5CYII=') repeat-x scroll left top #fff", 1299 position : 'relative' 1300 }); 1301 1302 this.$progressBar.css({ 1303 position : 'absolute', 1304 left : 0, 1305 bottom : 0, 1306 height : 4, 1307 width : '100%', 1308 backgroundColor: '#000000', 1309 opacity : 0.2, 1310 '-ms-filter' : 'progid:DXImageTransform.Microsoft.Alpha(Opacity=20)', 1311 filter : 'alpha(opacity=20)' 1312 }); 1313 1314 this.$message.css({ 1315 textAlign: 'center', 1316 padding : '8px 10px 9px', 1317 width : 'auto', 1318 position : 'relative' 1319 }); 1320 1321 this.$closeButton.css({ 1322 position : 'absolute', 1323 top : 4, right: 4, 1324 width : 10, height: 10, 1325 background: "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAxUlEQVR4AR3MPUoDURSA0e++uSkkOxC3IAOWNtaCIDaChfgXBMEZbQRByxCwk+BasgQRZLSYoLgDQbARxry8nyumPcVRKDfd0Aa8AsgDv1zp6pYd5jWOwhvebRTbzNNEw5BSsIpsj/kurQBnmk7sIFcCF5yyZPDRG6trQhujXYosaFoc+2f1MJ89uc76IND6F9BvlXUdpb6xwD2+4q3me3bysiHvtLYrUJto7PD/ve7LNHxSg/woN2kSz4txasBdhyiz3ugPGetTjm3XRokAAAAASUVORK5CYII=)", 1326 display : 'none', 1327 cursor : 'pointer' 1328 }); 1329 1330 this.$buttons.css({ 1331 padding : 5, 1332 textAlign : 'right', 1333 borderTop : '1px solid #ccc', 1334 backgroundColor: '#fff' 1335 }); 1336 1337 this.$buttons.find('button').css({ 1338 marginLeft: 5 1339 }); 1340 1341 this.$buttons.find('button:first').css({ 1342 marginLeft: 0 1343 }); 1344 1345 this.$bar.on({ 1346 mouseenter: function () { 1347 $(this).find('.noty_close').stop().fadeTo('normal', 1); 1348 }, 1349 mouseleave: function () { 1350 $(this).find('.noty_close').stop().fadeTo('normal', 0); 1351 } 1352 }); 1353 1354 switch (this.options.layout.name) { 1355 case 'top': 1356 this.$bar.css({ 1357 borderRadius: '0px 0px 5px 5px', 1358 borderBottom: '2px solid #eee', 1359 borderLeft : '2px solid #eee', 1360 borderRight : '2px solid #eee', 1361 boxShadow : "0 2px 4px rgba(0, 0, 0, 0.1)" 1362 }); 1363 break; 1364 case 'topCenter': 1365 case 'center': 1366 case 'bottomCenter': 1367 case 'inline': 1368 this.$bar.css({ 1369 borderRadius: '5px', 1370 border : '1px solid #eee', 1371 boxShadow : "0 2px 4px rgba(0, 0, 0, 0.1)" 1372 }); 1373 this.$message.css({textAlign: 'center'}); 1374 break; 1375 case 'topLeft': 1376 case 'topRight': 1377 case 'bottomLeft': 1378 case 'bottomRight': 1379 case 'centerLeft': 1380 case 'centerRight': 1381 this.$bar.css({ 1382 borderRadius: '5px', 1383 border : '1px solid #eee', 1384 boxShadow : "0 2px 4px rgba(0, 0, 0, 0.1)" 1385 }); 1386 this.$message.css({textAlign: 'left'}); 1387 break; 1388 case 'bottom': 1389 this.$bar.css({ 1390 borderRadius: '5px 5px 0px 0px', 1391 borderTop : '2px solid #eee', 1392 borderLeft : '2px solid #eee', 1393 borderRight : '2px solid #eee', 1394 boxShadow : "0 -2px 4px rgba(0, 0, 0, 0.1)" 1395 }); 1396 break; 1397 default: 1398 this.$bar.css({ 1399 border : '2px solid #eee', 1400 boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)" 1401 }); 1402 break; 1403 } 1404 switch (this.options.type) { 1405 case 'alert': 1406 case 'notification':
1407 this.$bar.css({backgroundColor: '#FFF', borderColor: '#CCC', color: '#444'}); 1408 break; 1409 case 'warning': 1410 this.$bar.css({backgroundColor: '#FFEAA8', borderColor: '#FFC237', color: '#826200'}); 1411 this.$buttons.css({borderTop: '1px solid #FFC237'}); 1412 break; 1413 case 'error': 1414 this.$bar.css({backgroundColor: 'red', borderColor: 'darkred', color: '#FFF'}); 1415 this.$message.css({fontWeight: 'bold'}); 1416 this.$buttons.css({borderTop: '1px solid darkred'}); 1417 break; 1418 case 'information': 1419 this.$bar.css({backgroundColor: '#57B7E2', borderColor: '#0B90C4', color: '#FFF'}); 1420 this.$buttons.css({borderTop: '1px solid #0B90C4'}); 1421 break; 1422 case 'success': 1423 this.$bar.css({backgroundColor: 'lightgreen', borderColor: '#50C24E', color: 'darkgreen'}); 1424 this.$buttons.css({borderTop: '1px solid #50C24E'}); 1425 break; 1426 default: 1427 this.$bar.css({backgroundColor: '#FFF', borderColor: '#CCC', color: '#444'}); 1428 break; 1429 } 1430 }, 1431 callback: { 1432 onShow : function () { 1433 $.noty.themes.defaultTheme.helpers.borderFix.apply(this); 1434 }, 1435 onClose: function () { 1436 $.noty.themes.defaultTheme.helpers.borderFix.apply(this); 1437 } 1438 } 1439}; 1440 1441$.noty.themes.metroui = { 1442 name : 'metroui', 1443 helpers : {}, 1444 modal : { 1445 css: { 1446 position : 'fixed', 1447 width : '100%', 1448 height : '100%', 1449 backgroundColor: '#000', 1450 zIndex : 10000, 1451 opacity : 0.6, 1452 display : 'none', 1453 left : 0, 1454 top : 0 1455 } 1456 }, 1457 style : function () { 1458 1459 this.$bar.css({ 1460 overflow : 'hidden', 1461 margin : '4px 0', 1462 borderRadius: '0', 1463 position : 'relative' 1464 }); 1465 1466 this.$progressBar.css({ 1467 position : 'absolute', 1468 left : 0, 1469 bottom : 0, 1470 height : 4, 1471 width : '100%', 1472 backgroundColor: '#000000', 1473 opacity : 0.2, 1474 '-ms-filter' : 'progid:DXImageTransform.Microsoft.Alpha(Opacity=20)', 1475 filter : 'alpha(opacity=20)' 1476 }); 1477 1478 this.$message.css({ 1479 textAlign: 'center', 1480 padding : '1.25rem', 1481 width : 'auto', 1482 position : 'relative' 1483 }); 1484 1485 this.$closeButton.css({ 1486 position : 'absolute', 1487 top : '.25rem', right: '.25rem', 1488 width : 10, height: 10, 1489 background: "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAxUlEQVR4AR3MPUoDURSA0e++uSkkOxC3IAOWNtaCIDaChfgXBMEZbQRByxCwk+BasgQRZLSYoLgDQbARxry8nyumPcVRKDfd0Aa8AsgDv1zp6pYd5jWOwhvebRTbzNNEw5BSsIpsj/kurQBnmk7sIFcCF5yyZPDRG6trQhujXYosaFoc+2f1MJ89uc76IND6F9BvlXUdpb6xwD2+4q3me3bysiHvtLYrUJto7PD/ve7LNHxSg/woN2kSz4txasBdhyiz3ugPGetTjm3XRokAAAAASUVORK5CYII=)", 1490 display : 'none', 1491 cursor : 'pointer' 1492 }); 1493 1494 this.$buttons.css({ 1495 padding : 5, 1496 textAlign : 'right', 1497 borderTop : '1px solid #ccc', 1498 backgroundColor: '#fff' 1499 }); 1500 1501 this.$buttons.find('button').css({ 1502 marginLeft: 5 1503 }); 1504 1505 this.$buttons.find('button:first').css({ 1506 marginLeft: 0 1507 }); 1508 1509 this.$bar.on({ 1510 mouseenter: function () { 1511 $(this).find('.noty_close').stop().fadeTo('normal', 1); 1512 }, 1513 mouseleave: function () { 1514 $(this).find('.noty_close').stop().fadeTo('normal', 0); 1515 } 1516 }); 1517 1518 switch (this.options.layout.name) { 1519 case 'top': 1520 this.$bar.css({ 1521 border : 'none', 1522 boxShadow: "0 0 5px 0 rgba(0, 0, 0, 0.3)" 1523 }); 1524 break; 1525 case 'topCenter': 1526 case 'center': 1527 case 'bottomCenter': 1528 case 'inline': 1529 this.$bar.css({ 1530 border : 'none', 1531 boxShadow: "0 0 5px 0 rgba(0, 0, 0, 0.3)" 1532 }); 1533 this.$message.css({textAlign: 'center'}); 1534 break; 1535 case 'topLeft': 1536 case 'topRight': 1537 case 'bottomLeft': 1538 case 'bottomRight': 1539 case 'centerLeft': 1540 case 'centerRight': 1541 this.$bar.css({ 1542 border : 'none', 1543 boxShadow: "0 0 5px 0 rgba(0, 0, 0, 0.3)" 1544 }); 1545 this.$message.css({textAlign: 'left'}); 1546 break; 1547 case 'bottom': 1548 this.$bar.css({ 1549 border : 'none', 1550 boxShadow: "0 0 5px 0 rgba(0, 0, 0, 0.3)" 1551 }); 1552 break; 1553 default: 1554 this.$bar.css({ 1555 border : 'none', 1556 boxShadow: "0 0 5px 0 rgba(0, 0, 0, 0.3)" 1557 }); 1558 break; 1559 } 1560 1561 switch (this.options.type) { 1562 case 'alert': 1563 case 'notification': 1564 this.$bar.css({backgroundColor: '#fff', border: 'none', color: '#1d1d1d'}); 1565 break; 1566 case 'warning': 1567 this.$bar.css({backgroundColor: '#FA6800', border: 'none', color: '#fff'}); 1568 this.$buttons.css({borderTop: '1px solid #FA6800'}); 1569 break; 1570 case 'error': 1571 this.$bar.css({backgroundColor: '#CE352C', border: 'none', color: '#fff'}); 1572 this.$message.css({fontWeight: 'bold'}); 1573 this.$buttons.css({borderTop: '1px solid #CE352C'}); 1574 break; 1575 case 'information': 1576 this.$bar.css({backgroundColor: '#1BA1E2', border: 'none', color: '#fff'}); 1577 this.$buttons.css({borderTop: '1px solid #1BA1E2'}); 1578 break; 1579 case 'success': 1580 this.$bar.css({backgroundColor: '#60A917', border: 'none', color: '#fff'}); 1581 this.$buttons.css({borderTop: '1px solid #50C24E'}); 1582 break; 1583 default: 1584 this.$bar.css({backgroundColor: '#fff', border: 'none', color: '#1d1d1d'}); 1585 break; 1586 } 1587 }, 1588 callback: { 1589 onShow : function () { 1590 1591 }, 1592 onClose: function () { 1593 1594 } 1595 } 1596}; 1597$.noty.themes.relax = { 1598 name : 'relax', 1599 helpers : {}, 1600 modal : { 1601 css: { 1602 position : 'fixed', 1603 width : '100%', 1604 height : '100%', 1605 backgroundColor: '#000', 1606 zIndex : 10000, 1607 opacity : 0.6, 1608 display : 'none', 1609 left : 0, 1610 top : 0 1611 } 1612 }, 1613 style : function () { 1614 1615 this.$bar.css({ 1616 overflow : 'hidden', 1617 margin : '4px 0', 1618 borderRadius: '0', 1619 position : 'relative' 1620 }); 1621 1622 this.$progressBar.css({ 1623 position : 'absolute', 1624 left : 0, 1625 bottom : 0, 1626 height : 4, 1627 width : '100%', 1628 backgroundColor: '#000000', 1629 opacity : 0.2, 1630 '-ms-filter' : 'progid:DXImageTransform.Microsoft.Alpha(Opacity=20)', 1631 filter : 'alpha(opacity=20)' 1632 }); 1633 1634 this.$message.css({ 1635 textAlign: 'center', 1636 padding : '15px 25px', 1637 width : 'auto', 1638 position : 'relative' 1639 }); 1640 1641 this.$closeButton.css({ 1642 position : 'absolute', 1643 top : 10, right: 10, 1644 width : 14, height: 14, 1645 background: "url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQgMS40MUwxMi41OSAwTDcgNS41OUwxLjQxIDBMMCAxLjQxTDUuNTkgN0wwIDEyLjU5TDEuNDEgMTRMNyA4LjQxTDEyLjU5IDE0TDE0IDEyLjU5TDguNDEgN0wxNCAxLjQxWiIgZmlsbD0iIzMzMzMzMyIvPjwvc3ZnPg==)", 1646 display : 'none', 1647 cursor : 'pointer' 1648 }); 1649 1650 this.$buttons.css({ 1651 padding : 5, 1652 textAlign : 'right', 1653 borderTop : '1px solid #ccc', 1654 backgroundColor: '#fff' 1655 }); 1656 1657 this.$buttons.find('button').css({ 1658 marginLeft: 5 1659 }); 1660 1661 this.$buttons.find('button:first').css({ 1662 marginLeft: 0 1663 }); 1664 1665 this.$bar.on({ 1666 mouseenter: function () { 1667 $(this).find('.noty_close').stop().fadeTo('normal', 1); 1668 }, 1669 mouseleave: function () { 1670 $(this).find('.noty_close').stop().fadeTo('normal', 0); 1671 } 1672 }); 1673 1674 switch (this.options.layout.name) { 1675 case 'top': 1676 this.$bar.css({ 1677 borderBottom: '2px solid #eee', 1678 borderLeft : '2px solid #eee', 1679 borderRight : '2px solid #eee', 1680 borderTop : '2px solid #eee', 1681 boxShadow : "0 2px 4px rgba(0, 0, 0, 0.1)" 1682 }); 1683 break; 1684 case 'topCenter': 1685 case 'center': 1686 case 'bottomCenter': 1687 case 'inline': 1688 this.$bar.css({ 1689 border : '1px solid #eee',
1690 boxShadow: "0px 4px 100px rgba(1, 52, 82, 0.15)" 1691 }); 1692 this.$message.css({textAlign: 'center'}); 1693 break; 1694 case 'topLeft': 1695 case 'topRight': 1696 case 'bottomLeft': 1697 case 'bottomRight': 1698 case 'centerLeft': 1699 case 'centerRight': 1700 this.$bar.css({ 1701 border : '1px solid #eee', 1702 boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)" 1703 }); 1704 this.$message.css({textAlign: 'left'}); 1705 break; 1706 case 'bottom': 1707 this.$bar.css({ 1708 borderTop : '2px solid #eee', 1709 borderLeft : '2px solid #eee', 1710 borderRight : '2px solid #eee', 1711 borderBottom: '2px solid #eee', 1712 boxShadow : "0 -2px 4px rgba(0, 0, 0, 0.1)" 1713 }); 1714 break; 1715 default: 1716 this.$bar.css({ 1717 border : '2px solid #eee', 1718 boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)" 1719 }); 1720 break; 1721 } 1722 switch (this.options.type) { 1723 case 'alert': 1724 case 'notification': 1725 this.$bar.css({backgroundColor: '#FFF', borderColor: '#dedede', color: '#444'}); 1726 break; 1727 case 'warning': 1728 this.$bar.css({backgroundColor: '#FFEAA8', borderColor: '#FFC237', color: '#826200'}); 1729 this.$buttons.css({borderTop: '1px solid #FFC237'}); 1730 break; 1731 case 'error': 1732 this.$bar.css({backgroundColor: 'rgba(255, 255, 255, .9)', borderColor: '#CD202C', color: '#CD202C'}); 1733 //this.$message.css({fontWeight: 'bold'}); 1734 this.$buttons.css({borderTop: '1px solid darkred'}); 1735 break; 1736 case 'information': 1737 this.$bar.css({backgroundColor: 'rgba(87, 183, 226, 1)', borderColor: 'rgba(11, 144, 196, .3)', color: '#FFF'}); 1738 this.$buttons.css({borderTop: '1px solid #0B90C4'}); 1739 break; 1740 case 'success': 1741 this.$bar.css({backgroundColor: 'rgba(144, 238, 144, 1)', borderColor: 'rgba(80, 194, 78, .3)', color: 'darkgreen'}); 1742 this.$buttons.css({borderTop: '1px solid #50C24E'}); 1743 break; 1744 case 'status': 1745 this.$bar.css({backgroundColor: 'rgba(255, 255, 255, .9)', borderColor: '#E8EDF2', color: '#333'}); 1746 this.$buttons.css({borderTop: '1px solid #50C24E'}); 1747 break; 1748 default: 1749 this.$bar.css({backgroundColor: '#FFF', borderColor: '#CCC', color: '#444'}); 1750 break; 1751 } 1752 }, 1753 callback: { 1754 onShow : function () { 1755 1756 }, 1757 onClose: function () { 1758 1759 } 1760 } 1761}; 1762 1763$.noty.themes.semanticUI = { 1764 name: 'semanticUI', 1765 1766 template: '<div class="ui message"><div class="content"><div class="header"></div></div></div>', 1767 1768 animation: { 1769 open : { 1770 animation: 'fade', 1771 duration : '800ms' 1772 }, 1773 close: { 1774 animation: 'fade left', 1775 duration : '800ms' 1776 } 1777 }, 1778 1779 modal : { 1780 css: { 1781 position : 'fixed', 1782 width : '100%', 1783 height : '100%', 1784 backgroundColor: '#000', 1785 zIndex : 10000, 1786 opacity : 0.6, 1787 display : 'none', 1788 left : 0, 1789 top : 0 1790 } 1791 }, 1792 style : function () { 1793 this.$message = this.$bar.find('.ui.message'); 1794 1795 this.$message.find('.header').html(this.options.header); 1796 this.$message.find('.content').append(this.options.text); 1797 1798 this.$bar.css({ 1799 margin : '0.5em', 1800 position: 'relative' 1801 }); 1802 1803 if (this.options.icon) { 1804 this.$message.addClass('icon').prepend($('<i/>').addClass(this.options.icon)); 1805 } 1806 1807 this.$progressBar.css({ 1808 position : 'absolute', 1809 left : 0, 1810 bottom : 0, 1811 height : 4, 1812 width : '100%', 1813 backgroundColor: '#000000', 1814 opacity : 0.2, 1815 '-ms-filter' : 'progid:DXImageTransform.Microsoft.Alpha(Opacity=20)', 1816 filter : 'alpha(opacity=20)' 1817 }); 1818 1819 switch (this.options.size) { 1820 case 'mini': 1821 this.$message.addClass('mini'); 1822 break; 1823 case 'tiny': 1824 this.$message.addClass('tiny'); 1825 break; 1826 case 'small': 1827 this.$message.addClass('small'); 1828 break; 1829 case 'large': 1830 this.$message.addClass('large'); 1831 break; 1832 case 'big': 1833 this.$message.addClass('big'); 1834 break; 1835 case 'huge': 1836 this.$message.addClass('huge'); 1837 break; 1838 case 'massive': 1839 this.$message.addClass('massive'); 1840 break; 1841 } 1842 1843 switch (this.options.type) { 1844 case 'info': 1845 this.$message.addClass('info'); 1846 break; 1847 case 'warning': 1848 this.$message.addClass('warning'); 1849 break; 1850 case 'error': 1851 this.$message.addClass('error'); 1852 break; 1853 case 'negative': 1854 this.$message.addClass('negative'); 1855 break; 1856 case 'success': 1857 this.$message.addClass('success'); 1858 break; 1859 case 'positive': 1860 this.$message.addClass('positive'); 1861 break; 1862 case 'floating': 1863 this.$message.addClass('floating'); 1864 break; 1865 } 1866 }, 1867 callback: { 1868 onShow : function () { 1869 // Enable transition 1870 this.$bar.addClass('transition'); 1871 // Actual transition 1872 this.$bar.transition(this.options.animation.open); 1873 }, 1874 onClose: function () { 1875 this.$bar.transition(this.options.animation.close); 1876 } 1877 } 1878}; 1879 1880 1881return window.noty; 1882 1883});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.