Skip to content

Commit 56b395f

Browse files
committed
迁移项目
1 parent 337bada commit 56b395f

336 files changed

Lines changed: 122653 additions & 2 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,53 @@
1-
# hiker
2-
海阔视界静态资源
1+
# hiker海阔视界道长项目库
2+
#### 用户存放一些相关的静态文件以及插件依赖
3+
#### 文件变更日志
4+
###### 2024.10.7
5+
由于gitcode开始做限制,大量直链提示请登录,无法正常访问,因此gitcode项目全部转移至github
6+
项目中所有链接做了统一修改:
7+
```text
8+
https://hjdhnx.coding.net/p/hiker/d/dr/git/raw/master/
9+
```
10+
修改为
11+
```text
12+
https://gitcode.net/qq_32394351/dr/-/raw/master/
13+
```
14+
###### 2022.07.28
15+
由于coding开始做限制,大量直链提示请登录,无法正常访问,因此coding项目全部转移至gitcode
16+
项目中所有链接做了统一修改:
17+
```text
18+
https://hjdhnx.coding.net/p/hiker/d/dr/git/raw/master/
19+
```
20+
修改为
21+
```text
22+
https://gitcode.net/qq_32394351/dr/-/raw/master/
23+
```
24+
25+
```text
26+
http://dr.nokia.press/html/主页时钟天气.html
27+
```
28+
上面这个地址是coding上的pages服务,暂无迁移,道德经刷新海报用的这个地址
29+
30+
### 代码格式化压缩成一行教程
31+
```text
32+
npm install uglify-js -g
33+
uglifyjs xx.js -o xx.min.js
34+
35+
配置webstorm
36+
C:\Users\dashen\AppData\Roaming\npm\uglifyjs.cmd
37+
$FileName$ -o $FileNameWithoutExtension$.min.js
38+
$FileDir$
39+
```
40+
41+
### 格式化教程
42+
```text
43+
vscode安装插件 prettier
44+
webstorm安装插件 prettier
45+
在设置里找到prettier配置保存时执行
46+
对js文件右键,最下面的使用prettier重新格式化
47+
```
48+
49+
### 自动函数参数注释教程
50+
```text
51+
在函数上方输入 /**然后回车即可
52+
完结
53+
```

alist/AlistTool.js

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

