init
11
README.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
拖入APK将直接调用adb install apk命令
|
||||||
|
|
||||||
|
按钮可查看设备已安装包名(adb shell pm list package)
|
||||||
|
|
||||||
|
当前顶层Activity(adb shell dumpsys window | findstr mCurrentFocus)
|
||||||
|
|
||||||
|
APK的Manifest清单(aapt dump xmltree apk AndroidManifest.xml)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#注意!需要自行配置好adb与aapt环境,否则无法使用本插件
|
182
index.html
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<script src="js/jquery-3.2.1.js"></script>
|
||||||
|
<script src="layui/layui.all.js"></script>
|
||||||
|
<link rel="stylesheet" href="layui/css/layui.css">
|
||||||
|
<link rel="stylesheet" href="layui/css/modules/layer/default/layer.css">
|
||||||
|
<link rel="stylesheet" href="layui/css/layui.css" media="all">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<form class="layui-form">
|
||||||
|
<input id="text" name="iput" required lay-verify="required" placeholder="请输入指令" autocomplete="off"
|
||||||
|
class="layui-input" />
|
||||||
|
<label class="layui-form-label">设备列表</label>
|
||||||
|
<select id="device" name="device" lay-verify="" lay-filter="dev">
|
||||||
|
</select>
|
||||||
|
<input id="btn" name="btn" type="button" value="执行" class="layui-btn layui-btn-normal" />
|
||||||
|
|
||||||
|
<button type="button" class="layui-btn" id="upload">
|
||||||
|
<i class="layui-icon"></i>上传APK
|
||||||
|
</button>
|
||||||
|
<input id="flush" name="flush" type="button" value="刷新设备列表" class="layui-btn" />
|
||||||
|
<input id="showPack" name="showPack" type="button" value="已安装列表" class="layui-btn" />
|
||||||
|
<input id="show" name="show" type="button" value="查看apk信息" class="layui-btn" />
|
||||||
|
<input id="showTopActivity" name="showTopActivity" type="button" value="设备当前顶层Activity" class="layui-btn" />
|
||||||
|
<p />
|
||||||
|
<label class="layui-form-label">日志:</label>
|
||||||
|
|
||||||
|
<textarea name="log" id="log" required lay-verify="required" placeholder="等待输出" class="layui-textarea"
|
||||||
|
style="height: 350px;"></textarea>
|
||||||
|
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
<script>
|
||||||
|
function log(data) {
|
||||||
|
console.log("日志输出:" + data)
|
||||||
|
$('#log').val($('#log').val() + "\n" + data)
|
||||||
|
}
|
||||||
|
function install() {
|
||||||
|
log("开始执行:" + $('#text').val());
|
||||||
|
window.adb($('#text').val(), (stdout) => {
|
||||||
|
log(stdout);
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
var devices = []
|
||||||
|
var path;
|
||||||
|
layui.use('form', function () {
|
||||||
|
var form = layui.form;
|
||||||
|
var upload = layui.upload;
|
||||||
|
form.render();
|
||||||
|
form.on('select(dev)', function (data) {
|
||||||
|
$('#text').val("adb -s " + data.value + " install \"" + path + "\"");
|
||||||
|
});
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#upload' //绑定元素
|
||||||
|
,
|
||||||
|
url: '/upload/', //上传接口
|
||||||
|
accept: 'file',
|
||||||
|
auto: false,
|
||||||
|
|
||||||
|
choose: function (obj) {
|
||||||
|
//上传完毕回调
|
||||||
|
var files = obj.pushFile();
|
||||||
|
obj.preview(function (index, file, result) {
|
||||||
|
path = file.path;
|
||||||
|
var dv = devices[0].split(/\s+/);
|
||||||
|
$('#text').val("adb -s " + dv[0] + " install \"" + path + "\"");
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
//请求异常回调
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
$('#btn').click(function () {
|
||||||
|
install();
|
||||||
|
})
|
||||||
|
$('#flush').click(function () {
|
||||||
|
reload()
|
||||||
|
})
|
||||||
|
|
||||||
|
reload()
|
||||||
|
utools.onPluginEnter(({
|
||||||
|
code,
|
||||||
|
type,
|
||||||
|
payload
|
||||||
|
}) => {
|
||||||
|
if (type == 'files') {
|
||||||
|
path = payload[0].path;
|
||||||
|
console.log("检测到文件:" + path)
|
||||||
|
log("准备安装:" + path)
|
||||||
|
}
|
||||||
|
reload()
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
function reload() {
|
||||||
|
chinese = [];
|
||||||
|
$('#device').empty();
|
||||||
|
$('#log').val('');
|
||||||
|
|
||||||
|
window.adb('adb devices', (stdout,error) => {
|
||||||
|
if(error==true){
|
||||||
|
log(stdout)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var out = stdout.split("\n");
|
||||||
|
var j = 0;
|
||||||
|
for (var i = 1; i < out.length; i++) {
|
||||||
|
if (out[i].length > 5) {
|
||||||
|
devices[j++] = out[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (var i = 0; i < devices.length; i++) {
|
||||||
|
var dv = devices[i].split(/\s+/);
|
||||||
|
$('#device').append("<option value='" + dv[0] + "'>" + devices[i] + "</option>");
|
||||||
|
}
|
||||||
|
layui.form.render();
|
||||||
|
if (devices.length == 1) {
|
||||||
|
var dv = devices[0].split(/\s+/);
|
||||||
|
$('#text').val("adb -s " + dv[0] + " install \"" + path + "\"");
|
||||||
|
|
||||||
|
if (path == null || path == "") {
|
||||||
|
$('#text').val("adb -s " + dv[0] + " ");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
log("开始安装:" + path);
|
||||||
|
/* window.adb("adb -s " + dv[0] + " install " + path, (stdout,error) => {
|
||||||
|
console.log("ADB err:"+err)
|
||||||
|
console.log("ADB stdout:"+stdout)
|
||||||
|
console.log("ADB stderr:"+stderr)
|
||||||
|
log(stdout,error);
|
||||||
|
}) */
|
||||||
|
install();
|
||||||
|
} else if (devices.length > 1) {
|
||||||
|
log("请选择设备");
|
||||||
|
if (path == null || path == "") {
|
||||||
|
$('#text').val("adb -s " + dv[0] + " ");
|
||||||
|
} else {
|
||||||
|
$('#text').val("adb -s " + dv[0] + " install \"" + path + "\"");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log("没有连接设备");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
$('#showPack').click(function () {
|
||||||
|
window.adb("adb shell pm list package", (stdout,error) => {
|
||||||
|
if(error==true){
|
||||||
|
log(stdout)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
log(stdout)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
$('#show').click(function(){
|
||||||
|
console.log("aapt dump badging \""+path+"\"")
|
||||||
|
window.adb("aapt dump badging \""+path+"\"",(stdout,error) => {
|
||||||
|
if(error==true){
|
||||||
|
log(stdout)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
log(stdout)
|
||||||
|
window.adb("aapt dump xmltree \""+path+"\" AndroidManifest.xml",(stdout,error)=>{
|
||||||
|
log(stdout)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
$('#showTopActivity').click(function(){
|
||||||
|
window.adb("adb shell dumpsys window | findstr mCurrentFocus",(data,error)=>{
|
||||||
|
log(data)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</html>
|
10253
js/jquery-3.2.1.js
vendored
Normal file
2
layui/css/layui.css
Normal file
2
layui/css/layui.mobile.css
Normal file
2
layui/css/modules/code.css
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||||
|
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}
|
2
layui/css/modules/laydate/default/laydate.css
Normal file
BIN
layui/css/modules/layer/default/icon-ext.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
layui/css/modules/layer/default/icon.png
Normal file
After Width: | Height: | Size: 11 KiB |
2
layui/css/modules/layer/default/layer.css
Normal file
BIN
layui/css/modules/layer/default/loading-0.gif
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
layui/css/modules/layer/default/loading-1.gif
Normal file
After Width: | Height: | Size: 701 B |
BIN
layui/css/modules/layer/default/loading-2.gif
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
layui/font/iconfont.eot
Normal file
473
layui/font/iconfont.svg
Normal file
After Width: | Height: | Size: 274 KiB |
BIN
layui/font/iconfont.ttf
Normal file
BIN
layui/font/iconfont.woff
Normal file
BIN
layui/images/face/0.gif
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
layui/images/face/1.gif
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
layui/images/face/10.gif
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
layui/images/face/11.gif
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
layui/images/face/12.gif
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
layui/images/face/13.gif
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
layui/images/face/14.gif
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
layui/images/face/15.gif
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
layui/images/face/16.gif
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
layui/images/face/17.gif
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
layui/images/face/18.gif
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
layui/images/face/19.gif
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
layui/images/face/2.gif
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
layui/images/face/20.gif
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
layui/images/face/21.gif
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
layui/images/face/22.gif
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
layui/images/face/23.gif
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
layui/images/face/24.gif
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
layui/images/face/25.gif
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
layui/images/face/26.gif
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
layui/images/face/27.gif
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
layui/images/face/28.gif
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
layui/images/face/29.gif
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
layui/images/face/3.gif
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
layui/images/face/30.gif
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
layui/images/face/31.gif
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
layui/images/face/32.gif
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
layui/images/face/33.gif
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
layui/images/face/34.gif
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
layui/images/face/35.gif
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
layui/images/face/36.gif
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
layui/images/face/37.gif
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
layui/images/face/38.gif
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
layui/images/face/39.gif
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
layui/images/face/4.gif
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
layui/images/face/40.gif
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
layui/images/face/41.gif
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
layui/images/face/42.gif
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
layui/images/face/43.gif
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
layui/images/face/44.gif
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
layui/images/face/45.gif
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
layui/images/face/46.gif
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
layui/images/face/47.gif
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
layui/images/face/48.gif
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
layui/images/face/49.gif
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
layui/images/face/5.gif
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
layui/images/face/50.gif
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
layui/images/face/51.gif
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
layui/images/face/52.gif
Normal file
After Width: | Height: | Size: 777 B |
BIN
layui/images/face/53.gif
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
layui/images/face/54.gif
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
layui/images/face/55.gif
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
layui/images/face/56.gif
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
layui/images/face/57.gif
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
layui/images/face/58.gif
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
layui/images/face/59.gif
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
layui/images/face/6.gif
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
layui/images/face/60.gif
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
layui/images/face/61.gif
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
layui/images/face/62.gif
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
layui/images/face/63.gif
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
layui/images/face/64.gif
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
layui/images/face/65.gif
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
layui/images/face/66.gif
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
layui/images/face/67.gif
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
layui/images/face/68.gif
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
layui/images/face/69.gif
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
layui/images/face/7.gif
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
layui/images/face/70.gif
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
layui/images/face/71.gif
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
layui/images/face/8.gif
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
layui/images/face/9.gif
Normal file
After Width: | Height: | Size: 4.1 KiB |
2
layui/lay/modules/carousel.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||||
|
;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['<button class="layui-icon '+u+'" lay-type="sub">'+("updown"===n.anim?"":"")+"</button>",'<button class="layui-icon '+u+'" lay-type="add">'+("updown"===n.anim?"":"")+"</button>"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['<div class="'+c+'"><ul>',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("<li"+(n.index===e?' class="layui-this"':"")+"></li>")}),i.join("")}(),"</ul></div>"].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a<n.index&&e.slide("sub",n.index-a)})},m.prototype.slide=function(e,i){var n=this,l=n.elemItem,u=n.config,c=u.index,m=u.elem.attr("lay-filter");n.haveSlide||("sub"===e?(n.subIndex(i),l.eq(u.index).addClass(d),setTimeout(function(){l.eq(c).addClass(r),l.eq(u.index).addClass(r)},50)):(n.addIndex(i),l.eq(u.index).addClass(s),setTimeout(function(){l.eq(c).addClass(o),l.eq(u.index).addClass(o)},50)),setTimeout(function(){l.removeClass(a+" "+d+" "+s+" "+o+" "+r),l.eq(u.index).addClass(a),n.haveSlide=!1},300),n.elemInd.find("li").eq(u.index).addClass(a).siblings().removeClass(a),n.haveSlide=!0,layui.event.call(this,t,"change("+m+")",{index:u.index,prevIndex:c,item:l.eq(u.index)}))},m.prototype.events=function(){var e=this,i=e.config;i.elem.data("haveEvents")||(i.elem.on("mouseenter",function(){clearInterval(e.timer)}).on("mouseleave",function(){e.autoplay()}),i.elem.data("haveEvents",!0))},n.render=function(e){var i=new m(e);return i},e(t,n)});
|
2
layui/lay/modules/code.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||||
|
;layui.define("jquery",function(e){"use strict";var a=layui.$,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('<ol class="layui-code-ol"><li>'+o.replace(/[\r\t\n]+/g,"</li><li>")+"</li></ol>"),c.find(">.layui-code-h3")[0]||c.prepend('<h3 class="layui-code-h3">'+(c.attr("lay-title")||e.title||"code")+(e.about?'<a href="'+l+'" target="_blank">layui.code</a>':"")+"</h3>");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss");
|
2
layui/lay/modules/colorpicker.js
Normal file
2
layui/lay/modules/element.js
Normal file
2
layui/lay/modules/flow.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||||
|
;layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='<i class="layui-anim layui-anim-rotate layui-anim-loop layui-icon "></i>';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="<cite>加载更多</cite>",h=l('<div class="layui-flow-more"><a href="javascript:;">'+d+"</a></div>");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),i||(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;s<t.lazyimg.elem.length;s++){var v=t.lazyimg.elem.eq(s),y=a?function(){return v.offset().top-n.offset().top+m}():v.offset().top;if(c(v,f),i=s,y>u)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)});
|
2
layui/lay/modules/form.js
Normal file
5
layui/lay/modules/jquery.js
vendored
Normal file
2
layui/lay/modules/laydate.js
Normal file
2
layui/lay/modules/layedit.js
Normal file
2
layui/lay/modules/layer.js
Normal file
2
layui/lay/modules/laypage.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||||
|
;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?'<a href="javascript:;" class="layui-laypage-prev'+(1==a.curr?" "+r:"")+'" data-page="'+(a.curr-1)+'">'+a.prev+"</a>":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push('<a href="javascript:;" class="layui-laypage-first" data-page="1" title="首页">'+(a.first||1)+"</a>");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r<t-1&&(r=u-t+1),a.first!==!1&&r>2&&e.push('<span class="layui-laypage-spr">…</span>');r<=u;r++)r===a.curr?e.push('<span class="layui-laypage-curr"><em class="layui-laypage-em" '+(/^#/.test(a.theme)?'style="background-color:'+a.theme+';"':"")+"></em><em>"+r+"</em></span>"):e.push('<a href="javascript:;" data-page="'+r+'">'+r+"</a>");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1<a.pages&&e.push('<span class="layui-laypage-spr">…</span>'),0!==t&&e.push('<a href="javascript:;" class="layui-laypage-last" title="尾页" data-page="'+a.pages+'">'+(a.last||a.pages)+"</a>")),e.join("")}(),next:function(){return a.next?'<a href="javascript:;" class="layui-laypage-next'+(a.curr==a.pages?" "+r:"")+'" data-page="'+(a.curr+1)+'">'+a.next+"</a>":""}(),count:'<span class="layui-laypage-count">共 '+a.count+" 条</span>",limit:function(){var e=['<span class="layui-laypage-limits"><select lay-ignore>'];return layui.each(a.limits,function(t,n){e.push('<option value="'+n+'"'+(n===a.limit?"selected":"")+">"+n+" 条/页</option>")}),e.join("")+"</select></span>"}(),refresh:['<a href="javascript:;" data-page="'+a.curr+'" class="layui-laypage-refresh">','<i class="layui-icon layui-icon-refresh"></i>',"</a>"].join(""),skip:function(){return['<span class="layui-laypage-skip">到第','<input type="text" min="1" value="'+a.curr+'" class="layui-input">','页<button type="button" class="layui-laypage-btn">确定</button>',"</span>"].join("")}()};return['<div class="layui-box layui-laypage layui-laypage-'+(a.theme?/^#/.test(a.theme)?"molv":a.theme:"default")+'" id="layui-laypage-'+a.index+'">',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"</div>"].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;o<y;o++)"a"===r[o].nodeName.toLowerCase()&&s.on(r[o],"click",function(){var e=0|this.getAttribute("data-page");e<1||e>i.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)});
|