cbsy/blxc-admin/target/classes/static/ajax/libs/layer/layer.min.js

2 lines
36 KiB
JavaScript
Raw Normal View History

2024-06-02 22:37:16 +08:00
/*! layer-v3.7.0 Web 通用弹出层组件 MIT License */
!function(window,undefined){var isLayui=window.layui&&layui.define;var $;var win;var ready={getPath:function(){var jsPath=document.currentScript?document.currentScript.src:function(){var js=document.scripts;var last=js.length-1;var src;for(var i=last;i>0;i--){if(js[i].readyState==="interactive"){src=js[i].src;break}}return src||js[last].src}();var GLOBAL=window.LAYUI_GLOBAL||{};return GLOBAL.layer_dir||jsPath.substring(0,jsPath.lastIndexOf("/")+1)}(),config:{removeFocus:true},end:{},events:{resize:{}},minStackIndex:0,minStackArr:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(node,name){var style=node.currentStyle?node.currentStyle:window.getComputedStyle(node,null);return style[style.getPropertyValue?"getPropertyValue":"getAttribute"](name)},link:function(href,fn,cssname){if(!layer.path){return}var head=document.getElementsByTagName("head")[0];var link=document.createElement("link");if(typeof fn==="string"){cssname=fn}var app=(cssname||href).replace(/\.|\//g,"");var id="layuicss-"+app;var STATUS_NAME="creating";var timeout=0;link.rel="stylesheet";link.href=layer.path+href;link.id=id;if(!document.getElementById(id)){head.appendChild(link)}if(typeof fn!=="function"){return}(function poll(status){var delay=100;var getLinkElem=document.getElementById(id);if(++timeout>10*1000/delay){return window.console&&console.error(app+".css: Invalid")}if(parseInt(ready.getStyle(getLinkElem,"width"))===1989){if(status===STATUS_NAME){getLinkElem.removeAttribute("lay-status")}getLinkElem.getAttribute("lay-status")===STATUS_NAME?setTimeout(poll,delay):fn()}else{getLinkElem.setAttribute("lay-status",STATUS_NAME);setTimeout(function(){poll(STATUS_NAME)},delay)}}())}};var layer={v:"3.7.0",ie:function(){var agent=navigator.userAgent.toLowerCase();return(!!window.ActiveXObject||"ActiveXObject" in window)?((agent.match(/msie\s(\d+)/)||[])[1]||"11"):false}(),index:(window.layer&&window.layer.v)?100000:0,path:ready.getPath,config:function(options,fn){options=options||{};layer.cache=ready.config=$.extend({},ready.config,options);layer.path=ready.config.path||layer.path;typeof options.extend==="string"&&(options.extend=[options.extend]);if(ready.config.path){layer.ready()}if(!options.extend){return this}ready.link("theme/"+options.extend);return this},ready:function(callback){var cssname="layer";var ver="";var path=(isLayui?"modules/":"css/")+"layer.css?v="+layer.v+ver;isLayui?(layui["layui.all"]?(typeof callback==="function"&&callback()):layui.addcss(path,callback,cssname)):ready.link(path,callback,cssname);return this},alert:function(content,options,yes){var type=typeof options==="function";if(type){yes=options}return layer.open($.extend({content:content,yes:yes},type?{}:options))},confirm:function(content,options,yes,cancel){var type=typeof options==="function";if(type){cancel=yes;yes=options}return layer.open($.extend({content:content,btn:ready.btn,yes:yes,btn2:cancel},type?{}:options))},msg:function(content,options,end){var type=typeof options==="function",rskin=ready.config.skin;var skin=(rskin?rskin+" "+rskin+"-msg":"")||"layui-layer-msg";var anim=doms.anim.length-1;if(type){end=options}return layer.open($.extend({content:content,time:3000,shade:false,skin:skin,title:false,closeBtn:false,btn:false,resize:false,end:end,removeFocus:false},(type&&!ready.config.skin)?{skin:skin+" layui-layer-hui",anim:anim}:function(){options=options||{};if(options.icon===-1||options.icon===undefined&&!ready.config.skin){options.skin=skin+" "+(options.skin||"layui-layer-hui")}return options}()))},load:function(icon,options){return layer.open($.extend({type:3,icon:icon||0,resize:false,shade:0.01,removeFocus:false},options))},tips:function(content,follow,options){return layer.open($.extend({type:4,content:[content,follow],closeBtn:false,time:3000,shade:false,resize:false,fixed:false,maxWidth:260,removeFocus:false},options))}};var Class=function(setings){var that=this,creat=function(){that.creat()};that.index=++layer.index;that.config.maxWidth=$(win).width()-15*2;that.config=$.extend({},that.config,re