alist/主页.js

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
js:
2+
var d = [];
3+
if (getAppVersion() < 3204) {
4+
setResult([{
5+
title: "您当前版本不支持本小程序,请更新至最新版本",
6+
url: "https://haikuo.lanzoui.com/u/GoldRiver"
7+
}])
8+
} else {
9+
const {
10+
getFiles,
11+
getLink
12+
} = $.require('hiker://page/api');
13+
const {color,small}=$.require('hiker://page/utils');
14+
var path = getMyVar("path", "");
15+
d.push({
16+
title: '⚙️设置',
17+
col_type: 'scroll_button',
18+
url: 'hiker://page/settings#noHistory##noRecordHistory#',
19+
extra: {
20+
version: MY_RULE.version
21+
}
22+
});
23+
let sub_urls = $.get_sub_urls();
24+
let rstrip = $.rstrip;
25+
var base_path = rstrip(getMyVar("baseurl", sub_urls[0].url), '/');
26+
let nowSub = sub_urls.find(x=>rstrip(x.url,'/')===base_path);
27+
sub_urls.forEach((item) => {
28+
var isClicked = base_path === rstrip(item.url, '/');
29+
d.push({
30+
title: isClicked ? "‘‘’’<strong><font color='#1E90FF'>" + item.name + "</front></strong>" : item.name,
31+
url: isClicked ? base_path + path : $(rstrip(item.url, '/')+"#noLoading#").lazyRule(() => {
32+
input = input.split('#')[0];
33+
putMyVar("baseurl", input);
34+
clearMyVar("path");
35+
refreshPage(false);
36+
return "toast://切换成功"
37+
}),
38+
col_type: "scroll_button"
39+
});
40+
});
41+
d.push({
42+
col_type: "blank_block"
43+
});
44+
d.push({
45+
title: "‘‘’’<strong><font color='#1E90FF'>...</front></strong>",
46+
url: $('#noLoading#').lazyRule((path) => {
47+
// 返回上级
48+
path.pop();
49+
putMyVar("path", path.join("/"));
50+
if(getItem('clear_change','')){
51+
clearMyVar('search','');
52+
}
53+
refreshPage(false);
54+
return "hiker://empty"
55+
}, path.split("/")),
56+
col_type: "scroll_button"
57+
});
58+
d.push({
59+
title: "🏠首页",
60+
col_type: "scroll_button",
61+
url: $('#noLoading#').lazyRule(() => {
62+
putMyVar("path", "");
63+
if(getItem('clear_refresh','')){
64+
clearMyVar('search','');
65+
}
66+
refreshPage(false);
67+
return "hiker://empty"
68+
}),
69+
});
70+
let paths = "";
71+
for (item of path.split("/")) {
72+
if (item !== "") {
73+
paths += "/" + item;
74+
d.push({
75+
title: item,
76+
col_type: "scroll_button",
77+
url: $('#noLoading#').lazyRule((paths) => {
78+
putMyVar("path", paths);
79+
if(getItem('clear_change','')){
80+
clearMyVar('search','');
81+
}
82+
refreshPage(false);
83+
return "hiker://empty"
84+
}, paths)
85+
})
86+
}
87+
}
88+
let sorts = ["名称", "类型", "大小", '时间'];
89+
let nsort = getMyVar('sort', '名称');
90+
let nsearch = getMyVar('search','');
91+
sorts.forEach(item => {
92+
let cc = nsort === item + "-";
93+
let isClicked = nsort === item;
94+
d.push({
95+
title: cc || isClicked ? "‘‘’’<strong><font color='#1E90FF'>" + item + (cc ? "∧" : "∨") + "</front></strong>" : item,
96+
col_type: "flex_button",
97+
url: $('#noLoading#').lazyRule((item, isClicked) => {
98+
if (isClicked) {
99+
putMyVar("sort", item + "-");
100+
} else {
101+
putMyVar("sort", item);
102+
if(getItem('clear_change','')){
103+
clearMyVar('search','');
104+
}
105+
}
106+
refreshPage(false);
107+
return "hiker://empty"
108+
}, item, isClicked)
109+
});
110+
});
111+
let filterOption = getItem('filterOption','全部');
112+
let filter_rules = JSON.parse(readFile('filter_rules.json', 0) || '[]').filter(x=>x.active);
113+
let filterSels = ['全部','文件','文件夹'];
114+
filterSels = filterSels.concat(filter_rules.map(x=>x.name));
115+
let filterSel = filterSels.map(it=>it===filterOption?color(it,'#12b668'):it);
116+
filterSel.push(color('自定义过滤','#d96715'));
117+
d.push({
118+
title:'⏳'+color(filterOption,'#d96715'),
119+
col_type:'flex_button',
120+
url:$(filterSel,2,'选择要显示的内容').select((filterOption)=>{
121+
input = pdfh(input,'body&&Text').replace('““””','');
122+
if(input==='自定义过滤'){
123+
return 'hiker://page/superSettings#noHistory##noRecordHistory#'
124+
}
125+
if(filterOption!==input){
126+
setItem('filterOption',input);
127+
refreshPage(false);
128+
}
129+
return 'hiker://empty'
130+
},filterOption),
131+
});
132+
d.push({
133+
title:nsearch?"🔍"+small(color(':'+nsearch,'#12b668')):'🔍',
134+
col_type:'flex_button',
135+
url:$(nsearch,'输入要搜索的内容。支持正则。如\\.js').input((nsearch)=>{
136+
if(input!==nsearch){
137+
putMyVar('search',input);
138+
refreshPage(false);
139+
}
140+
return 'hiker://empty'
141+
},nsearch),
142+
});
143+
d.push({
144+
title: color("🕓历史","#d96715"),
145+
url: "hiker://page/history#noHistory##noRecordHistory#",
146+
col_type: "flex_button"
147+
});
148+
let dirInfo = getFiles(path,filterOption);
149+
if(dirInfo.can_upload){
150+
d.push({
151+
title: color("⛅访客","#15ab21"),
152+
url: "hiker://page/upload#noHistory##noRecordHistory#",
153+
col_type: "flex_button"
154+
});
155+
}
156+
// log(nowSub);
157+
if(path.split('/').length>1&&nowSub&&nowSub.webdav&&nowSub.webdav.user){
158+
let web_dav = nowSub.webdav;
159+
// log(webdav);
160+
d.push({
161+
title: color("📂创建","#15ab21"),
162+
url: $('','请输入待创建的文件夹名称').input((user,pwd,base_path,path)=>{
163+
if(input){
164+
let url = base_path +'/dav'+path;
165+
log(url);
166+
let webdav = buildWebDav(url, user, pwd);
167+
webdav.makeDir(input);
168+
refreshPage(false);
169+
return "toast://文件夹"+input+"创建完毕"
170+
}
171+
return 'hiker://empty'
172+
},web_dav.user,web_dav.pwd,base_path,path),
173+
col_type: "flex_button"
174+
});
175+
d.push({
176+
title: color("☁上传","#15ab21"),
177+
url: "hiker://page/webdavUpload#noHistory##noRecordHistory#",
178+
col_type: "flex_button"
179+
});
180+
}
181+
d.push({
182+
title:color('🔍全局','#12b668'),
183+
col_type:'flex_button',
184+
url:'hiker://page/search?page=fypage#noHistory##noRecordHistory#',
185+
});
186+
d.push({
187+
col_type: "line_blank"
188+
});
189+
let clickOption = getItem('clickOption', '打开');
190+
let showZimu = getItem('showZimu','开');
191+
dirInfo.result.forEach(item => {
192+
if (item.url) {
193+
d.push({
194+
title: item.title,
195+
img: item.img,
196+
url: item.url,
197+
col_type: item.col_type,
198+
});
199+
} else {
200+
// let it_type = item.extra.type;
201+
let it_type = item.type;
202+
let url = 'hiker://empty';
203+
let title = item.extra.name || item.title;
204+
let id=item.extra.id;
205+
if (it_type === 1) {
206+
url = $('#noLoading#').lazyRule((item, title) => {
207+
putMyVar("path", $.rstrip(getMyVar("path", ""),'/' )+ "/" + title);
208+
if(getItem('clear_change','')){
209+
clearMyVar('search','');
210+
}
211+
refreshPage(false);
212+
return "hiker://empty"
213+
}, item, title);
214+
} else if (it_type === 3 || /\.m3u8$/.test(title)) { //3是媒体,禁用下载和跳转
215+
url = getLink(title, null,'打开', showZimu,'#isVideo=true#');
216+
} else if (it_type === 6) {
217+
url = getLink(title, null,'打开', showZimu,"#.jpg");
218+
} else { //跟随系统预览和下载
219+
url = getLink(title, null,clickOption,showZimu);
220+
}
221+
d.push({
222+
title: item.title,
223+
img: item.img,
224+
url: url,
225+
col_type: item.col_type,
226+
extra: {
227+
id:id,
228+
type: it_type,
229+
title: title,
230+
}
231+
});
232+
}
233+
});
234+
setResult(d);
235+
}

0 commit comments

Comments
 (0)