www.gusucode.com > CPF开源的PHP SNS问答社区 v0.7源码程序 > code/admin/static/libs/pop/pop.min.js

    !function(t){function e(n){if(o[n])return o[n].exports;var i=o[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var o={};e.m=t,e.c=o,e.d=function(t,o,n){e.o(t,o)||Object.defineProperty(t,o,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,o){o(1),o(2),o(4)},function(t,e){},function(t,e,o){(function(t){!function(t,e){t.iziToast=function(t){"use strict";var e={},o=(document.querySelector("body"),!!/Mobi/.test(navigator.userAgent)),n=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor),i="undefined"!=typeof InstallTrigger,s="ontouchstart"in document.documentElement,a=["bottomRight","bottomLeft","bottomCenter","topRight","topLeft","topCenter","center"],r={info:{color:"blue",icon:"ico-info"},success:{color:"green",icon:"ico-check"},warning:{color:"yellow",icon:"ico-warning"},error:{color:"red",icon:"ico-error"}},l={},c={id:null,class:"",title:"",titleColor:"",titleSize:"",titleLineHeight:"",message:"",messageColor:"",messageSize:"",messageLineHeight:"",backgroundColor:"",theme:"light",color:"",icon:"",iconText:"",iconColor:"",image:"",imageWidth:50,maxWidth:null,zindex:null,layout:1,balloon:!1,close:!0,rtl:!1,position:"bottomRight",target:"",targetFirst:!0,toastOnce:!1,timeout:5e3,drag:!0,pauseOnHover:!0,resetOnHover:!1,progressBar:!1,progressBarColor:"",animateInside:!0,buttons:{},transitionIn:"fadeInUp",transitionOut:"fadeOut",transitionInMobile:"fadeInUp",transitionOutMobile:"fadeOutDown",onOpening:function(){},onOpened:function(){},onClosing:function(){},onClosed:function(){}};if("remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)}),"function"!=typeof window.CustomEvent){var d=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var o=document.createEvent("CustomEvent");return o.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),o};d.prototype=window.Event.prototype,window.CustomEvent=d}var u=function(t,e,o){if("[object Object]"===Object.prototype.toString.call(t))for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.call(o,t[n],n,t);else if(t)for(var i=0,s=t.length;i<s;i++)e.call(o,t[i],i,t)},p=function(t,e){var o={};return u(t,function(e,n){o[n]=t[n]}),u(e,function(t,n){o[n]=e[n]}),o},g=function(t){var e=document.createDocumentFragment(),o=document.createElement("div");for(o.innerHTML=t;o.firstChild;)e.appendChild(o.firstChild);return e},m=function(t){return"#"==t.substring(0,1)||"rgb"==t.substring(0,3)||"hsl"==t.substring(0,3)},f=function(){return{move:function(t,e,o,s){var a;t.style.transform="translateX("+s+"px)",s>0?(a=(180-s)/180)<.3&&e.hide(p(o,{transitionOut:"fadeOutRight",transitionOutMobile:"fadeOutRight"}),t,"drag"):(a=(180+s)/180)<.3&&e.hide(p(o,{transitionOut:"fadeOutLeft",transitionOutMobile:"fadeOutLeft"}),t,"drag"),t.style.opacity=a,a<.3&&((n||i)&&(t.style.left=s+"px"),t.parentNode.style.opacity=.3,this.stopMoving(t,null))},startMoving:function(t,e,o,n){n=n||window.event;var i=s?n.touches[0].clientX:n.clientX,a=t.style.transform.replace("px)","");a=a.replace("translateX(","");var r=i-a;t.classList.remove(o.transitionIn),t.classList.remove(o.transitionInMobile),t.style.transition="",s?document.ontouchmove=function(n){n.preventDefault(),n=n||window.event;var i=n.touches[0].clientX,s=i-r;f.move(t,e,o,s)}:document.onmousemove=function(n){n.preventDefault(),n=n||window.event;var i=n.clientX,s=i-r;f.move(t,e,o,s)}},stopMoving:function(t,e){s?document.ontouchmove=function(){}:document.onmousemove=function(){},t.style.transition="transform 0.4s ease, opacity 0.4s ease",t.style.opacity="",t.style.transform="",window.setTimeout(function(){t.style.transition=""},400)}}}(),h=function(t,e,o){var n=t.querySelector(".iziToast-progressbar div"),i=null,s={Paused:!1,Reseted:!1,Closed:!1},a={hideEta:null,maxHideTime:null,currentTime:(new Date).getTime(),updateProgress:function(){if(s.Paused=!!t.classList.contains("iziToast-paused"),s.Reseted=!!t.classList.contains("iziToast-reseted"),s.Closed=!!t.classList.contains("iziToast-closed"),s.Reseted&&(clearInterval(i),n.style.width="100%",h(t,e,o),t.classList.remove("iziToast-reseted")),s.Closed&&(clearInterval(i),t.classList.remove("iziToast-closed")),!s.Paused&&!s.Reseted&&!s.Closed){a.currentTime=a.currentTime+10;var r=(a.hideEta-a.currentTime)/a.maxHideTime*100;n.style.width=r+"%",(Math.round(r)<0||"object"!=typeof t)&&(clearInterval(i),o.apply())}}};e.timeout&&(a.maxHideTime=parseFloat(e.timeout),a.hideEta=(new Date).getTime()+a.maxHideTime,i=setInterval(a.updateProgress,10))};return e.destroy=function(){u(document.querySelectorAll(".iziToast-wrapper"),function(t,e){t.remove()}),u(document.querySelectorAll(".iziToast"),function(t,e){t.remove()}),document.removeEventListener("iziToast-opened",{},!1),document.removeEventListener("iziToast-opening",{},!1),document.removeEventListener("iziToast-closing",{},!1),document.removeEventListener("iziToast-closed",{},!1),l={}},e.settings=function(t){e.destroy(),l=t,c=p(c,t||{})},u(r,function(t,o){e[o]=function(e){var o=p(l,e||{});o=p(t,o||{}),this.show(o)}}),e.hide=function(t,e,n){var i=p(c,t||{});n=n||!1,"object"!=typeof e&&(e=document.querySelector(e)),e.classList.add("iziToast-closed"),(i.transitionIn||i.transitionInMobile)&&(e.classList.remove(i.transitionIn),e.classList.remove(i.transitionInMobile)),o||window.innerWidth<=568?i.transitionOutMobile&&e.classList.add(i.transitionOutMobile):i.transitionOut&&e.classList.add(i.transitionOut);var s=e.parentNode.offsetHeight;e.parentNode.style.height=s+"px",e.style.pointerEvents="none",(!o||window.innerWidth>568)&&(e.parentNode.style.transitionDelay="0.2s");try{i.closedBy=n;var a=new CustomEvent("iziToast-closing",{detail:i,bubbles:!0,cancelable:!0});document.dispatchEvent(a)}catch(t){console.warn(t)}setTimeout(function(){e.parentNode.style.height="0px",e.parentNode.style.overflow="",window.setTimeout(function(){e.parentNode.remove();try{i.closedBy=n;var t=new CustomEvent("iziToast-closed",{detail:i,bubbles:!0,cancelable:!0});document.dispatchEvent(t)}catch(t){console.warn(t)}void 0!==i.onClosed&&i.onClosed.apply(null,[i,e,n])},1e3)},200),void 0!==i.onClosing&&i.onClosing.apply(null,[i,e,n])},e.show=function(t){var e=this,n=p(l,t||{});if(n=p(c,n),n.toastOnce&&n.id&&document.querySelectorAll(".iziToast#"+n.id).length>0)return!1;var i={toast:document.createElement("div"),toastBody:document.createElement("div"),toastCapsule:document.createElement("div"),icon:document.createElement("i"),cover:document.createElement("div"),buttons:document.createElement("div"),wrapper:null};i.toast.appendChild(i.toastBody),i.toastCapsule.appendChild(i.toast),function(){if(i.toast.classList.add("iziToast"),i.toastCapsule.classList.add("iziToast-capsule"),i.toastBody.classList.add("iziToast-body"),o||window.innerWidth<=568?n.transitionInMobile&&i.toast.classList.add(n.transitionInMobile):n.transitionIn&&i.toast.classList.add(n.transitionIn),n.class){var t=n.class.split(" ");u(t,function(t,e){i.toast.classList.add(t)})}n.id&&(i.toast.id=n.id),n.rtl&&i.toast.classList.add("iziToast-rtl"),n.layout>1&&i.toast.classList.add("iziToast-layout"+n.layout),n.balloon&&i.toast.classList.add("iziToast-balloon"),n.maxWidth&&(isNaN(n.maxWidth)?i.toast.style.maxWidth=n.maxWidth:i.toast.style.maxWidth=n.maxWidth+"px"),""===n.theme&&"light"===n.theme||i.toast.classList.add("iziToast-theme-"+n.theme),n.color&&(m(n.color)?i.toast.style.background=n.color:i.toast.classList.add("iziToast-color-"+n.color)),n.backgroundColor&&(i.toast.style.background=n.backgroundColor,n.balloon&&(i.toast.style.borderColor=n.backgroundColor))}(),function(){n.image&&(i.cover.classList.add("iziToast-cover"),i.cover.style.width=n.imageWidth+"px",i.cover.style.backgroundImage="url("+n.image+")",n.rtl?i.toastBody.style.marginRight=n.imageWidth+10+"px":i.toastBody.style.marginLeft=n.imageWidth+10+"px",i.toast.appendChild(i.cover))}(),function(){n.close?(i.buttonClose=document.createElement("button"),i.buttonClose.classList.add("iziToast-close"),i.buttonClose.addEventListener("click",function(t){t.target;e.hide(n,i.toast,"button")}),i.toast.appendChild(i.buttonClose)):n.rtl?i.toast.style.paddingLeft="30px":i.toast.style.paddingRight="30px"}(),function(){n.progressBar&&n.timeout?(i.progressBar=document.createElement("div"),i.progressBarDiv=document.createElement("div"),i.progressBar.classList.add("iziToast-progressbar"),i.progressBarDiv.style.background=n.progressBarColor,i.progressBar.appendChild(i.progressBarDiv),i.toast.appendChild(i.progressBar),setTimeout(function(){h(i.toast,n,function(){e.hide(n,i.toast)})},300)):!1===n.progressBar&&n.timeout&&setTimeout(function(){e.hide(n,i.toast)},n.timeout)}(),function(){n.icon&&(i.icon.setAttribute("class","iziToast-icon "+n.icon),n.iconText&&i.icon.appendChild(document.createTextNode(n.iconText)),n.rtl?i.toastBody.style.paddingRight="33px":i.toastBody.style.paddingLeft="33px",n.iconColor&&(i.icon.style.color=n.iconColor),i.toastBody.appendChild(i.icon))}(),function(){n.title.length>0&&(i.strong=document.createElement("strong"),i.strong.appendChild(g(n.title)),i.toastBody.appendChild(i.strong),n.titleColor&&(i.strong.style.color=n.titleColor),n.titleSize&&(isNaN(n.titleSize)?i.strong.style.fontSize=n.titleSize:i.strong.style.fontSize=n.titleSize+"px"),n.titleLineHeight&&(isNaN(n.titleSize)?i.strong.style.lineHeight=n.titleLineHeight:i.strong.style.lineHeight=n.titleLineHeight+"px"))}(),function(){n.message.length>0&&(i.p=document.createElement("p"),i.p.appendChild(g(n.message)),i.toastBody.appendChild(i.p),n.messageColor&&(i.p.style.color=n.messageColor),n.messageSize&&(isNaN(n.titleSize)?i.p.style.fontSize=n.messageSize:i.p.style.fontSize=n.messageSize+"px"),n.messageLineHeight&&(isNaN(n.titleSize)?i.p.style.lineHeight=n.messageLineHeight:i.p.style.lineHeight=n.messageLineHeight+"px"))}(),n.title.length>0&&n.message.length>0&&(i.strong.style.paddingRight="10px"),function(){if(n.buttons.length>0){i.buttons.classList.add("iziToast-buttons"),n.message.length>0&&(n.rtl?i.p.style.marginLeft="15px":i.p.style.marginRight="15px");var t=0;u(n.buttons,function(o,n){i.buttons.appendChild(g(o[0])),i.buttons.childNodes[t].addEventListener("click",function(t){return t.preventDefault(),new(0,o[1])(e,i.toast,o[2])}),t++}),i.toastBody.appendChild(i.buttons)}}(),function(){i.toastCapsule.style.visibility="hidden",setTimeout(function(){var t=i.toast.offsetHeight,e=i.toast.currentStyle||window.getComputedStyle(i.toast),o=e.marginTop;o=o.split("px"),o=parseInt(o[0]);var s=e.marginBottom;s=s.split("px"),s=parseInt(s[0]),i.toastCapsule.style.visibility="",i.toastCapsule.style.height=t+s+o+"px",setTimeout(function(){i.toastCapsule.style.height="auto",n.target&&(i.toastCapsule.style.overflow="visible")},1e3)},100)}(),function(){var t=n.position;if(n.target)i.wrapper=document.querySelector(n.target),i.wrapper.classList.add("iziToast-target"),n.targetFirst?i.wrapper.insertBefore(i.toastCapsule,i.wrapper.firstChild):i.wrapper.appendChild(i.toastCapsule);else{if(-1==a.indexOf(n.position))return void console.warn("[iziToast] Incorrect position.\nIt can be › "+a);t=o||window.innerWidth<=568?"bottomLeft"==n.position||"bottomRight"==n.position||"bottomCenter"==n.position?"iziToast-wrapper-bottomCenter":"topLeft"==n.position||"topRight"==n.position||"topCenter"==n.position?"iziToast-wrapper-topCenter":"iziToast-wrapper-center":"iziToast-wrapper-"+t,i.wrapper=document.querySelector(".iziToast-wrapper."+t),i.wrapper||(i.wrapper=document.createElement("div"),i.wrapper.classList.add("iziToast-wrapper"),i.wrapper.classList.add(t),document.body.appendChild(i.wrapper)),"topLeft"==n.position||"topCenter"==n.position||"topRight"==n.position?i.wrapper.insertBefore(i.toastCapsule,i.wrapper.firstChild):i.wrapper.appendChild(i.toastCapsule)}isNaN(n.zindex)?console.warn("[iziToast] Invalid zIndex."):i.wrapper.style.zIndex=n.zindex}(),function(){if(n.animateInside){i.toast.classList.add("iziToast-animateInside");var t=[200,100,300];if("bounceInLeft"==n.transitionIn&&(t=[400,200,400]),n.title.length>0&&window.setTimeout(function(){i.strong.classList.add("slideIn")},t[0]),n.message.length>0&&window.setTimeout(function(){i.p.classList.add("slideIn")},t[1]),n.icon&&window.setTimeout(function(){i.icon.classList.add("revealIn")},t[2]),n.buttons.length>0&&i.buttons){var e=150;u(i.buttons.childNodes,function(t,o){window.setTimeout(function(){t.classList.add("revealIn")},e),e+=e})}}}(),n.onOpening.apply(null,[n,i.toast]);try{var r=new CustomEvent("iziToast-opening",{detail:n,bubbles:!0,cancelable:!0});document.dispatchEvent(r)}catch(t){console.warn(t)}setTimeout(function(){try{var t=new CustomEvent("iziToast-opened",{detail:n,bubbles:!0,cancelable:!0});document.dispatchEvent(t)}catch(t){console.warn(t)}n.onOpened.apply(null,[n,i.toast])},1e3),n.pauseOnHover&&(i.toast.addEventListener("mouseenter",function(t){this.classList.add("iziToast-paused")}),i.toast.addEventListener("mouseleave",function(t){this.classList.remove("iziToast-paused")})),n.resetOnHover&&(i.toast.addEventListener("mouseenter",function(t){this.classList.add("iziToast-reseted")}),i.toast.addEventListener("mouseleave",function(t){this.classList.remove("iziToast-reseted")})),n.drag&&(s?(i.toast.addEventListener("touchstart",function(t){f.startMoving(this,e,n,t)},!1),i.toast.addEventListener("touchend",function(t){f.stopMoving(this,t)},!1)):(i.toast.addEventListener("mousedown",function(t){t.preventDefault(),f.startMoving(this,e,n,t)},!1),i.toast.addEventListener("mouseup",function(t){t.preventDefault(),f.stopMoving(this,t)},!1)))},e}(t)}(void 0!==t?t:window||this.window||this.global)}).call(e,o(3))},function(t,e){var o;o=function(){return this}();try{o=o||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(o=window)}t.exports=o},function(t,e){!function(t,e){t.pop=function(t){function e(t){var e=document.createElement("div"),o={index:8888,id:"globalMarkedDOM"};if(void 0!==t)for(var n in o)t[n]&&(o[n]=t[n]);var i=document.getElementById(o.id);i?this.gDOM=i:(e.id=o.id,e.className="-globalPopMarked-",document.body.appendChild(e),this.gDOM=e)}var o={id:null,class:"",title:"",titleColor:"",titleSize:"",titleLineHeight:"",message:"",messageColor:"",messageSize:"",messageLineHeight:"",backgroundColor:"",theme:"light",color:"",icon:"",iconText:"",iconColor:"",image:"",imageWidth:50,maxWidth:null,zindex:null,layout:1,balloon:!1,close:!0,rtl:!1,position:"bottomRight",target:"",targetFirst:!0,toastOnce:!1,timeout:3500,drag:!0,pauseOnHover:!0,resetOnHover:!1,progressBar:!1,progressBarColor:"",animateInside:!0,buttons:{},transitionIn:"fadeInUp",transitionOut:"fadeOut",transitionInMobile:"fadeInUp",transitionOutMobile:"fadeOutDown",onOpening:function(){},onOpened:function(){},onClosing:function(){},onClosed:function(){}};e.prototype.show=function(){this.gDOM.style.display="block"},e.prototype.close=function(){this.gDOM.style.display="none"};var n=function(t,e,o){if("[object Object]"===Object.prototype.toString.call(t))for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.call(o,t[n],n,t);else if(t)for(var i=0,s=t.length;i<s;i++)e.call(o,t[i],i,t)},i=function(t,e){var o={};return n(t,function(e,n){o[n]=t[n]}),n(e,function(t,n){o[n]=e[n]}),o},s=function(t,e){var n=i(o,e);return t?i(n,t):n};return{success:function(t,e){e=s(e,{theme:"dark",icon:"pop-success",backgroundColor:"#00a65a",messageColor:"#fff",position:"topRight"});try{e.message=t,iziToast.success(e)}catch(t){console.log(t)}},error:function(t,e){e=s(e,{theme:"dark",icon:"pop-error",backgroundColor:"#f56954",messageColor:"#fff",position:"topRight"});try{e.message=t,iziToast.error(e)}catch(t){console.log(t)}},warning:function(t,e){e=s(e,{theme:"dark",icon:"pop-warning",backgroundColor:"#c55b33",messageColor:"#fff",position:"topRight"});try{e.message=t,iziToast.warning(e)}catch(t){console.log(t)}},info:function(t,e){e=s(e,{theme:"dark",icon:"pop-info",messageColor:"#fff",position:"topRight"});try{e.message=t,iziToast.info(e)}catch(t){console.log(t)}},alert:function(t,e){e=s(e,{theme:"dark",icon:"pop-alert",backgroundColor:"#f39c12",position:"topCenter",pauseOnHover:!0,progressBar:!1,close:!0});try{e.message=t||"提示",iziToast.show(e)}catch(t){console.log(t)}},confirm:function(t,o){var n=new e,i=s(o.config,{icon:"pop-confirm",backgroundColor:"#705656",messageColor:"#fff",theme:"dark",position:"topCenter",close:!1,drag:!1,layout:1,timeout:0});if(i.message=t||"确认执行该操作吗?",i.buttons=[],void 0!==o&&void 0!==o.btn){for(var a in o.btn)if(o.btn.hasOwnProperty(a)){var r="<button>"+o.btn[a]+"</button>",l=function(t,e,i){var s=function(){n.close()};o.actions.hasOwnProperty(i)&&(s=o.actions[i]),t.hide({transitionOut:"fadeOutUp",onClosing:s(t,e)},e),n.close()};i.buttons.push([r,l,a])}}else i.buttons=[["<button>确认</button>",function(t,e){t.hide({transitionOut:"fadeOutUp"},e),n.close()}]];i.onOpening=function(){n.show()},i.onClick=function(){n.close()},i.onClosed=function(){n.close()};try{iziToast.warning(i)}catch(t){n.close(),console.log(t)}}}}(t)}(window)}]);