add console.rawInput, app.intent
This commit is contained in:
@@ -45,10 +45,6 @@ var rawInput = function(title, prefill){
|
||||
return dialogs.rawInput(title, prefill);
|
||||
}
|
||||
|
||||
var input = function(title, prefill){
|
||||
return dialogs.input(title, prefill);
|
||||
}
|
||||
|
||||
var alert = function(title, prefill){
|
||||
dialogs.alert(title, prefill);
|
||||
}
|
||||
|
||||
8
app/src/main/assets/sample/控制台/控制台示例.js
Normal file
8
app/src/main/assets/sample/控制台/控制台示例.js
Normal file
@@ -0,0 +1,8 @@
|
||||
//显示控制台
|
||||
console.show();
|
||||
|
||||
console.verbose("这是灰色");
|
||||
console.log("这是黑色");
|
||||
console.info("这是红色");
|
||||
console.warn("这是蓝色");
|
||||
console.error("这是绿色=_=");
|
||||
13
app/src/main/assets/sample/控制台/终端模拟器.js
Normal file
13
app/src/main/assets/sample/控制台/终端模拟器.js
Normal file
@@ -0,0 +1,13 @@
|
||||
var sh = new Shell();
|
||||
sh.setCallback({
|
||||
onNewLine: function(str){
|
||||
console.log(str);
|
||||
}
|
||||
})
|
||||
console.show();
|
||||
console.info("请输入要运行命令:");
|
||||
do {
|
||||
var cmd = console.rawInput();
|
||||
sh.exec(cmd);
|
||||
}while(cmd != "exit");
|
||||
sh.exit();
|
||||
Reference in New Issue
Block a user