mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-08 22:51:25 +08:00
添加注释
This commit is contained in:
parent
5eddc7b6b0
commit
158f6d3bc1
@ -160,6 +160,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 读取历史记录
|
||||||
loadOrSaveHistory() {
|
loadOrSaveHistory() {
|
||||||
// 读取
|
// 读取
|
||||||
var history = UTOOLS.getDB(UTOOLS.DBPRE.CFG + "codeHistory");
|
var history = UTOOLS.getDB(UTOOLS.DBPRE.CFG + "codeHistory");
|
||||||
@ -184,6 +185,7 @@ export default {
|
|||||||
UTOOLS.putDB(saveData, UTOOLS.DBPRE.CFG + "codeHistory");
|
UTOOLS.putDB(saveData, UTOOLS.DBPRE.CFG + "codeHistory");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 绑定快捷键
|
||||||
bindKeys() {
|
bindKeys() {
|
||||||
let that = this;
|
let that = this;
|
||||||
// ctrl+b 运行
|
// ctrl+b 运行
|
||||||
@ -191,6 +193,7 @@ export default {
|
|||||||
that.runCurrentCommand();
|
that.runCurrentCommand();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 匹配编程语言
|
||||||
matchLanguage() {
|
matchLanguage() {
|
||||||
let language = Object.values(allProgrammings).filter(
|
let language = Object.values(allProgrammings).filter(
|
||||||
(program) => program.ext === this.customOptions.ext
|
(program) => program.ext === this.customOptions.ext
|
||||||
@ -199,16 +202,19 @@ export default {
|
|||||||
this.setLanguage(language[0].name);
|
this.setLanguage(language[0].name);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 设置编程语言
|
||||||
setLanguage(language) {
|
setLanguage(language) {
|
||||||
let highlight = allProgrammings[language].highlight;
|
let highlight = allProgrammings[language].highlight;
|
||||||
this.$refs.editor.setEditorLanguage(highlight ? highlight : language);
|
this.$refs.editor.setEditorLanguage(highlight ? highlight : language);
|
||||||
},
|
},
|
||||||
|
// 打开文档
|
||||||
showHelp() {
|
showHelp() {
|
||||||
utools.createBrowserWindow("./helps/quickcommand.html", {
|
utools.createBrowserWindow("./helps/quickcommand.html", {
|
||||||
width: 1280,
|
width: 1280,
|
||||||
height: 920,
|
height: 920,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 编码设置页面
|
||||||
showCodingPage() {
|
showCodingPage() {
|
||||||
quickcommand
|
quickcommand
|
||||||
.showInputBox(
|
.showInputBox(
|
||||||
@ -223,6 +229,7 @@ export default {
|
|||||||
if (res) [this.scriptCode, this.outputCode] = res;
|
if (res) [this.scriptCode, this.outputCode] = res;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 运行命令
|
||||||
async runCurrentCommand() {
|
async runCurrentCommand() {
|
||||||
let cmd = this.$refs.editor.getEditorValue();
|
let cmd = this.$refs.editor.getEditorValue();
|
||||||
cmd = window.special(cmd);
|
cmd = window.special(cmd);
|
||||||
@ -265,6 +272,7 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 替换特殊变量
|
||||||
async replaceTempInputVals(cmd) {
|
async replaceTempInputVals(cmd) {
|
||||||
let tempInputVals = [];
|
let tempInputVals = [];
|
||||||
let specilaVals = [
|
let specilaVals = [
|
||||||
@ -290,6 +298,7 @@ export default {
|
|||||||
});
|
});
|
||||||
return cmd;
|
return cmd;
|
||||||
},
|
},
|
||||||
|
// 显示运行结果
|
||||||
showRunResult(content, raw, isSuccess) {
|
showRunResult(content, raw, isSuccess) {
|
||||||
this.isResultShow = true;
|
this.isResultShow = true;
|
||||||
this.runResultStatus = isSuccess;
|
this.runResultStatus = isSuccess;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user