From c1bb4e95193df699d0f0a4050c397bf9efc25086 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Fri, 25 Aug 2023 14:17:25 +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 | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/SrcJuSet.js b/SrcJuSet.js index 1413ed20..033101c0 100644 --- a/SrcJuSet.js +++ b/SrcJuSet.js @@ -190,7 +190,30 @@ function SRCSet() { }else{ let additem = { title: taskResult.id, - url: "", + url: $(["删除", "禁用"], 2).select((id) => { + let sourcefile = "hiker://files/rules/Src/Ju/jiekou.json"; + if (input == "删除") { + return $("确定删除:"+id).confirm((sourcefile,id)=>{ + let sourcedata = fetch(sourcefile); + eval("var datalist=" + sourcedata + ";"); + let index = datalist.indexOf(datalist.filter(d => d.type+"_"+d.name == id)[0]); + datalist.splice(index, 1); + writeFile(sourcefile, JSON.stringify(datalist)); + clearMyVar('SrcJu_searchMark'); + deleteItem(id); + return 'toast://已删除'; + },sourcefile,id) + } else if (input == "禁用") { + let sourcedata = fetch(sourcefile); + eval("var datalist=" + sourcedata + ";"); + let index = datalist.indexOf(datalist.filter(d => d.type+"_"+d.name == id)[0]); + datalist[index].stop = 1; + writeFile(sourcefile, JSON.stringify(datalist)); + clearMyVar('SrcJu_searchMark'); + deleteItem(id); + return 'toast://' + id + "已禁用"; + } + }, taskResult.id), col_type: "text_1", extra: { id: taskResult.id