From 64a4da20598be18bd7698e0bd6c7af7df41deced Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Sun, 9 Apr 2023 09:51:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcJuSet.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcJuSet.js | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/SrcJuSet.js b/SrcJuSet.js index f3895687..97e98df6 100644 --- a/SrcJuSet.js +++ b/SrcJuSet.js @@ -187,6 +187,7 @@ function jiekouapi(sourcefile, data) { clearMyVar('jiekoutype'); clearMyVar('jiekouparse'); clearMyVar('jiekouerparse'); + clearMyVar('jiekoupublic'); clearMyVar('jiekouedit'); })); if (data&&getMyVar('jiekouedit')!="1") { @@ -196,6 +197,7 @@ function jiekouapi(sourcefile, data) { putMyVar('jiekoutype', data.type||"漫画"); storage0.putMyVar('jiekouparse', data.parse); storage0.putMyVar('jiekouerparse', data.erparse ? data.erparse : ""); + storage0.putMyVar('jiekoupublic', data.public ? data.public : ""); } let d = []; d.push({ @@ -228,7 +230,7 @@ function jiekouapi(sourcefile, data) { titleVisible: false, type: "textarea", highlight: true, - height: 4, + height: 3, onChange: $.toString(() => { if (/{|}/.test(input) || !input) { storage0.putMyVar("jiekouparse", input) @@ -245,7 +247,7 @@ function jiekouapi(sourcefile, data) { titleVisible: false, type: "textarea", highlight: true, - height: 4, + height: 3, onChange: $.toString(() => { if (/{|}/.test(input) || !input) { storage0.putMyVar("jiekouerparse", input) @@ -253,6 +255,23 @@ function jiekouapi(sourcefile, data) { }) } }); + d.push({ + title: '公共变量', + col_type: 'input', + desc: "公共变量, {}对象", + extra: { + defaultValue: storage0.getMyVar('jiekoupublic') || "", + titleVisible: false, + type: "textarea", + highlight: true, + height: 3, + onChange: $.toString(() => { + if (/{|}/.test(input) || !input) { + storage0.putMyVar("jiekoupublic", input) + } + }) + } + }); d.push({ title: '测试搜索', col_type: 'text_2', @@ -261,6 +280,7 @@ function jiekouapi(sourcefile, data) { let name = getMyVar('jiekouname'); let type = getMyVar('jiekoutype','漫画'); let erparse = getMyVar('jiekouerparse'); + let public = getMyVar('jiekoupublic'); if(!name || !erparse){ return "toast://名称或搜索源接口不能为空"; } @@ -270,6 +290,9 @@ function jiekouapi(sourcefile, data) { type: type, erparse: erparse } + if(public){ + source.public = public; + } }catch(e){ log(e.message); return "toast://搜索源接口有异常,看日志" @@ -314,6 +337,7 @@ function jiekouapi(sourcefile, data) { let type = getMyVar('jiekoutype','漫画'); let parse = getMyVar('jiekouparse'); let erparse = getMyVar('jiekouerparse'); + let public = getMyVar('jiekoupublic'); let newapi = { name: name, type: type @@ -336,6 +360,9 @@ function jiekouapi(sourcefile, data) { } newapi['erparse'] = erparse; } + if (public) { + newapi['public'] = public; + } let sourcedata = fetch(sourcefile); if (sourcedata != "") { try {