-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathAlistTool.js
More file actions
104 lines (100 loc) · 2.49 KB
/
Copy pathAlistTool.js
File metadata and controls
104 lines (100 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
js:
let d=[];
d.push({
title:'Alist订阅转换器by道长',
url: 'hiker://empty',
col_type: "text_1",
desc: "可以把Pro版订阅转为普通版",
});
d.push({
title:'Pro版订阅',
desc:'输入Pro版订阅文本',
col_type:'input',
extra:{
height:4,
type: "textarea",
highlight:getMyVar('switch','开')==='开',
defaultValue:getMyVar('input',''),
onChange:'putMyVar("input",input)'
}
});
d.push({
title: '高亮开关:'+getMyVar('switch','开'),
url: $('#noLoading#').lazyRule(()=>{
putMyVar('switch',getMyVar('switch','开')==='开'?'关':'开');
refreshPage(false);
return 'hiker://empty'
}),
col_type: "text_3",
});
d.push({
title: '清空输入',
url: $('#noLoading#').lazyRule(()=>{
clearMyVar('input');
refreshPage(false);
return 'hiker://empty'
}),
col_type: "text_3",
});
d.push({
title: '清空输出',
url: $('#noLoading#').lazyRule(()=>{
clearMyVar('output');
refreshPage(false);
return 'hiker://empty'
}),
col_type: "text_3",
});
d.push({
title:'开始转化',
col_type:'text_center_1',
url:$('#noLoading#').lazyRule(()=>{
input=getMyVar("input",'');
if(!input){
return 'toast://啥也没有转换个鸡鸡?'
}
try{
let ret=eval(input);
ret = ret.map((it)=>{
return {
name:it.name,
url:it.host
}
});
putMyVar("output",JSON.stringify(ret));
refreshPage(false);
return 'toast://转换成功'
}catch(e){
return 'toast://出错了!'+e.message
}
})
});
d.push({
title:'普通版订阅',
desc:'输出普通版订阅文本',
col_type:'input',
extra:{
defaultValue:getMyVar('output',''),
height:4,
highlight:getMyVar('switch','开')==='开',
type: "textarea",
onChange:'putMyVar("output",input)'
}
});
d.push({
title:'复制转换结果',
col_type:'text_center_1',
url:$('#noLoading#').lazyRule(()=>{
let output=getMyVar('output','');
if(!output){
return 'toast://啥也没有复制个鸡鸡?'
}
try{
let ret=JSON.stringify(eval(output));
return 'copy://'+ret
}catch(e){
return 'toast://出错了!'+e.message
}
})
});
setResult(d)