forked from snailuncle/jsTree
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
578a5f7
commit 2d6d88c
Showing
24 changed files
with
697 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
enginesAll = engines.all() | ||
log(enginesAll) | ||
enginesAll.map((ScriptEngine) => { | ||
if (engines.myEngine() == ScriptEngine) {} else { | ||
console.log('即将停止的脚本引擎' + ScriptEngine) | ||
ScriptEngine.forceStop() | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
fn=()=>{ | ||
// var s=ScriptEngine.cwd() | ||
var s=engines.myEngine().getSource() | ||
console.log(s) | ||
} | ||
|
||
setInterval(fn,2000) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
fn=()=>{ | ||
// var s=ScriptEngine.cwd() | ||
var s=engines.myEngine().getSource() | ||
console.log(s) | ||
} | ||
|
||
setInterval(fn,2000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
fn=()=>{ | ||
// var s=ScriptEngine.cwd() | ||
var s=engines.myEngine().getSource() | ||
console.log(s) | ||
console.log('ccc的fn') | ||
} | ||
|
||
setInterval(fn,2000) | ||
console.log('ccc存在过') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Response.body | ||
{Object} | ||
当前响应的内容。他有以下属性和函数: | ||
|
||
bytes() {Array} 以字节数组形式返回响应内容 | ||
|
||
|
||
console.show(); | ||
http.get("www.baidu.com", {}, function(res, err){ | ||
if(err){ | ||
console.error(err); | ||
return; | ||
} | ||
log("code = " + res.statusCode); | ||
var bodyBytes=res.body.bytes() | ||
var path='./' | ||
files.writeBytes(path, bytes) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
脚本数组 = ['aaa', 'bbb', 'ccc'] | ||
脚本数组.map((file) => { | ||
engines.execScriptFile(files.cwd() + "/" + file + ".js") | ||
}) | ||
end = () => { | ||
enginesAll = engines.all() | ||
log(enginesAll) | ||
enginesAll.map((ScriptEngine) => { | ||
if (engines.myEngine().toString() != ScriptEngine.toString()) { | ||
console.log('即将停止的脚本引擎' + ScriptEngine) | ||
ScriptEngine.forceStop() | ||
} | ||
}) | ||
for (let i = 0; i < 10; i++) { | ||
sleep(1000) | ||
console.log(213); | ||
|
||
} | ||
} | ||
setTimeout(end, 5000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
function 解压文件(fileName){ | ||
var fileName=files.path('./'+fileName) | ||
var unzipFileName=fileName.replace('.zip','') | ||
com.stardust.io.Zip.unzip(new java.io.File(fileName), new java.io.File(unzipFileName)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"xiaomi/ugglite/ugglite:7.1.2/N2G47H/8.3.1:user/release-keys":{"屏幕宽度":720,"屏幕高度":1280,"buildId":"N2G47H","主板":"QC_Reference_Phone","制造商":"xiaomi","型号":"Redmi Note 5A","产品名称":"ugglite","硬件名称":"qcom","唯一标识码":"xiaomi/ugglite/ugglite:7.1.2/N2G47H/8.3.1:user/release-keys","AndroidId":"eff4c619a4f92b20","API":25,"ip":"::ffff:192.168.12.100","port":51615,"客户端登记时间":"2018-12-14 12:50:40"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>__小简__下载测试</title> | ||
<style> | ||
div { | ||
width: 100%; | ||
text-align: center; | ||
margin-top: 50px; | ||
} | ||
</style> | ||
<script> | ||
window.onload=function(){ | ||
var oBtnDownload=document.getElementById('download'); | ||
oBtnDownload.onclick=function(){ | ||
window.open('http://localhost:3000/download', '_blank') | ||
} | ||
} | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<div> | ||
<button id="download">点击下载</button> | ||
</div> | ||
</body> | ||
|
||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const koa = require('koa'); // "koa": "^2.2.0" | ||
const app = new koa(); | ||
const router = require('koa-router')(); // "koa-router": "^7.2.0" | ||
const send = require('koa-send'); // "koa-send": "^4.1.0" | ||
|
||
router.get('/', async function (ctx) { | ||
var fileName = 'index.html'; | ||
await send(ctx, fileName, { root: __dirname + '/public' }); | ||
}); | ||
|
||
router.get('/download', async function (ctx) { | ||
// 为了方便演示,这里直接下载index页面 | ||
var fileName = 'index.html'; | ||
// Set Content-Disposition to "attachment" to signal the client to prompt for download. | ||
// Optionally specify the filename of the download. | ||
// 设置实体头(表示消息体的附加信息的头字段),提示浏览器以文件下载的方式打开 | ||
// 也可以直接设置 ctx.set("Content-disposition", "attachment; filename=" + fileName); | ||
ctx.attachment(fileName); | ||
await send(ctx, fileName, { root: __dirname + '/public' }); | ||
}); | ||
|
||
app | ||
.use(router.routes()) | ||
.use(router.allowedMethods()); | ||
|
||
port=3000 | ||
app.listen(port); | ||
|
||
console.log('open http://localhost:' + port); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.