-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy path预处理.js
More file actions
53 lines (53 loc) · 1.76 KB
/
Copy path预处理.js
File metadata and controls
53 lines (53 loc) · 1.76 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
$.require('hiker://page/libs?rule=道长仓库Pro');
if (!(getAppVersion() < 3204)) {
const {getU}=$.require('hiker://page/api');
const {isOffice}=$.require('hiker://page/fileType');
const {similar,removeExt,saveHistory,renderText}=$.require('hiker://page/utils');
$.extend({
get_sub_urls() {
let sub_urls = JSON.parse(readFile('sub_urls.json', 0) || '[]');
if (sub_urls.length < 1) {
sub_urls = this.sub_urls;
}
return sub_urls
},
getU:getU,
isOffice:isOffice,
similar:similar,
removeExt:removeExt,
saveHistory:saveHistory,
renderText:renderText,
lstrip(string,char){//去除左边指定字符
return string.replace(new RegExp('^\\'+char+'+', 'g'), '');
},
rstrip(string,char){//去除右边指定字符
return string.replace(new RegExp('\\'+char+'+$', 'g'), '');
},
strip(string,char){//去除两边指定字符
return string.replace(new RegExp('^\\'+char+'+|\\'+char+'+$', 'g'), '');
},
getTimeOut(){
return Number(getItem('timeout',this.timeout+''))
},
timeout:3500,
sub_urls: [{
name: '小棉袄仓库',
url: 'http://pan.haikuoshijie.cn/',
}, {
name: '嗨翻',
url: 'https://pan.hikerfans.com/',
}, {
name: '非盘',
url: 'http://www.feifwp.top/',
}, {
name: '姬路白雪',
url: 'https://pan.jlbx.xyz/',
}, {
name: '听闻',
url: 'https://wangpan.sangxuesheng.com/',
}, {
name: 'Joe自用',
url: 'http://joegu.tk/',
}],
});
}