控制台应用,yzncms本身基于tp5.1框架,里面的队列用不了,bug,坑
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1
  1. layui.define([],function(l){var m={},PLUGIN_NAME='iziToast',BODY=document.querySelector('body'),ISMOBILE=(/Mobi/.test(navigator.userAgent))?true:false,ISCHROME=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor),ISFIREFOX=typeof InstallTrigger!=='undefined',ACCEPTSTOUCH='ontouchstart'in document.documentElement,POSITIONS=['bottomRight','bottomLeft','bottomCenter','topRight','topLeft','topCenter','center'],THEMES={info:{color:'blue',icon:'ico-info'},success:{color:'green',icon:'ico-success'},warning:{color:'orange',icon:'ico-warning'},error:{color:'red',icon:'ico-error'},question:{color:'yellow',icon:'ico-question'}},MOBILEWIDTH=568,CONFIG={};m.children={};var n={id:null,class:'',title:'',titleColor:'',titleSize:'',titleLineHeight:'',message:'',messageColor:'',messageSize:'',messageLineHeight:'',backgroundColor:'',theme:'dark',color:'',icon:'',iconText:'',iconColor:'',iconUrl:null,image:'',imageWidth:50,maxWidth:null,zindex:null,layout:1,balloon:false,close:true,closeOnEscape:false,closeOnClick:false,displayMode:0,position:'topRight',target:'',targetFirst:true,timeout:5000,rtl:false,animateInside:true,drag:true,pauseOnHover:true,resetOnHover:false,progressBar:true,progressBarColor:'',progressBarEasing:'linear',overlay:false,overlayClose:false,overlayColor:'rgba(0, 0, 0, 0.6)',transitionIn:'fadeInUp',transitionOut:'fadeOut',transitionInMobile:'fadeInUp',transitionOutMobile:'fadeOutDown',buttons:{},inputs:{},onOpening:function(){},onOpened:function(){},onClosing:function(){},onClosed:function(){}};if(!('remove'in Element.prototype)){Element.prototype.remove=function(){if(this.parentNode){this.parentNode.removeChild(this)}}}if(typeof window.CustomEvent!=='function'){var o=function(a,b){b=b||{bubbles:false,cancelable:false,detail:undefined};var c=document.createEvent('CustomEvent');c.initCustomEvent(a,b.bubbles,b.cancelable,b.detail);return c};o.prototype=window.Event.prototype;window.CustomEvent=o}var p=function(a,b,c){if(Object.prototype.toString.call(a)==='[object Object]'){for(var d in a){if(Object.prototype.hasOwnProperty.call(a,d)){b.call(c,a[d],d,a)}}}else{if(a){for(var i=0,len=a.length;i<len;i++){b.call(c,a[i],i,a)}}}};var q=function(c,d){var e={};p(c,function(a,b){e[b]=c[b]});p(d,function(a,b){e[b]=d[b]});return e};var r=function(a){var b=document.createDocumentFragment(),temp=document.createElement('div');temp.innerHTML=a;while(temp.firstChild){b.appendChild(temp.firstChild)}return b};var s=function(a){var b=btoa(encodeURIComponent(a));return b.replace(/=/g,"")};var t=function(a){if(a.substring(0,1)=='#'||a.substring(0,3)=='rgb'||a.substring(0,3)=='hsl'){return true}else{return false}};var u=function(a){try{return btoa(atob(a))==a}catch(err){return false}};var v=function(){return{move:function(a,b,c,d){var e,opacityRange=0.3,distance=180;if(d!==0){a.classList.add(PLUGIN_NAME+'-dragged');a.style.transform='translateX('+d+'px)';if(d>0){e=(distance-d)/distance;if(e<opacityRange){b.hide(q(c,{transitionOut:'fadeOutRight',transitionOutMobile:'fadeOutRight'}),a,'drag')}}else{e=(distance+d)/distance;if(e<opacityRange){b.hide(q(c,{transitionOut:'fadeOutLeft',transitionOutMobile:'fadeOutLeft'}),a,'drag')}}a.style.opacity=e;if(e<opacityRange){if(ISCHROME||ISFIREFOX)a.style.left=d+'px';a.parentNode.style.opacity=opacityRange;this.stopMoving(a,null)}}},startMoving:function(b,c,d,e){e=e||window.event;var f=((ACCEPTSTOUCH)?e.touches[0].clientX:e.clientX),toastLeft=b.style.transform.replace('px)','');toastLeft=toastLeft.replace('translateX(','');var g=f-toastLeft;if(d.transitionIn){b.classList.remove(d.transitionIn)}if(d.transitionInMobile){b.classList.remove(d.transitionInMobile)}b.style.transition='';if(ACCEPTSTOUCH){document.ontouchmove=function(e){e.preventDefault();e=e||window.event;var a=e.touches[0].clientX,finalX=a-g;v.move(b,c,d,finalX)}}else{document.onmousemove=function(e){e.preventDefault();e=e||window.event;var a=e.clientX,finalX=a-g;v.move(b,c,d,finalX)}}},stopMoving:function(a,e){if(ACCEPTSTOUCH){document.ontouchmove=function(){}}else{document.onmousemove=function(){}}a.style.opacity='';a.style.transform='';if(a.classList.contains(PLUGIN_NAME+'-dragged')){a.classList.remove(PLUGIN_NAME+'-dragged');a.style.transition='transform 0.4s ease, opacity 0.4s ease';setTimeout(function(){a.style.transition=''},400)}}}}();m.setSetting=function(a,b,c){m.children[a][b]=c};m.getSetting=function(a,b){return m.children[a][b]};m.destroy=function(){p(document.querySelectorAll('.'+PLUGIN_NAME+'-overlay'),function(a,b){a.remove()});p(document.querySelectorAll('.'+PLUGIN_NAME+'-wrapper'),function(a,b){a.remove()});p(document.querySelectorAll('.'+PLUGIN_NAME),function(a,b){a.remove()});this.children={};document.removeEventListener(PLUGIN_NAME+'-opened',{},false);document.removeEventListener(PLUGIN_NAME+'-opening',{},false);document.removeEventListener(PLUGIN_NAME+'-closing',{},false);document.removeEventListener(PLUGIN_NAME+'-closed',{},false);document.removeEventListener('keyup',{},false);CONFIG={}};m.settings=function(a){m.destroy();CONFIG=a;n=q(n,a||{})};p(THEMES,function(c,d){m[d]=function(a){var b=q(CONFIG,a||{});b=q(c,b||{});this.show(b)}});m.progress=function(b,c,d){var e=this,ref=c.getAttribute('data-iziToast-ref'),settings=q(this.children[ref],b||{}),$elem=c.querySelector('.'+PLUGIN_NAME+'-progressbar div');return{start:function(){if(typeof settings.time.REMAINING=='undefined'){c.classList.remove(PLUGIN_NAME+'-reseted');if($elem!==null){$elem.style.transition='width '+settings.timeout+'ms '+settings.progressBarEasing;$elem.style.width='0%'}settings.time.START=new Date().getTime();settings.time.END=settings.time.START+settings.timeout;settings.time.TIMER=setTimeout(function(){clearTimeout(settings.time.TIMER);if(!c.classList.contains(PLUGIN_NAME+'-closing')){e.hide(settings,c,'timeout');if(typeof d==='function'){d.apply(e)}}},settings.timeout);e.setSetting(ref,'time',settings.time)}},pause:function(){if(typeof settings.time.START!=='undefined'&&!c.classList.contains(PLUGIN_NAME+'-paused')&&!c.classList.contains(PLUGIN_NAME+'-reseted')){c.classList.add(PLUGIN_NAME+'-paused');settings.time.REMAINING=settings.time.END-new Date().getTime();clearTimeout(settings.time.TIMER);e.setSetting(ref,'time',settings.time);if($elem!==null){var a=window.getComputedStyle($elem),propertyWidth=a.getPropertyValue('width');$elem.style.transition='none';$elem.style.width=propertyWidth}if(typeof d==='function'){setTimeout(function(){d.apply(e)},10)}}},resume:function(){if(typeof settings.time.REMAINING!=='undefined'){c.classList.remove(PLUGIN_NAME+'-paused');if($elem!==null){$elem.style.transition='width '+settings.time.REMAINING+'ms '+settings.progressBarEasing;$elem.style.width='0%'}settings.time.END=new Date().getTime()+settings.time.REMAINING;settings.time.TIMER=setTimeout(function(){clearTimeout(settings.time.TIMER);if(!c.classList.contains(PLUGIN_NAME+'-closing')){e.hide(settings,c,'timeout');if(typeof d==='function'){d.apply(e)}}},settings.time.REMAINING);e.setSetting(ref,'time',settings.time)}else{this.start()}},reset:function(){clearTimeout(settings.time.TIMER);delete settings.time.REMAINING;e.setSetting(ref,'time',settings.time);c.classList.add(PLUGIN_NAME+'-reseted');c.classList.remove(PLUGIN_NAME+'-paused');if($elem!==null){$elem.style.transition='none';$elem.style.width='100%'}if(typeof d==='function'){setTimeout(function(){d.apply(e)},10)}}}};m.hide=function(d,e,f){if(typeof e!='object'){e=document.querySelector(e)}var g=this,settings=q(this.children[e.getAttribute('data-iziToast-ref')],d||{});settings.closedBy=f||null;delete settings.time.REMAINING;e.classList.add(PLUGIN_NAME+'-closing');(function(){var a=document.querySelector('.'+PLUGIN_NAME+'-overlay');if(a!==null){var b=a.getAttribute('data-iziToast-ref');b=b.split(',');var c=b.indexOf(String(settings.ref));if(c!==-1){b.splice(c,1)}a.setAttribute('data-iziToast-ref',b.join());if(b.length===0){a.classList.remove('fadeIn');a.classList.add('fadeOut');setTimeout(function(){a.remove()},700)}}})();if(settings.transitionIn){e.classList.remove(settings.transitionIn)}if(settings.transitionInMobile){e.classList.remove(settings.transitionInMobile)}if(ISMOBILE||window.innerWidth<=MOBILEWIDTH){if(settings.transitionOutMobile)e.classList.add(settings.transitionOutMobile)}else{if(settings.transitionOut)e.classList.add(settings.transitionOut)}var H=e.parentNode.offsetHeight;e.parentNode.style.height=H+'px';e.style.pointerEvents='none';if(!ISMOBILE||window.innerWidth>MOBILEWIDTH){e.parentNode.style.transitionDelay='0.2s'}try{var h=new CustomEvent(PLUGIN_NAME+'-closing',{detail:settings,bubbles:true,cancelable:true});document.dispatchEvent(h)}catch(ex){console.warn(ex)}setTimeout(function(){e.parentNode.style.height='0px';e.parentNode.style.overflow='';setTimeout(function(){delete g.children[settings.ref];e.parentNode.remove();try{var a=new CustomEvent(PLUGIN_NAME+'-closed',{detail:settings,bubbles:true,cancelable:true});document.dispatchEvent(a)}catch(ex){console.warn(ex)}if(typeof settings.onClosed!=='undefined'){settings.onClosed.apply(null,[settings,e,f])}},1000)},200);if(typeof settings.onClosing!=='undefined'){settings.onClosing.apply(null,[settings,e,f])}};m.show=function(f){var g=this;var h=q(CONFIG,f||{});h=q(n,h);h.time={};if(h.id===null){h.id=s(h.title+h.message+h.color)}if(h.displayMode===1||h.displayMode=='once'){try{if(document.querySelectorAll('.'+PLUGIN_NAME+'#'+h.id).length>0){return false}}catch(exc){console.warn('['+PLUGIN_NAME+'] Could not find an element with this selector: '+'#'+h.id+'. Try to set an valid id.')}}if(h.displayMode===2||h.displayMode=='replace'){try{p(document.querySelectorAll('.'+PLUGIN_NAME+'#'+h.id),function(a,b){g.hide(h,a,'replaced')})}catch(exc){console.warn('['+PLUGIN_NAME+'] Could not find an element with this selector: '+'#'+h.id+'. Try to set an valid id.')}}h.ref=new Date().getTime()+Math.floor((Math.random()*10000000)+1);m.children[h.ref]=h;var i={body:document.querySelector('body'),overlay:document.createElement('div'),toast:document.createElement('div'),toastBody:document.createElement('div'),toastTexts:document.createElement('div'),toastCapsule:document.createElement('div'),cover:document.createElement('div'),buttons:document.createElement('div'),inputs:document.createElement('div'),icon:!h.iconUrl?document.createElement('i'):document.createElement('img'),wrapper:null};i.toast.setAttribute('data-iziToast-ref',h.ref);i.toast.appendChild(i.toastBody);i.toastCapsule.appendChild(i.toast);(function(){i.toast.classList.add(PLUGIN_NAME);i.toast.classList.add(PLUGIN_NAME+'-opening');i.toastCapsule.classList.add(PLUGIN_NAME+'-capsule');i.toastBody.classList.add(PLUGIN_NAME+'-body');i.toastTexts.classList.add(PLUGIN_NAME+'-texts');if(ISMOBILE||window.innerWidth<=MOBILEWIDTH){if(h.transitionInMobile)i.toast.classList.add(h.transitionInMobile)}else{if(h.transitionIn)i.toast.classList.add(h.transitionIn)}if(h.class){var c=h.class.split(' ');p(c,function(a,b){i.toast.classList.add(a)})}if(h.id){i.toast.id=h.id}if(h.rtl){i.toast.classList.add(PLUGIN_NAME+'-rtl');i.toast.setAttribute('dir','rtl')}if(h.layout>1){i.toast.classList.add(PLUGIN_NAME+'-layout'+h.layout)}if(h.balloon){i.toast.classList.add(PLUGIN_NAME+'-balloon')}if(h.maxWidth){if(!isNaN(h.maxWidth)){i.toast.style.maxWidth=h.maxWidth+'px'}else{i.toast.style.maxWidth=h.maxWidth}}if(h.theme!==''||h.theme!=='light'){i.toast.classList.add(PLUGIN_NAME+'-theme-'+h.theme)}if(h.color){if(t(h.color)){i.toast.style.background=h.color}else{i.toast.classList.add(PLUGIN_NAME+'-color-'+h.color)}}if(h.backgroundColor){i.toast.style.background=h.backgroundColor;if(h.balloon){i.toast.style.borderColor=h.backgroundColor}}})();(function(){if(h.image){i.cover.classList.add(PLUGIN_NAME+'-cover');i.cover.style.width=h.imageWidth+'px';if(u(h.image.replace(/ /g,''))){i.cover.style.backgroundImage='url(data:image/png;base64,'+h.image.replace(/ /g,'')+')'}else{i.cover.style.backgroundImage='url('+h.image+')'}if(h.rtl){i.toastBody.style.marginRight=(h.imageWidth+10)+'px'}else{i.toastBody.style.marginLeft=(h.imageWidth+10)+'px'}i.toast.appendChild(i.cover)}})();(function(){if(h.close){i.buttonClose=document.createElement('button');i.buttonClose.type='button';i.buttonClose.classList.add(PLUGIN_NAME+'-close');i.buttonClose.addEventListener('click',function(e){var a=e.target;g.hide(h,i.toast,'button')});i.toast.appendChild(i.buttonClose)}else{if(h.rtl){i.toast.style.paddingLeft='18px'}else{i.toast.style.paddingRight='18px'}}})();(function(){if(h.progressBar){i.progressBar=document.createElement('div');i.progressBarDiv=document.createElement('div');i.progressBar.classList.add(PLUGIN_NAME+'-progressbar');i.progressBarDiv.style.background=h.progressBarColor;i.progressBar.appendChild(i.progressBarDiv);i.toast.appendChild(i.progressBar)}if(h.timeout){if(h.pauseOnHover&&!h.resetOnHover){i.toast.addEventListener('mouseenter',function(e){g.progress(h,i.toast).pause()});i.toast.addEventListener('mouseleave',function(e){g.progress(h,i.toast).resume()})}if(h.resetOnHover){i.toast.addEventListener('mouseenter',function(e){g.progress(h,i.toast).reset()});i.toast.addEventListener('mouseleave',function(e){g.progress(h,i.toast).start()})}}})();(function(){if(h.iconUrl){i.icon.setAttribute('class',PLUGIN_NAME+'-icon');i.icon.setAttribute('src',h.iconUrl)}else if(h.icon){i.icon.setAttribute('class',PLUGIN_NAME+'-icon '+h.icon);if(h.iconText){i.icon.appendChild(document.createTextNode(h.iconText))}if(h.iconColor){i.icon.style.color=h.iconColor}}if(h.icon||h.iconUrl){if(h.rtl){i.toastBody.style.paddingRight='33px'}else{i.toastBody.style.paddingLeft='33px'}i.toastBody.appendChild(i.icon)}})();(function(){if(h.title.length>0){i.strong=document.createElement('strong');i.strong.classList.add(PLUGIN_NAME+'-title');i.strong.appendChild(r(h.title));i.toastTexts.appendChild(i.strong);if(h.titleColor){i.strong.style.color=h.titleColor}if(h.titleSize){if(!isNaN(h.titleSize)){i.strong.style.fontSize=h.titleSize+'px'}else{i.strong.style.fontSize=h.titleSize}}if(h.titleLineHeight){if(!isNaN(h.titleSize)){i.strong.style.lineHeight=h.titleLineHeight+'px'}else{i.strong.style.lineHeight=h.titleLineHeight}}}if(h.message.length>0){i.p=document.createElement('p');i.p.classList.add(PLUGIN_NAME+'-message');i.p.appendChild(r(h.message));i.toastTexts.appendChild(i.p);if(h.messageColor){i.p.style.color=h.messageColor}if(h.messageSize){if(!isNaN(h.titleSize)){i.p.style.fontSize=h.messageSize+'px'}else{i.p.style.fontSize=h.messageSize}}if(h.messageLineHeight){if(!isNaN(h.titleSize)){i.p.style.lineHeight=h.messageLineHeight+'px'}else{i.p.style.lineHeight=h.messageLineHeight}}}if(h.title.length>0&&h.message.length>0){if(h.rtl){i.strong.style.marginLeft='10px'}else if(h.layout!==2&&!h.rtl){i.strong.style.marginRight='10px'}}})();i.toastBody.appendChild(i.toastTexts);var j;(function(){if(h.inputs.length>0){i.inputs.classList.add(PLUGIN_NAME+'-inputs');p(h.inputs,function(b,c){i.inputs.appendChild(r(b[0]));j=i.inputs.childNodes;j[c].classList.add(PLUGIN_NAME+'-inputs-child');if(b[3]){setTimeout(function(){j[c].focus()},300)}j[c].addEventListener(b[1],function(e){var a=b[2];return a(g,i.toast,this,e)})});i.toastBody.appendChild(i.inputs)}})();(function(){if(h.buttons.length>0){i.buttons.classList.add(PLUGIN_NAME+'-buttons');p(h.buttons,function(b,c){i.buttons.appendChild(r(b[0]));var d=i.buttons.childNodes;d[c].classList.add(PLUGIN_NAME+'-buttons-child');if(b[2]){setTimeout(function(){d[c].focus()},300)}d[c].addEventListener('click',function(e){e.preventDefault();var a=b[1];return a(g,i.toast,this,e,j)})})}i.toastBody.appendChild(i.buttons)})();if(h.message.length>0&&(h.inputs.length>0||h.buttons.length>0)){i.p.style.marginBottom='0'}if(h.inputs.length>0||h.buttons.length>0){if(h.rtl){i.toastTexts.style.marginLeft='10px'}else{i.toastTexts.style.marginRight='10px'}if(h.inputs.length>0&&h.buttons.length>0){if(h.rtl){i.inputs.style.marginLeft='8px'}else{i.inputs.style.marginRight='8px'}}}(function(){i.toastCapsule.style.visibility='hidden';setTimeout(function(){var H=i.toast.offsetHeight;var a=i.toast.currentStyle||window.getComputedStyle(i.toast);var b=a.marginTop;b=b.split('px');b=parseInt(b[0]);var c=a.marginBottom;c=c.split('px');c=parseInt(c[0]);i.toastCapsule.style.visibility='';i.toastCapsule.style.height=(H+c+b)+'px';setTimeout(function(){i.toastCapsule.style.height='auto';if(h.target){i.toastCapsule.style.overflow='visible'}},500);if(h.timeout){g.progress(h,i.toast).start()}},100)})();(function(){var a=h.position;if(h.target){i.wrapper=document.querySelector(h.target);i.wrapper.classList.add(PLUGIN_NAME+'-target');if(h.targetFirst){i.wrapper.insertBefore(i.toastCapsule,i.wrapper.firstChild)}else{i.wrapper.appendChild(i.toastCapsule)}}else{if(POSITIONS.indexOf(h.position)==-1){console.warn('['+PLUGIN_NAME+'] Incorrect position.\nIt can be › '+POSITIONS);return}if(ISMOBILE||window.innerWidth<=MOBILEWIDTH){if(h.position=='bottomLeft'||h.position=='bottomRight'||h.position=='bottomCenter'){a=PLUGIN_NAME+'-wrapper-bottomCenter'}else if(h.position=='topLeft'||h.position=='topRight'||h.position=='topCenter'){a=PLUGIN_NAME+'-wrapper-topCenter'}else{a=PLUGIN_NAME+'-wrapper-center'}}else{a=PLUGIN_NAME+'-wrapper-'+a}i.wrapper=document.querySelector('.'+PLUGIN_NAME+'-wrapper.'+a);if(!i.wrapper){i.wrapper=document.createElement('div');i.wrapper.classList.add(PLUGIN_NAME+'-wrapper');i.wrapper.classList.add(a);document.body.appendChild(i.wrapper)}if(h.position=='topLeft'||h.position=='topCenter'||h.position=='topRight'){i.wrapper.insertBefore(i.toastCapsule,i.wrapper.firstChild)}else{i.wrapper.appendChild(i.toastCapsule)}}if(!isNaN(h.zindex)){i.wrapper.style.zIndex=h.zindex}else{console.warn('['+PLUGIN_NAME+'] Invalid zIndex.')}})();(function(){if(h.overlay){if(document.querySelector('.'+PLUGIN_NAME+'-overlay.fadeIn')!==null){i.overlay=document.querySelector('.'+PLUGIN_NAME+'-overlay');i.overlay.setAttribute('data-iziToast-ref',i.overlay.getAttribute('data-iziToast-ref')+','+h.ref);if(!isNaN(h.zindex)&&h.zindex!==null){i.overlay.style.zIndex=h.zindex-1}}else{i.overlay.classList.add(PLUGIN_NAME+'-overlay');i.overlay.classList.add('fadeIn');i.overlay.style.background=h.overlayColor;i.overlay.setAttribute('data-iziToast-ref',h.ref);if(!isNaN(h.zindex)&&h.zindex!==null){i.overlay.style.zIndex=h.zindex-1}document.querySelector('body').appendChild(i.overlay)}if(h.overlayClose){i.overlay.removeEventListener('click',{});i.overlay.addEventListener('click',function(e){g.hide(h,i.toast,'overlay')})}else{i.overlay.removeEventListener('click',{})}}})();(function(){if(h.animateInside){i.toast.classList.add(PLUGIN_NAME+'-animateInside');var c=[200,100,300];if(h.transitionIn=='bounceInLeft'||h.transitionIn=='bounceInRight'){c=[400,200,400]}if(h.title.length>0){setTimeout(function(){i.strong.classList.add('slideIn')},c[0])}if(h.message.length>0){setTimeout(function(){i.p.classList.add('slideIn')},c[1])}if(h.icon||h.iconUrl){setTimeout(function(){i.icon.classList.add('revealIn')},c[2])}var d=150;if(h.buttons.length>0&&i.buttons){setTimeout(function(){p(i.buttons.childNodes,function(a,b){setTimeout(function(){a.classList.add('revealIn')},d);d=d+150})},h.inputs.length>0?150:0)}if(h.inputs.length>0&&i.inputs){d=150;p(i.inputs.childNodes,function(a,b){setTimeout(function(){a.classList.add('revealIn')},d);d=d+150})}}})();h.onOpening.apply(null,[h,i.toast]);try{var k=new CustomEvent(PLUGIN_NAME+'-opening',{detail:h,bubbles:true,cancelable:true});document.dispatchEvent(k)}catch(ex){console.warn(ex)}setTimeout(function(){i.toast.classList.remove(PLUGIN_NAME+'-opening');i.toast.classList.add(PLUGIN_NAME+'-opened');try{var a=new CustomEvent(PLUGIN_NAME+'-opened',{detail:h,bubbles:true,cancelable:true});document.dispatchEvent(a)}catch(ex){console.warn(ex)}h.onOpened.apply(null,[h,i.toast])},1000);if(h.drag){if(ACCEPTSTOUCH){i.toast.addEventListener('touchstart',function(e){v.startMoving(this,g,h,e)},false);i.toast.addEventListener('touchend',function(e){v.stopMoving(this,e)},false)}else{i.toast.addEventListener('mousedown',function(e){e.preventDefault();v.startMoving(this,g,h,e)},false);i.toast.addEventListener('mouseup',function(e){e.preventDefault();v.stopMoving(this,e)},false)}}if(h.closeOnEscape){document.addEventListener('keyup',function(a){a=a||window.event;if(a.keyCode==27){g.hide(h,i.toast,'esc')}})}if(h.closeOnClick){i.toast.addEventListener('click',function(a){g.hide(h,i.toast,'toast')})}g.toast=i.toast};layui.link(layui.cache.base+'notice/notice.css');window.notice=m;l('notice',m)});