增加小说模板
This commit is contained in:
167
code/public/public/layer/layer-bf.js
Normal file
167
code/public/public/layer/layer-bf.js
Normal file
@@ -0,0 +1,167 @@
|
||||
"use strict";
|
||||
|
||||
const b = document;
|
||||
const c = "querySelectorAll";
|
||||
const d = "getElementsByClassName";
|
||||
|
||||
const e = function(a) {
|
||||
return b[c](a);
|
||||
};
|
||||
|
||||
const f = {
|
||||
type: 0,
|
||||
shade: true,
|
||||
shadeClose: true,
|
||||
fixed: true,
|
||||
anim: "scale"
|
||||
};
|
||||
|
||||
const g = {
|
||||
extend: function(a) {
|
||||
const b = JSON.parse(JSON.stringify(f));
|
||||
for (const c in a) {
|
||||
b[c] = a[c];
|
||||
}
|
||||
return b;
|
||||
},
|
||||
timer: {},
|
||||
end: {}
|
||||
};
|
||||
|
||||
g.touch = function(a, b) {
|
||||
a.addEventListener("click", function(a) {
|
||||
b.call(this, a);
|
||||
}, false);
|
||||
};
|
||||
|
||||
let h = 0;
|
||||
const i = ["layui-m-layer"];
|
||||
|
||||
const j = function(a) {
|
||||
const b = this;
|
||||
b.config = g.extend(a);
|
||||
b.view();
|
||||
};
|
||||
|
||||
j.prototype.view = function() {
|
||||
const a = this;
|
||||
const c = a.config;
|
||||
const f = b.createElement("div");
|
||||
a.id = f.id = i[0] + h;
|
||||
f.setAttribute("class", i[0] + " " + i[0] + (c.type || 0));
|
||||
f.setAttribute("index", h);
|
||||
|
||||
const g = function() {
|
||||
const a = typeof c.title === "object";
|
||||
return c.title ? `<h3 style="${a ? c.title[1] : ''}">${a ? c.title[0] : c.title}</h3>` : "";
|
||||
}();
|
||||
|
||||
const j = function() {
|
||||
if (typeof c.btn === "string") c.btn = [c.btn];
|
||||
let a;
|
||||
const b = (c.btn || []).length;
|
||||
if (b !== 0 && c.btn) {
|
||||
a = `<span yes type="1">${c.btn[0]}</span>`;
|
||||
if (b === 2) a = `<span no type="0">${c.btn[1]}</span>${a}`;
|
||||
return `<div class="layui-m-layerbtn">${a}</div>`;
|
||||
}
|
||||
return "";
|
||||
}();
|
||||
|
||||
if (!c.fixed) {
|
||||
c.top = c.hasOwnProperty("top") ? c.top : 100;
|
||||
c.style = c.style || "";
|
||||
c.style += ` top:${b.body.scrollTop + c.top}px`;
|
||||
}
|
||||
|
||||
if (c.type === 2) {
|
||||
c.content = `<i></i><i class="layui-m-layerload"></i><i></i><p>${c.content || ''}</p>`;
|
||||
}
|
||||
|
||||
if (c.skin) c.anim = "up";
|
||||
if (c.skin === "msg") c.shade = false;
|
||||
|
||||
f.innerHTML = `${c.shade ? `<div ${typeof c.shade === 'string' ? `style="${c.shade}"` : ''} class="layui-m-layershade"></div>` : ''}` +
|
||||
`<div class="layui-m-layermain" ${c.fixed ? '' : 'style="position:static;"'}>` +
|
||||
`<div class="layui-m-layersection">` +
|
||||
`<div class="layui-m-layerchild ${c.skin ? `layui-m-layer-${c.skin} ` : ''}${c.className ? c.className : ''} ${c.anim ? `layui-m-anim-${c.anim}` : ''}" ${c.style ? `style="${c.style}"` : ''}>` +
|
||||
`${g}<div class="layui-m-layercont">${c.content}</div>${j}</div></div></div>`;
|
||||
|
||||
if (!c.type || c.type === 2) {
|
||||
const k = b[d](i[0] + c.type);
|
||||
const l = k.length;
|
||||
if (l >= 1) layer.close(k[0].getAttribute("index"));
|
||||
}
|
||||
|
||||
document.body.appendChild(f);
|
||||
const m = a.elem = e(`#${a.id}`)[0];
|
||||
if (c.success) c.success(m);
|
||||
a.index = h++;
|
||||
a.action(c, m);
|
||||
};
|
||||
|
||||
j.prototype.action = function(a, b) {
|
||||
const c = this;
|
||||
if (a.time) {
|
||||
g.timer[c.index] = setTimeout(function() {
|
||||
layer.close(c.index);
|
||||
}, 1000 * a.time);
|
||||
}
|
||||
|
||||
const e = function() {
|
||||
const b = this.getAttribute("type");
|
||||
if (b == 0) {
|
||||
if (a.no) a.no();
|
||||
layer.close(c.index);
|
||||
} else {
|
||||
if (a.yes) a.yes(c.index);
|
||||
else layer.close(c.index);
|
||||
}
|
||||
};
|
||||
|
||||
if (a.btn) {
|
||||
const f = b[d]("layui-m-layerbtn")[0].children;
|
||||
const h = f.length;
|
||||
for (let i = 0; i < h; i++) {
|
||||
g.touch(f[i], e);
|
||||
}
|
||||
}
|
||||
|
||||
if (a.shade && a.shadeClose) {
|
||||
const j = b[d]("layui-m-layershade")[0];
|
||||
g.touch(j, function() {
|
||||
layer.close(c.index, a.end);
|
||||
});
|
||||
}
|
||||
|
||||
if (a.end) g.end[c.index] = a.end;
|
||||
};
|
||||
|
||||
const layer = {
|
||||
v: "2.0",
|
||||
index: h,
|
||||
open: function(a) {
|
||||
const b = new j(a || {});
|
||||
return b.index;
|
||||
},
|
||||
close: function(a) {
|
||||
const c = e(`#${i[0]}${a}`)[0];
|
||||
if (c) {
|
||||
c.innerHTML = "";
|
||||
b.body.removeChild(c);
|
||||
clearTimeout(g.timer[a]);
|
||||
delete g.timer[a];
|
||||
if (typeof g.end[a] === 'function') g.end[a]();
|
||||
delete g.end[a];
|
||||
}
|
||||
},
|
||||
closeAll: function() {
|
||||
const a = b[d](i[0]);
|
||||
const c = a.length;
|
||||
for (let e = 0; e < c; e++) {
|
||||
layer.close(0 | a[0].getAttribute("index"));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default layer;
|
||||
355
code/public/public/layer/layer.css
Normal file
355
code/public/public/layer/layer.css
Normal file
@@ -0,0 +1,355 @@
|
||||
.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-layermain,
|
||||
.layui-m-layershade {
|
||||
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, .1);
|
||||
pointer-events: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
-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: 0 0;
|
||||
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-layerbtn span,
|
||||
.layui-m-layerchild h3 {
|
||||
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%;
|
||||
-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-layerbtn,
|
||||
.layui-m-layerbtn span {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
border-radius: 0 0 5px 5px
|
||||
}
|
||||
|
||||
.layui-m-layer2 .layui-m-layercont p {
|
||||
margin-top: 20px
|
||||
}
|
||||
|
||||
@-webkit-keyframes layui-m-anim-loading {
|
||||
0%,
|
||||
100%,
|
||||
80% {
|
||||
transform: scale(0);
|
||||
-webkit-transform: scale(0)
|
||||
}
|
||||
40% {
|
||||
transform: scale(1);
|
||||
-webkit-transform: scale(1)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes layui-m-anim-loading {
|
||||
0%,
|
||||
100%,
|
||||
80% {
|
||||
transform: scale(0);
|
||||
-webkit-transform: scale(0)
|
||||
}
|
||||
40% {
|
||||
transform: scale(1);
|
||||
-webkit-transform: scale(1)
|
||||
}
|
||||
}
|
||||
|
||||
.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%;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
font-size: 0;
|
||||
border-top: 1px solid #D0D0D0;
|
||||
background-color: #F2F2F2
|
||||
}
|
||||
|
||||
.layui-m-layerbtn span {
|
||||
display: block;
|
||||
-moz-box-flex: 1;
|
||||
box-flex: 1;
|
||||
-webkit-box-flex: 1;
|
||||
font-size: 14px;
|
||||
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: 0 0;
|
||||
cursor: pointer;
|
||||
-webkit-appearance: none;
|
||||
font-size: 30px
|
||||
}
|
||||
|
||||
.layui-m-layerend::after,
|
||||
.layui-m-layerend::before {
|
||||
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: 0 0
|
||||
}
|
||||
|
||||
.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: 0 0;
|
||||
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
|
||||
}
|
||||
101
code/public/public/layer/layer.js
Normal file
101
code/public/public/layer/layer.js
Normal file
@@ -0,0 +1,101 @@
|
||||
/* ! layer mobile-v2.0 弹层组件移动版 License LGPL http://layer.layui.com/mobile By 贤心 */ ;
|
||||
! function(a) {
|
||||
"use strict";
|
||||
var b = document,
|
||||
c = "querySelectorAll",
|
||||
d = "getElementsByClassName",
|
||||
e = function(a) {
|
||||
return b[c](a)
|
||||
},
|
||||
f = {
|
||||
type: 0,
|
||||
shade: !0,
|
||||
shadeClose: !0,
|
||||
fixed: !0,
|
||||
anim: "scale"
|
||||
},
|
||||
g = {
|
||||
extend: function(a) {
|
||||
var b = JSON.parse(JSON.stringify(f));
|
||||
for(var c in a) {
|
||||
b[c] = a[c]
|
||||
}
|
||||
return b
|
||||
},
|
||||
timer: {},
|
||||
end: {}
|
||||
};
|
||||
g.touch = function(a, b) {
|
||||
a.addEventListener("click", function(a) {
|
||||
b.call(this, a)
|
||||
}, !1)
|
||||
};
|
||||
var h = 0,
|
||||
i = ["layui-m-layer"],
|
||||
j = function(a) {
|
||||
var b = this;
|
||||
b.config = g.extend(a), b.view()
|
||||
};
|
||||
j.prototype.view = function() {
|
||||
var a = this,
|
||||
c = a.config,
|
||||
f = b.createElement("div");
|
||||
a.id = f.id = i[0] + h, f.setAttribute("class", i[0] + " " + i[0] + (c.type || 0)), f.setAttribute("index", h);
|
||||
var g = function() {
|
||||
var a = "object" == typeof c.title;
|
||||
return c.title ? '<h3 style="' + (a ? c.title[1] : "") + '">' + (a ? c.title[0] : c.title) + "</h3>" : ""
|
||||
}(),
|
||||
j = function() {
|
||||
"string" == typeof c.btn && (c.btn = [c.btn]);
|
||||
var a, b = (c.btn || []).length;
|
||||
return 0 !== b && c.btn ? (a = '<span yes type="1">' + c.btn[0] + "</span>", 2 === b && (a = '<span no type="0">' + c.btn[1] + "</span>" + a), '<div class="layui-m-layerbtn">' + a + "</div>") : ""
|
||||
}();
|
||||
if(c.fixed || (c.top = c.hasOwnProperty("top") ? c.top : 100, c.style = c.style || "", c.style += " top:" + (b.body.scrollTop + c.top) + "px"), 2 === c.type && (c.content = '<i></i><i class="layui-m-layerload"></i><i></i><p>' + (c.content || "") + "</p>"), c.skin && (c.anim = "up"), "msg" === c.skin && (c.shade = !1), f.innerHTML = (c.shade ? "<div " + ("string" == typeof c.shade ? 'style="' + c.shade + '"' : "") + ' class="layui-m-layershade"></div>' : "") + '<div class="layui-m-layermain" ' + (c.fixed ? "" : 'style="position:static;"') + '><div class="layui-m-layersection"><div class="layui-m-layerchild ' + (c.skin ? "layui-m-layer-" + c.skin + " " : "") + (c.className ? c.className : "") + " " + (c.anim ? "layui-m-anim-" + c.anim : "") + '" ' + (c.style ? 'style="' + c.style + '"' : "") + ">" + g + '<div class="layui-m-layercont">' + c.content + "</div>" + j + "</div></div></div>", !c.type || 2 === c.type) {
|
||||
var k = b[d](i[0] + c.type),
|
||||
l = k.length;
|
||||
l >= 1 && layer.close(k[0].getAttribute("index"))
|
||||
}
|
||||
document.body.appendChild(f);
|
||||
var m = a.elem = e("#" + a.id)[0];
|
||||
c.success && c.success(m), a.index = h++, a.action(c, m)
|
||||
}, j.prototype.action = function(a, b) {
|
||||
var c = this;
|
||||
a.time && (g.timer[c.index] = setTimeout(function() {
|
||||
layer.close(c.index)
|
||||
}, 1e3 * a.time));
|
||||
var e = function() {
|
||||
var b = this.getAttribute("type");
|
||||
0 == b ? (a.no && a.no(), layer.close(c.index)) : a.yes ? a.yes(c.index) : layer.close(c.index)
|
||||
};
|
||||
if(a.btn) {
|
||||
for(var f = b[d]("layui-m-layerbtn")[0].children, h = f.length, i = 0; h > i; i += 1) {
|
||||
g.touch(f[i], e)
|
||||
}
|
||||
}
|
||||
if(a.shade && a.shadeClose) {
|
||||
var j = b[d]("layui-m-layershade")[0];
|
||||
g.touch(j, function() {
|
||||
layer.close(c.index, a.end)
|
||||
})
|
||||
}
|
||||
a.end && (g.end[c.index] = a.end)
|
||||
}, a.layer = {
|
||||
v: "2.0",
|
||||
index: h,
|
||||
open: function(a) {
|
||||
var b = new j(a || {});
|
||||
return b.index
|
||||
},
|
||||
close: function(a) {
|
||||
var c = e("#" + i[0] + a)[0];
|
||||
c && (c.innerHTML = "", b.body.removeChild(c), clearTimeout(g.timer[a]), delete g.timer[a], "function" == typeof g.end[a] && g.end[a](), delete g.end[a])
|
||||
},
|
||||
closeAll: function() {
|
||||
for(var a = b[d](i[0]), c = 0, e = a.length; e > c; c += 1) {
|
||||
layer.close(0 | a[0].getAttribute("index"))
|
||||
}
|
||||
}
|
||||
}, "function" == typeof define ? define(function() {
|
||||
return layer
|
||||
}) : function() {}()
|
||||
}(window);
|
||||
2
code/public/public/layer/layer.min.js
vendored
Normal file
2
code/public/public/layer/layer.min.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/* ! layer mobile-v2.0 弹层组件移动版 License LGPL http://layer.layui.com/mobile By 贤心 */
|
||||
;!function(a){"use strict";var b=document,c="querySelectorAll",d="getElementsByClassName",e=function(a){return b[c](a)},f={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},g={extend:function(a){var b=JSON.parse(JSON.stringify(f));for(var c in a){b[c]=a[c]}return b},timer:{},end:{}};g.touch=function(a,b){a.addEventListener("click",function(a){b.call(this,a)},!1)};var h=0,i=["layui-m-layer"],j=function(a){var b=this;b.config=g.extend(a),b.view()};j.prototype.view=function(){var a=this,c=a.config,f=b.createElement("div");a.id=f.id=i[0]+h,f.setAttribute("class",i[0]+" "+i[0]+(c.type||0)),f.setAttribute("index",h);var g=function(){var a="object"==typeof c.title;return c.title?'<h3 style="'+(a?c.title[1]:"")+'">'+(a?c.title[0]:c.title)+"</h3>":""}(),j=function(){"string"==typeof c.btn&&(c.btn=[c.btn]);var a,b=(c.btn||[]).length;return 0!==b&&c.btn?(a='<span yes type="1">'+c.btn[0]+"</span>",2===b&&(a='<span no type="0">'+c.btn[1]+"</span>"+a),'<div class="layui-m-layerbtn">'+a+"</div>"):""}();if(c.fixed||(c.top=c.hasOwnProperty("top")?c.top:100,c.style=c.style||"",c.style+=" top:"+(b.body.scrollTop+c.top)+"px"),2===c.type&&(c.content='<i></i><i class="layui-m-layerload"></i><i></i><p>'+(c.content||"")+"</p>"),c.skin&&(c.anim="up"),"msg"===c.skin&&(c.shade=!1),f.innerHTML=(c.shade?"<div "+("string"==typeof c.shade?'style="'+c.shade+'"':"")+' class="layui-m-layershade"></div>':"")+'<div class="layui-m-layermain" '+(c.fixed?"":'style="position:static;"')+'><div class="layui-m-layersection"><div class="layui-m-layerchild '+(c.skin?"layui-m-layer-"+c.skin+" ":"")+(c.className?c.className:"")+" "+(c.anim?"layui-m-anim-"+c.anim:"")+'" '+(c.style?'style="'+c.style+'"':"")+">"+g+'<div class="layui-m-layercont">'+c.content+"</div>"+j+"</div></div></div>",!c.type||2===c.type){var k=b[d](i[0]+c.type),l=k.length;l>=1&&layer.close(k[0].getAttribute("index"))}document.body.appendChild(f);var m=a.elem=e("#"+a.id)[0];c.success&&c.success(m),a.index=h++,a.action(c,m)},j.prototype.action=function(a,b){var c=this;a.time&&(g.timer[c.index]=setTimeout(function(){layer.close(c.index)},1e3*a.time));var e=function(){var b=this.getAttribute("type");0==b?(a.no&&a.no(),layer.close(c.index)):a.yes?a.yes(c.index):layer.close(c.index)};if(a.btn){for(var f=b[d]("layui-m-layerbtn")[0].children,h=f.length,i=0;h>i;i+=1){g.touch(f[i],e)}}if(a.shade&&a.shadeClose){var j=b[d]("layui-m-layershade")[0];g.touch(j,function(){layer.close(c.index,a.end)})}a.end&&(g.end[c.index]=a.end)},a.layer={v:"2.0",index:h,open:function(a){var b=new j(a||{});return b.index},close:function(a){var c=e("#"+i[0]+a)[0];c&&(c.innerHTML="",b.body.removeChild(c),clearTimeout(g.timer[a]),delete g.timer[a],"function"==typeof g.end[a]&&g.end[a](),delete g.end[a])},closeAll:function(){for(var a=b[d](i[0]),c=0,e=a.length;e>c;c+=1){layer.close(0|a[0].getAttribute("index"))}}},"function"==typeof define?define(function(){return layer}):function(){}()}(window);
|
||||
1
code/public/public/layer/need/layer.css
Normal file
1
code/public/public/layer/need/layer.css
Normal file
File diff suppressed because one or more lines are too long
5
code/public/public/layer/教程.md
Normal file
5
code/public/public/layer/教程.md
Normal file
@@ -0,0 +1,5 @@
|
||||
###Welcome to use MarkDown
|
||||
|
||||
|
||||
|
||||
http://layer.layui.com/mobile/
|
||||
Reference in New Issue
Block a user