filesbox/web/dist/design/designstatic/home/js/layer/layer.js

2 lines
22 KiB
JavaScript
Raw Permalink Normal View History

2024-07-26 06:10:54 +00:00
/*! layer-v3.1.1 Web弹层组件 MIT License http://layer.layui.com/ By 贤心 */(function(v,F){"use strict";var c,p,L=v.layui&&layui.define,u={getPath:function(){var t=document.currentScript?document.currentScript.src:function(){for(var e,n=document.scripts,a=n.length-1,i=a;i>0;i--)if(n[i].readyState==="interactive"){e=n[i].src;break}return e||n[a].src}();return t.substring(0,t.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,e){var n=t.currentStyle?t.currentStyle:v.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](e)},link:function(t,e,n){if(o.path){var a=document.getElementsByTagName("head")[0],i=document.createElement("link");typeof e=="string"&&(n=e);var r=(n||t).replace(/\.|\//g,""),s="layuicss-"+r,l=0;i.rel="stylesheet",i.href=o.path+t,i.id=s,document.getElementById(s)||a.appendChild(i),typeof e=="function"&&function d(){return++l>80?v.console&&console.error("layer.css: Invalid"):void(parseInt(u.getStyle(document.getElementById(s),"width"))===1989?e():setTimeout(d,100))}()}}},o={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(v.ActiveXObject||"ActiveXObject"in v)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:v.layer&&v.layer.v?1e5:0,path:u.getPath,config:function(t,e){return t=t||{},o.cache=u.config=c.extend({},u.config,t),o.path=u.config.path||o.path,typeof t.extend=="string"&&(t.extend=[t.extend]),u.config.path&&o.ready(),t.extend?(L?layui.addcss("modules/layer/"+t.extend):u.link("theme/"+t.extend),this):this},ready:function(t){var e="layer",n="",a=(L?"modules/layer/":"theme/")+"default/layer.css?v="+o.v+n;return L?layui.addcss(a,t,e):u.link(a,t,e),this},alert:function(t,e,n){var a=typeof e=="function";return a&&(n=e),o.open(c.extend({content:t,yes:n},a?{}:e))},confirm:function(t,e,n,a){var i=typeof e=="function";return i&&(a=n,n=e),o.open(c.extend({content:t,btn:u.btn,yes:n,btn2:a},i?{}:e))},msg:function(t,e,n){var a=typeof e=="function",i=u.config.skin,r=(i?i+" "+i+"-msg":"")||"layui-layer-msg",s=f.anim.length-1;return a&&(n=e),o.open(c.extend({content:t,time:3e3,shade:!1,skin:r,title:!1,closeBtn:!1,btn:!1,resize:!1,end:n},a&&!u.config.skin?{skin:r+" layui-layer-hui",anim:s}:function(){return e=e||{},(e.icon===-1||e.icon===F&&!u.config.skin)&&(e.skin=r+" "+(e.skin||"layui-layer-hui")),e}()))},load:function(t,e){return o.open(c.extend({type:3,icon:t||0,resize:!1,shade:.01},e))},tips:function(t,e,n){return o.open(c.extend({type:4,content:[t,e],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},x=function(t){var e=this;e.index=++o.index,e.config=c.extend({},e.config,u.config,t),document.body?e.creat():setTimeout(function(){e.creat()},30)};x.pt=x.prototype;var f=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];f.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],x.pt.config={type:0,shade:.3,fixed:!0,move:f[1],title:"&#x4FE1;&#x606F;",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},x.pt.vessel=function(t,e){var n=this,a=n.index,i=n.config,r=i.zIndex+a,s=typeof i.title=="object",l=i.maxmin&&(i.type===1||i.type===2),d=i.title?'<div class="layui-layer-title" style="'+(s?i.title[1]:"")+'">'+(s?i.title[0]:i.title)+"</div>":"";return i.zIndex=r,e([i.shade?'<div class="layui-layer-shade" id="layui-layer-shade'+a+'" times="'+a+'" style="'+("z-index:"+(r-1)+"; ")+'"></div>':"",'<div class="'+f[0]+(" layui-layer-"+u.type[i.type])+(i.type!=0&&i.type!=2||i.shade?"":" layui-layer-border")+" "+(i.skin||"")+'" id="'+f[0]+a+'" type="'+u.type[i.type]+'" times="'+a+'" showtime="'+i.time+'" conType="'+(t?"object":"string")+'" style="z-index: '+r+"; width:"+i.area[0]+";height:"+i.area[1]+(i.fixed?"":";position:absolute;")+'">'+(t&&i.type!=2?"":d)+'<div id=