12 |
- !function(a,b){"function"==typeof define&&define.amd?define("pnotify",["jquery"],function(c){return b(c,a)}):"object"==typeof exports&&"undefined"!=typeof module?module.exports=b(require("jquery"),global||a):a.PNotify=b(a.jQuery,a)}("undefined"!=typeof window?window:this,function(a,b){var c=function(b){var d,e,f={dir1:"down",dir2:"left",push:"bottom",spacing1:36,spacing2:36,context:a("body"),modal:!1},g=a(b),h=function(){e=a("body"),j.prototype.options.stack.context=e,g=a(b),g.bind("resize",function(){d&&clearTimeout(d),d=setTimeout(function(){j.positionAll(!0)},10)})},i=function(b){var c=a("<div />",{class:"ui-pnotify-modal-overlay"});return c.prependTo(b.context),b.overlay_close&&c.click(function(){j.removeStack(b)}),c},j=function(a){this.state="initializing",this.timer=null,this.animTimer=null,this.styles=null,this.elem=null,this.container=null,this.title_container=null,this.text_container=null,this.animating=!1,this.timerHide=!1,this.parseOptions(a),this.init()};return a.extend(j.prototype,{version:"3.2.0",options:{title:!1,title_escape:!1,text:!1,text_escape:!1,styling:"brighttheme",addclass:"",cornerclass:"",auto_display:!0,width:"300px",min_height:"16px",type:"notice",icon:!0,animation:"fade",animate_speed:"normal",shadow:!0,hide:!0,delay:8e3,mouse_reset:!0,remove:!0,insert_brs:!0,destroy:!0,stack:f},modules:{},runModules:function(a,b){var c;for(var d in this.modules)c="object"==typeof b&&d in b?b[d]:b,"function"==typeof this.modules[d][a]&&(this.modules[d].notice=this,this.modules[d].options="object"==typeof this.options[d]?this.options[d]:{},this.modules[d][a](this,"object"==typeof this.options[d]?this.options[d]:{},c))},init:function(){var b=this;return this.modules={},a.extend(!0,this.modules,j.prototype.modules),"object"==typeof this.options.styling?this.styles=this.options.styling:this.styles=j.styling[this.options.styling],this.elem=a("<div />",{class:"ui-pnotify "+this.options.addclass,css:{display:"none"},"aria-live":"assertive","aria-role":"alertdialog",mouseenter:function(a){if(b.options.mouse_reset&&"out"===b.animating){if(!b.timerHide)return;b.cancelRemove()}b.options.hide&&b.options.mouse_reset&&b.cancelRemove()},mouseleave:function(a){b.options.hide&&b.options.mouse_reset&&"out"!==b.animating&&b.queueRemove(),j.positionAll()}}),"fade"===this.options.animation&&this.elem.addClass("ui-pnotify-fade-"+this.options.animate_speed),this.container=a("<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),role:"alert"}).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"),!1!==this.options.icon&&a("<div />",{class:"ui-pnotify-icon"}).append(a("<span />",{class:!0===this.options.icon?"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=a("<h4 />",{class:"ui-pnotify-title"}).appendTo(this.container),!1===this.options.title?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=a("<div />",{class:"ui-pnotify-text","aria-role":"alert"}).appendTo(this.container),!1===this.options.text?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),"top"===this.options.stack.push?j.notices=a.merge([this],j.notices):j.notices=a.merge(j.notices,[this]),"top"===this.options.stack.push&&this.queuePosition(!1,1),this.options.stack.animation=!1,this.runModules("init"),this.state="closed",this.options.auto_display&&this.open(),this},update:function(b){var c=this.options;return this.parseOptions(c,b),this.elem.removeClass("ui-pnotify-fade-slow ui-pnotify-fade-normal ui-pnotify-fade-fast"),"fade"===this.options.animation&&this.elem.addClass("ui-pnotify-fade-"+this.options.animate_speed),this.options.cornerclass!==c.cornerclass&&this.container.removeClass("ui-corner-all "+c.cornerclass).addClass(this.options.cornerclass),this.options.shadow!==c.shadow&&(this.options.shadow?this.container.addClass("ui-pnotify-shadow"):this.container.removeClass("ui-pnotify-shadow")),!1===this.options.addclass?this.elem.removeClass(c.addclass):this.options.addclass!==c.addclass&&this.elem.removeClass(c.addclass).addClass(this.options.addclass),!1===this.options.title?this.title_container.slideUp("fast"):this.options.title!==c.title&&(this.options.title_escape?this.title_container.text(this.options.title):this.title_container.html(this.options.title),!1===c.title&&this.title_container.slideDown(200)),!1===this.options.text?this.text_container.slideUp("fast"):this.options.text!==c.text&&(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),!1===c.text&&this.text_container.slideDown(200)),this.options.type!==c.type&&this.container.removeClass(this.styles.error+" "+this.styles.notice+" "+this.styles.success+" "+this.styles.info).addClass("error"===this.options.type?this.styles.error:"info"===this.options.type?this.styles.info:"success"===this.options.type?this.styles.success:this.styles.notice),(this.options.icon!==c.icon||!0===this.options.icon&&this.options.type!==c.type)&&(this.container.find("div.ui-pnotify-icon").remove(),!1!==this.options.icon&&a("<div />",{class:"ui-pnotify-icon"}).append(a("<span />",{class:!0===this.options.icon?"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.options.width!==c.width&&this.elem.animate({width:this.options.width}),this.options.min_height!==c.min_height&&this.container.animate({minHeight:this.options.min_height}),this.options.hide?c.hide||this.queueRemove():this.cancelRemove(),this.queuePosition(!0),this.runModules("update",c),this},open:function(){this.state="opening",this.runModules("beforeOpen");var a=this;return this.elem.parent().length||this.elem.appendTo(this.options.stack.context?this.options.stack.context:e),"top"!==this.options.stack.push&&this.position(!0),this.animateIn(function(){a.queuePosition(!0),a.options.hide&&a.queueRemove(),a.state="open",a.runModules("afterOpen")}),this},remove:function(c){this.state="closing",this.timerHide=!!c,this.runModules("beforeClose");var d=this;return this.timer&&(b.clearTimeout(this.timer),this.timer=null),this.animateOut(function(){if(d.state="closed",d.runModules("afterClose"),d.queuePosition(!0),d.options.remove&&d.elem.detach(),d.runModules("beforeDestroy"),d.options.destroy&&null!==j.notices){var b=a.inArray(d,j.notices);-1!==b&&j.notices.splice(b,1)}d.runModules("afterDestroy")}),this},get:function(){return this.elem},parseOptions:function(b,c){this.options=a.extend(!0,{},j.prototype.options),this.options.stack=j.prototype.options.stack;for(var d,e=[b,c],f=0;f<e.length&&void 0!==(d=e[f]);f++)if("object"!=typeof d)this.options.text=d;else for(var g in d)this.modules[g]?a.extend(!0,this.options[g],d[g]):this.options[g]=d[g]},animateIn:function(a){this.animating="in";var b=this,c=function(){b.animTimer&&clearTimeout(b.animTimer),"in"===b.animating&&(b.elem.is(":visible")?(a&&a.call(),b.animating=!1):b.animTimer=setTimeout(c,40))};"fade"===this.options.animation?(this.elem.one("webkitTransitionEnd mozTransitionEnd MSTransitionEnd oTransitionEnd transitionend",c).addClass("ui-pnotify-in"),this.elem.css("opacity"),this.elem.addClass("ui-pnotify-fade-in"),this.animTimer=setTimeout(c,650)):(this.elem.addClass("ui-pnotify-in"),c())},animateOut:function(b){this.animating="out";var c=this,d=function(){if(c.animTimer&&clearTimeout(c.animTimer),"out"===c.animating)if("0"!=c.elem.css("opacity")&&c.elem.is(":visible"))c.animTimer=setTimeout(d,40);else{if(c.elem.removeClass("ui-pnotify-in"),c.options.stack.overlay){var e=!1;a.each(j.notices,function(a,b){b!=c&&b.options.stack===c.options.stack&&"closed"!=b.state&&(e=!0)}),e||c.options.stack.overlay.hide()}b&&b.call(),c.animating=!1}};"fade"===this.options.animation?(this.elem.one("webkitTransitionEnd mozTransitionEnd MSTransitionEnd oTransitionEnd transitionend",d).removeClass("ui-pnotify-fade-in"),this.animTimer=setTimeout(d,650)):(this.elem.removeClass("ui-pnotify-in"),d())},position:function(a){var b=this.options.stack,c=this.elem;if(void 0===b.context&&(b.context=e),b){"number"!=typeof b.nextpos1&&(b.nextpos1=b.firstpos1),"number"!=typeof b.nextpos2&&(b.nextpos2=b.firstpos2),"number"!=typeof b.addpos2&&(b.addpos2=0);var d=!c.hasClass("ui-pnotify-in");if(!d||a){b.modal&&(b.overlay?b.overlay.show():b.overlay=i(b)),c.addClass("ui-pnotify-move");var f,h,j;switch(b.dir1){case"down":j="top";break;case"up":j="bottom";break;case"left":j="right";break;case"right":j="left"}f=parseInt(c.css(j).replace(/(?:\..*|[^0-9.])/g,"")),isNaN(f)&&(f=0),void 0!==b.firstpos1||d||(b.firstpos1=f,b.nextpos1=b.firstpos1);var k;switch(b.dir2){case"down":k="top";break;case"up":k="bottom";break;case"left":k="right";break;case"right":k="left"}switch(h=parseInt(c.css(k).replace(/(?:\..*|[^0-9.])/g,"")),isNaN(h)&&(h=0),void 0!==b.firstpos2||d||(b.firstpos2=h,b.nextpos2=b.firstpos2),("down"===b.dir1&&b.nextpos1+c.height()>(b.context.is(e)?g.height():b.context.prop("scrollHeight"))||"up"===b.dir1&&b.nextpos1+c.height()>(b.context.is(e)?g.height():b.context.prop("scrollHeight"))||"left"===b.dir1&&b.nextpos1+c.width()>(b.context.is(e)?g.width():b.context.prop("scrollWidth"))||"right"===b.dir1&&b.nextpos1+c.width()>(b.context.is(e)?g.width():b.context.prop("scrollWidth")))&&(b.nextpos1=b.firstpos1,b.nextpos2+=b.addpos2+(void 0===b.spacing2?25:b.spacing2),b.addpos2=0),"number"==typeof b.nextpos2&&(b.animation?c.css(k,b.nextpos2+"px"):(c.removeClass("ui-pnotify-move"),c.css(k,b.nextpos2+"px"),c.css(k),c.addClass("ui-pnotify-move"))),b.dir2){case"down":case"up":c.outerHeight(!0)>b.addpos2&&(b.addpos2=c.height());break;case"left":case"right":c.outerWidth(!0)>b.addpos2&&(b.addpos2=c.width())}switch("number"==typeof b.nextpos1&&(b.animation?c.css(j,b.nextpos1+"px"):(c.removeClass("ui-pnotify-move"),c.css(j,b.nextpos1+"px"),c.css(j),c.addClass("ui-pnotify-move"))),b.dir1){case"down":case"up":b.nextpos1+=c.height()+(void 0===b.spacing1?25:b.spacing1);break;case"left":case"right":b.nextpos1+=c.width()+(void 0===b.spacing1?25:b.spacing1)}}return this}},queuePosition:function(a,b){return d&&clearTimeout(d),b||(b=10),d=setTimeout(function(){j.positionAll(a)},b),this},cancelRemove:function(){return this.timer&&b.clearTimeout(this.timer),this.animTimer&&b.clearTimeout(this.animTimer),"closing"===this.state&&(this.state="open",this.animating=!1,this.elem.addClass("ui-pnotify-in"),"fade"===this.options.animation&&this.elem.addClass("ui-pnotify-fade-in")),this},queueRemove:function(){var a=this;return this.cancelRemove(),this.timer=b.setTimeout(function(){a.remove(!0)},isNaN(this.options.delay)?0:this.options.delay),this}}),a.extend(j,{notices:[],reload:c,removeAll:function(){a.each(j.notices,function(a,b){b.remove&&b.remove(!1)})},removeStack:function(b){a.each(j.notices,function(a,c){c.remove&&c.options.stack===b&&c.remove(!1)})},positionAll:function(b){if(d&&clearTimeout(d),d=null,j.notices&&j.notices.length)a.each(j.notices,function(a,c){var d=c.options.stack;d&&(d.overlay&&d.overlay.hide(),d.nextpos1=d.firstpos1,d.nextpos2=d.firstpos2,d.addpos2=0,d.animation=b)}),a.each(j.notices,function(a,b){b.position()});else{var c=j.prototype.options.stack;c&&(delete c.nextpos1,delete c.nextpos2)}},styling:{brighttheme:{container:"brighttheme",notice:"brighttheme-notice",notice_icon:"brighttheme-icon-notice",info:"brighttheme-info",info_icon:"brighttheme-icon-info",success:"brighttheme-success",success_icon:"brighttheme-icon-success",error:"brighttheme-error",error_icon:"brighttheme-icon-error"},bootstrap3:{container:"alert",notice:"alert-warning",notice_icon:"glyphicon glyphicon-exclamation-sign",info:"alert-info",info_icon:"glyphicon glyphicon-info-sign",success:"alert-success",success_icon:"glyphicon glyphicon-ok-sign",error:"alert-danger",error_icon:"glyphicon glyphicon-warning-sign"}}}),j.styling.fontawesome=a.extend({},j.styling.bootstrap3),a.extend(j.styling.fontawesome,{notice_icon:"fa fa-exclamation-circle",info_icon:"fa fa-info",success_icon:"fa fa-check",error_icon:"fa fa-warning"}),b.document.body?h():a(h),j};return c(b)}),!function(a,b){"function"==typeof define&&define.amd?define("pnotify.animate",["jquery","pnotify"],b):"object"==typeof exports&&"undefined"!=typeof module?module.exports=b(require("jquery"),require("./pnotify")):b(a.jQuery,a.PNotify)}("undefined"!=typeof window?window:this,function(a,b){return b.prototype.options.animate={animate:!1,in_class:"",out_class:""},b.prototype.modules.animate={init:function(a,b){this.setUpAnimations(a,b),a.attention=function(b,c){a.elem.one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){a.elem.removeClass(b),c&&c.call(a)}).addClass("animated "+b)}},update:function(a,b,c){b.animate!=c.animate&&this.setUpAnimations(a,b)},setUpAnimations:function(a,b){if(b.animate){a.options.animation="none",a.elem.removeClass("ui-pnotify-fade-slow ui-pnotify-fade-normal ui-pnotify-fade-fast"),a._animateIn||(a._animateIn=a.animateIn),a._animateOut||(a._animateOut=a.animateOut),a.animateIn=this.animateIn.bind(this),a.animateOut=this.animateOut.bind(this);var c=400;"slow"===a.options.animate_speed?c=600:"fast"===a.options.animate_speed?c=200:a.options.animate_speed>0&&(c=a.options.animate_speed),c/=1e3,a.elem.addClass("animated").css({"-webkit-animation-duration":c+"s","-moz-animation-duration":c+"s","animation-duration":c+"s"})}else a._animateIn&&a._animateOut&&(a.animateIn=a._animateIn,delete a._animateIn,a.animateOut=a._animateOut,delete a._animateOut,a.elem.addClass("animated"))},animateIn:function(a){this.notice.animating="in";var b=this;a=function(){b.notice.elem.removeClass(b.options.in_class),this&&this.call(),b.notice.animating=!1}.bind(a),this.notice.elem.show().one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",a).removeClass(this.options.out_class).addClass("ui-pnotify-in").addClass(this.options.in_class)},animateOut:function(a){this.notice.animating="out";var b=this;a=function(){b.notice.elem.removeClass("ui-pnotify-in "+b.options.out_class),this&&this.call(),b.notice.animating=!1}.bind(a),this.notice.elem.one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",a).removeClass(this.options.in_class).addClass(this.options.out_class)}},b}),!function(a,b){"function"==typeof define&&define.amd?define("pnotify.buttons",["jquery","pnotify"],b):"object"==typeof exports&&"undefined"!=typeof module?module.exports=b(require("jquery"),require("./pnotify")):b(a.jQuery,a.PNotify)}("undefined"!=typeof window?window:this,function(a,b){return b.prototype.options.buttons={closer:!0,closer_hover:!0,sticker:!0,sticker_hover:!0,show_on_nonblock:!1,labels:{close:"关闭",stick:"悬挂",unstick:"取消悬挂"},classes:{closer:null,pin_up:null,pin_down:null}},b.prototype.modules.buttons={init:function(b,c){var d=this;b.elem.on({mouseenter:function(a){!d.options.sticker||b.options.nonblock&&b.options.nonblock.nonblock&&!d.options.show_on_nonblock||d.sticker.trigger("pnotify:buttons:toggleStick").css("visibility","visible"),!d.options.closer||b.options.nonblock&&b.options.nonblock.nonblock&&!d.options.show_on_nonblock||d.closer.css("visibility","visible")},mouseleave:function(a){d.options.sticker_hover&&d.sticker.css("visibility","hidden"),d.options.closer_hover&&d.closer.css("visibility","hidden")}}),this.sticker=a("<div />",{class:"ui-pnotify-sticker","aria-role":"button","aria-pressed":b.options.hide?"false":"true",tabindex:"0",title:b.options.hide?c.labels.stick:c.labels.unstick,css:{cursor:"pointer",visibility:c.sticker_hover?"hidden":"visible"},click:function(){b.options.hide=!b.options.hide,b.options.hide?b.queueRemove():b.cancelRemove(),a(this).trigger("pnotify:buttons:toggleStick")}}).bind("pnotify:buttons:toggleStick",function(){var c=null===d.options.classes.pin_up?b.styles.pin_up:d.options.classes.pin_up,e=null===d.options.classes.pin_down?b.styles.pin_down:d.options.classes.pin_down;a(this).attr("title",b.options.hide?d.options.labels.stick:d.options.labels.unstick).children().attr("class","").addClass(b.options.hide?c:e).attr("aria-pressed",b.options.hide?"false":"true")}).append("<span />").trigger("pnotify:buttons:toggleStick").prependTo(b.container),(!c.sticker||b.options.nonblock&&b.options.nonblock.nonblock&&!c.show_on_nonblock)&&this.sticker.css("display","none"),this.closer=a("<div />",{class:"ui-pnotify-closer","aria-role":"button",tabindex:"0",title:c.labels.close,css:{cursor:"pointer",visibility:c.closer_hover?"hidden":"visible"},click:function(){b.remove(!1),d.sticker.css("visibility","hidden"),d.closer.css("visibility","hidden")}}).append(a("<span />",{class:null===c.classes.closer?b.styles.closer:c.classes.closer})).prependTo(b.container),(!c.closer||b.options.nonblock&&b.options.nonblock.nonblock&&!c.show_on_nonblock)&&this.closer.css("display","none")},update:function(a,b){!b.closer||a.options.nonblock&&a.options.nonblock.nonblock&&!b.show_on_nonblock?this.closer.css("display","none"):b.closer&&this.closer.css("display","block"),!b.sticker||a.options.nonblock&&a.options.nonblock.nonblock&&!b.show_on_nonblock?this.sticker.css("display","none"):b.sticker&&this.sticker.css("display","block"),this.sticker.trigger("pnotify:buttons:toggleStick"),this.closer.find("span").attr("class","").addClass(null===b.classes.closer?a.styles.closer:b.classes.closer),b.sticker_hover?this.sticker.css("visibility","hidden"):a.options.nonblock&&a.options.nonblock.nonblock&&!b.show_on_nonblock||this.sticker.css("visibility","visible"),b.closer_hover?this.closer.css("visibility","hidden"):a.options.nonblock&&a.options.nonblock.nonblock&&!b.show_on_nonblock||this.closer.css("visibility","visible")}},a.extend(b.styling.brighttheme,{closer:"brighttheme-icon-closer",pin_up:"brighttheme-icon-sticker",pin_down:"brighttheme-icon-sticker brighttheme-icon-stuck"}),a.extend(b.styling.bootstrap3,{closer:"glyphicon glyphicon-remove",pin_up:"glyphicon glyphicon-pause",pin_down:"glyphicon glyphicon-play"}),a.extend(b.styling.fontawesome,{closer:"fa fa-times",pin_up:"fa fa-pause",pin_down:"fa fa-play"}),b}),!function(a,b){"function"==typeof define&&define.amd?define("pnotify.callbacks",["jquery","pnotify"],b):"object"==typeof exports&&"undefined"!=typeof module?module.exports=b(require("jquery"),require("./pnotify")):b(a.jQuery,a.PNotify)}("undefined"!=typeof window?window:this,function(a,b){var c=b.prototype.init,d=b.prototype.open,e=b.prototype.remove;return b.prototype.init=function(){this.options.before_init&&this.options.before_init(this.options),c.apply(this,arguments),this.options.after_init&&this.options.after_init(this)},b.prototype.open=function(){var a;this.options.before_open&&(a=this.options.before_open(this)),!1!==a&&(d.apply(this,arguments),this.options.after_open&&this.options.after_open(this))},b.prototype.remove=function(a){var b;this.options.before_close&&(b=this.options.before_close(this,a)),!1!==b&&(e.apply(this,arguments),this.options.after_close&&this.options.after_close(this,a))},b}),!function(a,b){"function"==typeof define&&define.amd?define("pnotify.confirm",["jquery","pnotify"],b):"object"==typeof exports&&"undefined"!=typeof module?module.exports=b(require("jquery"),require("./pnotify")):b(a.jQuery,a.PNotify)}("undefined"!=typeof window?window:this,function(a,b){return b.prototype.options.confirm={confirm:!1,prompt:!1,prompt_class:"",prompt_default:"",prompt_multi_line:!1,align:"right",buttons:[{text:"Ok",addClass:"",promptTrigger:!0,click:function(a,b){a.remove(),a.get().trigger("pnotify.confirm",[a,b])}},{text:"Cancel",addClass:"",click:function(a){a.remove(),a.get().trigger("pnotify.cancel",a)}}]},b.prototype.modules.confirm={init:function(b,c){this.container=a('<div class="ui-pnotify-action-bar" style="margin-top:5px;clear:both;" />').css("text-align",c.align).appendTo(b.container),c.confirm||c.prompt?this.makeDialog(b,c):this.container.hide()},update:function(a,b){b.confirm?(this.makeDialog(a,b),this.container.show()):this.container.hide().empty()},afterOpen:function(a,b){b.prompt&&this.prompt.focus()},makeDialog:function(c,d){var e,f,g=!1,h=this;this.container.empty(),d.prompt&&(this.prompt=a("<"+(d.prompt_multi_line?'textarea rows="5"':'input type="text"')+' style="margin-bottom:5px;clear:both;" />').addClass((void 0===c.styles.input?"":c.styles.input)+" "+(void 0===d.prompt_class?"":d.prompt_class)).val(d.prompt_default).appendTo(this.container));for(var i=d.buttons[0]&&d.buttons[0]!==b.prototype.options.confirm.buttons[0],j=0;j<d.buttons.length;j++)null===d.buttons[j]||i&&b.prototype.options.confirm.buttons[j]&&b.prototype.options.confirm.buttons[j]===d.buttons[j]||(e=d.buttons[j],g?this.container.append(" "):g=!0,f=a('<button type="button" class="ui-pnotify-action-button" />').addClass((void 0===c.styles.btn?"":c.styles.btn)+" "+(void 0===e.addClass?"":e.addClass)).text(e.text).appendTo(this.container).on("click",function(a){return function(){"function"==typeof a.click&&a.click(c,d.prompt?h.prompt.val():null)}}(e)),d.prompt&&!d.prompt_multi_line&&e.promptTrigger&&this.prompt.keypress(function(a){return function(b){13==b.keyCode&&a.click()}}(f)),c.styles.text&&f.wrapInner('<span class="'+c.styles.text+'"></span>'),c.styles.btnhover&&f.hover(function(a){return function(){a.addClass(c.styles.btnhover)}}(f),function(a){return function(){a.removeClass(c.styles.btnhover)}}(f)),c.styles.btnactive&&f.on("mousedown",function(a){return function(){a.addClass(c.styles.btnactive)}}(f)).on("mouseup",function(a){return function(){a.removeClass(c.styles.btnactive)}}(f)),c.styles.btnfocus&&f.on("focus",function(a){return function(){a.addClass(c.styles.btnfocus)}}(f)).on("blur",function(a){return function(){a.removeClass(c.styles.btnfocus)}}(f)))}},a.extend(b.styling.bootstrap3,{btn:"btn btn-default",input:"form-control"}),a.extend(b.styling.fontawesome,{btn:"btn btn-default",input:"form-control"}),b}),!function(a,b){"function"==typeof define&&define.amd?define("pnotify.desktop",["jquery","pnotify"],b):"object"==typeof exports&&"undefined"!=typeof module?module.exports=b(require("jquery"),require("./pnotify")):b(a.jQuery,a.PNotify)}("undefined"!=typeof window?window:this,function(a,b){var c,d=function(a,b){return(d="Notification"in window?function(a,b){return new Notification(a,b)}:"mozNotification"in navigator?function(a,b){return navigator.mozNotification.createNotification(a,b.body,b.icon).show()}:"webkitNotifications"in window?function(a,b){return window.webkitNotifications.createNotification(b.icon,a,b.body)}:function(a,b){return null})(a,b)};return b.prototype.options.desktop={desktop:!1,fallback:!0,icon:null,tag:null,title:null,text:null},b.prototype.modules.desktop={genNotice:function(a,b){null===b.icon?this.icon="http://sciactive.com/pnotify/includes/desktop/"+a.options.type+".png":!1===b.icon?this.icon=null:this.icon=b.icon,null!==this.tag&&null===b.tag||(this.tag=null===b.tag?"PNotify-"+Math.round(1e6*Math.random()):b.tag),a.desktop=d(b.title||a.options.title,{icon:this.icon,body:b.text||a.options.text,tag:this.tag}),!("close"in a.desktop)&&"cancel"in a.desktop&&(a.desktop.close=function(){a.desktop.cancel()}),a.desktop.onclick=function(){a.elem.trigger("click")},a.desktop.onclose=function(){"closing"!==a.state&&"closed"!==a.state&&a.remove()}},init:function(a,d){if(d.desktop){if(0!==(c=b.desktop.checkPermission()))return void(d.fallback||(a.options.auto_display=!1));this.genNotice(a,d)}},update:function(a,b,d){0!==c&&b.fallback||!b.desktop||this.genNotice(a,b)},beforeOpen:function(a,b){0!==c&&b.fallback||!b.desktop||a.elem.css({left:"-10000px"}).removeClass("ui-pnotify-in")},afterOpen:function(a,b){0!==c&&b.fallback||!b.desktop||(a.elem.css({left:"-10000px"}).removeClass("ui-pnotify-in"),"show"in a.desktop&&a.desktop.show())},beforeClose:function(a,b){0!==c&&b.fallback||!b.desktop||a.elem.css({left:"-10000px"}).removeClass("ui-pnotify-in")},afterClose:function(a,b){0!==c&&b.fallback||!b.desktop||(a.elem.css({left:"-10000px"}).removeClass("ui-pnotify-in"),"close"in a.desktop&&a.desktop.close())}},b.desktop={permission:function(){"undefined"!=typeof Notification&&"requestPermission"in Notification?Notification.requestPermission():"webkitNotifications"in window&&window.webkitNotifications.requestPermission()},checkPermission:function(){return"undefined"!=typeof Notification&&"permission"in Notification?"granted"===Notification.permission?0:1:"webkitNotifications"in window&&0==window.webkitNotifications.checkPermission()?0:1}},c=b.desktop.checkPermission(),b}),!function(a,b){"function"==typeof define&&define.amd?define("pnotify.history",["jquery","pnotify"],b):"object"==typeof exports&&"undefined"!=typeof module?module.exports=b(require("jquery"),require("./pnotify")):b(a.jQuery,a.PNotify)}("undefined"!=typeof window?window:this,function(a,b){var c,d;return a(function(){a("body").on("pnotify.history-all",function(){a.each(b.notices,function(){this.modules.history.inHistory&&(this.elem.is(":visible")?this.options.hide&&this.queueRemove():this.open&&this.open())})}).on("pnotify.history-last",function(){var a,c="top"===b.prototype.options.stack.push,d=c?0:-1;do{if(a=-1===d?b.notices.slice(d):b.notices.slice(d,d+1),!a[0])return!1;d=c?d+1:d-1}while(!a[0].modules.history.inHistory||a[0].elem.is(":visible"));a[0].open&&a[0].open()})}),b.prototype.options.history={history:!0,menu:!1,fixed:!0,maxonscreen:1/0,labels:{redisplay:"Redisplay",all:"All",last:"Last"}},b.prototype.modules.history={init:function(b,e){if(b.options.destroy=!1,this.inHistory=e.history,e.menu&&void 0===c){c=a("<div />",{class:"ui-pnotify-history-container "+b.styles.hi_menu,mouseleave:function(){c.css("top","-"+d+"px")}}).append(a("<div />",{class:"ui-pnotify-history-header",text:e.labels.redisplay})).append(a("<button />",{class:"ui-pnotify-history-all "+b.styles.hi_btn,text:e.labels.all,mouseenter:function(){a(this).addClass(b.styles.hi_btnhov)},mouseleave:function(){a(this).removeClass(b.styles.hi_btnhov)},click:function(){return a(this).trigger("pnotify.history-all"),!1}})).append(a("<button />",{class:"ui-pnotify-history-last "+b.styles.hi_btn,text:e.labels.last,mouseenter:function(){a(this).addClass(b.styles.hi_btnhov)},mouseleave:function(){a(this).removeClass(b.styles.hi_btnhov)},click:function(){return a(this).trigger("pnotify.history-last"),!1}})).appendTo("body");var f=a("<span />",{class:"ui-pnotify-history-pulldown "+b.styles.hi_hnd,mouseenter:function(){c.css("top","0")}}).appendTo(c);d=f.offset().top+2,c.css("top","-"+d+"px"),e.fixed&&c.addClass("ui-pnotify-history-fixed")}},update:function(a,b){this.inHistory=b.history,b.fixed&&c?c.addClass("ui-pnotify-history-fixed"):c&&c.removeClass("ui-pnotify-history-fixed")},beforeOpen:function(c,d){if(b.notices&&b.notices.length>d.maxonscreen){var e;e="top"!==c.options.stack.push?b.notices.slice(0,b.notices.length-d.maxonscreen):b.notices.slice(d.maxonscreen,b.notices.length),a.each(e,function(){this.remove&&this.remove()})}}},a.extend(b.styling.brighttheme,{hi_menu:"ui-pnotify-history-brighttheme",hi_btn:"",hi_btnhov:"",hi_hnd:""}),a.extend(b.styling.bootstrap3,{hi_menu:"well",hi_btn:"btn btn-default",hi_btnhov:"",hi_hnd:"glyphicon glyphicon-chevron-down"}),a.extend(b.styling.fontawesome,{hi_menu:"well",hi_btn:"btn btn-default",hi_btnhov:"",hi_hnd:"fa fa-chevron-down"}),b}),!function(a,b){"function"==typeof define&&define.amd?define("pnotify.mobile",["jquery","pnotify"],b):"object"==typeof exports&&"undefined"!=typeof module?module.exports=b(require("jquery"),require("./pnotify")):b(a.jQuery,a.PNotify)}("undefined"!=typeof window?window:this,function(a,b){return b.prototype.options.mobile={swipe_dismiss:!0,styling:!0},b.prototype.modules.mobile={init:function(a,b){var c=this,d=null,e=null,f=null;this.swipe_dismiss=b.swipe_dismiss,this.doMobileStyling(a,b),a.elem.on({touchstart:function(b){c.swipe_dismiss&&(d=b.originalEvent.touches[0].screenX,f=a.elem.width(),a.container.css("left","0"))},touchmove:function(b){if(d&&c.swipe_dismiss){var g=b.originalEvent.touches[0].screenX;e=g-d;var h=(1-Math.abs(e)/f)*a.options.opacity;a.elem.css("opacity",h),a.container.css("left",e)}},touchend:function(){if(d&&c.swipe_dismiss){if(Math.abs(e)>40){var b=e<0?-2*f:2*f;a.elem.animate({opacity:0},100),a.container.animate({left:b},100),a.remove()}else a.elem.animate({opacity:a.options.opacity},100),a.container.animate({left:0},100);d=null,e=null,f=null}},touchcancel:function(){d&&c.swipe_dismiss&&(a.elem.animate({opacity:a.options.opacity},100),a.container.animate({left:0},100),d=null,e=null,f=null)}})},update:function(a,b){this.swipe_dismiss=b.swipe_dismiss,this.doMobileStyling(a,b)},doMobileStyling:function(b,c){c.styling?(b.elem.addClass("ui-pnotify-mobile-able"),a(window).width()<=480?(b.options.stack.mobileOrigSpacing1||(b.options.stack.mobileOrigSpacing1=b.options.stack.spacing1,b.options.stack.mobileOrigSpacing2=b.options.stack.spacing2),b.options.stack.spacing1=0,b.options.stack.spacing2=0):(b.options.stack.mobileOrigSpacing1||b.options.stack.mobileOrigSpacing2)&&(b.options.stack.spacing1=b.options.stack.mobileOrigSpacing1,delete b.options.stack.mobileOrigSpacing1,b.options.stack.spacing2=b.options.stack.mobileOrigSpacing2,delete b.options.stack.mobileOrigSpacing2)):(b.elem.removeClass("ui-pnotify-mobile-able"),b.options.stack.mobileOrigSpacing1&&(b.options.stack.spacing1=b.options.stack.mobileOrigSpacing1,delete b.options.stack.mobileOrigSpacing1),b.options.stack.mobileOrigSpacing2&&(b.options.stack.spacing2=b.options.stack.mobileOrigSpacing2,delete b.options.stack.mobileOrigSpacing2))}},b}),!function(a,b){"function"==typeof define&&define.amd?define("pnotify.nonblock",["jquery","pnotify"],b):"object"==typeof exports&&"undefined"!=typeof module?module.exports=b(require("jquery"),require("./pnotify")):b(a.jQuery,a.PNotify)}("undefined"!=typeof window?window:this,function(a,b){var c,d=function(b,c){var d;if(b=b.toLowerCase(),document.createEvent&&this.dispatchEvent){if(b=b.replace(/^on/,""),b.match(/^(dbl)?click$|^mouse(move|down|up|over|out|enter|leave)$|^contextmenu$/)?(a(this).offset(),d=document.createEvent("MouseEvents"),d.initMouseEvent(b,c.bubbles,c.cancelable,c.view,c.detail,c.screenX,c.screenY,c.clientX,c.clientY,c.ctrlKey,c.altKey,c.shiftKey,c.metaKey,c.button,c.relatedTarget)):b.match(/^(focus|blur|select|change|reset)$|^key(press|down|up)$/)?(d=document.createEvent("UIEvents"),d.initUIEvent(b,c.bubbles,c.cancelable,c.view,c.detail)):b.match(/^(scroll|resize|(un)?load|abort|error)$/)&&(d=document.createEvent("HTMLEvents"),d.initEvent(b,c.bubbles,c.cancelable)),!d)return;this.dispatchEvent(d)}else b.match(/^on/)||(b="on"+b),d=document.createEventObject(c),this.fireEvent(b,d)},e=function(b,e,f){b.elem.addClass("ui-pnotify-nonblock-hide");var g=document.elementFromPoint(e.clientX,e.clientY);b.elem.removeClass("ui-pnotify-nonblock-hide");var h=a(g),i=h.css("cursor");"auto"===i&&"A"===g.tagName&&(i="pointer"),b.elem.css("cursor","auto"!==i?i:"default"),c&&c.get(0)==g||(c&&(d.call(c.get(0),"mouseleave",e.originalEvent),d.call(c.get(0),"mouseout",e.originalEvent)),
- d.call(g,"mouseenter",e.originalEvent),d.call(g,"mouseover",e.originalEvent)),d.call(g,f,e.originalEvent),c=h};return b.prototype.options.nonblock={nonblock:!1},b.prototype.modules.nonblock={init:function(a,b){var d=this;a.elem.on({mouseenter:function(b){d.options.nonblock&&b.stopPropagation(),d.options.nonblock&&a.elem.addClass("ui-pnotify-nonblock-fade")},mouseleave:function(b){d.options.nonblock&&b.stopPropagation(),c=null,a.elem.css("cursor","auto"),d.options.nonblock&&"out"!==a.animating&&a.elem.removeClass("ui-pnotify-nonblock-fade")},mouseover:function(a){d.options.nonblock&&a.stopPropagation()},mouseout:function(a){d.options.nonblock&&a.stopPropagation()},mousemove:function(b){d.options.nonblock&&(b.stopPropagation(),e(a,b,"onmousemove"))},mousedown:function(b){d.options.nonblock&&(b.stopPropagation(),b.preventDefault(),e(a,b,"onmousedown"))},mouseup:function(b){d.options.nonblock&&(b.stopPropagation(),b.preventDefault(),e(a,b,"onmouseup"))},click:function(b){d.options.nonblock&&(b.stopPropagation(),e(a,b,"onclick"))},dblclick:function(b){d.options.nonblock&&(b.stopPropagation(),e(a,b,"ondblclick"))}})}},b});
|