From aeeddf5d17384e81f2ec80c994ce0317470ba333 Mon Sep 17 00:00:00 2001 From: fofolee Date: Wed, 8 Apr 2020 00:24:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA=E9=99=90?= =?UTF-8?q?=E5=88=B6=EF=BC=8C=E5=BD=93=E6=98=BE=E7=A4=BA=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8pwd?= =?UTF-8?q?=E7=AD=89=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/options.js | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/assets/options.js b/assets/options.js index 4f05a40..680127c 100644 --- a/assets/options.js +++ b/assets/options.js @@ -206,9 +206,9 @@ showCustomize = () => { - + - + aa 输 出 @@ -359,20 +359,33 @@ $("#options").on('click', '#icon, #iconame', function () { // 保存 $("#options").on('click', '.saveBtn', function () { var code = $('#kw').val().split(',')[0].trim() - var customFts = getCustomFts(); + var customFts = getCustomFts(), + output = $('#output').val(), + cmd = window.editor.getValue(); // 如果 code 重复, 编辑状态下不检测 if (code in customFts && !$('#kw').attr('edit')) { $('#kw').css({ 'border-bottom-color': '#ec1212' }) - window.messageBox({ type: 'error', icon: window.logo, message: "命令名称重复!", buttons: ['朕知道了'] }) + window.messageBox({ + type: 'error', + icon: window.logo, + message: "命令名称重复!", + buttons: ['朕知道了'] + }) + } else if (['text', 'html'].includes($('#output').val()) + && ['{{SelectText}}', '{{SelectFile}}', '{{pwd}}'].map(x => cmd.includes(x)).includes(true)) { + window.messageBox({ + type: 'error', + icon: window.logo, + message: "显示文本或html输出时无法使用{{SelectText}}、{{SelectFile}}或{{pwd}}!", + buttons: ['朕知道了'] + }) } else { var kw = $('#kw').val().split(','), program = $('#program').val(), desc = $('#desc').val(), - output = $('#output').val(), codec = $('#codec').val(), iconame = $("#iconame").val(), iconpath = $("#icon").attr('src'), - cmd = window.editor.getValue(), icon, base64ico, hasSubInput;