diff --git a/README.md b/README.md index f50b649..25b3c8c 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,11 @@ #### v0.0.2 +- 可以自定义语言 - 修复uTools更新后进入插件空白的BUG - 添加Linux支持 - 修复导入BUG -- +- 修复说明为空时无法启用命令的BUG - 添加全部导出和全部删除的功能 ## 功能 diff --git a/assets/index.js b/assets/index.js index 5274c09..ae28264 100644 --- a/assets/index.js +++ b/assets/index.js @@ -1,5 +1,5 @@ utools.onPluginEnter(({ code, type, payload }) => { - checkUpdate(); + // checkUpdate(); // 配置页面 if (code == 'options') { utools.setExpendHeight(600); @@ -12,8 +12,12 @@ utools.onPluginEnter(({ code, type, payload }) => { $("#options").hide(); $("#out").show(); var db = utools.db.get('customFts').data[code], - cmd = db.cmd, + cmd = db.cmd; + if (db.program == "custom") { + option = db.customOptions; + } else { option = programs[db.program]; + } // 通过主输入框直接进入 if (type == 'over') cmd = cmd.replace(/\{\{input\}\}/mg, payload); // 无输出的批处理 diff --git a/assets/options.css b/assets/options.css index 864c79d..ab9f41d 100644 --- a/assets/options.css +++ b/assets/options.css @@ -249,6 +249,11 @@ color: #bd3523; } +#options #customize input#custombin, #options #customize input#customarg, #options #customize input#customext { + margin-left: 5px; + width: 200px; +} + #options #customize { position: fixed; height: 100%; diff --git a/assets/options.js b/assets/options.js index 6ad5623..edae5c8 100644 --- a/assets/options.js +++ b/assets/options.js @@ -126,7 +126,12 @@ programs = { bin: 'perl', agrv: '', ext: 'pl' - } + }, + custom: { + bin: '', + agrv: '', + ext: '' + } } showOptions = () => { @@ -216,12 +221,11 @@ showCustomize = () => {
脚 本 - + + + + +
@@ -300,6 +304,11 @@ $("#options").on('click', '.editBtn', function () { let mode = data.program; let iconame = basename(data.features.icon); if (iconame != `${mode}.png`) $('#iconame').val(iconame); + if (mode == 'custom') { + $('#custombin').show().val(data.customOptions.bin); + $('#customarg').show().val(data.customOptions.args); + $('#customext').show().val(data.customOptions.ext); + } mode == 'applescript' && (mode = 'shell'); mode == 'cmd' && (mode = 'powershell'); window.editor.setOption("mode", mode); @@ -405,6 +414,13 @@ $("#options").on('click', '.saveBtn', function () { base64Ico: base64ico, noKeyword: noKeyword } + if (program == 'custom') { + pushData.customOptions = { + "bin": $('#custombin').val(), + "args": $('#customarg').val(), + "ext": $('#customext').val() + } + } putCustomFts(code, pushData); showOptions(); } @@ -414,6 +430,15 @@ $("#options").on('click', '.saveBtn', function () { $("#options").on('change', '#program', function () { let mode = $(this).val(); if (!$("#iconame").val()) $("#icon").attr('src', `logo/${mode}.png`); + if (mode == 'custom') { + $('#custombin').show(); + $('#customarg').show(); + $('#customext').show(); + } else { + $('#custombin').hide(); + $('#customarg').hide(); + $('#customext').hide(); + } mode == 'applescript' && (mode = 'shell'); mode == 'cmd' && (mode = 'powershell'); window.editor.setOption("mode", mode); diff --git a/logo/custom.png b/logo/custom.png new file mode 100644 index 0000000..d6f4bef Binary files /dev/null and b/logo/custom.png differ diff --git a/releases/quickCommand-0.0.1.upx b/releases/quickCommand-0.0.1.upx deleted file mode 100644 index 174a4c8..0000000 Binary files a/releases/quickCommand-0.0.1.upx and /dev/null differ diff --git a/releases/quickCommand-0.0.2.upx b/releases/quickCommand-0.0.2.upx deleted file mode 100644 index 933759d..0000000 Binary files a/releases/quickCommand-0.0.2.upx and /dev/null differ