框架重构

清除多余的业务
This commit is contained in:
橙子
2022-04-03 23:21:53 +08:00
parent f5fb2ea17b
commit f0d32af3c3
936 changed files with 213647 additions and 86 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
/*! layer mobile-v2.0.0 Web弹层组件 MIT License http://layer.layui.com/mobile By 贤心 */
;!function(e){"use strict";var t=document,n="querySelectorAll",i="getElementsByClassName",a=function(e){return t[n](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var n in e)t[n]=e[n];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var r=0,o=["layui-m-layer"],c=function(e){var t=this;t.config=l.extend(e),t.view()};c.prototype.view=function(){var e=this,n=e.config,s=t.createElement("div");e.id=s.id=o[0]+r,s.setAttribute("class",o[0]+" "+o[0]+(n.type||0)),s.setAttribute("index",r);var l=function(){var e="object"==typeof n.title;return n.title?'<h3 style="'+(e?n.title[1]:"")+'">'+(e?n.title[0]:n.title)+"</h3>":""}(),c=function(){"string"==typeof n.btn&&(n.btn=[n.btn]);var e,t=(n.btn||[]).length;return 0!==t&&n.btn?(e='<span yes type="1">'+n.btn[0]+"</span>",2===t&&(e='<span no type="0">'+n.btn[1]+"</span>"+e),'<div class="layui-m-layerbtn">'+e+"</div>"):""}();if(n.fixed||(n.top=n.hasOwnProperty("top")?n.top:100,n.style=n.style||"",n.style+=" top:"+(t.body.scrollTop+n.top)+"px"),2===n.type&&(n.content='<i></i><i class="layui-m-layerload"></i><i></i><p>'+(n.content||"")+"</p>"),n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),s.innerHTML=(n.shade?"<div "+("string"==typeof n.shade?'style="'+n.shade+'"':"")+' class="layui-m-layershade"></div>':"")+'<div class="layui-m-layermain" '+(n.fixed?"":'style="position:static;"')+'><div class="layui-m-layersection"><div class="layui-m-layerchild '+(n.skin?"layui-m-layer-"+n.skin+" ":"")+(n.className?n.className:"")+" "+(n.anim?"layui-m-anim-"+n.anim:"")+'" '+(n.style?'style="'+n.style+'"':"")+">"+l+'<div class="layui-m-layercont">'+n.content+"</div>"+c+"</div></div></div>",!n.type||2===n.type){var d=t[i](o[0]+n.type),y=d.length;y>=1&&layer.close(d[0].getAttribute("index"))}document.body.appendChild(s);var u=e.elem=a("#"+e.id)[0];n.success&&n.success(u),e.index=r++,e.action(n,u)},c.prototype.action=function(e,t){var n=this;e.time&&(l.timer[n.index]=setTimeout(function(){layer.close(n.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),layer.close(n.index)):e.yes?e.yes(n.index):layer.close(n.index)};if(e.btn)for(var s=t[i]("layui-m-layerbtn")[0].children,r=s.length,o=0;o<r;o++)l.touch(s[o],a);if(e.shade&&e.shadeClose){var c=t[i]("layui-m-layershade")[0];l.touch(c,function(){layer.close(n.index,e.end)})}e.end&&(l.end[n.index]=e.end)},e.layer={v:"2.0",index:r,open:function(e){var t=new c(e||{});return t.index},close:function(e){var n=a("#"+o[0]+e)[0];n&&(n.innerHTML="",t.body.removeChild(n),clearTimeout(l.timer[e]),delete l.timer[e],"function"==typeof l.end[e]&&l.end[e](),delete l.end[e])},closeAll:function(){for(var e=t[i](o[0]),n=0,a=e.length;n<a;n++)layer.close(0|e[0].getAttribute("index"))}},"function"==typeof define?define(function(){return layer}):function(){var e=document.scripts,n=e[e.length-1],i=n.src,a=i.substring(0,i.lastIndexOf("/")+1);n.getAttribute("merge")||document.head.appendChild(function(){var e=t.createElement("link");return e.href=a+"need/layer.css?2.0",e.type="text/css",e.rel="styleSheet",e.id="layermcss",e}())}()}(window);

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,76 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>layer-更懂你的web弹窗解决方案</title>
<style>
html{background-color:#E3E3E3; font-size:14px; color:#000; font-family:'微软雅黑'}
a,a:hover{ text-decoration:none;}
pre{font-family:'微软雅黑'}
.box{padding:20px; background-color:#fff; margin:50px 100px; border-radius:5px;}
.box a{padding-right:15px;}
#about_hide{display:none}
.layer_text{background-color:#fff; padding:20px;}
.layer_text p{margin-bottom: 10px; text-indent: 2em; line-height: 23px;}
.button{display:inline-block; *display:inline; *zoom:1; line-height:30px; padding:0 20px; background-color:#56B4DC; color:#fff; font-size:14px; border-radius:3px; cursor:pointer; font-weight:normal;}
.photos-demo img{width:200px;}
</style>
<script src="http://cdn.bootcss.com/jquery/1.12.3/jquery.min.js"></script>
<script src="layer/layer.js"></script>
</head>
<body>
<div class="box">
<pre>
@Namelayer-v<script>document.write(layer.v)</script> 弹层组件说明
@Author贤心
@Site<a href="http://layer.layui.com/" target="_blank">http://layer.layui.com/</a>
<strong>【注意事项】</strong>
一、使用时请把文件夹layer整个放置在您站点的任何一个目录只需引入layer.js即可除jQuery外其它文件无需再引入。
二、如果您的js引入是通过合并处理或者您不想采用layer自动获取的绝对路径您可以通过layer.config()来配置详见官网API页
三、jquery需1.8+
四、更多使用说明与演示请参见layer官网。
五、使用时请务必保留来源请勿用于违反我国法律法规的web平台。
六、layer遵循MIT开源协议将永久性提供无偿服务。
</pre>
</div>
<div class="box" style="text-align:center">
<a href="http://layer.layui.com/" target="_blank">更多示例</a>
<a href="http://www.layui.com/doc/modules/layer.html" target="_blank">使用文档</a>
<a href="http://fly.layui.com/" id="suggest">交流反馈</a>
<a href="javascript:;" id="about">关于</a>
</div>
<script>
;!function(){
//页面一打开就执行放入ready是为了layer所需配件css、扩展模块加载完毕
layer.ready(function(){
layer.open({
type: 2,
title: '欢迎页',
maxmin: true,
area: ['800px', '500px'],
content: 'http://layer.layui.com/test/welcome.html',
end: function(){
layer.tips('Hi', '#about', {tips: 1})
}
});
});
//关于
$('#about').on('click', function(){
layer.alert(layer.v + ' - 贤心出品 sentsin.com');
});
}();
</script>
</body>
</html>

View File

@@ -0,0 +1,6 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://code.jquery.com/jquery-1.11.3.min.js
IDList=
HotKey=0

View File

@@ -0,0 +1,6 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://layer.layui.com/
IDList=
HotKey=0

View File

@@ -0,0 +1,8 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://www.layui.com/doc/modules/layer.html
IDList=
HotKey=0
IconIndex=0
IconFile=C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

View File

@@ -0,0 +1,8 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://fly.layui.com/
IDList=
HotKey=0
IconIndex=0
IconFile=C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

View File

@@ -0,0 +1,6 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://layim.layui.com/?from=icon
IDList=
HotKey=0

View File

@@ -0,0 +1,72 @@
当前版本对上个版本无缝兼容,可直接覆盖升级。
# v3.1.1 2017.12.05
* 优化自动获取路径代码,以解决部分浏览器下的某些场景无法自动加载样式问题
---
# v3.1.0 2017.09.13
* 紧急修复在最新版 Chrome61.0.3163.79)下遮罩层出现的奇异花屏现象
* 修复 layer.js 未设置btnAlign时包裹按钮的 div.layui-layer-btn 出现一多余 class
* 对默认按钮颜色、Tips层、Prompt层、Tab层等进行了样式调整以便更显大气且更符合layui风格
* 增加maxHeight参数用于设定弹层的最大高度
* 去除 type:2 时如果content未填写而弹出 layer 官网的默认设置
---
# v3.0.3 2017.03.06
* 增加参数 isOutAnim用于控制是否显示关闭动画true 或者 false
* 撤销自动ready处理机制因为在初始时与Ajax同步等使用场景存在耦合等问题
* 修复Firefox下对默认层设置了高度按钮被溢出的bug
* photos层的出场动画不再是随机而是采用默认动画也可以通过参数 anim 来自定义)
* 去除photos层的默认关闭动画觉得觉得不闪眼的话也可以通过参数isOutAnim开启
---
# v3.0.2 2017.02.25
* 新增 resizing 回调,用于监听窗口的调整大小
* 增加自动ready处理机制即如果你页面一打开就执行弹层无需放入layer.ready中
* 对moveEnd回调返回一个参数为当前容器的DOM对象
* 添加一个amd条件,避免 define出错Merge pull request #42 from wangyateng/master
* 修复tab,photos,prompt弹层默认success回调被覆盖导致功能不正常的问题来自github用户 @waychan23 的友情提醒)
* 完善多按钮场景换行的间距(之前是紧贴在一起,略不雅观)
* 弹出图片层的动画时间改为800ms
* 修复按方向键切换图片层过快时重复弹出的bug
* 修复与animate.css可能存在的动画冲突
---
# v3.0 2016.11.07
* 新增拖动弹层右下角可调节弹层尺寸的功能由参数resize控制默认开启。对loading、tips层无效
* offset参数新增 t、r、b、l、lt、lb、rt、rb、的赋值可快捷实现上、右、下、左、左上角、左下角、右上角、右下角的边缘定位
* 新增btnAlign参数支持三个参数l/c/r分别用于控制按钮居左、居中、居右的快捷设置默认r即居右
* 点击最小化时,自动定位到页面左下角,在出现多个最小化时,会依次排列,这是一次较为重大的完善。
* 新增关闭层的过度动画可通过anim: -1统一取消动画
* 重写拖拽核心代码,性能大幅度提升
* layer.config核心调整
* layer.config中的extend参数只提供加载一个css皮肤文件详见文档
* 处理在head标签中执行layer弹层无效的情况
* 瘦身layer.ready方法
* 修改iframe层的loading动画
* 捕获页类型的弹层在关闭时会根据所捕获元素的初始display值进行不同处理即不再强制隐藏。
* 剔除moveType参数只提供默认的一种拖拽风格
* 剔除语义欠佳的fix参数改为fixed取代
* 剔除语义欠佳的shift参数改为anim取代不过仍然对shift参数兼容
* 完善tips层细节
* 将prompt层改成页面层结构即当你弹出prompt层时再弹出msg不会将prompt销毁。
* prompt层的textarea模式支持area参数来设定宽高
* layer.css大面积改善
* 降解IE6的fixed支持不过仍然对ie6兼容话说现在全浏览器兼容的组件已经不多了layer后续会整理出不兼容ie6/7的版本
* 修改图片超出屏幕后重新计算大小的算法Merge pull request from 390029659/master
* 修复iframe层在用于iPhone设备时无法触发滚动的Bug