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.3.11 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 // Mix in the passed in options with the default options 35 this.options = $.extend({}, $.noty.defaults, options); 36 37 this.options.layout = (this.options.custom) ? $.noty.layouts.inline : $.noty.layouts[this.options.layout]; 38 if (this.options.custom && this.options.custom.selector && this.options.custom.selector.indexOf("popover") > -1) { 39 this.options.layout = $.noty.layouts.popover; 40 } 41 42 if ($.noty.themes[this.options.theme]) { 43 this.options.theme = $.noty.themes[this.options.theme]; 44 if (this.options.theme.template) 45 this.options.template = this.options.theme.template; 46 47 if (this.options.theme.animation) 48 this.options.animation = this.options.theme.animation; 49 } 50 else { 51 this.options.themeClassName = this.options.theme; 52 } 53 54 this.options = $.extend({}, this.options, this.options.layout.options); 55 56 //close others in the same unique queue 57 if (this.options.maxVisible == 1) { 58 $.noty.closeAll(true, this.options.queue); 59 } 60 61 if (this.options.id) { 62 if ($.noty.store[this.options.id]) { 63 return $.noty.store[this.options.id]; 64 } 65 } else { 66 this.options.id = 'noty_' + (new Date().getTime() * Math.floor(Math.random() * 1000000)); 67 } 68 69 // Build the noty dom initial structure 70 this._build(); 71 72 // return this so we can chain/use the bridge with less code. 73 return this; 74 }, // end init 75 76 _build: function () { 77 78 // Generating noty bar 79 var customClass = this.options.class && this.options.class.trim() ? ' ' + this.options.class.trim() : ''; 80 var $bar = $('<div class="noty_bar noty_type_' + this.options.type + customClass + '"></div>').attr('id', this.options.id); 81 $bar.append(this.options.template).find('.noty_text').html(this.options.text); 82 83 //if (this.options.layout.parent.object == "parentElementLink") this.options.layout.parent.object = this.options.parentElementLink; 84 this.$bar = (this.options.layout.parent.object !== null) ? $(this.options.layout.parent.object).css(this.options.layout.parent.css).append($bar) : $bar; 85 86 if (this.options.themeClassName) 87 this.$bar.addClass(this.options.themeClassName).addClass('noty_container_type_' + this.options.type); 88 89 // Set buttons if available 90 if (this.options.buttons) { 91 92 var $buttons; 93 // Try find container for buttons in presented template, and create it if not found 94 if (this.$bar.find('.noty_buttons').length > 0) { 95 $buttons = this.$bar.find('.noty_buttons'); 96 } else { 97 $buttons = $('<div/>').addClass('noty_buttons'); 98 (this.options.layout.parent.object !== null) ? this.$bar.find('.noty_bar').append($buttons) : this.$bar.append($buttons); 99 } 100 101 var self = this; 102 103 $.each(this.options.buttons, function (i, button) { 104 var $button = $('<button/>').addClass((button.addClass) ? button.addClass : 'gray').html(button.text).attr('id', button.id ? button.id : 'button-' + i) 105 .attr('title', button.title) 106 .appendTo($buttons) 107 .on('click', function (event) { 108 if ($.isFunction(button.onClick)) { 109 button.onClick.call($button, self, event); 110 } 111 }); 112 }); 113 } else { 114 // If buttons is not available, then remove containers if exist 115 this.$bar.find('.noty_buttons').remove(); 116 } 117 118 // For easy access 119 this.$message = this.$bar.find('.noty_message'); 120 this.$closeButton = this.$bar.find('.noty_close'); 121 this.$buttons = this.$bar.find('.noty_buttons'); 122 123 $.noty.store[this.options.id] = this; // store noty for api 124 125 }, // end _build 126 127 show: function () { 128 129 var self = this; 130 131 (self.options.custom) ? self.options.custom.find(self.options.layout.container.selector).append(self.$bar) : $(self.options.layout.container.selector).append(self.$bar); 132 133 if (self.options.theme && self.options.theme.style) 134 self.options.theme.style.apply(self); 135 136 ($.type(self.options.layout.css) === 'function') ? this.options.layout.css.apply(self.$bar) : self.$bar.css(this.options.layout.css || {}); 137 138 self.$bar.addClass(self.options.layout.addClass); 139 140 self.options.layout.container.style.apply($(self.options.layout.container.selector), [self.options.within]); 141 142 self.showing = true; 143 144 if (self.options.theme && self.options.theme.style) 145 self.options.theme.callback.onShow.apply(this); 146 147 if ($.inArray('click', self.options.closeWith) > -1) 148 self.$bar.css('cursor', 'pointer').on('click', function (evt) { 149 self.stopPropagation(evt); 150 if (self.options.callback.onCloseClick) { 151 self.options.callback.onCloseClick.apply(self); 152 } 153 self.close(); 154 }); 155 156 if ($.inArray('hover', self.options.closeWith) > -1) 157 self.$bar.on('mouseenter', function () { 158 self.close(); 159 }); 160 161 if ($.inArray('button', self.options.closeWith) > -1) 162 self.$closeButton.one('click', function (evt) { 163 self.stopPropagation(evt); 164 self.close(); 165 }); 166 167 if ($.inArray('parent_blur', self.options.closeWith) > -1) 168 $('a[href="#' + self.options.parentElementLink + '"]').on('mouseleave', function () { 169 self.close(); 170 }); 171 172 if ($.inArray('button', self.options.closeWith) == -1) 173 self.$closeButton.remove(); 174 175 if (self.options.callback.beforeShow) 176 self.options.callback.beforeShow.apply(self); 177 178 if (typeof self.options.animation.open == 'string') { 179 self.animationTypeOpen = 'css';
180 //self.$bar.css('min-height', self.$bar.innerHeight()); 181 self.$bar.on('click', function (e) { 182 self.wasClicked = true; 183 }); 184 self.$bar.show(); 185 186 if (self.options.callback.onShow) 187 self.options.callback.onShow.apply(self); 188 189 self.$bar.addClass(self.options.animation.open).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { 190 if (self.options.callback.afterShow) self.options.callback.afterShow.apply(self); 191 self.showing = false; 192 self.shown = true; 193 if (self.hasOwnProperty('wasClicked')) { 194 self.$bar.off('click', function (e) { 195 self.wasClicked = true; 196 }); 197 self.close(); 198 } 199 }); 200 201 } else if (typeof self.options.animation.open == 'object' && self.options.animation.open == null) { 202 self.animationTypeOpen = 'none'; 203 self.showing = false; 204 self.shown = true; 205 self.$bar.show(); 206 207 if (self.options.callback.onShow) 208 self.options.callback.onShow.apply(self); 209 210 self.$bar.queue(function () { 211 if (self.options.callback.afterShow) 212 self.options.callback.afterShow.apply(self); 213 }); 214 215 } else { 216 self.animationTypeOpen = 'anim'; 217 218 if (self.options.callback.onShow) 219 self.options.callback.onShow.apply(self); 220 221 self.$bar.animate( 222 self.options.animation.open, 223 self.options.animation.speed, 224 self.options.animation.easing, 225 function () { 226 if (self.options.callback.afterShow) self.options.callback.afterShow.apply(self); 227 self.showing = false; 228 self.shown = true; 229 }); 230 } 231 232 // If noty is have a timeout option 233 if (self.options.timeout) { 234 self.queueClose(self.options.timeout); 235 self.$bar.on('mouseenter', self.dequeueClose.bind(self)); 236 self.$bar.on('mouseleave', self.queueClose.bind(self, self.options.timeout)); 237 } 238 239 return this; 240 241 }, // end show 242 243 dequeueClose: function () { 244 if (!this.closeTimer) return; 245 clearTimeout(this.closeTimer); 246 this.closeTimer = null; 247 }, 248 249 queueClose: function (timeout) { 250 if (this.closeTimer) return; 251 var self = this; 252 self.closeTimer = window.setTimeout(function () { 253 self.close(); 254 }, timeout); 255 return self.closeTimer; 256 }, 257 258 close: function (closeImmediately, queueClose) { 259 if (typeof closeImmediately == 'undefined') { 260 closeImmediately = false; 261 } else if (typeof closeImmediately == 'string') { 262 queueClose = closeImmediately; 263 } 264 265 if (typeof queueClose == 'undefined' || this.options.queue == queueClose) { 266 if (this.closeTimer) this.dequeueClose(); 267 268 if (this.closed) return; 269 if (this.$bar && this.$bar.hasClass('i-am-closing-now')) return; 270 271 var self = this; 272 273 if (closeImmediately === true) { 274 self.closeCleanUp(); 275 return; 276 } 277 278 if (this.showing && (this.animationTypeOpen == 'anim' || this.animationTypeOpen == 'none')) { 279 self.$bar.queue( 280 function () { 281 self.close.apply(self); 282 } 283 ); 284 return; 285 } else if (this.showing && this.animationTypeOpen == 'css') { 286 self.$bar.on('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { 287 self.close(); 288 }); 289 } 290 291 if (!this.shown && !this.showing) { // If we are still waiting in the queue just delete from queue 292 var queue = []; 293 $.each($.noty.queue[self.options.queue], function (i, n) { 294 if (n.options.id != self.options.id) { 295 queue.push(n); 296 } 297 }); 298 $.noty.queue[self.options.queue] = queue; 299 return; 300 } 301 302 self.$bar.addClass('i-am-closing-now'); 303 304 if (self.options.callback.onClose) { 305 self.options.callback.onClose.apply(self); 306 } 307 308 if (typeof self.options.animation.close == 'string') { 309 self.$bar.removeClass(self.options.animation.open).addClass(self.options.animation.close).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { 310 if (self.options.callback.afterClose) self.options.callback.afterClose.apply(self); 311 self.closeCleanUp(); 312 }); 313 314 } else if (typeof self.options.animation.close == 'object' && self.options.animation.close == null) { 315 self.$bar.dequeue().hide(0, function() { 316 if (self.options.callback.afterClose) self.options.callback.afterClose.apply(self); 317 self.closeCleanUp(); 318 }); 319 320 } else { 321 self.$bar.clearQueue().stop().animate( 322 self.options.animation.close, 323 self.options.animation.speed, 324 self.options.animation.easing, 325 function () { 326 if (self.options.callback.afterClose) self.options.callback.afterClose.apply(self); 327 }) 328 .promise().done(function () { 329 self.closeCleanUp(); 330 }); 331 } 332 } 333 334 }, // end close 335 336 closeCleanUp: function () { 337 338 var self = this; 339 340 // Modal Cleaning 341 if (self.options.modal) { 342 $.notyRenderer.setModalCount(-1); 343 if ($.notyRenderer.getModalCount() == 0 && !$.noty.queue[self.options.queue].length) $('.noty_modal').fadeOut(self.options.animation.fadeSpeed, function () { 344 $(this).remove(); 345 }); 346 } 347 348 // Layout Cleaning 349 $.notyRenderer.setLayoutCountFor(self, -1); 350 if ($.notyRenderer.getLayoutCountFor(self) == 0) { 351 var selector = self.options.layout.container.selector; 352 if (self.options.layout.name == "popover") selector = self.options.custom.selector + " " + selector; 353 $(selector).remove(); 354 } 355 356 // Make sure self.$bar has not been removed before attempting to remove it 357 if (typeof self.$bar !== 'undefined' && self.$bar !== null) { 358 359 if (typeof self.options.animation.close == 'string') { 360 self.$bar.css('transition', 'all 10ms ease').css('border', 0).css('margin', 0).height(0); 361 self.$bar.one('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function () { 362 self.$bar.remove(); 363 self.$bar = null; 364 self.closed = true; 365 366 if (self.options.theme.callback && self.options.theme.callback.onClose) { 367 self.options.theme.callback.onClose.apply(self); 368 } 369 370 self.handleNext(); 371 }); 372 } else { 373 self.$bar.remove(); 374 self.$bar = null; 375 self.closed = true; 376 377 self.handleNext(); 378 } 379 } else { 380 self.handleNext(); 381 } 382 383 }, // end close clean up 384 385 handleNext: function () { 386 var self = this; 387 388 delete $.noty.store[self.options.id]; // deleting noty from store 389 390 if (self.options.theme.callback && self.options.theme.callback.onClose) { 391 self.options.theme.callback.onClose.apply(self); 392 } 393 394 if (!self.options.dismissQueue) { 395 // Queue render 396 $.noty.ontap = true; 397 398 $.notyRenderer.render(self.options.queue); 399 } 400 401 if (self.options.maxVisible > 0 && self.options.dismissQueue) { 402 $.notyRenderer.render(self.options.queue); 403 } 404 }, 405 406 setText: function (text) { 407 if (!this.closed) { 408 this.options.text = text; 409 this.$bar.find('.noty_text').html(text); 410 } 411 return this; 412 }, 413 414 setType: function (type) { 415 if (!this.closed) { 416 this.options.type = type; 417 this.options.theme.style.apply(this); 418 this.options.theme.callback.onShow.apply(this); 419 } 420 return this; 421 }, 422 423 setTimeout: function (time) { 424 if (!this.closed) { 425 var self = this; 426 this.options.timeout = time; 427 self.$bar.delay(self.options.timeout).promise().done(function () { 428 self.close(); 429 }); 430 } 431 return this; 432 }, 433 434 stopPropagation: function (evt) { 435 evt = evt || window.event; 436 if (typeof evt.stopPropagation !== "undefined") { 437 evt.stopPropagation(); 438 } 439 else { 440 evt.cancelBubble = true; 441 } 442 }, 443 444 closed : false, 445 showing: false, 446 shown : false 447 448}; // end NotyObject 449 450$.notyRenderer = {}; 451 452$.notyRenderer.init = function (options) { 453 454if ( !(options.queue in $.noty.queue) ) {
455 $.noty.queue[options.queue] = []; 456} 457 458// Renderer creates a new noty 459var notification = Object.create(NotyObject).init(options); 460 461if (notification.options.killer) { 462 $.noty.closeAll(); 463} else if (notification.options.killerNow) { 464 $.noty.closeAll(true); 465} 466 467if (notification.options.force) { 468 $.noty.queue[options.queue].unshift(notification); 469} else { 470 $.noty.queue[options.queue].push(notification); 471} 472 473$.notyRenderer.render(options.queue); 474 475return ($.noty.returns == 'object') ? notification : notification.options.id; 476}; 477 478$.notyRenderer.render = function (queueName) { 479 480var instance = $.noty.queue[queueName][0]; 481 482if ($.type(instance) === 'object') { 483 if (instance.options.dismissQueue) { 484 if (instance.options.maxVisible > 0) { 485 var selector = instance.options.layout.container.selector + ' > li'; 486 487 if (instance.options.queue != "global") { 488 selector = ".noty_message." + instance.options.queue; 489 } 490 491 if ($(selector).length < instance.options.maxVisible) { 492 $.notyRenderer.show($.noty.queue[queueName].shift()); 493 } 494 else { 495 //$.noty.queue[queueName].shift(); 496 } 497 } 498 else { 499 $.notyRenderer.show($.noty.queue[queueName].shift()); 500 } 501 } 502 else { 503 if ($.noty.ontap) { 504 $.notyRenderer.show($.noty.queue[queueName].shift()); 505 $.noty.ontap = false; 506 } 507 } 508} 509else { 510 $.noty.ontap = true; // Queue is over 511} 512 513}; 514 515$.notyRenderer.show = function (notification) { 516 517if (notification.options.modal) { 518 $.notyRenderer.createModalFor(notification); 519 $.notyRenderer.setModalCount(+1); 520} 521 522// Where is the container? 523if (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} 531else { 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 542notification.show(); 543}; 544 545$.notyRenderer.createModalFor = function (notification) { 546if ($('.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 var selector = notification.options.layout.container.selector; 563 if (notification.options.layout.name == "popover") selector = notification.options.custom.selector + " " + selector; 564 return $(selector).data('noty_layout_count') || 0; 565}; 566 567$.notyRenderer.setLayoutCountFor = function (notification, arg) { 568 var selector = notification.options.layout.container.selector; 569 if (notification.options.layout.name == "popover") selector = notification.options.custom.selector + " " + selector; 570 return $(selector).data('noty_layout_count', $.notyRenderer.getLayoutCountFor(notification) + arg); 571}; 572 573$.notyRenderer.getModalCount = function () { 574 return $('.noty_modal').data('noty_modal_count') || 0; 575}; 576 577$.notyRenderer.setModalCount = function (arg) { 578 return $('.noty_modal').data('noty_modal_count', $.notyRenderer.getModalCount() + arg); 579}; 580 581// This is for custom container 582$.fn.noty = function (options) { 583 options.custom = $(this); 584 return $.notyRenderer.init(options); 585}; 586 587$.noty = {}; 588$.noty.queue = {}; 589$.noty.ontap = true; 590$.noty.layouts = {}; 591$.noty.themes = {}; 592$.noty.returns = 'object'; 593$.noty.store = {}; 594 595$.noty.get = function (id) { 596 return $.noty.store.hasOwnProperty(id) ? $.noty.store[id] : false;
597}; 598 599$.noty.close = function (id) { 600 return $.noty.get(id) ? $.noty.get(id).close() : false; 601}; 602 603$.noty.setText = function (id, text) { 604 return $.noty.get(id) ? $.noty.get(id).setText(text) : false; 605}; 606 607$.noty.setType = function (id, type) { 608 return $.noty.get(id) ? $.noty.get(id).setType(type) : false; 609}; 610 611$.noty.clearQueue = function () { 612 $.noty.queue = {}; 613}; 614 615$.noty.closeAll = function (closeImmediately, queue) { 616 if (typeof closeImmediately == 'string') { 617 queue = closeImmediately; 618 } 619 if (typeof closeImmediately != 'string' && !queue) { 620 $.noty.clearQueue(); 621 } else if ($.noty.queue[queue]) { 622 $.noty.queue[queue] = []; 623 } 624 $.each($.noty.store, function (id, noty) { 625 noty.close(closeImmediately, queue); 626 }); 627}; 628 629var windowAlert = window.alert; 630 631$.noty.consumeAlert = function (options) { 632window.alert = function (text) { 633 if (options) 634 options.text = text; 635 else 636 options = {text: text}; 637 638 $.notyRenderer.init(options); 639}; 640}; 641 642$.noty.stopConsumeAlert = function () { 643window.alert = windowAlert; 644}; 645 646$.noty.defaults = { 647layout : 'topRight', 648theme : 'relax', 649type : 'alert', 650text : '', 651dismissQueue: true, 652template : '<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>', 653animation : { 654 open : {height: 'toggle'}, 655 close : {height: 'toggle'}, 656 easing : 'swing', 657 speed : 500, 658 fadeSpeed: 'fast' 659}, 660timeout : false, 661force : false, 662modal : false, 663maxVisible : 5, 664parentElementLink : '', 665killer : false, 666killerNow : false, 667closeWith : ['click'], 668callback : { 669 beforeShow : function () { 670 }, 671 onShow : function () { 672 }, 673 afterShow : function () { 674 }, 675 onClose : function () { 676 }, 677 afterClose : function () { 678 }, 679 onCloseClick: function () { 680 } 681}, 682buttons : false 683}; 684 685$(window).on('resize', function () { 686$.each($.noty.layouts, function (index, layout) { 687 layout.container.style.apply($(layout.container.selector)); 688}); 689}); 690 691// Helpers 692window.noty = function noty(options) { 693return $.notyRenderer.init(options); 694}; 695 696$.noty.layouts.bottom = { 697 name : 'bottom', 698 options : {}, 699 container: { 700 object : '<ul id="noty_bottom_layout_container" class="noty_layout_container" />', 701 selector: 'ul#noty_bottom_layout_container', 702 style : function() { 703 $(this).css({ 704 bottom : 0, 705 left : 0, 706 position : 'fixed', 707 height : 'auto', 708 margin : 0, 709 padding : 20, 710 listStyleType: 'none', 711 zIndex : 9999999 712 }); 713 } 714 }, 715 parent : { 716 object : '<li />', 717 selector: 'li', 718 css : {} 719 }, 720 css : { 721 display: 'none' 722 }, 723 addClass : '' 724}; 725 726$.noty.layouts.bottomCenter = { 727 name : 'bottomCenter', 728 options : { // overrides options 729 730 }, 731 container: { 732 object : '<ul id="noty_bottomCenter_layout_container" class="noty_layout_container" />', 733 selector: 'ul#noty_bottomCenter_layout_container', 734 style : function() { 735 $(this).css({ 736 bottom : 0, 737 left : 0, 738 position : 'fixed', 739 height : 'auto', 740 margin : 0, 741 padding : 20, 742 listStyleType: 'none', 743 zIndex : 10000000 744 }); 745 746 $(this).css({ 747 left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px' 748 }); 749 } 750 }, 751 parent : { 752 object : '<li />', 753 selector: 'li', 754 css : {} 755 }, 756 css : { 757 display: 'none', 758 }, 759 addClass : '' 760}; 761 762 763$.noty.layouts.bottomLeft = { 764 name : 'bottomLeft', 765 options : { // overrides options 766 767 }, 768 container: { 769 object : '<ul id="noty_bottomLeft_layout_container" class="noty_layout_container" />', 770 selector: 'ul#noty_bottomLeft_layout_container', 771 style : function() { 772 $(this).css({ 773 bottom : 0, 774 left : 0, 775 position : 'fixed', 776 height : 'auto', 777 margin : 0, 778 padding : 20, 779 listStyleType: 'none', 780 zIndex : 10000000 781 }); 782 783 if(window.innerWidth < 600) { 784 $(this).css({ 785 left: 5 786 }); 787 } 788 } 789 }, 790 parent : { 791 object : '<li />', 792 selector: 'li', 793 css : {} 794 }, 795 css : { 796 display: 'none', 797 }, 798 addClass : '' 799}; 800$.noty.layouts.bottomRight = { 801 name : 'bottomRight', 802 options : { // overrides options 803 804 }, 805 container: { 806 object : '<ul id="noty_bottomRight_layout_container" class="noty_layout_container" />', 807 selector: 'ul#noty_bottomRight_layout_container', 808 style : function() { 809 $(this).css({ 810 bottom : 0, 811 right : 0, 812 position : 'fixed', 813 height : 'auto', 814 margin : 0, 815 padding : 20, 816 listStyleType: 'none', 817 zIndex : 10000000 818 }); 819 820 if(window.innerWidth < 600) { 821 $(this).css({ 822 right: 5 823 }); 824 } 825 } 826 }, 827 parent : { 828 object : '<li />', 829 selector: 'li', 830 css : {} 831 }, 832 css : { 833 display: 'none', 834 }, 835 addClass : '' 836}; 837$.noty.layouts.center = { 838 name : 'center', 839 options : { // overrides options 840 841 }, 842 container: { 843 object : '<ul id="noty_center_layout_container" class="noty_layout_container" />', 844 selector: 'ul#noty_center_layout_container', 845 style : function() { 846 $(this).css({ 847 position : 'fixed', 848 height : 'auto', 849 margin : 0, 850 padding : 20, 851 listStyleType: 'none', 852 zIndex : 10000000 853 }); 854 855 $(this).css({ 856 left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px', 857 top: ($(window).height() - $(this).outerHeight(false)) / 2 + 'px' 858 }); 859 860 } 861 }, 862 parent : { 863 object : '<li />', 864 selector: 'li', 865 css : {} 866 }, 867 css : { 868 display: 'none', 869 }, 870 addClass : '' 871}; 872$.noty.layouts.centerLeft = { 873 name : 'centerLeft', 874 options : { // overrides options 875 876 }, 877 container: { 878 object : '<ul id="noty_centerLeft_layout_container" class="noty_layout_container" />', 879 selector: 'ul#noty_centerLeft_layout_container', 880 style : function() { 881 $(this).css({ 882 left : 0, 883 position : 'fixed', 884 height : 'auto', 885 margin : 0, 886 padding : 20, 887 listStyleType: 'none', 888 zIndex : 10000000 889 }); 890 891 $(this).css({ 892 top: ($(window).height() - $(this).outerHeight(false)) / 2 + 'px' 893 }); 894 895 if(window.innerWidth < 600) { 896 $(this).css({ 897 left: 5 898 }); 899 } 900 901 } 902 }, 903 parent : { 904 object : '<li />', 905 selector: 'li', 906 css : {} 907 }, 908 css : { 909 display: 'none', 910 }, 911 addClass : '' 912}; 913 914$.noty.layouts.centerRight = { 915 name : 'centerRight', 916 options : { // overrides options 917 918 }, 919 container: { 920 object : '<ul id="noty_centerRight_layout_container" class="noty_layout_container" />', 921 selector: 'ul#noty_centerRight_layout_container', 922 style : function() { 923 $(this).css({ 924 right : 0, 925 position : 'fixed', 926 height : 'auto', 927 margin : 0, 928 padding : 20, 929 listStyleType: 'none', 930 zIndex : 10000000 931 }); 932 933 $(this).css({ 934 top: ($(window).height() - $(this).outerHeight(false)) / 2 + 'px' 935 }); 936 937 if(window.innerWidth < 600) { 938 $(this).css({ 939 right: 5 940 }); 941 } 942 943 } 944 }, 945 parent : { 946 object : '<li />', 947 selector: 'li', 948 css : {} 949 }, 950 css : { 951 display: 'none', 952 }, 953 addClass : '' 954}; 955$.noty.layouts.inline = { 956 name : 'inline', 957 options : {}, 958 container: { 959 object : '<ul class="noty_inline_layout_container" class="noty_layout_container" />', 960 selector: 'ul.noty_inline_layout_container', 961 style : function() { 962 $(this).css({ 963 width : '100%', 964 height : 'auto', 965 margin : 0, 966 padding : 0, 967 listStyleType: 'none', 968 zIndex : 9999999 969 }); 970 } 971 }, 972 parent : { 973 object : '<li />', 974 selector: 'li', 975 css : {} 976 }, 977 css : { 978 display: 'none' 979 }, 980 addClass : '' 981}; 982$.noty.layouts.popover = { 983 name : 'popover', 984 options : { }, 985 container: { 986 object : '<ul class="noty_popover_layout_container" class="noty_layout_container" />', 987 selector: 'ul.noty_popover_layout_container', 988 style : function() { 989 var offset = $(this).offset(); 990 var width = $(this).width(); 991 var winWidth = jQuery(window).width(); 992 993 if (offset && offset.left < 0) { 994 $(this).css("width", width - 2 * Math.abs(Math.floor(offset.left))); 995 } else if (offset && offset.left + width > winWidth) { 996 $(this).css("width", width - 2 * Math.ceil((offset.left + width) - winWidth)); 997 } 998 } 999 }, 1000 parent : { 1001 object : '<li />', 1002 selector: 'li', 1003 css : {} 1004 }, 1005 css : { 1006 display: 'none' 1007 }, 1008 addClass : '' 1009}; 1010$.noty.layouts.top = { 1011 name : 'top', 1012 options : {}, 1013 container: { 1014 object : '<ul id="noty_top_layout_container" class="noty_layout_container" />', 1015 selector: 'ul#noty_top_layout_container', 1016 style : function() { 1017 $(this).css({ 1018 top : 0, 1019 left : 0, 1020 position : 'fixed', 1021 height : 'auto', 1022 margin : 0, 1023 padding : 20, 1024 listStyleType: 'none', 1025 zIndex : 9999999 1026 }); 1027 1028 $(this).css({ 1029 left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px' 1030 }); 1031 } 1032 }, 1033 parent : { 1034 object : '<li />', 1035 selector: 'li', 1036 css : {} 1037 }, 1038 css : { 1039 display: 'none' 1040 }, 1041 addClass : '' 1042}; 1043$.noty.layouts.topCenter = { 1044 name : 'topCenter', 1045 options : { // overrides options 1046 1047 }, 1048 container: { 1049 object : '<ul id="noty_topCenter_layout_container" class="noty_layout_container" />', 1050 selector: 'ul#noty_topCenter_layout_container', 1051 style : function() { 1052 $(this).css({ 1053 top : 0, 1054 left : 0, 1055 position : 'fixed', 1056 height : 'auto', 1057 margin : 0, 1058 padding : 20, 1059 listStyleType: 'none', 1060 zIndex : 10000000 1061 }); 1062 1063 $(this).css({ 1064 left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px' 1065 }); 1066 } 1067 }, 1068 parent : { 1069 object : '<li />', 1070 selector: 'li', 1071 css : {} 1072 }, 1073 css : { 1074 display: 'none', 1075 }, 1076 addClass : '' 1077}; 1078 1079$.noty.layouts.topLeft = { 1080 name : 'topLeft', 1081 options : { // overrides options 1082 1083 }, 1084 container: { 1085 object : '<ul id="noty_topLeft_layout_container" class="noty_layout_container" />', 1086 selector: 'ul#noty_topLeft_layout_container', 1087 style : function() { 1088 $(this).css({ 1089 top : 0, 1090 left : 0, 1091 position : 'fixed', 1092 height : 'auto', 1093 margin : 0, 1094 padding : 20, 1095 listStyleType: 'none', 1096 zIndex : 10000000 1097 }); 1098 1099 if(window.innerWidth < 600) { 1100 $(this).css({ 1101 left: 5 1102 }); 1103 } 1104 } 1105 }, 1106 parent : { 1107 object : '<li />', 1108 selector: 'li', 1109 css : {} 1110 }, 1111 css : { 1112 display: 'none', 1113 }, 1114 addClass : '' 1115}; 1116$.noty.layouts.topRight = { 1117 name : 'topRight', 1118 options : { // overrides options 1119 1120 }, 1121 container: { 1122 object : '<ul id="noty_topRight_layout_container" class="noty_layout_container" />', 1123 selector: 'ul#noty_topRight_layout_container', 1124 style : function() { 1125 $(this).css({ 1126 top : 0, 1127 right : 0, 1128 position : 'fixed', 1129 height : 'auto', 1130 margin : 0, 1131 padding : 20, 1132 listStyleType: 'none', 1133 zIndex : 10000000 1134 }); 1135 1136 if(window.innerWidth < 600) { 1137 $(this).css({ 1138 right: 5 1139 }); 1140 } 1141 } 1142 }, 1143 parent : { 1144 object : '<li />', 1145 selector: 'li', 1146 css : {} 1147 }, 1148 css : { 1149 display: 'none', 1150 }, 1151 addClass : '' 1152}; 1153 1154return window.noty; 1155 1156});
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.