SickGear/gui/slick/js/lib/pnotify.custom.min.js

1 line
24 KiB
JavaScript
Raw Normal View History

!function(t){"function"==typeof define&&define.amd?define("pnotify",["jquery"],t):t(jQuery)}(function(t){var i,o,s={dir1:"down",dir2:"left",push:"bottom",spacing1:25,spacing2:25,context:t("body")},e=t(window),n=function(){o=t("body"),PNotify.prototype.options.stack.context=o,e=t(window),e.bind("resize",function(){i&&clearTimeout(i),i=setTimeout(function(){PNotify.positionAll(!0)},10)})};return PNotify=function(t){this.parseOptions(t),this.init()},t.extend(PNotify.prototype,{version:"2.0.1",options:{title:!1,title_escape:!1,text:!1,text_escape:!1,styling:"bootstrap3",addclass:"",cornerclass:"",auto_display:!0,width:"300px",min_height:"16px",type:"notice",icon:!0,opacity:1,animation:"fade",animate_speed:"slow",position_animate_speed:500,shadow:!0,hide:!0,delay:8e3,mouse_reset:!0,remove:!0,insert_brs:!0,destroy:!0,stack:s},modules:{},runModules:function(t,i){var o;for(var s in this.modules)o="object"==typeof i&&s in i?i[s]:i,"function"==typeof this.modules[s][t]&&this.modules[s][t](this,"object"==typeof this.options[s]?this.options[s]:{},o)},state:"initializing",timer:null,styles:null,elem:null,container:null,title_container:null,text_container:null,animating:!1,timerHide:!1,init:function(){var i=this;return this.modules={},t.extend(!0,this.modules,PNotify.prototype.modules),this.styles="object"==typeof this.options.styling?this.options.styling:PNotify.styling[this.options.styling],this.elem=t("<div />",{"class":"ui-pnotify "+this.options.addclass,css:{display:"none"},mouseenter:function(){if(i.options.mouse_reset&&"out"===i.animating){if(!i.timerHide)return;i.cancelRemove()}i.options.hide&&i.options.mouse_reset&&i.cancelRemove()},mouseleave:function(){i.options.hide&&i.options.mouse_reset&&"out"!==i.animating&&i.queueRemove(),PNotify.positionAll()}}),this.container=t("<div />",{"class":this.styles.container+" ui-pnotify-container "+("error"===this.options.type?this.styles.error:"info"===this.options.type?this.styles.info:"success"===this.options.type?this.styles.success:this.styles.notice)}).appendTo(this.elem),""!==this.options.cornerclass&&this.container.removeClass("ui-corner-all").addClass(this.options.cornerclass),this.options.shadow&&this.container.addClass("ui-pnotify-shadow"),this.options.icon!==!1&&t("<div />",{"class":"ui-pnotify-icon"}).append(t("<span />",{"class":this.options.icon===!0?"error"===this.options.type?this.styles.error_icon:"info"===this.options.type?this.styles.info_icon:"success"===this.options.type?this.styles.success_icon:this.styles.notice_icon:this.options.icon})).prependTo(this.container),this.title_container=t("<h4 />",{"class":"ui-pnotify-title"}).appendTo(this.container),this.options.title===!1?this.title_container.hide():this.options.title_escape?this.title_container.text(this.options.title):this.title_container.html(this.options.title),this.text_container=t("<div />",{"class":"ui-pnotify-text"}).appendTo(this.container),this.options.text===!1?this.text_container.hide():this.options.text_escape?this.text_container.text(this.options.text):this.text_container.html(this.options.insert_brs?String(this.options.text).replace(/\n/g,"<br />"):this.options.text),"string"==typeof this.options.width&&this.elem.css("width",this.options.width),"string"==typeof this.options.min_height&&this.container.css("min-height",this.options.min_height),PNotify.notices="top"===this.options.stack.push?t.merge([this],PNotify.notices):t.merge(PNotify.notices,[this]),"top"===this.options.stack.push&&this.queuePosition(!1,1),this.options.stack.animation=!1,this.runModules("init"),this.options.auto_display&&this.open(),this},update:function(i){var o=this.options;return this.parseOptions(o,i),this.options.cornerclass!==o.cornerclass&&this.container.removeClass("ui-corner-all "+o.cornerclass).addClass(this.options.cornerclass),this.options.shadow!==o.shadow&&(this.options.shadow?this.container.addClass("ui-pnotify-shadow"):this.container.removeClass("ui-pnotify-shadow")),this.options.addclass===!1?this.elem.removeClass(o.addclass):this.options.addclass!==o.addclass&&this.elem.removeClass(o.addclass).addClass(this.option