1.0.8
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
@Name: layui
|
||||
@Author: 贤心
|
||||
@Site: http://www.layui.com
|
||||
@Site: www.layui.com
|
||||
|
||||
*/
|
||||
|
||||
@@ -29,11 +29,11 @@ pre{white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; w
|
||||
|
||||
/** 图标字体 **/
|
||||
@font-face {font-family: 'layui-icon';
|
||||
src: url('../font/iconfont.eot');
|
||||
src: url('../font/iconfont.eot?#iefix') format('embedded-opentype'),
|
||||
url('../font/iconfont.woff') format('woff'),
|
||||
url('../font/iconfont.ttf') format('truetype'),
|
||||
url('../font/iconfont.svg#iconfont') format('svg');
|
||||
src: url('../font/iconfont.eot?v=1.0.8');
|
||||
src: url('../font/iconfont.eot?v=1.0.8#iefix') format('embedded-opentype'),
|
||||
url('../font/iconfont.woff?v=1.0.8') format('woff'),
|
||||
url('../font/iconfont.ttf?v=1.0.8') format('truetype'),
|
||||
url('../font/iconfont.svg?v=1.0.8#iconfont') format('svg');
|
||||
}
|
||||
|
||||
.layui-icon{
|
||||
@@ -68,15 +68,15 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
|
||||
/* 布局 */
|
||||
.layui-main{position: relative; width: 1140px; margin: 0 auto;}
|
||||
.layui-header{position: relative; z-index: 1000; height: 65px;}
|
||||
.layui-header{position: relative; z-index: 1000; height: 60px;}
|
||||
.layui-header a:hover{transition: all .5s; -webkit-transition: all .5s;}
|
||||
.layui-side{position: fixed; top: 0; bottom: 0; z-index: 999; width: 200px; overflow-x: hidden;}
|
||||
.layui-side-scroll{width: 220px; height: 100%; overflow-x: hidden;}
|
||||
.layui-body{position: absolute; left: 200px; right: 0; top: 0; bottom: 0; z-index: 998; width: auto; overflow: hidden; overflow-y: auto; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;}
|
||||
|
||||
/* 后台布局风格 */.layui-layout-admin .layui-header{border-bottom: 5px solid #1AA094;}
|
||||
.layui-layout-admin .layui-side{top: 70px; width: 200px; overflow-x: hidden;}
|
||||
.layui-layout-admin .layui-body{top: 70px; bottom: 44px;}
|
||||
/* 后台布局风格 */.layui-layout-admin .layui-header{background-color: #23262E;}
|
||||
.layui-layout-admin .layui-side{top: 60px; width: 200px; overflow-x: hidden;}
|
||||
.layui-layout-admin .layui-body{top: 60px; bottom: 44px;}
|
||||
.layui-layout-admin .layui-main{width: auto; margin: 0 15px;}
|
||||
.layui-layout-admin .layui-footer{position: fixed; left: 200px; right: 0; bottom: 0; height: 44px; background-color: #eee;}
|
||||
|
||||
@@ -92,18 +92,30 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
.layui-field-box{padding: 10px 15px;}
|
||||
.layui-field-title .layui-field-box{padding: 10px 0;}
|
||||
|
||||
/* 颜色 */
|
||||
.layui-bg-black{background-color: #393D49; color: #c2c2c2;}
|
||||
.layui-bg-black a{color: #c2c2c2;}.layui-bg-black a:hover{color: #fff;}
|
||||
.layui-bg-gray{background-color: #eee; color: #333;}
|
||||
.layui-bg-green{background-color: #009688; color: #D7EEE8;}
|
||||
.layui-bg-blue{background-color: #1E9FFF; color: #D7EEE8;}
|
||||
/* 进度条 */
|
||||
.layui-progress{position: relative; height: 6px; border-radius: 20px; background-color: #e2e2e2;}
|
||||
.layui-progress-bar{position: absolute; width: 0; height: 6px; border-radius: 20px; background-color: #5FB878; transition: all .3s; -webkit-transition: all .3s;}
|
||||
.layui-progress-big,
|
||||
.layui-progress-big .layui-progress-bar{height: 18px; line-height: 18px; text-align: right;}
|
||||
.layui-progress-text{position: absolute; right: 0; top: -16px; line-height: 18px; font-size: 12px; color: #666}
|
||||
.layui-progress-big .layui-progress-text{position: static; padding: 0 10px; color: #fff;}}
|
||||
|
||||
|
||||
/* 背景颜色 */
|
||||
.layui-bg-red{background-color: #FF5722;} /*赤*/
|
||||
.layui-bg-orange{background-color: #F7B824;} /*橙*/
|
||||
.layui-bg-green{background-color: #009688;} /*绿*/
|
||||
.layui-bg-cyan{background-color: #2F4056;} /*青*/
|
||||
.layui-bg-blue{background-color: #1E9FFF;} /*蓝*/
|
||||
.layui-bg-black{background-color: #393D49;} /*黑*/
|
||||
.layui-bg-gray{background-color: #eee;} /*灰*/
|
||||
|
||||
|
||||
/* 文字 */
|
||||
.layui-word-aux{font-size: 12px; color: #999; padding: 0 5px;}
|
||||
|
||||
/* 按钮 */
|
||||
.layui-btn{display: inline-block; vertical-align: middle; height: 38px; line-height: 38px; padding: 0 18px; background-color: #009688; color: #fff; white-space: nowrap; text-align: center; border: none; border-radius: 2px; cursor: pointer; opacity: 0.9; filter:alpha(opacity=90); -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none;}
|
||||
.layui-btn{display: inline-block; vertical-align: middle; height: 38px; line-height: 38px; padding: 0 18px; background-color: #009688; color: #fff; white-space: nowrap; text-align: center; font-size: 14px; border: none; border-radius: 2px; cursor: pointer; opacity: 0.9; filter:alpha(opacity=90); -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none;}
|
||||
.layui-btn:hover{opacity: 0.8; filter:alpha(opacity=80); color: #fff;}
|
||||
.layui-btn:active{opacity: 1; filter:alpha(opacity=100);}
|
||||
.layui-btn+.layui-btn{margin-left: 10px;}
|
||||
@@ -122,6 +134,15 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
.layui-btn-small i{font-size: 16px !important;}
|
||||
/* 迷你 */.layui-btn-mini{height: 22px; line-height: 22px; padding: 0 5px; font-size: 12px;}
|
||||
.layui-btn-mini i{font-size: 14px !important;}
|
||||
/* 按钮组 */.layui-btn-group{display: inline-block; vertical-align: middle; font-size: 0;}
|
||||
.layui-btn-group .layui-btn{margin-left: 0!important; margin-right: 0!important; border-left: 1px solid rgba(255,255,255,.5); border-radius: 0;}
|
||||
.layui-btn-group .layui-btn-primary{border-left: none;}
|
||||
.layui-btn-group .layui-btn-primary:hover{border-color: #C9C9C9; color: #009688;}
|
||||
.layui-btn-group .layui-btn:first-child{border-left: none; border-radius: 2px 0 0 2px;}
|
||||
.layui-btn-group .layui-btn-primary:first-child{border-left: 1px solid #c9c9c9;}
|
||||
.layui-btn-group .layui-btn:last-child{border-radius: 0 2px 2px 0;}
|
||||
.layui-btn-group .layui-btn+.layui-btn{margin-left: 0;}
|
||||
.layui-btn-group+.layui-btn-group{margin-left: 10px;}
|
||||
|
||||
/** 表单 **/
|
||||
.layui-input, .layui-textarea, .layui-select{height: 38px; line-height: 38px; line-height: 36px\9; border: 1px solid #e6e6e6; background-color: #fff; border-radius: 2px;}
|
||||
@@ -172,7 +193,7 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
/* 复选框 */.layui-form-checkbox{position: relative; display: inline-block; vertical-align: middle; height: 30px; line-height: 28px; margin: 4px 10px 0 0; padding-right: 30px; border: 1px solid #d2d2d2; background-color: #fff; cursor: pointer; font-size: 0; border-radius: 2px; -webkit-transition: .1s linear; transition: .1s linear; box-sizing: border-box !important;}
|
||||
.layui-form-checkbox:hover{border: 1px solid #c2c2c2;}
|
||||
.layui-form-checkbox *{display: inline-block; vertical-align: middle;}
|
||||
.layui-form-checkbox span{padding: 0 10px; font-size: 14px; background-color: #d2d2d2; color: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
|
||||
.layui-form-checkbox span{padding: 0 10px; height: 100%; font-size: 14px; background-color: #d2d2d2; color: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
|
||||
.layui-form-checkbox:hover span{background-color: #c2c2c2;}
|
||||
.layui-form-checkbox i{position: absolute; right: 0; width: 37px; color: #fff; font-size: 20px;}
|
||||
.layui-form-checkbox:hover i{color: #c2c2c2;}
|
||||
@@ -198,19 +219,20 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
.layui-form-radioed i,.layui-form-radio i:hover{color: #5FB878;}
|
||||
.layui-radio-disbaled i{color: #e2e2e2 !important;}
|
||||
|
||||
/* 表单方框风格 */.layui-form-pane .layui-form-label{width: 80px; padding: 8px 15px; line-height: 20px; border: 1px solid #e6e6e6; border-radius: 2px 0 0 2px; text-align: center; background-color: #FBFBFB; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
|
||||
/* 表单方框风格 */.layui-form-pane .layui-form-label{width: 110px; padding: 8px 15px; height: 38px; line-height: 20px; border: 1px solid #e6e6e6; border-radius: 2px 0 0 2px; text-align: center; background-color: #FBFBFB; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; -webkit-box-sizing: border-box !important; -moz-box-sizing: border-box !important; box-sizing: border-box !important;}
|
||||
.layui-form-pane .layui-input-inline{margin-left: -1px;}
|
||||
.layui-form-pane .layui-input-block{margin-left: 112px; left: -1px;}
|
||||
.layui-form-pane .layui-input-block{margin-left: 110px; left: -1px;}
|
||||
.layui-form-pane .layui-input{border-radius: 0 2px 2px 0;}
|
||||
.layui-form-pane .layui-form-text .layui-form-label{float: none; width: 100%; border-right: 1px solid #e6e6e6; border-radius: 2px; box-sizing: border-box!important; text-align: left;}
|
||||
.layui-form-pane .layui-form-text .layui-form-label{float: none; width: 100%; border-right: 1px solid #e6e6e6; border-radius: 2px; -webkit-box-sizing: border-box !important; -moz-box-sizing: border-box !important; box-sizing: border-box !important; text-align: left;}
|
||||
.layui-form-pane .layui-form-text .layui-input-inline{display: block; margin: 0; top: -1px; clear: both;}
|
||||
.layui-form-pane .layui-form-text .layui-input-block{margin: 0; left: 0; top: -1px;}
|
||||
.layui-form-pane .layui-form-text .layui-textarea{min-height: 100px; border-radius: 0 0 2px 2px;}
|
||||
.layui-form-pane .layui-input:hover, .layui-form-pane .layui-textarea:hover{border-color: #e6e6e6 !important;}
|
||||
.layui-form-pane .layui-input:focus, .layui-form-pane .layui-textarea:focus{border-color: #e6e6e6 !important;}
|
||||
.layui-form-pane .layui-form-checkbox{margin: 0 0 10px 10px;}
|
||||
.layui-form-pane .layui-form-checkbox{margin: 4px 0 4px 10px;}
|
||||
.layui-form-pane .layui-form-switch,
|
||||
.layui-form-pane .layui-form-radio{margin-left: 10px; }
|
||||
.layui-form-pane .layui-form-radio{margin-top: 6px; margin-left: 10px; }
|
||||
.layui-form-pane .layui-form-item[pane]{position: relative; border: 1px solid #e6e6e6;}
|
||||
.layui-form-pane .layui-form-item[pane] .layui-form-label{position: absolute; left: 0; top: 0; height: 100%; border-width: 0px; border-right-width: 1px;}
|
||||
.layui-form-pane .layui-form-item[pane] .layui-input-inline{margin-left: 110px;}
|
||||
|
||||
/** 富文本编辑器 **/
|
||||
.layui-layedit{border: 1px solid #d2d2d2; border-radius: 2px;}
|
||||
@@ -491,7 +513,7 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
.layui-form-item .layui-form-label{text-overflow: ellipsis; overflow: hidden; white-space: nowrap;}
|
||||
.layui-form-item .layui-inline{display: block; margin-right: 0; margin-bottom: 20px; clear: both;}
|
||||
.layui-form-item .layui-inline:after{content:'\20'; clear:both; display:block; height:0;}
|
||||
.layui-form-item .layui-input-inline{display: block; float: none; left: -1px; width: auto; margin: 0 0 10px 112px; }
|
||||
.layui-form-item .layui-input-inline{display: block; float: none; left: -3px; width: auto; margin: 0 0 10px 112px; }
|
||||
.layui-form-item .layui-input-inline+.layui-form-mid{margin-left: 110px; top: -5px; padding: 0;}
|
||||
.layui-form-item .layui-form-checkbox{margin-right: 5px; margin-bottom: 5px;}
|
||||
}
|
||||
|
||||
151
src/css/layui.mobile.css
Normal file
151
src/css/layui.mobile.css
Normal file
@@ -0,0 +1,151 @@
|
||||
/**
|
||||
|
||||
@Name: layui mobile
|
||||
@Author: 贤心
|
||||
@Site: http://www.layui.com/mobile/
|
||||
|
||||
*/
|
||||
|
||||
/* reset */
|
||||
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,input,button,textarea,p,blockquote,th,td,form,legend{margin:0; padding:0; -webkit-tap-highlight-color:rgba(0,0,0,0)}
|
||||
html{font:12px 'Helvetica Neue','PingFang SC',STHeitiSC-Light,Helvetica,Arial,sans-serif; -ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;}
|
||||
a,button,input{-webkit-tap-highlight-color:rgba(255,0,0,0);}
|
||||
a{text-decoration: none; background:transparent}
|
||||
a:active,a:hover{outline:0}
|
||||
table{border-collapse:collapse;border-spacing:0}
|
||||
li{list-style:none;}
|
||||
b,strong{font-weight:700;}
|
||||
h1, h2, h3, h4, h5, h6{font-weight:500;}
|
||||
address,cite,dfn,em,var{font-style:normal;}
|
||||
dfn{font-style:italic}
|
||||
sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}
|
||||
img{border:0; vertical-align: bottom}
|
||||
button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0; outline: 0;}
|
||||
button,select{text-transform:none}
|
||||
select{-webkit-appearance: none; border:none;}
|
||||
input{line-height:normal; }
|
||||
input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}
|
||||
input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}
|
||||
input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}
|
||||
input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}
|
||||
label,input{vertical-align: middle;}
|
||||
|
||||
|
||||
/** 图标字体 **/
|
||||
@font-face {font-family: 'layui-icon';
|
||||
src: url('../font/iconfont.eot?v=1.0.7');
|
||||
src: url('../font/iconfont.eot?v=1.0.7#iefix') format('embedded-opentype'),
|
||||
url('../font/iconfont.woff?v=1.0.7') format('woff'),
|
||||
url('../font/iconfont.ttf?v=1.0.7') format('truetype'),
|
||||
url('../font/iconfont.svg?v=1.0.7#iconfont') format('svg');
|
||||
}
|
||||
|
||||
.layui-icon{
|
||||
font-family:"layui-icon" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
|
||||
/** 基础通用 **/
|
||||
/* 消除第三方ui可能造成的冲突 */.layui-box, .layui-box *{-webkit-box-sizing: content-box !important; -moz-box-sizing: content-box !important; box-sizing: content-box !important;}
|
||||
.layui-border-box, .layui-border-box *{-webkit-box-sizing: border-box !important; -moz-box-sizing: border-box !important; box-sizing: border-box !important;}
|
||||
.layui-inline{position: relative; display: inline-block; *display:inline; *zoom:1; vertical-align: middle;}
|
||||
/* 三角形 */.layui-edge{position: absolute; width: 0; height: 0; border-style: dashed; border-color: transparent; overflow: hidden;}
|
||||
/* 单行溢出省略 */.layui-elip{text-overflow: ellipsis; overflow: hidden; white-space: nowrap;}
|
||||
/* 屏蔽选中 */.layui-unselect{-moz-user-select: none; -webkit-user-select: none; -ms-user-select: none;}
|
||||
.layui-disabled,.layui-disabled:active{background-color: #d2d2d2 !important; color: #fff !important; cursor: not-allowed !important;}
|
||||
/* 纯圆角 */.layui-circle{border-radius: 100%;}
|
||||
.layui-show{display: block !important;}
|
||||
.layui-hide{display: none !important;}
|
||||
|
||||
|
||||
.layui-upload-iframe{position: absolute; width: 0px; height: 0px; border: 0px; visibility: hidden;}
|
||||
.layui-upload-enter{border: 1px solid #009E94; background-color: #009E94; color: #fff; -webkit-transform: scale(1.1); transform: scale(1.1);}
|
||||
|
||||
|
||||
/** layer-mobile */
|
||||
|
||||
.layui-m-layer{position:relative; z-index: 19891014;}
|
||||
.layui-m-layer *{-webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box;}
|
||||
.layui-m-layershade,
|
||||
.layui-m-layermain{position:fixed; left:0; top:0; width:100%; height:100%;}
|
||||
.layui-m-layershade{background-color:rgba(0,0,0, .7); pointer-events:auto;}
|
||||
.layui-m-layermain{display:table; font-family: Helvetica, arial, sans-serif; pointer-events: none;}
|
||||
.layui-m-layermain .layui-m-layersection{display:table-cell; vertical-align:middle; text-align:center;}
|
||||
.layui-m-layerchild{position:relative; display:inline-block; text-align:left; background-color:#fff; font-size:14px; border-radius: 5px; box-shadow: 0 0 8px rgba(0, 0, 0, 0.1); pointer-events:auto; -webkit-overflow-scrolling: touch;}
|
||||
.layui-m-layerchild{-webkit-animation-fill-mode: both; animation-fill-mode: both; -webkit-animation-duration: .2s; animation-duration: .2s;}
|
||||
|
||||
/* 弹出动画 */
|
||||
@-webkit-keyframes layui-m-anim-scale { /* 默认 */
|
||||
0% {opacity: 0; -webkit-transform: scale(.5); transform: scale(.5)}
|
||||
100% {opacity: 1; -webkit-transform: scale(1); transform: scale(1)}
|
||||
}
|
||||
@keyframes layui-m-anim-scale { /* 默认 */
|
||||
0% {opacity: 0; -webkit-transform: scale(.5); transform: scale(.5)}
|
||||
100% {opacity: 1; -webkit-transform: scale(1); transform: scale(1)}
|
||||
}
|
||||
.layui-m-anim-scale{animation-name: layui-m-anim-scale; -webkit-animation-name: layui-m-anim-scale;}
|
||||
|
||||
@-webkit-keyframes layui-m-anim-up{
|
||||
0%{opacity: 0; -webkit-transform: translateY(800px); transform: translateY(800px)}
|
||||
100%{opacity: 1; -webkit-transform: translateY(0); transform: translateY(0)}
|
||||
}
|
||||
@keyframes layui-m-anim-up{
|
||||
0%{opacity: 0; -webkit-transform: translateY(800px); transform: translateY(800px)}
|
||||
100%{opacity: 1; -webkit-transform: translateY(0); transform: translateY(0)}
|
||||
}
|
||||
.layui-m-anim-up{-webkit-animation-name: layui-m-anim-up;animation-name: layui-m-anim-up}
|
||||
|
||||
.layui-m-layer0 .layui-m-layerchild{width: 90%; max-width: 640px;}
|
||||
.layui-m-layer1 .layui-m-layerchild{border:none; border-radius:0;}
|
||||
.layui-m-layer2 .layui-m-layerchild{width:auto; max-width:260px; min-width:40px; border:none; background: none; box-shadow: none; color:#fff;}
|
||||
.layui-m-layerchild h3{padding: 0 10px; height: 60px; line-height: 60px; font-size:16px; font-weight: 400; border-radius: 5px 5px 0 0; text-align: center;}
|
||||
.layui-m-layerchild h3,
|
||||
.layui-m-layerbtn span{ text-overflow:ellipsis; overflow:hidden; white-space:nowrap;}
|
||||
.layui-m-layercont{padding: 50px 30px; line-height: 22px; text-align:center;}
|
||||
.layui-m-layer1 .layui-m-layercont{padding:0; text-align:left;}
|
||||
.layui-m-layer2 .layui-m-layercont{text-align:center; padding: 0; line-height: 0;}
|
||||
.layui-m-layer2 .layui-m-layercont i{width:25px; height:25px; margin-left:8px; display:inline-block; background-color:#fff; border-radius:100%;}
|
||||
.layui-m-layer2 .layui-m-layercont p{margin-top: 20px;}
|
||||
|
||||
/* loading */
|
||||
@-webkit-keyframes layui-m-anim-loading{
|
||||
0%,80%,100%{transform:scale(0); -webkit-transform:scale(0)}
|
||||
40%{transform:scale(1); -webkit-transform:scale(1)}
|
||||
}
|
||||
@keyframes layui-m-anim-loading{
|
||||
0%,80%,100%{transform:scale(0); -webkit-transform:scale(0)}
|
||||
40%{transform:scale(1); -webkit-transform:scale(1)}
|
||||
}
|
||||
.layui-m-layer2 .layui-m-layercont i{-webkit-animation: layui-m-anim-loading 1.4s infinite ease-in-out; animation: layui-m-anim-loading 1.4s infinite ease-in-out; -webkit-animation-fill-mode: both; animation-fill-mode: both;}
|
||||
|
||||
.layui-m-layer2 .layui-m-layercont i:first-child{margin-left:0; -webkit-animation-delay: -.32s; animation-delay: -.32s;}
|
||||
.layui-m-layer2 .layui-m-layercont i.layui-m-layerload{-webkit-animation-delay: -.16s; animation-delay: -.16s;}
|
||||
.layui-m-layer2 .layui-m-layercont>div{line-height:22px; padding-top:7px; margin-bottom:20px; font-size: 14px;}
|
||||
.layui-m-layerbtn{display: box; display: -moz-box; display: -webkit-box; width: 100%; position:relative; height: 50px; line-height: 50px; font-size: 0; text-align:center; border-top:1px solid #D0D0D0; background-color: #F2F2F2; border-radius: 0 0 5px 5px;}
|
||||
.layui-m-layerbtn span{position:relative; display: block; -moz-box-flex: 1; box-flex: 1; -webkit-box-flex: 1; text-align:center; font-size:14px; border-radius: 0 0 5px 5px; cursor:pointer;}
|
||||
.layui-m-layerbtn span[yes]{color: #40AFFE;}
|
||||
.layui-m-layerbtn span[no]{border-right: 1px solid #D0D0D0; border-radius: 0 0 0 5px;}
|
||||
.layui-m-layerbtn span:active{background-color: #F6F6F6;}
|
||||
.layui-m-layerend{position:absolute; right:7px; top:10px; width:30px; height:30px; border: 0; font-weight:400; background: transparent; cursor: pointer; -webkit-appearance: none; font-size:30px;}
|
||||
.layui-m-layerend::before, .layui-m-layerend::after{position:absolute; left:5px; top:15px; content:''; width:18px; height:1px; background-color:#999; transform:rotate(45deg); -webkit-transform:rotate(45deg); border-radius: 3px;}
|
||||
.layui-m-layerend::after{transform:rotate(-45deg); -webkit-transform:rotate(-45deg);}
|
||||
|
||||
/* 底部对话框风格 */
|
||||
body .layui-m-layer .layui-m-layer-footer{position: fixed; width: 95%; max-width: 100%; margin: 0 auto; left:0; right: 0; bottom: 10px; background: none;}
|
||||
.layui-m-layer-footer .layui-m-layercont{padding: 20px; border-radius: 5px 5px 0 0; background-color: rgba(255,255,255,.8);}
|
||||
.layui-m-layer-footer .layui-m-layerbtn{display: block; height: auto; background: none; border-top: none;}
|
||||
.layui-m-layer-footer .layui-m-layerbtn span{background-color: rgba(255,255,255,.8);}
|
||||
.layui-m-layer-footer .layui-m-layerbtn span[no]{color: #FD482C; border-top: 1px solid #c2c2c2; border-radius: 0 0 5px 5px;}
|
||||
.layui-m-layer-footer .layui-m-layerbtn span[yes]{margin-top: 10px; border-radius: 5px;}
|
||||
|
||||
/* 通用提示 */
|
||||
body .layui-m-layer .layui-m-layer-msg{width: auto; max-width: 90%; margin: 0 auto; bottom: -150px; background-color: rgba(0,0,0,.7); color: #fff;}
|
||||
.layui-m-layer-msg .layui-m-layercont{padding: 10px 20px;}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@Name: layer
|
||||
@Author: 贤心
|
||||
|
||||
**/
|
||||
*/
|
||||
|
||||
*html{background-image: url(about:blank); background-attachment: fixed;}
|
||||
html #layuicss-skinlayercss{display: none; position: absolute; width: 1989px;}
|
||||
@@ -16,7 +16,7 @@ html #layuicss-skinlayercss{display: none; position: absolute; width: 1989px;}
|
||||
.layui-layer-close{position:absolute;}
|
||||
.layui-layer-content{position:relative;}
|
||||
.layui-layer-border{border: 1px solid #B2B2B2; border: 1px solid rgba(0,0,0,.1); box-shadow: 1px 1px 5px rgba(0,0,0,.2);}
|
||||
.layui-layer-load{background:url(loading-1.gif) #eee center center no-repeat;}
|
||||
.layui-layer-load{background:url(loading-1.gif) center center no-repeat;}
|
||||
.layui-layer-ico{ background:url(icon.png) no-repeat;}
|
||||
.layui-layer-dialog .layui-layer-ico,
|
||||
.layui-layer-setwin a,
|
||||
@@ -28,39 +28,39 @@ html #layuicss-skinlayercss{display: none; position: absolute; width: 1989px;}
|
||||
/* 动画 */
|
||||
.layui-layer{border-radius: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; -webkit-animation-duration:.3s; animation-duration:.3s;}
|
||||
|
||||
@-webkit-keyframes bounceIn { /* 默认 */
|
||||
@-webkit-keyframes layer-bounceIn { /* 默认 */
|
||||
0% {opacity: 0; -webkit-transform: scale(.5); transform: scale(.5)}
|
||||
100% {opacity: 1; -webkit-transform: scale(1); transform: scale(1)}
|
||||
}
|
||||
@keyframes bounceIn {
|
||||
@keyframes layer-bounceIn {
|
||||
0% {opacity: 0; -webkit-transform: scale(.5); -ms-transform: scale(.5); transform: scale(.5)}
|
||||
100% {opacity: 1; -webkit-transform: scale(1); -ms-transform: scale(1); transform: scale(1)}
|
||||
}
|
||||
.layer-anim{-webkit-animation-name: bounceIn;animation-name: bounceIn}
|
||||
.layer-anim{-webkit-animation-name: layer-bounceIn;animation-name: layer-bounceIn}
|
||||
|
||||
@-webkit-keyframes zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);-ms-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);-ms-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-01{-webkit-animation-name:zoomInDown;animation-name:zoomInDown}
|
||||
@-webkit-keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);-ms-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);-ms-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-01{-webkit-animation-name:layer-zoomInDown;animation-name:layer-zoomInDown}
|
||||
|
||||
@-webkit-keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.layer-anim-02{-webkit-animation-name:fadeInUpBig;animation-name:fadeInUpBig}
|
||||
@-webkit-keyframes layer-fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes layer-fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.layer-anim-02{-webkit-animation-name:layer-fadeInUpBig;animation-name:layer-fadeInUpBig}
|
||||
|
||||
@-webkit-keyframes zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);-ms-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);-ms-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-03{-webkit-animation-name:zoomInLeft;animation-name:zoomInLeft}
|
||||
@-webkit-keyframes layer-zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);-ms-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);-ms-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-03{-webkit-animation-name:layer-zoomInLeft;animation-name:layer-zoomInLeft}
|
||||
|
||||
@-webkit-keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0px) rotate(0deg);transform:translateX(0px) rotate(0deg)}}@keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);-ms-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0px) rotate(0deg);-ms-transform:translateX(0px) rotate(0deg);transform:translateX(0px) rotate(0deg)}}.layer-anim-04{-webkit-animation-name:rollIn;animation-name:rollIn}
|
||||
@-webkit-keyframes layer-rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0px) rotate(0deg);transform:translateX(0px) rotate(0deg)}}@keyframes layer-rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);-ms-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0px) rotate(0deg);-ms-transform:translateX(0px) rotate(0deg);transform:translateX(0px) rotate(0deg)}}.layer-anim-04{-webkit-animation-name:layer-rollIn;animation-name:layer-rollIn}
|
||||
|
||||
@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.layer-anim-05{-webkit-animation-name:fadeIn;animation-name:fadeIn}
|
||||
@keyframes layer-fadeIn{0%{opacity:0}100%{opacity:1}}.layer-anim-05{-webkit-animation-name:layer-fadeIn;animation-name:layer-fadeIn}
|
||||
|
||||
@-webkit-keyframes shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}.layer-anim-06{-webkit-animation-name:shake;animation-name:shake}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}
|
||||
@-webkit-keyframes shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}.layer-anim-06{-webkit-animation-name:shake;animation-name:shake}@-webkit-keyframes layer-fadeIn{0%{opacity:0}100%{opacity:1}}
|
||||
|
||||
@-webkit-keyframes bounceOut { /* 关闭动画 */
|
||||
@-webkit-keyframes layer-bounceOut { /* 关闭动画 */
|
||||
100% {opacity: 0; -webkit-transform: scale(.7); transform: scale(.7)}
|
||||
30% {-webkit-transform: scale(1.05); transform: scale(1.05)}
|
||||
0% {-webkit-transform: scale(1); transform: scale(1);}
|
||||
}
|
||||
@keyframes bounceOut {
|
||||
@keyframes layer-bounceOut {
|
||||
100% {opacity: 0; -webkit-transform: scale(.7); -ms-transform: scale(.7); transform: scale(.7);}
|
||||
30% {-webkit-transform: scale(1.05); -ms-transform: scale(1.05); transform: scale(1.05);}
|
||||
0% {-webkit-transform: scale(1); -ms-transform: scale(1);transform: scale(1);}
|
||||
}
|
||||
.layer-anim-close{-webkit-animation-name: bounceOut;animation-name: bounceOut; -webkit-animation-duration:.2s; animation-duration:.2s;}
|
||||
.layer-anim-close{-webkit-animation-name: layer-bounceOut;animation-name: layer-bounceOut; -webkit-animation-duration:.2s; animation-duration:.2s;}
|
||||
|
||||
/* 标题栏 */
|
||||
.layui-layer-title{padding:0 80px 0 20px; height:42px; line-height:42px; border-bottom:1px solid #eee; font-size:14px; color:#333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background-color: #F8F8F8; border-radius: 2px 2px 0 0;}
|
||||
|
||||
Binary file not shown.
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>
|
||||
Created by FontForge 20120731 at Sun Nov 20 18:07:09 2016
|
||||
Created by FontForge 20120731 at Mon Feb 20 22:44:05 2017
|
||||
By admin
|
||||
</metadata>
|
||||
<defs>
|
||||
@@ -19,7 +19,7 @@ Created by FontForge 20120731 at Sun Nov 20 18:07:09 2016
|
||||
bbox="0 -212 1487.11 896"
|
||||
underline-thickness="0"
|
||||
underline-position="0"
|
||||
unicode-range="U+0078-E650"
|
||||
unicode-range="U+0078-E6FC"
|
||||
/>
|
||||
<missing-glyph
|
||||
/>
|
||||
@@ -45,10 +45,6 @@ q-2 -14 -12 -26.5t-21 -16.5q-17 -6 -40.5 -8.5t-40.5 4.5l-57 42q-11 8 -26.5 7t-25
|
||||
q14 -2 26.5 -12t16.5 -21q6 -17 8.5 -40.5t-4.5 -40.5l-42 -57q-8 -11 -7 -26.5t11 -25.5l31 -31q10 -10 25.5 -11t26.5 7l57 42q12 9 27.5 11t26.5 -4q16 -7 37 -24.5t23 -29.5l11 -70q2 -14 13.5 -24t25.5 -10h44q14 0 25.5 10t13.5 24l11 70q2 14 12 26.5t21 16.5
|
||||
q17 6 41 8.5t40 -4.5l57 -42q11 -8 26.5 -7t25.5 11l31 31q10 10 11 25.5t-7 26.5l-42 57q-9 11 -11 27t4 27q7 16 24.5 37t29.5 23l70 11q14 2 24 13.5t10 25.5v44q0 14 -10 25.5t-24 13.5zM512 210q-72 0 -123 51t-51 123t51 123t123 51t123 -51t51 -123t-51 -123
|
||||
t-123 -51zM512 384zM407 384q0 43 31 74t74 31t74 -31t31 -74t-31 -74t-74 -31t-74 31t-31 74z" />
|
||||
<glyph glyph-name="shuaxin" unicode="ဂ"
|
||||
d="M511 -63q-95 0 -182 40q-106 47 -175 139q-5 7 -3.5 15.5t8.5 14t15.5 4t13.5 -8.5q63 -83 158 -125q75 -34 157 -35.5t153.5 26t131.5 83t94 130.5t35 156.5t-26 153.5t-82.5 132t-130.5 93.5t-157 35t-153.5 -26t-131.5 -83t-94 -130.5q-41 -92 -34 -191q0 -9 -6 -15.5
|
||||
t-14 -7.5q-9 0 -15.5 5.5t-7.5 14.5q-7 110 38 212q38 83 104 144t145.5 91t169.5 28.5t173 -38.5t144.5 -103.5t91.5 -145.5t28.5 -169.5t-38.5 -173.5q-55 -123 -167 -193.5t-243 -71.5zM160 -9v0q-8 0 -13.5 5.5t-5.5 13.5l1 114q0 12 9 21q9 8 22 9l114 -1q8 0 13 -5.5
|
||||
t5 -13.5t-5.5 -13.5t-12.5 -5.5v0l-107 1l-1 -107q0 -7 -5.5 -12.5t-13.5 -5.5z" />
|
||||
<glyph glyph-name="yinshenim" unicode=""
|
||||
d="M512 834q-92 0 -175 -35.5t-143.5 -96t-96 -143.5t-35.5 -175t35.5 -175t96 -143.5t143.5 -96t175 -35.5t175 35.5t143.5 96t96 143.5t35.5 175t-35.5 175t-96 143.5t-143.5 96t-175 35.5zM266 590h492v-34h-492v34zM758 178h-492v34h492v-34zM140 367v34h744v-34h-744z
|
||||
" />
|
||||
@@ -116,10 +112,6 @@ t-51 -191t-139 -139t-191 -51z" />
|
||||
<glyph glyph-name="biaoge" unicode=""
|
||||
d="M305 260zM730 427zM596 554zM144 603v-602h737v602h-737zM420 216v129h185v-129h-185zM605 173v-129h-185v129h185zM605 517v-129h-185v129h185zM374 517v-129h-184v129h184zM190 345h184v-129h-184v129zM651 345h184v-129h-184v129zM651 388v129h184v-129h-184zM190 173
|
||||
h184v-129h-184v129zM651 44v129h184v-129h-184z" />
|
||||
<glyph glyph-name="loading" unicode=""
|
||||
d="M960 300q-2 89 -37 169q-35 81 -99 141q-62 61 -143 92q-80 32 -167 30q-86 -2 -164 -36t-136 -96q-59 -61 -89 -139q-31 -77 -29 -161q2 -83 35 -159q33 -75 92 -132q59 -56 135 -86q75 -29 156 -27t153 34q73 32 128 89t83 130q17 44 23 91h3q23 0 39.5 16t16.5 39v5v0
|
||||
v0zM871 152q-30 -70 -86 -123q-55 -53 -126 -80q-69 -27 -145 -25q-75 1 -143 32q-67 29 -118 83q-51 53 -77 121q-26 67 -24 140q2 72 31 137q28 65 80 114q51 49 116 74t135 23q70 -1 132 -29t110 -78q46 -49 70 -112q24 -62 23 -129v0v-5q0 -21 14 -37t35 -18
|
||||
q-8 -46 -27 -88z" />
|
||||
<glyph glyph-name="youyou" unicode=""
|
||||
d="M284 722l57 59l399 -397l-399 -397l-57 59l336 338z" />
|
||||
<glyph glyph-name="zuozuo" unicode=""
|
||||
@@ -228,6 +220,10 @@ t202 -54t146.5 -147t54 -202.5t-54 -202t-146.5 -146.5t-202 -54zM514 594q-14 -16 -
|
||||
q-24 -14 -54 -47l-11 -11l35 -27l9 9q8 9 20 19q-39 -128 -39 -164q0 -16 10 -27q9 -10 25 -10q15 0 36 11q19 11 59 49l11 10l-31 31z" />
|
||||
<glyph glyph-name="xiangshang" unicode=""
|
||||
d="M514 539l384 -384q9 -9 22 -9t22.5 9.5t9.5 22t-10 22.5l-403 403q-13 13 -25 13q-20 0 -26 -6l-410 -410q-9 -10 -9 -22.5t9.5 -22t22.5 -9.5t22 9z" />
|
||||
<glyph glyph-name="bofang" unicode=""
|
||||
d="M512 -128q-104 0 -199 40.5t-163.5 109t-109 163.5t-40.5 199t40.5 199t109 163.5t163.5 109t199 40.5t199 -40.5t163.5 -109t109 -163.5t40.5 -199t-40.5 -199t-109 -163.5t-163.5 -109t-199 -40.5zM512 864q-98 0 -186.5 -38t-153 -102.5t-102.5 -153t-38 -186.5
|
||||
t38 -186.5t102.5 -153t153 -102.5t186.5 -38t186.5 38t153 102.5t102.5 153t38 186.5t-38 186.5t-102.5 153t-153 102.5t-186.5 38zM640 181h-21q-18 0 -30.5 12.5t-12.5 30.5v320q0 18 12.5 30.5t30.5 12.5h21q18 0 30.5 -12.5t12.5 -30.5v-320q0 -18 -12.5 -30.5
|
||||
t-30.5 -12.5zM405 181h-21q-18 0 -30.5 12.5t-12.5 30.5v320q0 18 12.5 30.5t30.5 12.5h21q18 0 30.5 -12.5t12.5 -30.5v-320q0 -18 -12.5 -30.5t-30.5 -12.5z" />
|
||||
<glyph glyph-name="riqi" unicode=""
|
||||
d="M933 674h-167v57h-34v-57h-192v57h-34v-57h-217v57h-33v-57h-168q-9 0 -15.5 -6.5t-6.5 -15.5v-706q0 -10 6.5 -16.5t15.5 -6.5h845q9 0 15.5 6.5t6.5 16.5v706q0 9 -6.5 15.5t-15.5 6.5zM939 -54q0 -6 -6 -6h-845q-6 0 -6 6v706q0 6 6 6h168v-56h33v56h217v-56h34v56
|
||||
h192v-56h34v56h167q6 0 6 -6v-706zM207 524h129v-94h-129v94zM459 524h129v-94h-129v94zM685 524h129v-94h-129v94zM207 349h129v-94h-129v94zM459 349h129v-94h-129v94zM685 349h129v-94h-129v94zM207 174h129v-94h-129v94zM459 174h129v-94h-129v94zM685 174h129v-94h-129
|
||||
@@ -240,6 +236,9 @@ d="M739 24h-452q-20 0 -34.5 14.5t-14.5 33.5v418q0 20 14.5 34.5t34.5 14.5h452q20
|
||||
q0 19 14.5 32t35.5 13h640q21 0 35.5 -13t14.5 -32v-61q0 -18 -14.5 -31.5t-35.5 -13.5zM185 541q1 -3 7 -3h640q6 0 7 3v61q-1 3 -7 3h-640q-6 0 -7 -3v-61zM601 605h-175q-20 0 -34.5 13.5t-14.5 31.5v11q0 19 14.5 32t34.5 13h175q20 0 34.5 -13t14.5 -32v-11
|
||||
q0 -18 -14.5 -31.5t-34.5 -13.5zM419 650q2 -2 7 -2h175q5 0 7 2v11q-2 3 -7 3h-175q-5 0 -7 -3v-11zM404 431h-30q-5 0 -9 -4t-4 -9v-273q0 -5 4 -9t9 -4h30q6 0 9.5 4t3.5 9v273q0 5 -3.5 9t-9.5 4zM660 431h-31q-5 0 -9 -4t-4 -9v-273q0 -5 4 -9t9 -4h31q5 0 9 4t4 9v273
|
||||
q0 5 -4 9t-9 4zM532 431h-30q-6 0 -9.5 -4t-3.5 -9v-273q0 -5 3.5 -9t9.5 -4h30q5 0 9 4t4 9v273q0 5 -4 9t-9 4z" />
|
||||
<glyph glyph-name="bofangzanting02" unicode=""
|
||||
d="M512 896q-139 0 -257 -68.5t-186.5 -186.5t-68.5 -257t68.5 -257t186.5 -186.5t257 -68.5t257 68.5t186.5 186.5t68.5 257t-68.5 257t-186.5 186.5t-257 68.5v0v0zM512 -95q-98 0 -187 37.5t-153 101.5t-101.5 153t-37.5 187t37.5 187t101.5 153t153 101.5t187 37.5
|
||||
t187 -37.5t153 -101.5t101.5 -153t37.5 -187t-37.5 -187t-101.5 -153t-153 -101.5t-187 -37.5v0v0zM733 392l-340 197q-6 6 -12 0q-3 0 -5.5 -2.5t-2.5 -5.5v-394l4 -8q6 -6 12 0l344 197q4 4 4 8q3 3 1.5 5.5t-5.5 2.5v0v0zM733 392z" />
|
||||
<glyph glyph-name="top" unicode=""
|
||||
d="M812 153l-300 173l-300 -173l300 604zM264 209l248 143l248 -143l-248 499zM372 138v-126h-16v126h-46v15h107v-15h-45v0zM507 154q40 0 50 -11.5t10 -58.5q0 -50 -10 -61.5t-50.5 -11.5t-50 11.5t-9.5 60.5v10v13q0 28 12 38q13 10 48 10zM506 141q-33 0 -38.5 -7.5
|
||||
t-5.5 -51t5.5 -51t39 -7.5t39 7.5t5.5 51.5v9v13q0 23 -7.5 29.5t-37.5 6.5zM608 12v141h60h5q24 0 32.5 -9t8.5 -35q0 -24 -9 -32.5t-34 -8.5h-6h-41v-56h-16zM624 81h38q24 0 30.5 5t6.5 22q0 21 -4.5 26.5t-21.5 5.5h-6h-43v-59v0z" />
|
||||
@@ -294,12 +293,6 @@ d="M945 197h-88l-116 -325h74l17 62h135l18 -62h77l-117 325v0zM848 1l51 152l51 -15
|
||||
t12 -4t5.5 -11.5t-3.5 -12q-15 -17 -18.5 -43t11.5 -41q17 -13 42.5 -6t40.5 24q5 5 12 5.5t12 -4.5q13 -11 2 -23q-15 -17 -18.5 -43t11.5 -41q17 -12 42.5 -5.5t40.5 23.5q11 12 24 1q5 -4 5.5 -11t-4.5 -12q-14 -17 -17.5 -43t11.5 -41q16 -14 37 -12.5t34 17.5l171 200
|
||||
l-8 37l-449 357v0zM844 330l-164 141l250 244l10 10q28 32 25.5 74.5t-35 70.5t-75.5 25.5t-71 -34.5h-1l-219 -290l-164 143q-11 9 -25.5 8t-23.5 -12l-103 -116l-23 -26l26 -23l445 -384l30 -24l121 144q10 11 9 25t-12 24v0zM818 831q16 18 40 19.5t42 -14t20 -39.5
|
||||
t-14 -42t-40 -19.5t-42.5 14t-20 39.5t14.5 42v0zM765 758q6 -27 27 -45t49 -19l-197 -199l-51 43l172 220v0zM776 300l-66 -81l-402 347l69 79q11 12 23 2l374 -324q6 -4 6.5 -11t-4.5 -12v0z" />
|
||||
<glyph glyph-name="loading1" unicode=""
|
||||
d="M843 181q0 -5 5.5 -5t5.5 5v0q0 6 -5.5 6t-5.5 -6v0v0zM722 56v0q0 -4 3 -7.5t7.5 -3.5t8 3.5t3.5 7.5v0v0q0 5 -3.5 8t-8 3t-7.5 -3t-3 -8v0v0zM559 -8q0 -7 4.5 -12t11.5 -5t11.5 5t4.5 11.5t-4.5 11.5t-11.5 5t-11.5 -5t-4.5 -11v0zM383 0v0q0 -9 6 -15.5t15.5 -6.5
|
||||
t15.5 6.5t6 15.5v0v0q0 9 -6 15.5t-15.5 6.5t-15.5 -6.5t-6 -15.5v0v0zM227 80q0 -11 8 -19t19 -8t19 8t8 19v0q0 12 -8 20t-19 8t-19 -8t-8 -20v0v0zM119 217q0 -14 9.5 -23.5t23 -9.5t23 9.5t9.5 23t-9.5 23t-23 9.5t-23 -9.5t-9.5 -22.5v0zM78 384q0 -16 11 -27.5
|
||||
t27 -11.5t27 11.5t11 27.5t-11 27t-27 11t-27 -11t-11 -27v0zM111 550q0 -18 13 -31t31 -13t31 13t13 31t-13 31t-31 13t-31 -13t-13 -31v0zM211 684q0 -21 14.5 -35.5t35 -14.5t35 14.5t14.5 35.5v0q0 20 -14.5 34.5t-35 14.5t-35 -14.5t-14.5 -34.5v0v0zM358 760
|
||||
q0 -22 16.5 -38t39 -16t38.5 16t16 38.5t-16 38.5t-38.5 16t-39 -16t-16.5 -39v0zM524 765q0 -25 17.5 -42.5t42.5 -17.5t42.5 17.5t17.5 42.5v0q0 25 -17.5 42.5t-42.5 17.5t-42.5 -17.5t-17.5 -42.5v0v0zM675 697q0 -27 19 -46t46.5 -19t46.5 19t19 46t-19 46.5
|
||||
t-46.5 19.5t-46.5 -19.5t-19 -46.5v0zM782 569q0 -29 21 -50t50.5 -21t50 21t20.5 50.5t-20.5 50.5t-50 21t-50.5 -21t-21 -51v0zM825 404q0 -32 22.5 -54.5t54 -22.5t54 22.5t22.5 54.5t-22.5 54.5t-54 22.5t-54 -22.5t-22.5 -54.5v0z" />
|
||||
<glyph glyph-name="sanjiao" unicode=""
|
||||
d="M293 728l427 -355l-427 -356v711z" />
|
||||
<glyph glyph-name="danxuankuanghouxuan" unicode=""
|
||||
@@ -325,6 +318,12 @@ d="M79 832h864q6 0 11 -4.5t5 -11.5v-863q0 -7 -5 -11.5t-11 -4.5h-864q-7 0 -11.5 4
|
||||
<glyph glyph-name="gongsisvgtubiaozongji23" unicode=""
|
||||
d="M80 832h864q6 0 10.5 -4.5t4.5 -11.5v-863q0 -7 -4.5 -11.5t-10.5 -4.5h-864q-7 0 -11.5 4.5t-4.5 11.5v863q0 7 4.5 11.5t11.5 4.5v0zM928 800h-832v-831h832v831zM144 361q-11 12 0 23t22 0l11 -11l0.5 -0.5l0.5 -0.5l207 -206l472 471q11 12 22.5 0.5t0.5 -22.5
|
||||
l-484 -483v0q-11 -11 -22 0l-218 217l-1 1z" />
|
||||
<glyph glyph-name="shuaxin" unicode="ဂ"
|
||||
d="M959 451q-22 147 -127.5 252.5t-252.5 127.5q-70 11 -140 -1q-70 -11 -134 -44q-7 -4 -10 -12t1 -15.5t12 -10t16 1.5q120 62 252 41t227 -116q72 -73 102 -169t12 -195q-24 42 -86 88q-5 4 -11.5 6.5t-13.5 0.5t-8 -12q-1 -3 9 -19t24.5 -40.5t21.5 -45.5
|
||||
q13 -34 17 -66.5t6 -39.5q0 -2 1 -4v0q4 -13 16 -14.5t16 6.5h1q3 3 4 6q33 64 44 134q12 70 1 140zM700 18q-120 -62 -252 -41t-227 116q-72 73 -102 169t-12 195q25 -45 88 -92q5 -4 11.5 -6.5t13.5 0t8 11.5q1 4 -9 19.5t-24.5 40.5t-21.5 46q-13 35 -17 66.5t-7 42.5
|
||||
q-2 7 -6 10q-3 3 -6 5q-7 4 -15 1t-12 -10q-33 -64 -44 -134q-12 -70 -1 -140q22 -147 127.5 -252.5t252.5 -127.5q70 -11 140 1q70 11 134 44q7 4 10 12t-1 15.5t-12 10t-16 -1.5z" />
|
||||
<glyph glyph-name="loading2" unicode=""
|
||||
d="M538 832q-11 0 -18.5 -7.5t-7.5 -18t7.5 -18t18.5 -7.5q100 0 185.5 -50t135 -135.5t49.5 -185.5q0 -11 7.5 -18.5t18.5 -7.5t18.5 7.5t7.5 18.5q0 114 -57 211.5t-154 154t-211 56.5z" />
|
||||
<glyph glyph-name="jiacu" unicode=""
|
||||
d="M199 848h355q106 0 158 -8.5t92.5 -36.5t68 -74.5t27.5 -104.5q0 -62 -33.5 -114.5t-90.5 -78.5q81 -23 124.5 -80t43.5 -134q0 -61 -28 -118t-77 -91.5t-121 -42.5q-45 -5 -216 -6h-303v889zM378 700v-206h118q105 0 130 3q46 6 72.5 32.5t26.5 69.5q0 41 -22.5 67
|
||||
t-67.5 31q-27 3 -154 3h-103zM378 346v-236h167q97 0 123 5q40 7 65.5 35t25.5 75q0 40 -19.5 68t-56.5 40.5t-159 12.5h-146z" />
|
||||
@@ -333,12 +332,22 @@ d="M998 501q0 89 -55.5 165t-151.5 120t-209 44q-91 0 -173.5 -30t-142.5 -84q57 12
|
||||
t-39.5 15zM243 399q-23 0 -39 -15t-16 -36.5t16 -36.5t39 -15t39.5 15t16.5 36.5t-16.5 36.5t-39.5 15zM641 399q-23 0 -39.5 -15t-16.5 -36.5t16.5 -36.5t39.5 -15t39.5 15t16.5 36.5t-16.5 36.5t-39.5 15zM442 678q-113 0 -209 -44t-151.5 -120t-55.5 -165q0 -65 29 -122
|
||||
t77.5 -97t106.5 -66.5t119 -35.5l61 -79q8 -11 23 -11t24 11l60 79q62 10 120 36t106 66t77.5 97.5t29.5 121.5q0 89 -56 165t-152 120t-209 44zM715 174q-82 -71 -197 -90q-23 -3 -37 -21l-39 -50l-38 50q-14 18 -37 21q-115 19 -197 90q-87 75 -87 175q0 108 100 188
|
||||
q107 84 259 84q153 0 259 -84q101 -80 101 -188q0 -100 -87 -175z" />
|
||||
<glyph glyph-name="shipin1" unicode=""
|
||||
d="M953 599v0v0zM101 661v0v0zM101 720v0v0zM661 697q15 0 26 -2q18 -4 34 -17q23 -17 32 -52q4 -13 3 -42q-1 -8 -1 -12v-37l102 70l25 18h2v1q12 9 21 11q5 1 10 1q15 0 28 -9q19 -14 19 -51v-3v-410q0 -38 -20 -52q-11 -8 -27 -8q-8 0 -15 2.5t-16 10.5l-2 1l-25 18
|
||||
l-102 70v-38q0 -3 1 -12q0 -29 -3 -43q-9 -34 -31 -51q-17 -13 -34 -17q-10 -2 -25 -2h-13h-10h-473h-6h-6q-32 0 -47 7q-44 18 -53 73l-1 3v2v57v0v371v7v7q-1 55 9 77q16 33 49 46q6 2 15 3h3l4 2h501h12h6.5h7.5zM304 224l256 128v34l-256 127v-289zM661 738h-16h-10
|
||||
h-501h-7l-7 -3q-12 -1 -23 -5q-49 -18 -71 -67q-14 -30 -13 -94v-14v-371v0v0v-1v-56v-3v-3l1 -4v-2q7 -36 26 -62q20 -29 52 -42q23 -10 63 -10h6h6h473h9h14q19 0 34 3q25 6 49 25q34 25 46 72q3 11 4 26l37 -26l25 -17v-0.5v-0.5q15 -11 27 -15q14 -6 30 -6q28 0 51 16
|
||||
q25 18 33 48q4 14 4 37v410v3v0q0 23 -4 36q-8 30 -32 48q-23 17 -52 17q-10 0 -20 -2q-18 -5 -36 -18v0v-1l-25 -17h-1v0l-37 -26q-1 12 -4 23q-12 49 -46 75q-24 18 -50 24q-15 3 -35 3v0zM345 290v157l157 -78l-157 -79v0zM347 429v-121v121z" />
|
||||
<glyph glyph-name="yinpin" unicode=""
|
||||
d="M356 2v0v283h-103v-283h103zM665 285h103v-283h-103v283zM64 302q0 -6 -0.5 -33.5t-0.5 -43t1.5 -37.5t4.5 -34h66q-3 10 -4.5 24t-2.5 33t-1 31v34v26q0 108 51.5 200t140 145t193.5 53t193.5 -53t140 -145t51.5 -200q0 -121 -8 -148h66q3 12 4.5 34t1.5 37.5t-0.5 43
|
||||
t-0.5 33.5q0 94 -35.5 180t-95.5 148t-143 99t-174 37t-174 -37t-143 -99t-95.5 -148t-35.5 -180z" />
|
||||
<glyph glyph-name="wenjianjiafan" unicode=""
|
||||
d="M958 240l-124 464q-4 14 -15.5 23t-25.5 9h-679q-3 0 -5 -1v1q-19 0 -32 -13.5t-13 -31.5v-613q0 -19 13 -32t32 -13h172q19 0 32 13l55 56q3 2 6 2h411q19 0 32 13t13 32v38h87q21 0 34 16.5t7 36.5zM101 78v498l96 -358q4 -14 15.5 -22.5t25.5 -8.5h555v-38q0 -8 -8 -8
|
||||
h-411q-19 0 -32 -13l-55 -56q-2 -2 -6 -2h-172q-8 0 -8 8zM921.5 226q-1.5 -2 -4.5 -2h-679q-4 0 -5 4l-124 463q-1 3 0.5 5.5t4.5 2.5h679q4 0 5 -5l124 -463q1 -3 -0.5 -5z" />
|
||||
<glyph glyph-name="shouji" unicode=""
|
||||
d="M732 896h-440q-72 0 -124 -51.5t-52 -124.5v-672q0 -73 52 -124.5t124 -51.5h439q73 0 124.5 51.5t51.5 124.5v672q1 73 -51 124.5t-124 51.5zM292 853h439q53 0 91.5 -36t41.5 -89h-704q3 53 41.5 89t90.5 36zM865 49q0 -55 -39 -94.5t-94 -39.5h-440q-55 0 -94 39.5
|
||||
t-39 94.5v45h706v-45v0zM865 137h-706v549h706v-549v0zM512 -55q21 0 36.5 15.5t15.5 36.5t-15.5 36t-36.5 15t-36.5 -15t-15.5 -36t15.5 -36.5t36.5 -15.5z" />
|
||||
<glyph glyph-name="tianjia2" unicode=""
|
||||
d="M567 58q0 -23 -16 -39t-39 -16v0q-23 0 -39 16t-16 39v610q0 22 16 38.5t39 16.5v0q23 0 39 -16.5t16 -38.5v-610zM817 418q23 0 39 -16.5t16 -38.5v0q0 -23 -16 -39t-39 -16h-610q-23 0 -39 16t-16 39v0q0 22 16 38.5t39 16.5h610zM817 418z" />
|
||||
<glyph glyph-name="biaoqing" unicode="" horiz-adv-x="1025"
|
||||
d="M512 -128q-103 0 -196.5 38.5t-166 111t-111 166t-38.5 196.5t38.5 196.5t111.5 166t166.5 111t196 38.5t196 -38.5t165.5 -111.5q99 -98 133.5 -230t-0.5 -264t-133 -230q-72 -73 -165.5 -111.5t-196.5 -38.5v0v0v0v0v0zM512 829q-89 0 -170.5 -33.5t-144.5 -96.5
|
||||
t-96.5 -144.5t-33.5 -170.5t33.5 -170.5t96.5 -144.5t144.5 -96.5t170.5 -33.5t170.5 33.5t144.5 96.5q85 85 115.5 200t0 229.5t-115.5 200.5q-63 63 -144.5 96.5t-170.5 33.5v0v0v0v0v0zM330 244q3 -4 7.5 -10.5t21.5 -23t36.5 -29t51 -23t65.5 -10.5t67.5 10t56.5 24
|
||||
@@ -365,7 +374,14 @@ d="M773 89zM890 575h-731l365 -365z" />
|
||||
d="M765 615q5 0 11.5 -0.5t24.5 -5.5t31.5 -14.5t24.5 -30.5t11 -50q1 -2 1 -5.5t-1.5 -13.5t-4.5 -19.5t-10 -21t-17.5 -20t-29 -14.5t-41.5 -6q-4 -1 -10.5 -0.5t-24 6t-30.5 15t-24 30.5t-10 49q0 4 0.5 10t5.5 22.5t14.5 29.5t30 25t48.5 14zM968 771q3 -1 6.5 -1.5
|
||||
t13 -3.5t16.5 -8t13 -15.5t6 -23.5v-713q-1 -2 -1.5 -5.5t-3.5 -12.5t-8.5 -16t-16 -12.5t-25.5 -5.5v817zM1 6q1 -2 1 -6t3.5 -12.5t8.5 -15.5t15.5 -12.5t24.5 -5.5h914v150h-99l-203 207l-153 -154l-209 257l-205 -308l-45 -1l-2 613h-51v-712v0zM968 771h-914
|
||||
q-3 0 -6.5 -0.5t-12.5 -3t-15.5 -7.5t-12.5 -16t-6 -25h967v52z" />
|
||||
<glyph glyph-name="loading1" unicode=""
|
||||
d="M441 756.5q0 -29.5 21 -50t50 -20.5t50 20.5t21 50t-21 50t-50 20.5t-50 -20.5t-21 -50zM167 640q0 -28 20.5 -48.5t48.5 -20.5t48.5 20.5t20.5 48.5t-20.5 48.5t-48.5 20.5t-48.5 -20.5t-20.5 -48.5zM63 382v0q0 -26 18.5 -44t44 -18t44 18t18.5 44v0q0 26 -18.5 44.5
|
||||
t-44 18.5t-44 -18.5t-18.5 -44.5zM174 100.5q0 -22.5 15.5 -38.5t38 -16t38.5 16t16 38.5t-16 38.5t-38.5 16t-38 -16t-15.5 -38.5zM467 -17v0q0 -19 14 -33t33.5 -14t33 14t13.5 33v0v0q0 20 -13.5 33.5t-33 13.5t-33.5 -13.5t-14 -33.5v0zM771 91v0q0 -14 10 -23.5
|
||||
t24 -9.5t24 9.5t10 23.5v0v0q0 14 -10 24t-24 10t-24 -10t-10 -24v0zM912 383q0 -10 7 -17t16.5 -7t17 7t7.5 17v0q0 10 -7.5 17t-17 7t-16.5 -7t-7 -17v0zM840 635v0q0 -7 5 -12t12 -5t12 5t5 12v0v0q0 7 -5 12t-12 5t-12 -5t-5 -12v0z" />
|
||||
<glyph glyph-name="xieti" unicode=""
|
||||
d="M898 834v-64h-129l-321 -772h128v-64h-450v64h129l321 772h-128v64h450z" />
|
||||
<glyph glyph-name="yuyin" unicode=""
|
||||
d="M463 644v0q-7 7 -16.5 7t-16.5 -7t-7 -17t7 -17q93 -93 93 -226t-93 -226q-7 -7 -7 -17t7 -17t16.5 -7t16.5 7q53 53 81 122q27 66 27 138t-27 138q-28 69 -81 122zM782 619v0q-47 117 -137 206q-7 7 -17 7t-17 -7t-7 -16.5t7 -16.5q83 -83 127 -191q42 -104 42 -217
|
||||
t-42 -217q-44 -107 -127 -191q-7 -7 -7 -16.5t7 -16.5t17 -7t17 7q90 89 137 206q46 113 46 235t-46 235zM299 427.5q-18 18.5 -43 18.5t-43.5 -18t-18.5 -43.5t18 -43.5t43.5 -18t43.5 18t18 43t-18 43.5z" />
|
||||
</font>
|
||||
</defs></svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 59 KiB |
Binary file not shown.
Binary file not shown.
11
src/lay/all-mobile.js
Normal file
11
src/lay/all-mobile.js
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
|
||||
@Name:用于打包移动完整版
|
||||
@Author:贤心
|
||||
@License:LGPL
|
||||
|
||||
*/
|
||||
|
||||
layui.define(function(exports){
|
||||
exports('layui.mobile', layui.v);
|
||||
});
|
||||
@@ -57,6 +57,17 @@ layui.define('jquery', function(exports){
|
||||
return this;
|
||||
};
|
||||
|
||||
//动态改变进度条
|
||||
Element.prototype.progress = function(filter, percent){
|
||||
var ELEM = 'layui-progress'
|
||||
,elem = $('.'+ ELEM +'[lay-filter='+ filter +']')
|
||||
,elemBar = elem.find('.'+ ELEM +'-bar')
|
||||
,text = elemBar.find('.'+ ELEM +'-text');
|
||||
elemBar.css('width', percent);
|
||||
text.text(percent);
|
||||
return this;
|
||||
};
|
||||
|
||||
var NAV_ELEM = '.layui-nav', NAV_ITEM = 'layui-nav-item', NAV_BAR = 'layui-nav-bar'
|
||||
,NAV_TREE = 'layui-nav-tree', NAV_CHILD = 'layui-nav-child', NAV_MORE = 'layui-nav-more'
|
||||
,NAV_ANIM = 'layui-anim layui-anim-upbit'
|
||||
@@ -275,9 +286,10 @@ layui.define('jquery', function(exports){
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//面包屑
|
||||
,breadcrumb: function(){
|
||||
var ELEM = '.layui-breadcrumb'
|
||||
var ELEM = '.layui-breadcrumb';
|
||||
|
||||
$(ELEM).each(function(){
|
||||
var othis = $(this)
|
||||
@@ -291,6 +303,23 @@ layui.define('jquery', function(exports){
|
||||
othis.css('visibility', 'visible');
|
||||
});
|
||||
}
|
||||
|
||||
//进度条
|
||||
,progress: function(){
|
||||
var ELEM = 'layui-progress';
|
||||
|
||||
$('.'+ELEM).each(function(){
|
||||
var othis = $(this)
|
||||
,elemBar = othis.find('.layui-progress-bar')
|
||||
,width = elemBar.attr('lay-percent');
|
||||
elemBar.css('width', width);
|
||||
if(othis.attr('lay-showPercent')){
|
||||
setTimeout(function(){
|
||||
elemBar.html('<span class="'+ ELEM +'-text">'+ Math.round(elemBar.width()/othis.width()*100) +'%</span>');
|
||||
},350);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return layui.each(items, function(index, item){
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
@Name:layui.form 表单组件
|
||||
@Author:贤心
|
||||
@License:LGPL
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
|
||||
@@ -264,21 +264,25 @@ layui.define('layer', function(exports){
|
||||
|
||||
//开始校验
|
||||
layui.each(verifyElem, function(_, item){
|
||||
var othis = $(this), ver = othis.attr('lay-verify'), tips = '';
|
||||
var value = othis.val(), isFn = typeof verify[ver] === 'function';
|
||||
var othis = $(this), ver = othis.attr('lay-verify').split('|');
|
||||
var tips = '', value = othis.val();
|
||||
othis.removeClass(DANGER);
|
||||
if(verify[ver] && (isFn ? tips = verify[ver](value, item) : !verify[ver][0].test(value)) ){
|
||||
layer.msg(tips || verify[ver][1], {
|
||||
icon: 5
|
||||
,shift: 6
|
||||
});
|
||||
//非移动设备自动定位焦点
|
||||
if(!device.android && !device.ios){
|
||||
item.focus();
|
||||
layui.each(ver, function(_, thisVer){
|
||||
var isFn = typeof verify[thisVer] === 'function';
|
||||
if(verify[thisVer] && (isFn ? tips = verify[thisVer](value, item) : !verify[thisVer][0].test(value)) ){
|
||||
layer.msg(tips || verify[thisVer][1], {
|
||||
icon: 5
|
||||
,shift: 6
|
||||
});
|
||||
//非移动设备自动定位焦点
|
||||
if(!device.android && !device.ios){
|
||||
item.focus();
|
||||
}
|
||||
othis.addClass(DANGER);
|
||||
return stop = true;
|
||||
}
|
||||
othis.addClass(DANGER);
|
||||
return stop = true;
|
||||
}
|
||||
});
|
||||
if(stop) return stop;
|
||||
});
|
||||
|
||||
if(stop) return false;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@Name:layer v3.0.1 Web弹层组件
|
||||
@Author:贤心
|
||||
@Site:http://layer.layui.com
|
||||
@License:LGPL
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
|
||||
@@ -248,7 +248,7 @@ Class.pt.creat = function(){
|
||||
,conType = typeof content === 'object'
|
||||
,body = $('body');
|
||||
|
||||
if($('#'+config.id)[0]) return;
|
||||
if(config.id && $('#'+config.id)[0]) return;
|
||||
|
||||
if(typeof config.area === 'string'){
|
||||
config.area = config.area === 'auto' ? ['', ''] : [config.area, ''];
|
||||
@@ -565,12 +565,13 @@ Class.pt.move = function(){
|
||||
,height: dict.area[1] + Y
|
||||
})
|
||||
dict.isResize = true;
|
||||
config.resizing && config.resizing(layero);
|
||||
}
|
||||
}).on('mouseup', function(e){
|
||||
if(dict.moveStart){
|
||||
delete dict.moveStart;
|
||||
ready.moveElem.hide();
|
||||
config.moveEnd && config.moveEnd();
|
||||
config.moveEnd && config.moveEnd(layero);
|
||||
}
|
||||
if(dict.resizeStart){
|
||||
delete dict.resizeStart;
|
||||
|
||||
30
src/lay/modules/mobile.js
Normal file
30
src/lay/modules/mobile.js
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
|
||||
@Name:layui 移动模块入口 | 构建后则为移动模块集合
|
||||
@Author:贤心
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
|
||||
|
||||
if(!layui['layui.mobile']){
|
||||
layui.config({
|
||||
base: layui.cache.dir + 'lay/modules/mobile/'
|
||||
}).extend({
|
||||
'layer-mobile': 'layer-mobile'
|
||||
,'zepto': 'zepto'
|
||||
,'upload-mobile': 'upload-mobile'
|
||||
,'layim-mobile': 'layim-mobile'
|
||||
});
|
||||
}
|
||||
|
||||
layui.define([
|
||||
'layer-mobile'
|
||||
,'zepto'
|
||||
,'layim-mobile'
|
||||
], function(exports){
|
||||
exports('mobile', {
|
||||
layer: layui['layer-mobile'] //弹层
|
||||
,layim: layui['layim-mobile'] //WebIM
|
||||
});
|
||||
});
|
||||
189
src/lay/modules/mobile/layer-mobile.js
Normal file
189
src/lay/modules/mobile/layer-mobile.js
Normal file
@@ -0,0 +1,189 @@
|
||||
/*!
|
||||
|
||||
@Name:layer mobile v2.0 弹层组件移动版
|
||||
@Author:贤心
|
||||
@Site:http://layer.layui.com/mobie/
|
||||
@License:LGPL
|
||||
|
||||
*/
|
||||
|
||||
layui.define(function(exports){
|
||||
|
||||
"use strict";
|
||||
|
||||
var win = window, doc = document, query = 'querySelectorAll', claname = 'getElementsByClassName', S = function(s){
|
||||
return doc[query](s);
|
||||
};
|
||||
|
||||
//默认配置
|
||||
var config = {
|
||||
type: 0
|
||||
,shade: true
|
||||
,shadeClose: true
|
||||
,fixed: true
|
||||
,anim: 'scale' //默认动画类型
|
||||
};
|
||||
|
||||
var ready = {
|
||||
extend: function(obj){
|
||||
var newobj = JSON.parse(JSON.stringify(config));
|
||||
for(var i in obj){
|
||||
newobj[i] = obj[i];
|
||||
}
|
||||
return newobj;
|
||||
},
|
||||
timer: {}, end: {}
|
||||
};
|
||||
|
||||
//点触事件
|
||||
ready.touch = function(elem, fn){
|
||||
elem.addEventListener('click', function(e){
|
||||
fn.call(this, e);
|
||||
}, false);
|
||||
};
|
||||
|
||||
var index = 0, classs = ['layui-m-layer'], Layer = function(options){
|
||||
var that = this;
|
||||
that.config = ready.extend(options);
|
||||
that.view();
|
||||
};
|
||||
|
||||
Layer.prototype.view = function(){
|
||||
var that = this, config = that.config, layerbox = doc.createElement('div');
|
||||
|
||||
that.id = layerbox.id = classs[0] + index;
|
||||
layerbox.setAttribute('class', classs[0] + ' ' + classs[0]+(config.type || 0));
|
||||
layerbox.setAttribute('index', index);
|
||||
|
||||
//标题区域
|
||||
var title = (function(){
|
||||
var titype = typeof config.title === 'object';
|
||||
return config.title
|
||||
? '<h3 style="'+ (titype ? config.title[1] : '') +'">'+ (titype ? config.title[0] : config.title) +'</h3>'
|
||||
: '';
|
||||
}());
|
||||
|
||||
//按钮区域
|
||||
var button = (function(){
|
||||
typeof config.btn === 'string' && (config.btn = [config.btn]);
|
||||
var btns = (config.btn || []).length, btndom;
|
||||
if(btns === 0 || !config.btn){
|
||||
return '';
|
||||
}
|
||||
btndom = '<span yes type="1">'+ config.btn[0] +'</span>'
|
||||
if(btns === 2){
|
||||
btndom = '<span no type="0">'+ config.btn[1] +'</span>' + btndom;
|
||||
}
|
||||
return '<div class="layui-m-layerbtn">'+ btndom + '</div>';
|
||||
}());
|
||||
|
||||
if(!config.fixed){
|
||||
config.top = config.hasOwnProperty('top') ? config.top : 100;
|
||||
config.style = config.style || '';
|
||||
config.style += ' top:'+ ( doc.body.scrollTop + config.top) + 'px';
|
||||
}
|
||||
|
||||
if(config.type === 2){
|
||||
config.content = '<i></i><i class="layui-m-layerload"></i><i></i><p>'+ (config.content||'') +'</p>';
|
||||
}
|
||||
|
||||
if(config.skin) config.anim = 'up';
|
||||
if(config.skin === 'msg') config.shade = false;
|
||||
|
||||
layerbox.innerHTML = (config.shade ? '<div '+ (typeof config.shade === 'string' ? 'style="'+ config.shade +'"' : '') +' class="layui-m-layershade"></div>' : '')
|
||||
+'<div class="layui-m-layermain" '+ (!config.fixed ? 'style="position:static;"' : '') +'>'
|
||||
+'<div class="layui-m-layersection">'
|
||||
+'<div class="layui-m-layerchild '+ (config.skin ? 'layui-m-layer-' + config.skin + ' ' : '') + (config.className ? config.className : '') + ' ' + (config.anim ? 'layui-m-anim-' + config.anim : '') +'" ' + ( config.style ? 'style="'+config.style+'"' : '' ) +'>'
|
||||
+ title
|
||||
+'<div class="layui-m-layercont">'+ config.content +'</div>'
|
||||
+ button
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
+'</div>';
|
||||
|
||||
if(!config.type || config.type === 2){
|
||||
var dialogs = doc[claname](classs[0] + config.type), dialen = dialogs.length;
|
||||
if(dialen >= 1){
|
||||
layer.close(dialogs[0].getAttribute('index'))
|
||||
}
|
||||
}
|
||||
|
||||
document.body.appendChild(layerbox);
|
||||
var elem = that.elem = S('#'+that.id)[0];
|
||||
config.success && config.success(elem);
|
||||
|
||||
that.index = index++;
|
||||
that.action(config, elem);
|
||||
};
|
||||
|
||||
Layer.prototype.action = function(config, elem){
|
||||
var that = this;
|
||||
|
||||
//自动关闭
|
||||
if(config.time){
|
||||
ready.timer[that.index] = setTimeout(function(){
|
||||
layer.close(that.index);
|
||||
}, config.time*1000);
|
||||
}
|
||||
|
||||
//确认取消
|
||||
var btn = function(){
|
||||
var type = this.getAttribute('type');
|
||||
if(type == 0){
|
||||
config.no && config.no();
|
||||
layer.close(that.index);
|
||||
} else {
|
||||
config.yes ? config.yes(that.index) : layer.close(that.index);
|
||||
}
|
||||
};
|
||||
if(config.btn){
|
||||
var btns = elem[claname]('layui-m-layerbtn')[0].children, btnlen = btns.length;
|
||||
for(var ii = 0; ii < btnlen; ii++){
|
||||
ready.touch(btns[ii], btn);
|
||||
}
|
||||
}
|
||||
|
||||
//点遮罩关闭
|
||||
if(config.shade && config.shadeClose){
|
||||
var shade = elem[claname]('layui-m-layershade')[0];
|
||||
ready.touch(shade, function(){
|
||||
layer.close(that.index, config.end);
|
||||
});
|
||||
}
|
||||
|
||||
config.end && (ready.end[that.index] = config.end);
|
||||
};
|
||||
|
||||
var layer = {
|
||||
v: '2.0 m',
|
||||
index: index,
|
||||
|
||||
//核心方法
|
||||
open: function(options){
|
||||
var o = new Layer(options || {});
|
||||
return o.index;
|
||||
},
|
||||
|
||||
close: function(index){
|
||||
var ibox = S('#'+classs[0]+index)[0];
|
||||
if(!ibox) return;
|
||||
ibox.innerHTML = '';
|
||||
doc.body.removeChild(ibox);
|
||||
clearTimeout(ready.timer[index]);
|
||||
delete ready.timer[index];
|
||||
typeof ready.end[index] === 'function' && ready.end[index]();
|
||||
delete ready.end[index];
|
||||
},
|
||||
|
||||
//关闭所有layer层
|
||||
closeAll: function(){
|
||||
var boxs = doc[claname](classs[0]);
|
||||
for(var i = 0, len = boxs.length; i < len; i++){
|
||||
layer.close((boxs[0].getAttribute('index')|0));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
exports('layer-mobile', layer);
|
||||
|
||||
});
|
||||
11
src/lay/modules/mobile/layim-mobile-open.js
Normal file
11
src/lay/modules/mobile/layim-mobile-open.js
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
|
||||
@Name:layim mobile 开源包
|
||||
@Author:贤心
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
|
||||
layui.define(function(exports){
|
||||
exports('layim-mobile', layui.v);
|
||||
});
|
||||
689
src/lay/modules/mobile/layim-mobile.js
Normal file
689
src/lay/modules/mobile/layim-mobile.js
Normal file
@@ -0,0 +1,689 @@
|
||||
/**
|
||||
|
||||
@Name:layim mobile 1.0.2 Beta 临时版
|
||||
@Author:贤心
|
||||
@Site:http://layim.layui.com
|
||||
@License:LGPL
|
||||
|
||||
*/
|
||||
|
||||
layui.define(['laytpl', 'upload-mobile', 'layer-mobile', 'zepto'], function(exports){
|
||||
|
||||
var v = '1.0 Beta';
|
||||
var $ = layui.zepto;
|
||||
var laytpl = layui.laytpl;
|
||||
var layer = layui['layer-mobile'];
|
||||
var upload = layui['upload-mobile'];
|
||||
|
||||
var SHOW = 'layui-show', THIS = 'layim-this', MAX_ITEM = 20;
|
||||
|
||||
//回调
|
||||
var call = {};
|
||||
|
||||
//对外API
|
||||
var LAYIM = function(){
|
||||
this.v = v;
|
||||
$('body').on('click', '*[layim-event]', function(e){
|
||||
var othis = $(this), methid = othis.attr('layim-event');
|
||||
events[methid] ? events[methid].call(this, othis, e) : '';
|
||||
});
|
||||
};
|
||||
|
||||
//底部弹出
|
||||
layer.popBottom = function(options){
|
||||
layer.close(layer.popBottom.index);
|
||||
layer.popBottom.index = layer.open($.extend({
|
||||
type: 1
|
||||
,content: options.content || ''
|
||||
,shade: false
|
||||
,className: 'layim-layer'
|
||||
}, options));
|
||||
};
|
||||
|
||||
//基础配置
|
||||
LAYIM.prototype.config = function(options){
|
||||
options = options || {};
|
||||
options = $.extend({
|
||||
title: '我的IM'
|
||||
,isfriend: !0
|
||||
,voice: 'default.mp3'
|
||||
,chatTitleColor: '#36373C'
|
||||
}, options);
|
||||
init(options);
|
||||
};
|
||||
|
||||
//监听事件
|
||||
LAYIM.prototype.on = function(events, callback){
|
||||
if(typeof callback === 'function'){
|
||||
call[events] ? call[events].push(callback) : call[events] = [callback];
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
//打开一个自定义的会话界面
|
||||
LAYIM.prototype.chat = function(data){
|
||||
if(!window.JSON || !window.JSON.parse) return;
|
||||
return popchat(data), this;
|
||||
};
|
||||
|
||||
//获取所有缓存数据
|
||||
LAYIM.prototype.cache = function(){
|
||||
return cache;
|
||||
};
|
||||
|
||||
//接受消息
|
||||
LAYIM.prototype.getMessage = function(data){
|
||||
return getMessage(data), this;
|
||||
};
|
||||
|
||||
//设置当前会话状态
|
||||
LAYIM.prototype.setChatStatus = function(str){
|
||||
var thatChat = thisChat(), status = thatChat.elem.find('.layim-chat-status');
|
||||
return status.html(str), this;
|
||||
};
|
||||
|
||||
//解析聊天内容
|
||||
LAYIM.prototype.content = function(content){
|
||||
return layui.data.content(content);
|
||||
};
|
||||
|
||||
//列表内容模板
|
||||
var listTpl = function(options){
|
||||
var nodata = {
|
||||
friend: "该分组下暂无好友"
|
||||
,group: "暂无群组"
|
||||
,history: "暂无消息"
|
||||
};
|
||||
|
||||
options = options || {};
|
||||
options.item = options.item || ('d.' + options.type);
|
||||
|
||||
return ['{{# var length = 0; layui.each('+ options.item +', function(i, data){ length++; }}'
|
||||
,'<li layim-event="chat" data-type="'+ options.type +'" data-index="{{ '+ (options.index||'i') +' }}" id="layim-'+ options.type +'{{ data.id }}" {{ data.status === "offline" ? "class=layim-list-gray" : "" }}><img src="{{ data.avatar }}"><span>{{ data.username||data.groupname||data.name||"佚名" }}</span><p>{{ data.remark||data.sign||"" }}</p></li>'
|
||||
,'{{# }); if(length === 0){ }}'
|
||||
,'<li class="layim-null">'+ (nodata[options.type] || "暂无数据") +'</li>'
|
||||
,'{{# } }}'].join('');
|
||||
};
|
||||
|
||||
//主界面模版
|
||||
var elemTpl = ['<div class="layui-layim">'
|
||||
,'<div class="layim-chat-title" style="background-color: {{d.base.chatTitleColor}};">'
|
||||
,'<p>{{ d.base.title }}</p>'
|
||||
,'</div>'
|
||||
,'<ul class="layui-unselect layim-tab-content {{# if(d.base.isfriend){ }}layui-show{{# } }} layim-list-friend">'
|
||||
,'{{# layui.each(d.friend, function(index, item){ var spread = d.local["spread"+index]; }}'
|
||||
,'<li>'
|
||||
,'<h5 layim-event="spread" lay-type="{{ spread }}"><i class="layui-icon">{{# if(spread === "true"){ }}{{# } else { }}{{# } }}</i><span>{{ item.groupname||"未命名分组"+index }}</span><em>(<cite class="layim-count"> {{ (item.list||[]).length }}</cite>)</em></h5>'
|
||||
,'<ul class="layui-layim-list {{# if(spread === "true"){ }}'
|
||||
,' layui-show'
|
||||
,'{{# } }}">'
|
||||
,listTpl({
|
||||
type: "friend"
|
||||
,item: "item.list"
|
||||
,index: "index"
|
||||
})
|
||||
,'</ul>'
|
||||
,'</li>'
|
||||
,'{{# }); if(d.friend.length === 0){ }}'
|
||||
,'<li><ul class="layui-layim-list layui-show"><li class="layim-null">暂无联系人</li></ul>'
|
||||
,'{{# } }}'
|
||||
,'</ul>'
|
||||
,'<ul class="layui-unselect layui-layim-tab">'
|
||||
,'<li class="layui-icon" title="会话" layim-event="tab" lay-type="history"></li>'
|
||||
,'<li class="layui-icon" title="联系人" layim-event="tab" lay-type="friend"></li>'
|
||||
,'</ul>'
|
||||
,'</div>'].join('');
|
||||
|
||||
//聊天主模板
|
||||
var elemChatTpl = ['<div class="layim-chat layim-chat-{{d.data.type}}{{d.first ? " layui-show" : ""}}">'
|
||||
,'{{# if(d.base.chatTitleColor){ }}'
|
||||
,'<div class="layim-chat-title" style="background-color: {{d.base.chatTitleColor}};">'
|
||||
,'<p><i class="layui-icon layim-chat-back" layim-event="backList"></i> {{ d.data.name }}<span class="layim-chat-status"></span> </p>'
|
||||
,'</div>'
|
||||
,'{{# } }}'
|
||||
,'<div class="layim-chat-main" {{d.base.chatTitleColor ? "" : "nonetitle"}}>'
|
||||
,'<ul></ul>'
|
||||
,'</div>'
|
||||
,'<div class="layim-chat-footer">'
|
||||
,'<div class="layim-chat-send"><input type="text" autocomplete="off"><button class="layim-send layui-disabled" layim-event="send">发送</button></div>'
|
||||
,'<div class="layim-chat-tool" data-json="{{encodeURIComponent(JSON.stringify(d.data))}}">'
|
||||
,'<span class="layui-icon layim-tool-face" title="选择表情" layim-event="face"></span>'
|
||||
,'{{# if(d.base && d.base.uploadImage){ }}'
|
||||
,'<span class="layui-icon layim-tool-image" title="上传图片" layim-event="image"><input type="file" name="file" accept="image/*"></span>'
|
||||
,'{{# }; }}'
|
||||
,'{{# if(d.base && d.base.uploadFile){ }}'
|
||||
,'<span class="layui-icon layim-tool-image" title="发送文件" layim-event="image" data-type="file"><input type="file" name="file"></span>'
|
||||
,'{{# }; }}'
|
||||
,'{{# layui.each(d.base.tool, function(index, item){ }}'
|
||||
,'<span class="layui-icon layim-tool-{{item.alias}}" title="{{item.title}}" layim-event="extend" lay-filter="{{ item.alias }}">{{item.icon}}</span>'
|
||||
,'{{# }); }}'
|
||||
,'</div>'
|
||||
,'</div>'
|
||||
,'</div>'].join('');
|
||||
|
||||
//补齐数位
|
||||
var digit = function(num){
|
||||
return num < 10 ? '0' + (num|0) : num;
|
||||
};
|
||||
|
||||
//转换时间
|
||||
layui.data.date = function(timestamp){
|
||||
var d = new Date(timestamp||new Date());
|
||||
return digit(d.getMonth() + 1) + '-' + digit(d.getDate())
|
||||
+ ' ' + digit(d.getHours()) + ':' + digit(d.getMinutes());
|
||||
};
|
||||
|
||||
//转换内容
|
||||
layui.data.content = function(content){
|
||||
//支持的html标签
|
||||
var html = function(end){
|
||||
return new RegExp('\\n*\\['+ (end||'') +'(pre|div|p|table|thead|th|tbody|tr|td|ul|li|ol|li|dl|dt|dd|h2|h3|h4|h5)([\\s\\S]*?)\\]\\n*', 'g');
|
||||
};
|
||||
content = (content||'').replace(/&(?!#?[a-zA-Z0-9]+;)/g, '&')
|
||||
.replace(/</g, '<').replace(/>/g, '>').replace(/'/g, ''').replace(/"/g, '"') //XSS
|
||||
.replace(/@(\S+)(\s+?|$)/g, '@<a href="javascript:;">$1</a>$2') //转义@
|
||||
|
||||
.replace(/face\[([^\s\[\]]+?)\]/g, function(face){ //转义表情
|
||||
var alt = face.replace(/^face/g, '');
|
||||
return '<img alt="'+ alt +'" title="'+ alt +'" src="' + faces[alt] + '">';
|
||||
})
|
||||
.replace(/img\[([^\s]+?)\]/g, function(img){ //转义图片
|
||||
return '<img class="layui-layim-photos" src="' + img.replace(/(^img\[)|(\]$)/g, '') + '">';
|
||||
})
|
||||
.replace(/file\([\s\S]+?\)\[[\s\S]*?\]/g, function(str){ //转义文件
|
||||
var href = (str.match(/file\(([\s\S]+?)\)\[/)||[])[1];
|
||||
var text = (str.match(/\)\[([\s\S]*?)\]/)||[])[1];
|
||||
if(!href) return str;
|
||||
return '<a class="layui-layim-file" href="'+ href +'" download target="_blank"><i class="layui-icon"></i><cite>'+ (text||href) +'</cite></a>';
|
||||
})
|
||||
.replace(/audio\[([^\s]+?)\]/g, function(audio){ //转义音频
|
||||
return '<div class="layui-unselect layui-layim-audio" layim-event="playAudio" data-src="' + audio.replace(/(^audio\[)|(\]$)/g, '') + '"><i class="layui-icon"></i><p>音频消息</p></div>';
|
||||
})
|
||||
.replace(/video\[([^\s]+?)\]/g, function(video){ //转义音频
|
||||
return '<div class="layui-unselect layui-layim-video" layim-event="playVideo" data-src="' + video.replace(/(^video\[)|(\]$)/g, '') + '"><i class="layui-icon"></i></div>';
|
||||
})
|
||||
|
||||
.replace(/a\([\s\S]+?\)\[[\s\S]*?\]/g, function(str){ //转义链接
|
||||
var href = (str.match(/a\(([\s\S]+?)\)\[/)||[])[1];
|
||||
var text = (str.match(/\)\[([\s\S]*?)\]/)||[])[1];
|
||||
if(!href) return str;
|
||||
return '<a href="'+ href +'" target="_blank">'+ (text||href) +'</a>';
|
||||
}).replace(html(), '\<$1 $2\>').replace(html('/'), '\</$1\>') //转移HTML代码
|
||||
.replace(/\n/g, '<br>') //转义换行
|
||||
return content;
|
||||
};
|
||||
|
||||
var elemChatMain = ['<li class="layim-chat-li{{ d.mine ? " layim-chat-mine" : "" }}">'
|
||||
,'<div class="layim-chat-user"><img src="{{ d.avatar }}"><cite>'
|
||||
,'{{ d.username||"佚名" }}'
|
||||
,'</cite></div>'
|
||||
,'<div class="layim-chat-text">{{ layui.data.content(d.content||" ") }}</div>'
|
||||
,'</li>'].join('');
|
||||
|
||||
//处理初始化信息
|
||||
var cache = {message: {}, chat: []}, init = function(options){
|
||||
var init = options.init || {}
|
||||
mine = init.mine || {}
|
||||
,local = layui.data('layim-mobile')[mine.id] || {}
|
||||
,obj = {
|
||||
base: options
|
||||
,local: local
|
||||
,mine: mine
|
||||
,history: local.history || {}
|
||||
}, create = function(data){
|
||||
var mine = data.mine || {};
|
||||
var local = layui.data('layim-mobile')[mine.id] || {}, obj = {
|
||||
base: options //基础配置信息
|
||||
,local: local //本地数据
|
||||
,mine: mine //我的用户信息
|
||||
,friend: data.friend || [] //联系人信息
|
||||
,group: data.group || [] //群组信息
|
||||
,history: local.history || {} //历史会话信息
|
||||
};
|
||||
cache = $.extend(cache, obj);
|
||||
popim(laytpl(elemTpl).render(obj));
|
||||
layui.each(call.ready, function(index, item){
|
||||
item && item(obj);
|
||||
});
|
||||
};
|
||||
cache = $.extend(cache, obj);
|
||||
if(options.brief){
|
||||
return layui.each(call.ready, function(index, item){
|
||||
item && item(obj);
|
||||
});
|
||||
};
|
||||
create(init)
|
||||
};
|
||||
|
||||
//显示好友列表面板
|
||||
var popim = function(content){
|
||||
return layer.open({
|
||||
type: 1
|
||||
,shade: false
|
||||
,anim: -1
|
||||
,content: content
|
||||
,success: function(layero){
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//显示聊天面板
|
||||
var layimChat, layimMin, To = {}, popchat = function(data){
|
||||
data = data || {};
|
||||
|
||||
var chat = $('#layui-layim-chat'), render = {
|
||||
data: data
|
||||
,base: cache.base
|
||||
,local: cache.local
|
||||
};
|
||||
|
||||
if(!data.id){
|
||||
return layer.msg('非法用户');
|
||||
}
|
||||
|
||||
layer.close(popchat.index);
|
||||
|
||||
return popchat.index = layer.open({
|
||||
type: 1
|
||||
,className: 'layui-layim-chat'
|
||||
,shade: false
|
||||
,anim: -1
|
||||
,content: laytpl(elemChatTpl).render(render)
|
||||
,success: function(elem){
|
||||
layimChat = $(elem);
|
||||
|
||||
hotkeySend();
|
||||
viewChatlog();
|
||||
|
||||
//聊天窗口的切换监听
|
||||
layui.each(call.chatChange, function(index, item){
|
||||
item && item(thisChat());
|
||||
});
|
||||
}
|
||||
,end: function(){
|
||||
layimChat = null;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//获取当前聊天面板
|
||||
var thisChat = function(){
|
||||
var cont = layimChat.find('.layim-chat');
|
||||
var to = JSON.parse(decodeURIComponent(cont.find('.layim-chat-tool').data('json')));
|
||||
return {
|
||||
elem: cont
|
||||
,data: to
|
||||
,textarea: cont.find('input')
|
||||
};
|
||||
};
|
||||
|
||||
//发送消息
|
||||
var sendMessage = function(){
|
||||
var data = {
|
||||
username: cache.mine ? cache.mine.username : '访客'
|
||||
,avatar: cache.mine ? cache.mine.avatar : (layui.cache.dir+'css/pc/layim/skin/logo.jpg')
|
||||
,id: cache.mine ? cache.mine.id : null
|
||||
,mine: true
|
||||
};
|
||||
var thatChat = thisChat(), ul = thatChat.elem.find('.layim-chat-main ul');
|
||||
var To = thatChat.data, maxLength = cache.base.maxLength || 3000;
|
||||
var time = new Date().getTime();
|
||||
|
||||
data.content = thatChat.textarea.val();
|
||||
|
||||
if(data.content === '') return;
|
||||
|
||||
if(data.content.length > maxLength){
|
||||
return layer.msg('内容最长不能超过'+ maxLength +'个字符')
|
||||
}
|
||||
|
||||
if(time - (sendMessage.time||0) > 60*1000){
|
||||
ul.append('<li class="layim-chat-system"><span>'+ layui.data.date() +'</span></li>');
|
||||
sendMessage.time = time;
|
||||
}
|
||||
ul.append(laytpl(elemChatMain).render(data));
|
||||
|
||||
var param = {
|
||||
mine: data
|
||||
,to: To
|
||||
}, message = {
|
||||
username: param.mine.username
|
||||
,avatar: param.mine.avatar
|
||||
,id: To.id
|
||||
,type: To.type
|
||||
,content: param.mine.content
|
||||
,timestamp: time
|
||||
,mine: true
|
||||
};
|
||||
pushChatlog(message);
|
||||
|
||||
layui.each(call.sendMessage, function(index, item){
|
||||
item && item(param);
|
||||
});
|
||||
|
||||
chatListMore();
|
||||
thatChat.textarea.val('').focus();
|
||||
};
|
||||
|
||||
//消息声音提醒
|
||||
var voice = function() {
|
||||
var audio = document.createElement("audio");
|
||||
audio.src = layui.cache.dir+'css/modules/layim/voice/'+ cache.base.voice;
|
||||
audio.play();
|
||||
};
|
||||
|
||||
//接受消息
|
||||
var messageNew = {}, getMessage = function(data){
|
||||
data = data || {};
|
||||
|
||||
var group = {}
|
||||
|
||||
data.timestamp = data.timestamp || new Date().getTime();
|
||||
data.system || pushChatlog(data);
|
||||
messageNew = JSON.parse(JSON.stringify(data));
|
||||
|
||||
if(cache.base.voice){
|
||||
voice();
|
||||
}
|
||||
|
||||
if(!layimChat && data.content){
|
||||
if(cache.message[data.type + data.id]){
|
||||
cache.message[data.type + data.id].push(data)
|
||||
} else {
|
||||
cache.message[data.type + data.id] = [data];
|
||||
|
||||
//记录聊天面板队列
|
||||
if(data.type === 'friend'){
|
||||
var friend;
|
||||
layui.each(cache.friend, function(index1, item1){
|
||||
layui.each(item1.list, function(index, item){
|
||||
if(item.id == data.id){
|
||||
item.type = 'friend';
|
||||
item.name = item.username;
|
||||
cache.chat.push(item);
|
||||
return friend = true;
|
||||
}
|
||||
});
|
||||
if(friend) return true;
|
||||
});
|
||||
if(!friend){
|
||||
data.name = data.username;
|
||||
data.temporary = true; //临时会话
|
||||
cache.chat.push(data);
|
||||
}
|
||||
} else if(data.type === 'group'){
|
||||
var isgroup;
|
||||
layui.each(cache.group, function(index, item){
|
||||
if(item.id == data.id){
|
||||
item.type = 'group';
|
||||
item.name = item.groupname;
|
||||
cache.chat.push(item);
|
||||
return isgroup = true;
|
||||
}
|
||||
});
|
||||
if(!isgroup){
|
||||
data.name = data.groupname;
|
||||
cache.chat.push(data);
|
||||
}
|
||||
} else {
|
||||
data.name = data.name || data.username || data.groupname;
|
||||
cache.chat.push(data);
|
||||
}
|
||||
}
|
||||
if(data.type === 'group'){
|
||||
layui.each(cache.group, function(index, item){
|
||||
if(item.id == data.id){
|
||||
group.avatar = item.avatar;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
if(!data.system){
|
||||
//显示消息提示区域
|
||||
}
|
||||
}
|
||||
|
||||
if(!layimChat) return;
|
||||
|
||||
var cont = layimChat.find('.layim-chat');
|
||||
var ul = cont.find('.layim-chat-main ul');
|
||||
|
||||
//系统消息
|
||||
if(data.system){
|
||||
ul.append('<li class="layim-chat-system"><span>'+ data.content +'</span></li>');
|
||||
} else if(data.content.replace(/\s/g, '') !== ''){
|
||||
if(data.timestamp - (sendMessage.time||0) > 60*1000){
|
||||
ul.append('<li class="layim-chat-system"><span>'+ layui.data.date(data.timestamp) +'</span></li>');
|
||||
sendMessage.time = data.timestamp;
|
||||
}
|
||||
ul.append(laytpl(elemChatMain).render(data));
|
||||
}
|
||||
|
||||
chatListMore();
|
||||
};
|
||||
|
||||
//存储最近MAX_ITEM条聊天记录到本地
|
||||
var pushChatlog = function(message){
|
||||
var local = layui.data('layim-mobile')[cache.mine.id] || {};
|
||||
var chatlog = local.chatlog || {};
|
||||
if(chatlog[message.type + message.id]){
|
||||
chatlog[message.type + message.id].push(message);
|
||||
if(chatlog[message.type + message.id].length > MAX_ITEM){
|
||||
chatlog[message.type + message.id].shift();
|
||||
}
|
||||
} else {
|
||||
chatlog[message.type + message.id] = [message];
|
||||
}
|
||||
local.chatlog = chatlog;
|
||||
layui.data('layim-mobile', {
|
||||
key: cache.mine.id
|
||||
,value: local
|
||||
});
|
||||
};
|
||||
|
||||
//渲染本地最新聊天记录到相应面板
|
||||
var viewChatlog = function(){
|
||||
var local = layui.data('layim-mobile')[cache.mine.id] || {};
|
||||
var thatChat = thisChat(), chatlog = local.chatlog || {};
|
||||
var ul = thatChat.elem.find('.layim-chat-main ul');
|
||||
layui.each(chatlog[thatChat.data.type + thatChat.data.id], function(index, item){
|
||||
if(new Date().getTime() > item.timestamp && item.timestamp - (sendMessage.time||0) > 60*1000){
|
||||
ul.append('<li class="layim-chat-system"><span>'+ layui.data.date(item.timestamp) +'</span></li>');
|
||||
sendMessage.time = item.timestamp;
|
||||
}
|
||||
ul.append(laytpl(elemChatMain).render(item));
|
||||
});
|
||||
chatListMore();
|
||||
};
|
||||
|
||||
//查看更多记录
|
||||
var chatListMore = function(){
|
||||
var thatChat = thisChat(), chatMain = thatChat.elem.find('.layim-chat-main');
|
||||
var ul = chatMain.find('ul'), li = ul.children('.layim-chat-li');
|
||||
|
||||
if(li.length >= MAX_ITEM){
|
||||
var first = li.eq(0);
|
||||
if(!ul.prev().hasClass('layim-chat-system')){
|
||||
ul.before('<div class="layim-chat-system"><span layim-event="chatLog">查看更多记录</span></div>');
|
||||
}
|
||||
first.remove();
|
||||
}
|
||||
chatMain.scrollTop(chatMain[0].scrollHeight + 1000);
|
||||
};
|
||||
|
||||
//快捷键发送
|
||||
var hotkeySend = function(){
|
||||
var thatChat = thisChat(), textarea = thatChat.textarea;
|
||||
var btn = textarea.next();
|
||||
textarea.off('keyup').on('keyup', function(e){
|
||||
var keyCode = e.keyCode;
|
||||
if(keyCode === 13){
|
||||
e.preventDefault();
|
||||
sendMessage();
|
||||
}
|
||||
btn[textarea.val() === '' ? 'addClass' : 'removeClass']('layui-disabled')
|
||||
});
|
||||
};
|
||||
|
||||
//表情库
|
||||
var faces = function(){
|
||||
var alt = ["[微笑]", "[嘻嘻]", "[哈哈]", "[可爱]", "[可怜]", "[挖鼻]", "[吃惊]", "[害羞]", "[挤眼]", "[闭嘴]", "[鄙视]", "[爱你]", "[泪]", "[偷笑]", "[亲亲]", "[生病]", "[太开心]", "[白眼]", "[右哼哼]", "[左哼哼]", "[嘘]", "[衰]", "[委屈]", "[吐]", "[哈欠]", "[抱抱]", "[怒]", "[疑问]", "[馋嘴]", "[拜拜]", "[思考]", "[汗]", "[困]", "[睡]", "[钱]", "[失望]", "[酷]", "[色]", "[哼]", "[鼓掌]", "[晕]", "[悲伤]", "[抓狂]", "[黑线]", "[阴险]", "[怒骂]", "[互粉]", "[心]", "[伤心]", "[猪头]", "[熊猫]", "[兔子]", "[ok]", "[耶]", "[good]", "[NO]", "[赞]", "[来]", "[弱]", "[草泥马]", "[神马]", "[囧]", "[浮云]", "[给力]", "[围观]", "[威武]", "[奥特曼]", "[礼物]", "[钟]", "[话筒]", "[蜡烛]", "[蛋糕]"], arr = {};
|
||||
layui.each(alt, function(index, item){
|
||||
arr[item] = layui.cache.dir + 'images/face/'+ index + '.gif';
|
||||
});
|
||||
return arr;
|
||||
}();
|
||||
|
||||
|
||||
var stope = layui.stope; //组件事件冒泡
|
||||
|
||||
//在焦点处插入内容
|
||||
var focusInsert = function(obj, str, nofocus){
|
||||
var result, val = obj.value;
|
||||
nofocus || obj.focus();
|
||||
if(document.selection){ //ie
|
||||
result = document.selection.createRange();
|
||||
document.selection.empty();
|
||||
result.text = str;
|
||||
} else {
|
||||
result = [val.substring(0, obj.selectionStart), str, val.substr(obj.selectionEnd)];
|
||||
nofocus || obj.focus();
|
||||
obj.value = result.join('');
|
||||
}
|
||||
};
|
||||
|
||||
//事件
|
||||
var anim = 'layui-anim-upbit', events = {
|
||||
//弹出聊天面板
|
||||
chat: function(othis){
|
||||
var local = layui.data('layim-mobile')[cache.mine.id] || {};
|
||||
var type = othis.data('type'), index = othis.data('index');
|
||||
var list = othis.attr('data-list') || othis.index(), data = {};
|
||||
if(type === 'friend'){
|
||||
data = cache[type][index].list[list];
|
||||
} else if(type === 'group'){
|
||||
data = cache[type][list];
|
||||
} else if(type === 'history'){
|
||||
data = (local.history || {})[index] || {};
|
||||
}
|
||||
data.name = data.name || data.username || data.groupname;
|
||||
if(type !== 'history'){
|
||||
data.type = type;
|
||||
}
|
||||
popchat(data);
|
||||
}
|
||||
|
||||
//展开联系人分组
|
||||
,spread: function(othis){
|
||||
var type = othis.attr('lay-type');
|
||||
var spread = type === 'true' ? 'false' : 'true';
|
||||
var local = layui.data('layim-mobile')[cache.mine.id] || {};
|
||||
othis.next()[type === 'true' ? 'removeClass' : 'addClass'](SHOW);
|
||||
local['spread' + othis.parent().index()] = spread;
|
||||
layui.data('layim-mobile', {
|
||||
key: cache.mine.id
|
||||
,value: local
|
||||
});
|
||||
othis.attr('lay-type', spread);
|
||||
othis.find('.layui-icon').html(spread === 'true' ? '' : '');
|
||||
}
|
||||
|
||||
//返回到好友列表
|
||||
,backList: function(){
|
||||
layer.close(popchat.index);
|
||||
}
|
||||
|
||||
//发送聊天内容
|
||||
,send: function(){
|
||||
sendMessage();
|
||||
}
|
||||
|
||||
//表情
|
||||
,face: function(othis, e){
|
||||
var content = '', thatChat = thisChat(), input = thatChat.textarea;
|
||||
layui.each(faces, function(key, item){
|
||||
content += '<li title="'+ key +'"><img src="'+ item +'"></li>';
|
||||
});
|
||||
content = '<ul class="layui-layim-face">'+ content +'</ul>';
|
||||
layer.popBottom({
|
||||
content: content
|
||||
,success: function(elem){
|
||||
var list = $(elem).find('.layui-layim-face>li')
|
||||
list.on('click', function(){
|
||||
focusInsert(input[0], 'face' + this.title + ' ', true);
|
||||
input.next()[input.val() === '' ? 'addClass' : 'removeClass']('layui-disabled');
|
||||
return false;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).off('click', events.faceHide).on('click', events.faceHide);
|
||||
stope(e);
|
||||
|
||||
} ,faceHide: function(){
|
||||
layer.close(layer.popBottom.index);
|
||||
}
|
||||
|
||||
//图片或一般文件
|
||||
,image: function(othis){
|
||||
var type = othis.data('type') || 'images', api = {
|
||||
images: 'uploadImage'
|
||||
,file: 'uploadFile'
|
||||
}
|
||||
,thatChat = thisChat(), conf = cache.base[api[type]] || {};
|
||||
upload({
|
||||
url: conf.url || ''
|
||||
,method: conf.type
|
||||
,elem: othis.find('input')[0]
|
||||
,unwrap: true
|
||||
,type: type
|
||||
,success: function(res){
|
||||
if(res.code == 0){
|
||||
res.data = res.data || {};
|
||||
if(type === 'images'){
|
||||
focusInsert(thatChat.textarea[0], 'img['+ (res.data.src||'') +']');
|
||||
} else if(type === 'file'){
|
||||
focusInsert(thatChat.textarea[0], 'file('+ (res.data.src||'') +')['+ (res.data.name||'下载文件') +']');
|
||||
}
|
||||
sendMessage();
|
||||
} else {
|
||||
layer.msg(res.msg||'上传失败');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//扩展工具栏
|
||||
,extend: function(othis){
|
||||
var filter = othis.attr('lay-filter')
|
||||
,thatChat = thisChat();
|
||||
|
||||
layui.each(call['tool('+ filter +')'], function(index, item){
|
||||
item && item(function(content){
|
||||
focusInsert(thatChat.textarea[0], content)
|
||||
});;
|
||||
});
|
||||
}
|
||||
|
||||
//聊天记录
|
||||
,chatLog: function(othis){
|
||||
var thatChat = thisChat();
|
||||
layui.each(call.chatlog, function(index, item){
|
||||
item && item({
|
||||
id: thatChat.data.id
|
||||
,type: thatChat.data.type
|
||||
,elem: thatChat.elem.find('.layim-chat-main>ul')
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
//暴露接口
|
||||
exports('layim-mobile', new LAYIM());
|
||||
|
||||
}).addcss(
|
||||
'modules/layim/mobile/layim.css?v=1.0Beta'
|
||||
,'skinlayim-mobilecss'
|
||||
);
|
||||
166
src/lay/modules/mobile/upload-mobile.js
Normal file
166
src/lay/modules/mobile/upload-mobile.js
Normal file
@@ -0,0 +1,166 @@
|
||||
/*!
|
||||
|
||||
@Title: layui.upload 单文件上传 - 全浏览器兼容版
|
||||
@Author: 贤心
|
||||
@License:LGPL
|
||||
|
||||
*/
|
||||
|
||||
layui.define(['layer-mobile', 'zepto'] , function(exports){
|
||||
"use strict";
|
||||
|
||||
var $ = layui.zepto;
|
||||
var layer = layui['layer-mobile'];
|
||||
var device = layui.device();
|
||||
|
||||
var elemDragEnter = 'layui-upload-enter';
|
||||
var elemIframe = 'layui-upload-iframe';
|
||||
|
||||
var msgConf = {
|
||||
icon: 2
|
||||
,shift: 6
|
||||
}, fileType = {
|
||||
file: '文件'
|
||||
,video: '视频'
|
||||
,audio: '音频'
|
||||
};
|
||||
|
||||
layer.msg = function(content){
|
||||
return layer.open({
|
||||
content: content || ''
|
||||
,skin: 'msg'
|
||||
,time: 0 //2秒后自动关闭
|
||||
});
|
||||
};
|
||||
|
||||
var Upload = function(options){
|
||||
this.options = options;
|
||||
};
|
||||
|
||||
//初始化渲染
|
||||
Upload.prototype.init = function(){
|
||||
var that = this, options = that.options;
|
||||
var body = $('body'), elem = $(options.elem || '.layui-upload-file');
|
||||
var iframe = $('<iframe id="'+ elemIframe +'" class="'+ elemIframe +'" name="'+ elemIframe +'"></iframe>');
|
||||
|
||||
//插入iframe
|
||||
$('#'+elemIframe)[0] || body.append(iframe);
|
||||
|
||||
return elem.each(function(index, item){
|
||||
item = $(item);
|
||||
var form = '<form target="'+ elemIframe +'" method="'+ (options.method||'post') +'" key="set-mine" enctype="multipart/form-data" action="'+ (options.url||'') +'"></form>';
|
||||
|
||||
var type = item.attr('lay-type') || options.type; //获取文件类型
|
||||
|
||||
//包裹ui元素
|
||||
if(!options.unwrap){
|
||||
form = '<div class="layui-box layui-upload-button">' + form + '<span class="layui-upload-icon"><i class="layui-icon"></i>'+ (
|
||||
item.attr('lay-title') || options.title|| ('上传'+ (fileType[type]||'图片') )
|
||||
) +'</span></div>';
|
||||
}
|
||||
|
||||
form = $(form);
|
||||
|
||||
//拖拽支持
|
||||
if(!options.unwrap){
|
||||
form.on('dragover', function(e){
|
||||
e.preventDefault();
|
||||
$(this).addClass(elemDragEnter);
|
||||
}).on('dragleave', function(){
|
||||
$(this).removeClass(elemDragEnter);
|
||||
}).on('drop', function(){
|
||||
$(this).removeClass(elemDragEnter);
|
||||
});
|
||||
}
|
||||
|
||||
//如果已经实例化,则移除包裹元素
|
||||
if(item.parent('form').attr('target') === elemIframe){
|
||||
if(options.unwrap){
|
||||
item.unwrap();
|
||||
} else {
|
||||
item.parent().next().remove();
|
||||
item.unwrap().unwrap();
|
||||
}
|
||||
};
|
||||
|
||||
//包裹元素
|
||||
item.wrap(form);
|
||||
|
||||
//触发上传
|
||||
item.off('change').on('change', function(){
|
||||
that.action(this, type);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
//提交上传
|
||||
Upload.prototype.action = function(input, type){
|
||||
var that = this, options = that.options, val = input.value;
|
||||
var item = $(input), ext = item.attr('lay-ext') || options.ext || ''; //获取支持上传的文件扩展名;
|
||||
|
||||
if(!val){
|
||||
return;
|
||||
};
|
||||
|
||||
//校验文件
|
||||
switch(type){
|
||||
case 'file': //一般文件
|
||||
if(ext && !RegExp('\\w\\.('+ ext +')$', 'i').test(escape(val))){
|
||||
layer.msg('不支持该文件格式', msgConf);
|
||||
return input.value = '';
|
||||
}
|
||||
break;
|
||||
case 'video': //视频文件
|
||||
if(!RegExp('\\w\\.('+ (ext||'avi|mp4|wma|rmvb|rm|flash|3gp|flv') +')$', 'i').test(escape(val))){
|
||||
layer.msg('不支持该视频格式', msgConf);
|
||||
return input.value = '';
|
||||
}
|
||||
break;
|
||||
case 'audio': //音频文件
|
||||
if(!RegExp('\\w\\.('+ (ext||'mp3|wav|mid') +')$', 'i').test(escape(val))){
|
||||
layer.msg('不支持该音频格式', msgConf);
|
||||
return input.value = '';
|
||||
}
|
||||
break;
|
||||
default: //图片文件
|
||||
if(!RegExp('\\w\\.('+ (ext||'jpg|png|gif|bmp|jpeg') +')$', 'i').test(escape(val))){
|
||||
layer.msg('不支持该图片格式', msgConf);
|
||||
return input.value = '';
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
options.before && options.before(input);
|
||||
item.parent().submit();
|
||||
|
||||
var iframe = $('#'+elemIframe), timer = setInterval(function() {
|
||||
var res;
|
||||
try {
|
||||
res = iframe.contents().find('body').text();
|
||||
} catch(e) {
|
||||
layer.msg('上传接口存在跨域', msgConf);
|
||||
clearInterval(timer);
|
||||
}
|
||||
if(res){
|
||||
clearInterval(timer);
|
||||
iframe.contents().find('body').html('');
|
||||
try {
|
||||
res = JSON.parse(res);
|
||||
} catch(e){
|
||||
res = {};
|
||||
return layer.msg('请对上传接口返回JSON字符', msgConf);
|
||||
}
|
||||
typeof options.success === 'function' && options.success(res, input);
|
||||
}
|
||||
}, 30);
|
||||
|
||||
input.value = '';
|
||||
};
|
||||
|
||||
//暴露接口
|
||||
exports('upload-mobile', function(options){
|
||||
var upload = new Upload(options = options || {});
|
||||
upload.init();
|
||||
});
|
||||
});
|
||||
|
||||
1646
src/lay/modules/mobile/zepto.js
Normal file
1646
src/lay/modules/mobile/zepto.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@
|
||||
|
||||
*/
|
||||
|
||||
layui.define('layer', function(exports){
|
||||
layui.define('layer' , function(exports){
|
||||
"use strict";
|
||||
|
||||
var $ = layui.jquery;
|
||||
|
||||
26
src/layui.js
26
src/layui.js
@@ -4,7 +4,7 @@
|
||||
@Description:经典模块化前端框架
|
||||
@Site: www.layui.com
|
||||
@Author: 贤心
|
||||
@License:LGPL
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"use strict";
|
||||
|
||||
var Lay = function(){
|
||||
this.v = '1.0.7'; //版本号
|
||||
this.v = '1.0.8'; //版本号
|
||||
};
|
||||
|
||||
Lay.fn = Lay.prototype;
|
||||
@@ -50,12 +50,10 @@ modules = {
|
||||
,util: 'modules/util' //工具块
|
||||
,flow: 'modules/flow' //流加载
|
||||
,code: 'modules/code' //代码修饰器
|
||||
,single: 'modules/single' //单页应用
|
||||
,mobile: 'modules/mobile' //移动大模块
|
||||
|
||||
,jquery: 'lib/jquery' //DOM库(第三方)
|
||||
,jquery: 'modules/jquery' //DOM库(第三方)
|
||||
|
||||
,'layui.mod': 'dest/layui.mod' //PC模块合并版
|
||||
,mobile: 'modules/mobile' //移动大模块 | 若当前为开发目录,则为移动模块入口,否则为移动模块集合
|
||||
,'layui.all': 'dest/layui.all' //PC模块合并版
|
||||
};
|
||||
|
||||
config.modules = {}; //记录模块物理路径
|
||||
@@ -74,13 +72,16 @@ Lay.fn.define = function(deps, callback){
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
type && (
|
||||
callback = deps,
|
||||
deps = []
|
||||
);
|
||||
if(layui['layui.all']){
|
||||
|
||||
if(layui['layui.all'] || (!layui['layui.all'] && layui['layui.mobile'])){
|
||||
return mods.call(that);
|
||||
};
|
||||
}
|
||||
|
||||
that.use(deps, mods);
|
||||
return that;
|
||||
};
|
||||
@@ -108,8 +109,11 @@ Lay.fn.use = function(apps, callback, exports){
|
||||
//静态资源host
|
||||
config.host = config.host || (dir.match(/\/\/([\s\S]+?)\//)||['//'+ location.host +'/'])[0];
|
||||
|
||||
if(apps.length === 0 || (layui['layui.all'] && modules[item])){
|
||||
return typeof callback === 'function' && callback.apply(layui, exports), that;
|
||||
if(apps.length === 0
|
||||
|| (layui['layui.all'] && modules[item])
|
||||
|| (!layui['layui.all'] && layui['layui.mobile'] && modules[item])
|
||||
){
|
||||
return onCallback(), that;
|
||||
}
|
||||
|
||||
//加载完毕
|
||||
|
||||
Reference in New Issue
Block a user