├── .gitignore
├── Config.js
├── MyWeb
└── custome 2048
│ ├── 2048.css
│ ├── index.html
│ ├── main2048.js
│ ├── picture
│ ├── 1024.jpg
│ ├── 128.jpg
│ ├── 16.jpg
│ ├── 16384.jpg
│ ├── 2.jpg
│ ├── 2048.jpg
│ ├── 256.jpg
│ ├── 32.jpg
│ ├── 4.jpg
│ ├── 4096.jpg
│ ├── 512.jpg
│ ├── 64.jpg
│ ├── 8.jpg
│ ├── 8192.jpg
│ ├── 原图
│ │ ├── IMG_6008.PNG
│ │ ├── IMG_6009.PNG
│ │ ├── IMG_6010.PNG
│ │ ├── IMG_6011.PNG
│ │ ├── IMG_6012.PNG
│ │ ├── IMG_6013.PNG
│ │ └── IMG_6030.JPG
│ ├── 版本一
│ │ ├── 1024.jpg
│ │ ├── 128.jpg
│ │ ├── 16.jpg
│ │ ├── 16384.jpg
│ │ ├── 2.jpg
│ │ ├── 2048.jpg
│ │ ├── 256.jpg
│ │ ├── 32.jpg
│ │ ├── 4.jpg
│ │ ├── 4096.jpg
│ │ ├── 512.jpg
│ │ ├── 64.jpg
│ │ ├── 8.jpg
│ │ └── 8192.jpg
│ └── 版本二
│ │ ├── 1024.jpg
│ │ ├── 128.jpg
│ │ ├── 16.jpg
│ │ ├── 2.jpg
│ │ ├── 2048.jpg
│ │ ├── 256.jpg
│ │ ├── 32.jpg
│ │ ├── 4.jpg
│ │ ├── 4096.jpg
│ │ ├── 512.jpg
│ │ ├── 64.jpg
│ │ ├── 8.jpg
│ │ ├── 8192.jpg
│ │ └── 原图
│ │ ├── 2fc131uo0wv1000.jpg
│ │ ├── 2fc141uo0wv1000.jpg
│ │ ├── 2fc161uo0wv1000.jpg
│ │ ├── 2fc171uo0wv1000.jpg
│ │ ├── 2fc181uo0wv1000.jpg
│ │ ├── 2fc1a1uo0wv1000.jpg
│ │ ├── 2fc1b1uo0wv1000.jpg
│ │ ├── 2fc1d1uo0wv1000.jpg
│ │ ├── 2fc1p1uo0wv1000.jpg
│ │ ├── 2fc5j1uo0wv1000.jpg
│ │ ├── 2fch31uo0wv1000.jpg
│ │ ├── 2fgcl1uo0wv1000.jpg
│ │ └── 2fh1f1uo0wv1000.jpg
│ ├── showanimation2048.js
│ └── support2048.js
├── NASA.js
├── README.md
├── README_EN.md
├── RSS Reg Parse.js
├── RSS.js
├── _config.yml
├── funko图片下载
├── download.js
└── funko download.js
├── 下载INS图片.js
├── 修正格式用.html
├── 修正格式用.js
├── 去重工具.js
├── 文献下载
├── ArticlesHelper.box
├── 历史版本备份
│ ├── 文献下载1.0.js
│ ├── 文献下载2.0.js
│ ├── 文献下载2.1.js
│ ├── 文献下载2.2.js
│ ├── 文献下载2.5.js
│ ├── 文献下载助手3.0
│ │ ├── README.md
│ │ ├── assets
│ │ │ └── icon.png
│ │ ├── config.json
│ │ ├── main.js
│ │ ├── main.ux
│ │ │ ├── actions.js
│ │ │ └── views.json
│ │ ├── scripts
│ │ │ └── app.js
│ │ └── strings
│ │ │ ├── en.strings
│ │ │ └── zh-Hans.strings
│ ├── 文献下载助手3.1
│ │ ├── README.md
│ │ ├── assets
│ │ │ └── icon.png
│ │ ├── config.json
│ │ ├── main.js
│ │ ├── main.ux
│ │ │ ├── actions.js
│ │ │ └── views.json
│ │ ├── scripts
│ │ │ └── app.js
│ │ └── strings
│ │ │ ├── en.strings
│ │ │ └── zh-Hans.strings
│ ├── 文献下载助手3.2
│ │ ├── README.md
│ │ ├── assets
│ │ │ └── icon.png
│ │ ├── config.json
│ │ ├── main.js
│ │ ├── main.ux
│ │ │ ├── actions.js
│ │ │ └── views.json
│ │ ├── scripts
│ │ │ └── app.js
│ │ └── strings
│ │ │ ├── en.strings
│ │ │ └── zh-Hans.strings
│ ├── 文献下载助手4.0
│ │ ├── README.md
│ │ ├── assets
│ │ │ ├── errorlist.json
│ │ │ ├── icloudlist.json
│ │ │ ├── icon.png
│ │ │ └── locallist.json
│ │ ├── config.json
│ │ ├── main.js
│ │ ├── main.ux
│ │ │ ├── actions.js
│ │ │ └── views.json
│ │ ├── scripts
│ │ │ └── app.js
│ │ └── strings
│ │ │ ├── en.strings
│ │ │ └── zh-Hans.strings
│ ├── 文献下载助手4.1 归档 (获取链接后下载 隐藏label定位)
│ │ ├── README.md
│ │ ├── assets
│ │ │ ├── icloudlist.json
│ │ │ ├── icon.png
│ │ │ └── linklist.json
│ │ ├── config.json
│ │ ├── main.js
│ │ ├── main.ux
│ │ │ ├── actions.js
│ │ │ └── views.json
│ │ ├── scripts
│ │ │ └── app.js
│ │ └── strings
│ │ │ ├── en.strings
│ │ │ └── zh-Hans.strings
│ ├── 文献下载助手4.1 归档(批量下载bug 尝试await或者if switch太快了(可能有bug))
│ │ ├── README.md
│ │ ├── assets
│ │ │ ├── errorlist.json
│ │ │ ├── icloudlist.json
│ │ │ ├── icon.png
│ │ │ └── locallist.json
│ │ ├── config.json
│ │ ├── main.js
│ │ ├── main.ux
│ │ │ ├── actions.js
│ │ │ └── views.json
│ │ ├── scripts
│ │ │ └── app.js
│ │ └── strings
│ │ │ ├── en.strings
│ │ │ └── zh-Hans.strings
│ └── 文献下载助手4.9
│ │ ├── README.md
│ │ ├── assets
│ │ ├── icloudlist.json
│ │ ├── icon.png
│ │ └── locallist.json
│ │ ├── config.json
│ │ ├── main.js
│ │ ├── main.ux
│ │ ├── actions.js
│ │ └── views.json
│ │ ├── scripts
│ │ └── app.js
│ │ └── strings
│ │ ├── en.strings
│ │ └── zh-Hans.strings
└── 文献下载助手
│ ├── README.md
│ ├── assets
│ ├── icloudlist.json
│ ├── icon.png
│ └── locallist.json
│ ├── config.json
│ ├── main.js
│ ├── main.ux
│ ├── actions.js
│ └── views.json
│ ├── scripts
│ └── app.js
│ └── strings
│ ├── en.strings
│ └── zh-Hans.strings
├── 样例学习
├── MyApp
│ ├── README.md
│ ├── assets
│ │ └── icon.png
│ ├── config.json
│ ├── main.js
│ ├── scripts
│ │ ├── app.js
│ │ ├── groups.js
│ │ ├── navigationBar.js
│ │ ├── spinner.js
│ │ ├── tabBar.js
│ │ └── utils.js
│ └── strings
│ │ ├── en.strings
│ │ └── zh-Hans.strings
├── bili.js
├── cview-widget-views
│ ├── index.js
│ ├── package-lock.json
│ └── package.json
├── react-jsbox-example
│ ├── README.md
│ ├── assets
│ │ ├── code.png
│ │ ├── icon.png
│ │ ├── prism.html
│ │ └── react-lottie.json
│ ├── config.json
│ ├── main.js
│ ├── report.html
│ ├── scripts
│ │ ├── components
│ │ │ ├── CodeView.js
│ │ │ └── ExampleView.js
│ │ ├── constants.js
│ │ ├── examples
│ │ │ ├── AnimateExample.js
│ │ │ ├── BasicExample.js
│ │ │ ├── CacheExample.js
│ │ │ ├── HttpExample.js
│ │ │ ├── JsxLiteralExample.js
│ │ │ ├── LottieExample.js
│ │ │ ├── TodoExample.js
│ │ │ ├── WebViewExample.js
│ │ │ └── index.js
│ │ ├── helper.js
│ │ ├── index.js
│ │ └── store.js
│ └── strings
│ │ ├── en.strings
│ │ └── zh-Hans.strings
├── runtime-browser
│ ├── README.md
│ ├── config.json
│ ├── main.js
│ ├── report.html
│ ├── scripts
│ │ ├── App.js
│ │ ├── components
│ │ │ ├── CodeView.js
│ │ │ ├── Input.js
│ │ │ └── Tab.js
│ │ ├── constants.js
│ │ ├── containers
│ │ │ ├── History.js
│ │ │ ├── Home.js
│ │ │ └── Settings.js
│ │ ├── helper.js
│ │ ├── index.js
│ │ └── store.js
│ └── strings
│ │ ├── en.strings
│ │ └── zh-Hans.strings
└── 影视大全
│ ├── README.md
│ ├── assets
│ ├── icon.png
│ └── lottie
│ │ ├── checkmark.json
│ │ ├── confetti.json
│ │ ├── launch-screen.json
│ │ └── list-loading.json
│ ├── config.json
│ ├── erots.json
│ ├── main.js
│ ├── scripts
│ ├── api.js
│ ├── app.js
│ ├── database.js
│ ├── favorite.js
│ ├── finds.js
│ ├── info.js
│ ├── launchScreen.js
│ ├── main.js
│ ├── message.js
│ ├── navigationBar.js
│ ├── picker.js
│ ├── playHistory.js
│ ├── player.js
│ ├── search.js
│ ├── setting.js
│ ├── siri.js
│ ├── spinner.js
│ ├── utils.js
│ └── widget.js
│ └── strings
│ ├── en.strings
│ └── zh-Hans.strings
├── 氨基酸.js
├── 热门监控
├── README.md
├── assets
│ └── icon.png
├── index.js
├── package.json
└── strings
│ ├── en.strings
│ └── zh-Hans.strings
├── 经纬度转坐标.js
└── 缩写翻译
├── 1.0缩写翻译.js
├── 1.1缩写翻译输入版本.js
└── 1.2缩写翻译输入粘贴并存.js
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | Config.js
3 | MyWeb/Zheng.zip
4 |
--------------------------------------------------------------------------------
/Config.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Author: evilbutcher
3 | * Github: https://github.com/evilbutcher
4 | */
5 |
6 | module.exports = {
7 | bilibili: () => 0, //👈就改这个数字。B站榜单对应关系:0全站,1动画,3音乐,4游戏,5娱乐,36科技,119鬼畜,129舞蹈。
8 | blnum: () => 6, //自定义B站显示数量
9 | blrancolor: () => true, //是否开启B站随机颜色
10 | dbnum: () => 6, //自定义豆瓣显示数量
11 | dbrancolor: () => true, //是否开启豆瓣随机颜色
12 | rrnum: () => 6, //自定义人人影视显示数量
13 | rrrancolor: () => true, //是否开启人人影视随机颜色
14 | rsslink: () =>
15 | "https://github.com/evilbutcher/Quantumult_X/commits/master.atom", //👈就改引号里的链接。
16 | rssnum: () => 6, //自定义RSS显示数量
17 | rssrancolor: () => true, //是否开启RSS随机颜色
18 | wbnum: () => 6, //自定义微博显示数量
19 | wbrancolor: () => true, //是否开启微博随机颜色
20 | zhnum: () => 6, //自定义知乎显示数量
21 | zhrancolor: () => true, //是否开启知乎随机颜色
22 | nasaapi: () => "686BJ2YbpYYmyxvbk312vmj5EuMcOp8gaVTeVs0t", //填写NASA API Key
23 | imglink: () => "http://api.dujin.org/bing/1366.php", //NASA备用图片地址,可自定义
24 | imglink2: () => "https://source.unsplash.com/random", //NASA备用图片地址,可自定义
25 | checkintitle: () => "", //填写签到标题
26 | checkinloginurl: () => "", //填写签到登陆链接
27 | checkinemail: () => "", //填写签到邮箱
28 | checkinpwd: () => "", //填写签到密码
29 | apps: () => [
30 | "1443988620|hk",
31 | "1312014438 cn",
32 | "499470113/vn",
33 | "1314212521-jp",
34 | "1282297037_au",
35 | "932747118:ie",
36 | "1116905928",
37 | "1373567447",
38 | ], //app跟踪id
39 | reg: () => "cn", //默认区域:美国us 中国cn 香港hk
40 | lastnumberofcar: () => "3" //北京尾号限行脚本填写汽车尾号
41 | };
42 |
--------------------------------------------------------------------------------
/MyWeb/custome 2048/2048.css:
--------------------------------------------------------------------------------
1 | @charset "utf-8";
2 | /* CSS Document */
3 | header {
4 | display: block;
5 | margin: 0 auto;
6 | width: 100%;
7 | text-align: center;
8 | }
9 | header h1 {
10 | margin: 0 auto;
11 | font-family: Arial sans-serif;
12 | font-size: 40px;
13 | font-weight: bold;
14 | }
15 | header #newgamebutton {
16 | display: block;
17 | width: 100px;
18 | margin: 10px auto;
19 | padding: 10px 10px;
20 | background-color: #8f7a66;
21 | font-family: Arial sans-serif;
22 | color: #fff;
23 | border-radius: 10px;
24 | text-decoration: none;
25 | }
26 | header #newgamebutton:hover {
27 | background-color: #9f8b77;
28 | }
29 | header p {
30 | margin: 10px auto;
31 | font-family: Arial sans-serif;
32 | font-size: 25px;
33 | }
34 | #grid-container {
35 | position: relative;
36 | width: 460px;
37 | height: 460px;
38 | padding: 20px;
39 | margin: 10px auto;
40 | background-color: #bbada0;
41 | border-radius: 10px;
42 | }
43 | #game-over {
44 | display: none;
45 | position: absolute;
46 | z-index: 999999;
47 | }
48 | .grid-cell {
49 | position: absolute;
50 | width: 100px;
51 | height: 100px;
52 | border-radius: 6px;
53 | background-color: #ccc0b3;
54 | }
55 | .number-cell {
56 | position: absolute;
57 | font-family: Arial sans-serif;
58 | font-weight: bold;
59 | font-size: 60px;
60 | line-height: 100px;
61 | text-align: center;
62 | border-radius: 6px;
63 | }
64 | .img {
65 | width: 100%;
66 | height: 100%;
67 | }
--------------------------------------------------------------------------------
/MyWeb/custome 2048/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Doctor Who
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | Doctor Who
16 | New Game
17 | score:0
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/1024.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/1024.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/128.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/128.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/16.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/16384.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/16384.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/2.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/2048.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/2048.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/256.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/256.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/32.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/32.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/4.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/4096.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/4096.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/512.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/512.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/64.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/64.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/8.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/8192.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/8192.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/原图/IMG_6008.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/原图/IMG_6008.PNG
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/原图/IMG_6009.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/原图/IMG_6009.PNG
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/原图/IMG_6010.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/原图/IMG_6010.PNG
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/原图/IMG_6011.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/原图/IMG_6011.PNG
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/原图/IMG_6012.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/原图/IMG_6012.PNG
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/原图/IMG_6013.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/原图/IMG_6013.PNG
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/原图/IMG_6030.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/原图/IMG_6030.JPG
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本一/1024.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本一/1024.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本一/128.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本一/128.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本一/16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本一/16.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本一/16384.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本一/16384.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本一/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本一/2.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本一/2048.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本一/2048.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本一/256.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本一/256.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本一/32.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本一/32.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本一/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本一/4.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本一/4096.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本一/4096.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本一/512.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本一/512.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本一/64.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本一/64.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本一/8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本一/8.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本一/8192.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本一/8192.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/1024.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/1024.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/128.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/128.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/16.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/2.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/2048.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/2048.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/256.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/256.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/32.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/32.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/4.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/4096.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/4096.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/512.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/512.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/64.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/64.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/8.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/8192.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/8192.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/原图/2fc131uo0wv1000.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/原图/2fc131uo0wv1000.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/原图/2fc141uo0wv1000.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/原图/2fc141uo0wv1000.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/原图/2fc161uo0wv1000.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/原图/2fc161uo0wv1000.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/原图/2fc171uo0wv1000.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/原图/2fc171uo0wv1000.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/原图/2fc181uo0wv1000.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/原图/2fc181uo0wv1000.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/原图/2fc1a1uo0wv1000.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/原图/2fc1a1uo0wv1000.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/原图/2fc1b1uo0wv1000.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/原图/2fc1b1uo0wv1000.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/原图/2fc1d1uo0wv1000.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/原图/2fc1d1uo0wv1000.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/原图/2fc1p1uo0wv1000.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/原图/2fc1p1uo0wv1000.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/原图/2fc5j1uo0wv1000.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/原图/2fc5j1uo0wv1000.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/原图/2fch31uo0wv1000.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/原图/2fch31uo0wv1000.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/原图/2fgcl1uo0wv1000.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/原图/2fgcl1uo0wv1000.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/picture/版本二/原图/2fh1f1uo0wv1000.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/MyWeb/custome 2048/picture/版本二/原图/2fh1f1uo0wv1000.jpg
--------------------------------------------------------------------------------
/MyWeb/custome 2048/showanimation2048.js:
--------------------------------------------------------------------------------
1 | // JavaScript Document
2 | function showNumberWithAnimation(i, j, Num) {
3 | var numberCell = $('#number-cell-' + i + "-" + j);
4 | numberCell.css('background-color', getNumberBackgroundColor(Num));
5 | numberCell.append('
');
6 | numberCell.animate({
7 | width: cellSideLength,
8 | height: cellSideLength,
9 | top: getPosTop(i, j),
10 | left: getPosLeft(i, j)
11 | }, 50);
12 | }
13 |
14 | function moveWithAnimation(fromX, fromY, toX, toY) {
15 | var numberCell = $("#number-cell-" + fromX + "-" + fromY);
16 | numberCell.animate({
17 | top: getPosTop(toX, toY),
18 | left: getPosLeft(toX, toY)
19 | }, 200);
20 | }
21 |
--------------------------------------------------------------------------------
/MyWeb/custome 2048/support2048.js:
--------------------------------------------------------------------------------
1 | // JavaScript Document
2 | var documentWidth = window.screen.availWidth;
3 | var gridContainerWidth = 0.92 * documentWidth;
4 | var cellSideLength = 0.18 * documentWidth;
5 | var cellSpace = 0.04 * documentWidth;
6 |
7 | function getPosTop(i, j) {
8 | return cellSpace + i * (cellSideLength + cellSpace);
9 | }
10 |
11 | function getPosLeft(i, j) {
12 | return cellSpace + j * (cellSideLength + cellSpace);
13 | }
14 |
15 | function noSpace() {
16 | for (var i = 0; i < 4; i++) {
17 | for (var j = 0; j < 4; j++) {
18 | if (board[i][j] == 0) return false;
19 | }
20 | }
21 | return true;
22 | }
23 |
24 | function getNumberBackgroundColor(num) {
25 | switch (num) {
26 | case 2:
27 | return "#eee4da";
28 | break;
29 | case 4:
30 | return "#ede0c8";
31 | break;
32 | case 8:
33 | return "#f2b179";
34 | break;
35 | case 16:
36 | return "#f59563";
37 | break;
38 | case 32:
39 | return "#f67c5f";
40 | break;
41 | case 64:
42 | return "#f65e3b";
43 | break;
44 | case 128:
45 | return "#edcf72";
46 | break;
47 | case 256:
48 | return "#edcc61";
49 | break;
50 | case 512:
51 | return "#9c0";
52 | break;
53 | case 1024:
54 | return "#33b5e5";
55 | break;
56 | case 2048:
57 | return "#09c";
58 | break;
59 | case 4096:
60 | return "#a6c";
61 | break;
62 | case 8192:
63 | return "#93c";
64 | break;
65 | case 16384:
66 | return "#7906b3";
67 | break;
68 | }
69 | }
70 |
71 | function getNumberColor(num) {
72 | if (num <= 4) {
73 | return "#000";
74 | } else {
75 | return "#fff"
76 | }
77 | }
78 |
79 | function canMoveLeft() {
80 | for (var i = 0; i < 4; i++) {
81 | for (var j = 1; j < 4; j++) {
82 | if (board[i][j] != 0) {
83 | if (board[i][j - 1] == 0 || board[i][j] == board[i][j - 1]) {
84 | return true;
85 | }
86 | }
87 | }
88 | }
89 | return false;
90 | }
91 |
92 | function canMoveUp() {
93 | for (var i = 1; i < 4; i++) {
94 | for (var j = 0; j < 4; j++) {
95 | if (board[i][j] != 0) {
96 | if (board[i - 1][j] == 0 || board[i][j] == board[i - 1][j]) {
97 | return true;
98 | }
99 | }
100 | }
101 | }
102 | return false;
103 | }
104 |
105 | function canMoveRight() {
106 | for (var i = 0; i < 4; i++) {
107 | for (var j = 0; j < 3; j++) {
108 | if (board[i][j] != 0) {
109 | if (board[i][j + 1] == 0 || board[i][j] == board[i][j + 1]) {
110 | return true;
111 | }
112 | }
113 | }
114 | }
115 | return false;
116 | }
117 |
118 | function canMoveDown() {
119 | for (var i = 0; i < 3; i++) {
120 | for (var j = 0; j < 4; j++) {
121 | if (board[i][j] != 0) {
122 | if (board[i + 1][j] == 0 || board[i][j] == board[i + 1][j]) {
123 | return true;
124 | }
125 | }
126 | }
127 | }
128 | return false;
129 | }
130 |
131 | function noBlockHorizontal(row, col1, col2) {
132 | for (var i = col1 + 1; i < col2; i++)
133 | if (board[row][i] != 0)
134 | return false;
135 | return true;
136 | }
137 |
138 | function noBlockVerticle(col, row1, row2) {
139 | for (var i = row1 + 1; i < row2; i++)
140 | if (board[i][col] != 0)
141 | return false;
142 | return true;
143 | }
144 |
145 | function noMove() {
146 | if (canMoveDown() ||
147 | canMoveLeft() ||
148 | canMoveRight() ||
149 | canMoveUp()) {
150 | return false;
151 | } else {
152 | return true;
153 | }
154 | }
155 |
156 | function loadImg() {
157 | var img = [];
158 | for (var i = 2; i < 16385; i = 2 * i) {
159 | img[i] = new Image();
160 | img[i].src = 'picture/' + i + '.jpg';
161 | }
162 | }
163 |
--------------------------------------------------------------------------------
/NASA.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Author: evilbutcher
3 | * Github: https://github.com/evilbutcher
4 | **/
5 | const $ = require("Config");
6 | const ERR = MYERR();
7 |
8 | !(async () => {
9 | if (init() == true) {
10 | var imglink = await getinfo();
11 | var flag = Math.floor(Math.random() * 10);
12 | if ($.headers.statusCode == 200) {
13 | if (flag >= 0 && flag < 2) {
14 | console.log(`${flag} 展示备用图片1`);
15 | var cover = $.thisimglink;
16 | } else if (flag >= 2 && flag < 4) {
17 | console.log(`${flag} 展示备用图片2`);
18 | cover = $.thisimglink2;
19 | } else {
20 | console.log(`${flag} 展示NASA图片`);
21 | cover = imglink[0];
22 | var title = imglink[1];
23 | console.log(title);
24 | }
25 | } else {
26 | if (flag >= 0 && flag < 5) {
27 | console.log(`${flag} 展示备用图片1`);
28 | cover = $.thisimglink;
29 | } else {
30 | console.log(`${flag} 展示备用图片2`);
31 | cover = $.thisimglink2;
32 | }
33 | }
34 | $widget.setTimeline(ctx => {
35 | return {
36 | type: "zstack",
37 | views: [
38 | {
39 | type: "image",
40 | props: {
41 | uri: cover,
42 | resizable: true,
43 | scaledToFill: true,
44 | clipped: true,
45 | widgetURL: cover
46 | }
47 | },
48 | {
49 | type: "text",
50 | props: {
51 | text: title,
52 | font: {
53 | name: "Cochin-Italic",
54 | size: 20
55 | },
56 | color: $color("white"),
57 | lineLimit: 1
58 | }
59 | }
60 | ]
61 | };
62 | });
63 | }
64 | })().catch(err => {
65 | if (err instanceof ERR.TokenError) {
66 | $push.schedule({
67 | title: "NASA - Config配置错误❌",
68 | body: err.message
69 | });
70 | } else if (err instanceof ERR.RequestError) {
71 | console.log("NASA - 网络错误❌" + err.message);
72 | } else {
73 | $push.schedule({
74 | title: "NASA - 出现错误❌",
75 | body: JSON.stringify(err, Object.getOwnPropertyNames(err))
76 | });
77 | }
78 | });
79 |
80 | function init() {
81 | try {
82 | $.thisapikey = $.nasaapi();
83 | $.thisimglink = $.imglink();
84 | $.thisimglink2 = $.imglink2();
85 | return true;
86 | } catch (err) {
87 | throw new ERR.TokenError("配置文件中未找到NASA API或备用图片地址");
88 | }
89 | }
90 |
91 | function MYERR() {
92 | class TokenError extends Error {
93 | constructor(message) {
94 | super(message);
95 | this.name = "TokenError";
96 | }
97 | }
98 | class RequestError extends Error {
99 | constructor(message) {
100 | super(message);
101 | this.name = "RequestError";
102 | }
103 | }
104 | return {
105 | TokenError,
106 | RequestError
107 | };
108 | }
109 |
110 | async function getinfo() {
111 | const url = `https://api.nasa.gov/planetary/apod?api_key=${$.thisapikey}`;
112 | var resp = await $http.get({
113 | url: url,
114 | timeout: 8
115 | });
116 | $.headers = resp.response;
117 | if ($.headers == null) {
118 | throw new ERR.RequestError("网络超时获取失败");
119 | }
120 | var cover = resp.data.url;
121 | var title = resp.data.title;
122 | return [cover, title];
123 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://github.com/anuraghazra/github-readme-stats)
2 |
3 | # 个人脚本整理
4 |
5 | [English Version](https://github.com/evilbutcher/Code/blob/master/README_EN.md)
6 |
7 | ⚠️ 所有内容仅供交流学习,请于下载后 24h 内删除,勿挪作他用,否则后果自负 ⚠️
8 | ⚠️ 一旦下载即视为您同意上述要求 ⚠️
9 |
10 | ## 【JSBox】
11 |
12 | ### [文献下载助手](https://github.com/evilbutcher/Code/tree/master/%E6%96%87%E7%8C%AE%E4%B8%8B%E8%BD%BD/%E6%96%87%E7%8C%AE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B)
13 |
14 | #### [安装链接](https://xteko.com/redir?name=ArticlesHelper&url=https%3A%2F%2Fgithub.com%2Fevilbutcher%2FCode%2Fraw%2Fmaster%2F%25E6%2596%2587%25E7%258C%25AE%25E4%25B8%258B%25E8%25BD%25BD%2FArticlesHelper.box)
15 |
16 | #### 功能特点
17 |
18 | 1. 输入 doi 号(默认复制剪贴板文本),点击“下载”按钮即可下载文献;可批量下载,doi 用英文逗号(,)隔开。
19 | 2. 长按地址栏可检测链接是否可用。
20 | 3. 若提示错误,长按对应的链接尝试手动下载。
21 | 4. 在文献界面,点击文献可以删除,长按可以分享。
22 | 5. 打开重命名开关将采用标题-期刊-卷-doi 方式命名,因为需要向同一网址请求数据,批量下载大于 5 篇时会关闭,否则有拉黑 ip 风险。
23 | 6. 关闭 iCloud Drive,文献存储在脚本目录 articles 下(可打包分享);打开 iCloud Drive,文献存储在 JSBox/ArticlesHelper/articles 目录下。
24 | 7. iCloud 中的 ArticlesHelper/download 目录用来存储 wos 下载的 html 记录。具体方法:Safari 下载 html 格式的 wos 文献记录,下载完成后打开目录,转存至 ArticlesHelper/download 文件夹,打开脚本,通过载入文件解析 doi,若有多篇文献记录默认载入最后一个文件的 doi。所有文献记录以 txt 格式保存在 ArticlesHelper/articles 目录下,可通过文献界面下拉刷新对解析记录进行管理。
25 | 8. Windows 用户可在 Microsoft Store 下载 iCloud 进行同步。
26 |
27 | ### [热门监控](https://github.com/evilbutcher/Code/tree/master/%E7%83%AD%E9%97%A8%E7%9B%91%E6%8E%A7)
28 |
29 | #### 功能特点
30 |
31 | 1. 可以选择性监控榜单。
32 | 2. 可以分别设定每个榜单的最热内容数量。
33 | 3. 可以选择是否附带话题链接。
34 | 4. 可以自定每个榜单是匹配关键词还是获取最新内容。
35 | 5. 可以自定每个榜单内容独立推送还是合并推送。
36 | 6. 一些榜单单独推送时支持封面。
37 | 7. 支持 BoxJs。
38 | 8. 监控微博热搜关键词。
39 | 9. 监控知乎热榜关键词。
40 | 10. 监控百度风云榜关键词。
41 | 11. 监控 B 站日榜关键词(对应关系:0 全站,1 动画,3 音乐,4 游戏,5 娱乐,36 科技,119 鬼畜,129 舞蹈)。
42 | 12. 监控豆瓣电影关键词。
43 | 13. 监控抖音视频关键词。
44 | 14. 监控 36 氪关键词。
45 | 15. 监控 Kindle 图书关键词。
46 | 16. 监控 RSSHub 订阅,感谢@api-evangelist-[rss2json](https://github.com/api-evangelist/rss2json)。
47 | 17. 监控人人影视最新上传,配合捷径[磁力离线](https://www.icloud.com/shortcuts/cfad8390798e459db458d6233d229209)可实现磁力下载,解锁追剧新姿势。
48 | 18. 可自定关键词推送间隔。
49 |
50 | ### [缩写翻译](https://github.com/evilbutcher/Code/blob/master/%E7%BC%A9%E5%86%99%E7%BF%BB%E8%AF%91/1.2%E7%BC%A9%E5%86%99%E7%BF%BB%E8%AF%91%E8%BE%93%E5%85%A5%E7%B2%98%E8%B4%B4%E5%B9%B6%E5%AD%98.js)
51 |
52 | #### 功能特点
53 |
54 | 复制带有缩写的文字运行脚本即可。
55 |
56 | ### [下载 INS 图片](https://github.com/evilbutcher/Code/blob/master/%E4%B8%8B%E8%BD%BDINS%E5%9B%BE%E7%89%87.js)
57 |
58 | #### 功能特点
59 |
60 | 需要自行填入 cookie。
61 | 其他方式:[大佬的捷径](https://www.icloud.com/shortcuts/3b6e85cd3f114ac79baf056765127dae)。
62 |
63 | ### [去重小工具](https://github.com/evilbutcher/Code/blob/master/%E5%8E%BB%E9%87%8D%E5%B7%A5%E5%85%B7.js)
64 |
65 | #### 功能特点
66 |
67 | 以英文,分隔,去除重复(可根据情况改)。
68 |
69 | ## 【网页】
70 |
71 | ### [神秘博士 2048](https://github.com/evilbutcher/Code/tree/master/MyWeb/custome%202048)
72 |
73 | #### 功能特点
74 |
75 | 打开 index.html 即可玩,picture 内图片可自定义。
76 |
77 | ### 免责声明
78 |
79 | 1. 此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。
80 | 2. 由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。
81 | 3. 请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。
82 | 4. 此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。
83 | 5. 本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。
84 | 6. 如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。
85 | 7. 所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。
86 |
87 | ### 访问量
88 |
89 | 
90 |
--------------------------------------------------------------------------------
/README_EN.md:
--------------------------------------------------------------------------------
1 | [](https://github.com/anuraghazra/github-readme-stats)
2 |
3 | # Scripts
4 |
5 | ⚠️ All content is for learning only, please delete within 24h after downloading, do not use it for other purposes, or else the consequences at your own risk! ⚠️
6 |
7 | ## 【JSBox】
8 |
9 | ### [ArticelsHelper](https://github.com/evilbutcher/Code/tree/master/%E6%96%87%E7%8C%AE%E4%B8%8B%E8%BD%BD/%E6%96%87%E7%8C%AE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B)
10 |
11 | #### [Install Link](https://xteko.com/redir?name=ArticlesHelper&url=https%3A%2F%2Fgithub.com%2Fevilbutcher%2FCode%2Fraw%2Fmaster%2F%25E6%2596%2587%25E7%258C%25AE%25E4%25B8%258B%25E8%25BD%25BD%2FArticlesHelper.box)
12 |
13 | #### Features
14 |
15 | 1. Enter the doi number (copy clipboard text by default), and click the "download" button to download articels; batch download is availiable, doi separated by English commas (,).
16 | 2. Long press the address bar to check if the link is available.
17 | 3. If an error is prompted, long press the corresponding link to try to download manually.
18 | 4. In the articels interface, tap the articels to delete it, and long-press to share it.
19 | 5. Turning on the rename switch will adopt the title-journal-volume-doi method of naming, because it needs to request data from the only ONE website, so it will be closed when downloading more than 5 articles in batches, otherwise there is a risk of blocking the ip.
20 | 6. Turn off iCloud Drive, and articles are stored in the script directory articles (can be packaged and shared); turn on iCloud Drive, and articles are stored in the JSBox/ArticlesHelper/articles directory.
21 | 7. The ArticlesHelper/download directory in iCloud is used to store the html records downloaded by Web of Science. Specific method: Safari downloads the Web of Science records in html format, after the download is complete, open the catalog, transfer to the ArticlesHelper/download folder, open the script, and parse the doi by loading the file. If there are multiple document records, load the last file by default doi. All records are saved in the ArticlesHelper/articles directory in txt format, and the analysis records can be managed by pull-down refresh on the document interface.
22 | 8. Windows users can download iCloud from the Microsoft Store for synchronization.
23 |
24 | ### [Hotlist Monitor](https://github.com/evilbutcher/Code/tree/master/%E7%83%AD%E9%97%A8%E7%9B%91%E6%8E%A7)
25 |
26 | #### Features
27 |
28 | 1. You can selectively monitor the list.
29 | 2. You can set the number of the hottest content in each list.
30 | 3. You can choose whether to attach topic links.
31 | 4. You can decide whether to match keywords or get the latest content for each list.
32 | 5. You can decide whether to split push or merge push the content of each list.
33 | 6. Some lists support cover page when pushed separately.
34 | 7. Support for BoxJs.
35 | 8. Monitor Weibo hotsearch keywords.
36 | 9. Monitoring Zhihu hotlist keywords.
37 | 10. Monitoring the Baidu hotlist keywords.
38 | 11. Monitor Bilibili hotlist keywords (Correspondence: 0 whole site, 1 animation, 3 music, 4 games, 5 entertainment, 36 technology, 119 kichiku, 129 dance).
39 | 12. Monitor Douban movie keywords.
40 | 13. Monitor Tiktok keywords.
41 | 14. Monitor 36Kr keywords.
42 | 15. Monitor Kindle book keywords.
43 | 16. Monitor RSSHub feeds, thanks to @api-evangelist-[rss2json](https://github.com/api-evangelist/rss2json).
44 | 17. Monitor the latest uploads of RenRenTV, with shortcuts [magnetic offline](https://www.icloud.com/shortcuts/cfad8390798e459db458d6233d229209) can achieve magnetic download, unlocking a new way to catch up on dramas.
45 | 18. You can customize the keyword push interval.
46 |
47 | ### [Abbreviation Translation](https://github.com/evilbutcher/Code/blob/master/%E7%BC%A9%E5%86%99%E7%BF%BB%E8%AF%91/1.2%E7%BC%A9%E5%86%99%E7%BF%BB%E8%AF%91%E8%BE%93%E5%85%A5%E7%B2%98%E8%B4%B4%E5%B9%B6%E5%AD%98.js)
48 |
49 | #### Features
50 |
51 | Just copy the abbreviated text and run the script.
52 |
53 | ### [Download INS Image](https://github.com/evilbutcher/Code/blob/master/%E4%B8%8B%E8%BD%BDINS%E5%9B%BE%E7%89%87.js)
54 |
55 | #### Features
56 |
57 | You need to fill in the cookie yourself.
58 |
59 | Other methods: [Shortcuts](https://www.icloud.com/shortcuts/3b6e85cd3f114ac79baf056765127dae).
60 |
61 | ### [Deduplication](https://github.com/evilbutcher/Code/blob/master/%E5%8E%BB%E9%87%8D%E5%B7%A5%E5%85%B7.js)
62 |
63 | #### Features
64 |
65 | Separate with English commas to remove duplicates (Delimiter can be changed according to the situation).
66 |
67 | ## 【Web Page】
68 |
69 | ### [Doctor Who 2048](https://github.com/evilbutcher/Code/tree/master/MyWeb/custome%202048)
70 |
71 | #### Features
72 |
73 | Open index.html to play, and the pictures can be customized.
74 |
75 | ### Disclaimer
76 |
77 | 1. This script is only used for study and research, and does not guarantee its legitimacy, accuracy, and validity. Please make your own judgment based on the situation. I do not assume any guarantee responsibility for this.
78 | 2. Since this script is only used for learning and research, you must completely delete all content from your computer or mobile phone or any storage device within 24 hours after downloading. I am not responsible for any incidents caused by violation of the regulations.
79 | 3. Please do not use this script for any commercial or illegal purposes. If you violate the regulations, please be responsible for it.
80 | 4. The application involved in this script has nothing to do with me, and I am not responsible for any privacy leakage or other consequences caused by this.
81 | 5. I am not responsible for any problems caused by scripts, including but not limited to any loss and damage caused by script errors.
82 | 6. If any unit or individual believes that this script may be suspected of infringing on their rights, they should promptly notify and provide proof of identity and ownership. We will delete this script after receiving the confirmation of the certification document.
83 | 7. All people who directly or indirectly use or view this script should read this statement carefully. I reserve the right to change or supplement this statement at any time. Once you use or copy this script, you are deemed to have accepted this disclaimer.
84 |
85 | ### Visitors
86 |
87 | 
88 |
--------------------------------------------------------------------------------
/RSS Reg Parse.js:
--------------------------------------------------------------------------------
1 | function parsehtmlrss(str, title, items, urls, covers) {
2 | var text = JSON.stringify(str);
3 | //title表达式
4 | var alltitle = /channel\>(\\\S.*?|)\(\<\!\[CDATA\[.*?\]|.*?)\>/;
5 | //括号表达式
6 | var getbracket = /CDATA\[.*?]/;
7 | //箭头表达式
8 | var getarrow = /title\>.*?\;
9 | //获取title
10 | var pretitle = text.match(alltitle);
11 | //检测括号
12 | var kuotitle = pretitle[0].match(getbracket);
13 | //检测箭头
14 | var jiantitle = pretitle[0].match(getarrow);
15 | title.splice(0);
16 | if (kuotitle != null) {
17 | title.push(kuotitle[0].slice(6, -1));
18 | } else {
19 | title.push(jiantitle[0].slice(6, -1));
20 | }
21 | //item表达式
22 | var content = /item\>.*?\<\/item/g;
23 | var detail = text.match(content);
24 | for (var i = 0; i < detail.length; i++) {
25 | //subtitle表达式
26 | var subtitle = /title\>(\<\!\[CDATA\[.*?\]|.*?)\>\;
27 | //description表达式
28 | var allwords = /description\>(\<\!\[CDATA\[.*?\]|\S.*?)\>\;
29 | //openurl的link表达式
30 | var allurls = /link\>http.*?\;
31 | //mediaurl的link表达式
32 | var allcovers = /img src=(\\\"|\S).*?(jpg|png|")/;
33 | //筛选http
34 | var getcovers = /http.*?(jpg|png|")/;
35 | //获取subtitle
36 | var presubtitle = detail[i].match(subtitle);
37 | if (presubtitle != null) {
38 | //检测括号
39 | var postsubtitle = presubtitle[0].match(getbracket);
40 | if (postsubtitle != null) {
41 | var finalsubtitle = postsubtitle[0].slice(6, -1);
42 | } else {
43 | finalsubtitle = presubtitle[0].slice(6, -9);
44 | }
45 | //获取description
46 | var prewords = detail[i].match(allwords);
47 | //检测括号
48 | var postwords = prewords[0].match(getbracket);
49 | if (postwords != null) {
50 | var getwords = postwords[0].slice(6, -1);
51 | } else {
52 | getwords = "未获取";
53 | }
54 | var finalwords = getwords
55 | .replace(new RegExp(/\\n/, "gm"), "")
56 | .replace(new RegExp(/\<.*?\>/, "gm"), "");
57 | if (finalwords.length != 0) {
58 | var item = finalsubtitle + "\n🔍详情 " + finalwords;
59 | items.push(item);
60 | } else {
61 | var item = finalsubtitle + "\n🔍详情 暂无";
62 | items.push(item);
63 | }
64 | var preurls = detail[i].match(allurls);
65 | var posturls = preurls[0].slice(5, -1);
66 | urls.push(posturls);
67 | var precovers = detail[i].match(allcovers);
68 | if (precovers != null) {
69 | var postcovers = precovers[0].match(getcovers);
70 | covers.push(postcovers[0]);
71 | } else {
72 | covers.push(
73 | "https://raw.githubusercontent.com/58xinian/icon/master/hot.png"
74 | );
75 | }
76 | } else {
77 | continue;
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/RSS.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Author: evilbutcher
3 | * Github: https://github.com/evilbutcher
4 | * 感谢Nicked大佬的不用微博脚本,让本菜鸡得以有模版参考🙏
5 | */
6 |
7 | const $ = require("Config");
8 | const family = $widget.family;
9 | var rsslink = "https://github.com/evilbutcher/Scriptables/commits/master.atom";
10 | try {
11 | $.thisnum = $.rssnum();
12 | $.rancolor = $.rssrancolor();
13 | $.rsslink = $.rsslink();
14 | console.log("将使用配置文件内RSS配置");
15 | } catch (e) {
16 | console.log("将使用脚本内RSS配置");
17 | }
18 |
19 | const res = await getinfo();
20 | var titles = [];
21 | if (res.status == "ok") {
22 | for (var i = 0; i < res.items.length; i++) {
23 | titles = titles.concat({
24 | type: "text",
25 | props: {
26 | text: res.items[i].title,
27 | font: $font(15),
28 | offset: $point(7, 0),
29 | lineLimit: 1
30 | }
31 | });
32 | }
33 | console.log(titles);
34 | $widget.setTimeline(ctx => {
35 | return {
36 | type: "zstack",
37 | props: {
38 | alignment: $widget.alignment.center
39 | },
40 | views: [
41 | {
42 | type: "vstack",
43 | props: {
44 | spacing: 5,
45 | alignment: $widget.horizontalAlignment.leading
46 | },
47 | views: [getGrid(family, titles)]
48 | }
49 | ]
50 | };
51 | });
52 | }
53 |
54 | async function getinfo() {
55 | const rssRequest = {
56 | url:
57 | "https://api.rss2json.com/v1/api.json?rss_url=" +
58 | encodeURIComponent(rsslink)
59 | };
60 | const res = await $http.get(rssRequest);
61 | console.log(res);
62 | return res.data;
63 | }
64 |
65 | //by Nicked
66 | function getGrid(family, data) {
67 | if (family == 1)
68 | return {
69 | type: "vgrid",
70 | props: {
71 | columns: Array(2).fill({
72 | flexible: {
73 | minimum: 10,
74 | maximum: Infinity
75 | }
76 | })
77 | },
78 | views: [
79 | {
80 | type: "vstack",
81 | props: {
82 | spacing: 8,
83 | alignment: $widget.horizontalAlignment.leading,
84 | offset: $point(2, 7),
85 | frame: {
86 | width: 150
87 | }
88 | },
89 | views: data.slice(0, 5)
90 | },
91 | {
92 | type: "vstack",
93 | props: {
94 | spacing: 8,
95 | alignment: $widget.horizontalAlignment.leading,
96 | offset: $point(-15, 7),
97 | frame: {
98 | width: 145
99 | }
100 | },
101 | views: data.slice(5, 10)
102 | }
103 | ]
104 | };
105 | else
106 | return {
107 | type: "vstack",
108 | props: {
109 | spacing: 8,
110 | alignment: $widget.horizontalAlignment.leading,
111 | offset: $point(0, 7),
112 | frame: {
113 | width: 150
114 | }
115 | },
116 | views: data.slice(0, 5)
117 | };
118 | }
119 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-minimal
--------------------------------------------------------------------------------
/funko图片下载/download.js:
--------------------------------------------------------------------------------
1 | var dic = JSON.parse($drive.read("funkoimg/itemlist.json").string);
2 | var notdl = [];
3 |
4 | async function download(title, url) {
5 | await $wait(1);
6 | var exist = $drive.exists("funkoimg/" + title + ".jpg");
7 | //console.log(exist);
8 | if (exist == false) {
9 | console.log(url);
10 | notdl.push({
11 | name: title,
12 | link: url
13 | });
14 | $http.download({
15 | url: "https://" + url,
16 | backgroundfetch: true,
17 | handler: function(resp) {
18 | //console.log(resp.data)
19 | $drive.write({
20 | data: resp.data,
21 | path: "funkoimg/" + title + ".jpg"
22 | });
23 | console.log(notdl);
24 | }
25 | });
26 | }
27 | i = i + 1;
28 | }
29 |
30 | for (var i = 0; i < dic.length; i++) {
31 | download(dic[i].title, dic[i].url);
32 | }
33 |
--------------------------------------------------------------------------------
/funko图片下载/funko download.js:
--------------------------------------------------------------------------------
1 | var itemlist = [];
2 |
3 | $http.request({
4 | method: "post",
5 | url: "https://www.funko.com/api/collections/sorted",
6 | header: {
7 | Host: "www.funko.com",
8 | UserAgent: "Popspedia/6 CFNetwork/1126 Darwin/19.5.0",
9 | Authorization:
10 | "eyJhbGciOiJSUzI1NiIsImtpZCI6ImMzZjI3NjU0MmJmZmU0NWU5OGMyMGQ2MDNlYmUyYmExMTc2ZWRhMzMiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vZnVua29hdXRocHJvZCIsImF1ZCI6ImZ1bmtvYXV0aHByb2QiLCJhdXRoX3RpbWUiOjE1NzI5NjUzNzYsInVzZXJfaWQiOiI3Tk9SM2hNRjJqVE8xSHBUMkJvYndkSEJnTUwyIiwic3ViIjoiN05PUjNoTUYyalRPMUhwVDJCb2J3ZEhCZ01MMiIsImlhdCI6MTU5MzA0NDk1OCwiZXhwIjoxNTkzMDQ4NTU4LCJlbWFpbCI6Ijg5NTU4MjA4M0BxcS5jb20iLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnsiZW1haWwiOlsiODk1NTgyMDgzQHFxLmNvbSJdfSwic2lnbl9pbl9wcm92aWRlciI6InBhc3N3b3JkIn19.F9N0iippjdO5RFSumPIGjTj1KKNW2dX56AAWbrDA-KDg3U9cR4iLRxQjtW0l9Uc8iCl_CJRMcG55bkgd4Zkl9nfcMc8ZaiZ7FQy-bY1CEZu2bdRr_Mp5UIr0Xlyv8Xmx3dhAnLs54DTKNG33aHBJp3czkZZbe_8151G9TpdKpoDtwnsjQhkTjTYVtbO7OIz8XC22gxjF_hC3h9bnS0gGUQ6Ml2ewQnaEN0HBRTpINY8yhABFXrSKmSp47uQy8smRwGZrFYE1nQy0aEYqdBT0fdvTmmoPUzT46OK1ctdqxA8DqozlsrqcMJGGhAsVb2l26NJQ7EXN_2_Dx1Sk8MzfOA"
11 | },
12 | body: {
13 | page: 1,
14 | pageCount: 200,
15 | type: "catalog"
16 | },
17 | handler: function(resp) {
18 | var data = resp.data;
19 | var item = data.search.hits;
20 | //console.log(item);
21 | for (var i = 0; i < item.length; i++) {
22 | var name = item[i].title;
23 | var series = item[i].licenses;
24 | var link = "www.funko.com" + item[i].imageUrl;
25 | itemlist.push({
26 | title: name + "_" + series,
27 | url: link
28 | });
29 | }
30 | $drive.write({
31 | data: $data({ string: JSON.stringify(itemlist) }),
32 | path: "funkoimg/itemlist.json"
33 | });
34 | }
35 | });
--------------------------------------------------------------------------------
/下载INS图片.js:
--------------------------------------------------------------------------------
1 | var L = $clipboard.text;
2 |
3 | $input.text({
4 | type: $kbType.text,
5 | placeholder: L,
6 | handler: function(link) {
7 | if (link.length == 0) {
8 | link = L;
9 | }
10 | $ui.toast("正在获取下载链接...");
11 | $http.get({
12 | url: link,
13 | header: {
14 | host: "www.instagram.com",
15 | useragent:
16 | "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36",
17 | cookie: "sessionid=抓包填入;"
18 | },
19 | handler: function(resp) {
20 | $ui.toast("正在解析链接...");
21 | var data = resp.data;
22 | var search = new RegExp(/display_url":".*?"/);
23 | var img = search.exec(data);
24 | var img1 = JSON.stringify(img);
25 | img1 = img1.slice(18);
26 | var img2 = img1.replace(new RegExp(/\\\\u0026/, "gm"), "&");
27 | var img3 = img2.replace("\\.", ".");
28 | var imglink = img3.slice(0, -4);
29 | $http.download({
30 | url: imglink,
31 | backgroundFetch: true, // Optional, default is false
32 | progress: function(bytesWritten, totalBytes) {
33 | var percentage = (bytesWritten * 1.0) / totalBytes;
34 | $ui.toast(`下载中(${parseInt(percentage * 100)}%)`);
35 | },
36 | handler: function(resp) {
37 | $photo.save({
38 | data: resp.data,
39 | handler: function(success) {
40 | $ui.success("下载成功");
41 | }
42 | });
43 | }
44 | });
45 | }
46 | });
47 | }
48 | });
--------------------------------------------------------------------------------
/修正格式用.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/修正格式用.html
--------------------------------------------------------------------------------
/修正格式用.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/修正格式用.js
--------------------------------------------------------------------------------
/去重工具.js:
--------------------------------------------------------------------------------
1 | var str =
2 | "以英文,分隔(可根据情况改)";
3 |
4 | var arr = str.split(", ");
5 | console.log(arr);
6 | var newArr = [];
7 | for (var i = 0; i < arr.length; i++) {
8 | if (newArr.indexOf(arr[i]) === -1) {
9 | newArr.push(arr[i]);
10 | }
11 | }
12 | var out = JSON.stringify(newArr)
13 | var out1 = out.replace(/\"/g,"")
14 | console.log(out1)
--------------------------------------------------------------------------------
/文献下载/ArticlesHelper.box:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/文献下载/ArticlesHelper.box
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载1.0.js:
--------------------------------------------------------------------------------
1 | //根据doi号下载文献,用的是sci-hub.tw,有问题可反馈pgcrfhht@outlook.com
2 | $app.theme = "auto";
3 | var doi = $clipboard.text;
4 | //var sl = RegExp(/".*?download.*"/);
5 |
6 | $ui.render({
7 | views: [
8 | {
9 | type: "input",
10 | props: {
11 | title:"请输入doi",
12 | placeholder:doi,
13 | },
14 | layout: function(make, view) {
15 | make.height.equalTo(60);
16 | make.top.left.right.inset(50);
17 | }
18 | },
19 | {
20 | type: "button",
21 | props: {
22 | title:"下载",
23 | },
24 | layout: function(make, view) {
25 | make.height.equalTo(50);
26 | make.width.equalTo(80);
27 | make.left.inset(50);
28 | make.bottom.inset(60);
29 | },
30 | events: {
31 | tapped: function(sender) {
32 | var word = $input.text
33 | if (word.length == 0){
34 | word = doi
35 | var rqurl = "https://sci-hub.tw/"+word
36 | console.log(rqurl)
37 | }
38 | $http.request({
39 | method:"get",
40 | url: rqurl,
41 | header:{
42 | host: "sci-hub.tw",
43 | },
44 | handler: function(resp) {
45 | var data = resp.data
46 | console.log(data)
47 | var cheerio = require("cheerio")
48 | var $ = cheerio.load(data)
49 | var link = $("#article").find("iframe").attr("src");
50 | console.log(link)
51 | download(link);
52 | //var dl = link.replace(/\"/g, "");
53 | //console.log(dl)
54 | // var links = $detector.link(data)
55 | // console.log(links)
56 | // var link = sl.exec(links)
57 | // console.log(link)
58 | }
59 | })
60 |
61 | }
62 | }
63 | },
64 | {
65 | type: "button",
66 | props: {
67 | title:"关闭",
68 | },
69 | layout: function(make, view) {
70 | make.height.equalTo(50);
71 | make.width.equalTo(80);
72 | make.right.inset(50);
73 | make.bottom.inset(60);
74 | },
75 | events: {
76 | tapped: function(sender) {
77 | $app.close()
78 | }
79 | }
80 | }
81 | ]
82 | })
83 |
84 | function download(link){
85 | $http.download({
86 | url: link,
87 | showsProgress: true, // Optional, default is true
88 | backgroundFetch: true, // Optional, default is false
89 | progress: function(bytesWritten, totalBytes) {
90 | var percentage = bytesWritten * 1.0 / totalBytes
91 | },
92 | handler: function(resp) {
93 | $share.sheet(resp.data)
94 | }
95 | })
96 | }
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载2.0.js:
--------------------------------------------------------------------------------
1 | //根据doi号下载文献,有问题可反馈pgcrfhht@outlook.com
2 | $app.theme = "auto";
3 | var doi = $clipboard.text;
4 | //var sl = RegExp(/".*?download.*"/);
5 |
6 | $ui.render({
7 | views: [
8 | {
9 | type: "input",
10 | props: {
11 | id: "inputtext",
12 | placeholder: doi
13 | },
14 | layout: function(make, view) {
15 | make.height.equalTo(40);
16 | make.top.left.right.inset(50);
17 | }
18 | },
19 | {
20 | type: "button",
21 | props: {
22 | id: "downloadbutton",
23 | title: "下载",
24 | menu: {
25 | title: "下载地址选择",
26 | items: [
27 | {
28 | title: "sci-hub.tw",
29 | handler: sender => {
30 | var word = $("inputtext").text;
31 | if (word.length == 0) {
32 | word = doi;
33 | var rqurl = "https://sci-hub.tw/" + word;
34 | } else {
35 | rqurl = "https://sci-hub.tw/" + word;
36 | }
37 | $http.request({
38 | method: "get",
39 | url: rqurl,
40 | header: {
41 | host: "sci-hub.tw"
42 | },
43 | handler: function(resp) {
44 | var data = resp.data;
45 | var cheerio = require("cheerio");
46 | var $ = cheerio.load(data);
47 | var link = $("#article")
48 | .find("iframe")
49 | .attr("src");
50 | download(link);
51 | }
52 | });
53 | }
54 | },
55 | {
56 | title: "sci-hub.im",
57 | handler: sender => {
58 | var word = $("inputtext").text;
59 | if (word.length == 0) {
60 | word = doi;
61 | var rqurl = "https://sci-hub.im/" + word;
62 | } else {
63 | rqurl = "https://sci-hub.im/" + word;
64 | }
65 | $http.request({
66 | method: "get",
67 | url: rqurl,
68 | header: {
69 | host: "sci-hub.im"
70 | },
71 | handler: function(resp) {
72 | var data = resp.data;
73 | var cheerio = require("cheerio");
74 | var $ = cheerio.load(data);
75 | var link = $("#article")
76 | .find("iframe")
77 | .attr("src");
78 | download(link);
79 | }
80 | });
81 | }
82 | },
83 | {
84 | title: "sci-hub.se",
85 | handler: sender => {
86 | var word = $("inputtext").text;
87 | if (word.length == 0) {
88 | word = doi;
89 | var rqurl = "https://sci-hub.se/" + word;
90 | } else {
91 | rqurl = "https://sci-hub.se/" + word;
92 | }
93 | $http.request({
94 | method: "get",
95 | url: rqurl,
96 | header: {
97 | host: "sci-hub.se"
98 | },
99 | handler: function(resp) {
100 | var data = resp.data;
101 | var cheerio = require("cheerio");
102 | var $ = cheerio.load(data);
103 | var link = $("#article")
104 | .find("iframe")
105 | .attr("src");
106 | download(link);
107 | }
108 | });
109 | }
110 | }
111 | // {
112 | // title: "企鹅论文",
113 | // handler: sender => {}
114 | // },
115 | // {
116 | // title: "谷歌学术",
117 | // handler: sender => {}
118 | // },
119 | // {
120 | // title: "GFsoso",
121 | // handler: sender => {}
122 | // }
123 | ]
124 | }
125 | },
126 | layout: function(make, view) {
127 | make.height.equalTo(50);
128 | make.width.equalTo(80);
129 | make.left.inset(50);
130 | make.top.inset(120);
131 | },
132 | events: {
133 | tapped: function(sender) {
134 | var word = $("inputtext").text;
135 | if (word.length == 0) {
136 | word = doi;
137 | var rqurl = "https://sci-hub.tw/" + word;
138 | } else {
139 | rqurl = "https://sci-hub.tw/" + word;
140 | }
141 | $http.request({
142 | method: "get",
143 | url: rqurl,
144 | header: {
145 | host: "sci-hub.tw"
146 | },
147 | handler: function(resp) {
148 | var data = resp.data;
149 | var cheerio = require("cheerio");
150 | var $ = cheerio.load(data);
151 | var link = $("#article")
152 | .find("iframe")
153 | .attr("src");
154 | download(link);
155 | }
156 | });
157 | }
158 | }
159 | },
160 | {
161 | type: "button",
162 | props: {
163 | title: "关闭"
164 | },
165 | layout: function(make, view) {
166 | make.height.equalTo(50);
167 | make.width.equalTo(80);
168 | make.right.inset(50);
169 | make.top.inset(120);
170 | },
171 | events: {
172 | tapped: function(sender) {
173 | $app.close();
174 | }
175 | }
176 | },
177 | {
178 | type: "text",
179 | props: {
180 | id: "textconsle",
181 | text:
182 | "请输入doi号(默认复制剪贴板文本),点击“下载”按钮即可下载文献。默认选择sci-hub.tw,若下载失败请长按“下载”按钮更换地址"
183 | },
184 | layout: function(make, view) {
185 | make.height.equalTo(300);
186 | make.left.right.inset(50);
187 | make.top.inset(200);
188 | }
189 | }
190 | //textField.addEventHandler({
191 | //events: {$("downloadbutton").tapped,
192 | //handler: sender=>{
193 |
194 | //}
195 | //}
196 | //})
197 | ]
198 | });
199 |
200 | function download(link) {
201 | $http.download({
202 | url: link,
203 | showsProgress: true, // Optional, default is true
204 | backgroundFetch: true, // Optional, default is false
205 | progress: function(bytesWritten, totalBytes) {
206 | var percentage = (bytesWritten * 1.0) / totalBytes;
207 | },
208 | handler: function(resp) {
209 | if (resp.error) {
210 | $ui.alert("下载出错,请更换下载地址或检查doi");
211 | } else {
212 | $share.sheet(resp.data);
213 | }
214 | }
215 | //flag = 1
216 | });
217 | }
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.0/README.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/文献下载/历史版本备份/文献下载助手3.0/README.md
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.0/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/文献下载/历史版本备份/文献下载助手3.0/assets/icon.png
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.0/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "info": {
3 | "name": "",
4 | "url": "",
5 | "version": "1.0.0",
6 | "author": "",
7 | "website": "",
8 | "types": 0
9 | },
10 | "settings": {
11 | "theme": "light",
12 | "minSDKVer": "2.0.0",
13 | "minOSVer": "12.0.0",
14 | "idleTimerDisabled": false,
15 | "autoKeyboardEnabled": false,
16 | "keyboardToolbarEnabled": false,
17 | "rotateDisabled": false
18 | },
19 | "widget": {
20 | "height": 0,
21 | "staticSize": false,
22 | "tintColor": "",
23 | "iconColor": ""
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.0/main.js:
--------------------------------------------------------------------------------
1 | var app = require("scripts/app.js")
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.0/main.ux/actions.js:
--------------------------------------------------------------------------------
1 | const app = require("./scripts/app");
2 |
3 | exports.tapped = sender => {
4 | app.sayHello();
5 | }
6 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.0/main.ux/views.json:
--------------------------------------------------------------------------------
1 | {
2 | "props" : {
3 | "id" : "main"
4 | },
5 | "views" : [
6 | {
7 | "type" : "button",
8 | "props" : {
9 | "id" : "button[0]",
10 | "title" : "Hello",
11 | "frame" : {
12 | "y" : 120,
13 | "x" : 462,
14 | "width" : 100,
15 | "height" : 36
16 | }
17 | },
18 | "events" : {
19 | "tapped" : {
20 | "$type" : "$event",
21 | "$props" : {
22 | "selector" : "tapped"
23 | }
24 | }
25 | }
26 | }
27 | ]
28 | }
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.0/strings/en.strings:
--------------------------------------------------------------------------------
1 | "OK" = "OK";
2 | "DONE" = "Done";
3 | "HELLO_WORLD" = "Hello, World!";
4 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.0/strings/zh-Hans.strings:
--------------------------------------------------------------------------------
1 | "OK" = "好的";
2 | "DONE" = "完成";
3 | "HELLO_WORLD" = "你好,世界!";
4 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.1/README.md:
--------------------------------------------------------------------------------
1 | 输入doi号(默认复制剪贴板文本),点击“下载”按钮即可下载文献。
2 | 默认选择sci-hub.tw,若下载失败请长按“下载”按钮更换地址。
3 | 打开重命名开关将采用标题-期刊-卷-doi方式命名,因为需要向同一网址请求数据,大量下载时建议关闭。
4 | 不打开iCloud Drive,文献存储在脚本目录download下;打开iCloud Drive,文献存储在JSBox/download目录下(需建立对应文件夹)。
5 | Windows用户可在Microsoft Store下载iCloud进行同步。
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.1/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/文献下载/历史版本备份/文献下载助手3.1/assets/icon.png
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.1/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "info": {
3 | "name": "",
4 | "url": "",
5 | "version": "1.0.0",
6 | "author": "",
7 | "website": "",
8 | "types": 0
9 | },
10 | "settings": {
11 | "theme": "light",
12 | "minSDKVer": "2.0.0",
13 | "minOSVer": "12.0.0",
14 | "idleTimerDisabled": false,
15 | "autoKeyboardEnabled": false,
16 | "keyboardToolbarEnabled": false,
17 | "rotateDisabled": false
18 | },
19 | "widget": {
20 | "height": 0,
21 | "staticSize": false,
22 | "tintColor": "",
23 | "iconColor": ""
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.1/main.js:
--------------------------------------------------------------------------------
1 | var app = require("scripts/app.js")
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.1/main.ux/actions.js:
--------------------------------------------------------------------------------
1 | const app = require("./scripts/app");
2 |
3 | exports.tapped = sender => {
4 | app.sayHello();
5 | }
6 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.1/main.ux/views.json:
--------------------------------------------------------------------------------
1 | {
2 | "props" : {
3 | "id" : "main"
4 | },
5 | "views" : [
6 | {
7 | "type" : "button",
8 | "props" : {
9 | "id" : "button[0]",
10 | "title" : "Hello",
11 | "frame" : {
12 | "y" : 120,
13 | "x" : 462,
14 | "width" : 100,
15 | "height" : 36
16 | }
17 | },
18 | "events" : {
19 | "tapped" : {
20 | "$type" : "$event",
21 | "$props" : {
22 | "selector" : "tapped"
23 | }
24 | }
25 | }
26 | }
27 | ]
28 | }
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.1/strings/en.strings:
--------------------------------------------------------------------------------
1 | "OK" = "OK";
2 | "DONE" = "Done";
3 | "HELLO_WORLD" = "Hello, World!";
4 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.1/strings/zh-Hans.strings:
--------------------------------------------------------------------------------
1 | "OK" = "好的";
2 | "DONE" = "完成";
3 | "HELLO_WORLD" = "你好,世界!";
4 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.2/README.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/文献下载/历史版本备份/文献下载助手3.2/README.md
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.2/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/文献下载/历史版本备份/文献下载助手3.2/assets/icon.png
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.2/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "info": {
3 | "name": "",
4 | "url": "",
5 | "version": "1.0.0",
6 | "author": "",
7 | "website": "",
8 | "types": 0
9 | },
10 | "settings": {
11 | "theme": "light",
12 | "minSDKVer": "2.0.0",
13 | "minOSVer": "12.0.0",
14 | "idleTimerDisabled": false,
15 | "autoKeyboardEnabled": false,
16 | "keyboardToolbarEnabled": false,
17 | "rotateDisabled": false
18 | },
19 | "widget": {
20 | "height": 0,
21 | "staticSize": false,
22 | "tintColor": "",
23 | "iconColor": ""
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.2/main.js:
--------------------------------------------------------------------------------
1 | $ui.render("main");
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.2/scripts/app.js:
--------------------------------------------------------------------------------
1 | if (typeof $cache.get("rename") == "undefined") {
2 | $cache.set("rename", false);
3 | }
4 | if (typeof $cache.get("iCloud") == "undefined") {
5 | $cache.set("iCloud", false);
6 | }
7 | if (typeof $cache.get("share") == "undefined") {
8 | $cache.set("share", false);
9 | }
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.2/strings/en.strings:
--------------------------------------------------------------------------------
1 | "OK" = "OK";
2 | "DONE" = "Done";
3 | "HELLO_WORLD" = "Hello, World!";
4 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手3.2/strings/zh-Hans.strings:
--------------------------------------------------------------------------------
1 | "OK" = "好的";
2 | "DONE" = "完成";
3 | "HELLO_WORLD" = "你好,世界!";
4 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.0/README.md:
--------------------------------------------------------------------------------
1 | 输入doi号(默认复制剪贴板文本),点击“下载”按钮即可下载文献。
2 | 若error,可点击输出的链接尝试手动下载,会自动去掉链接中最前面两个"//"
3 | 在文献界面,点击文献可以删除,长按可以分享。
4 | 有时启动会报错,删掉assets中对应的重复文件_2即可。
5 | 打开重命名开关将采用标题-期刊-卷-doi方式命名,因为需要向同一网址请求数据,大量下载时建议关闭。
6 | 不打开iCloud Drive,文献存储在脚本目录download下;打开iCloud Drive,文献存储在JSBox/download目录下(需建立对应文件夹)。
7 | Windows用户可在Microsoft Store下载iCloud进行同步。
8 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.0/assets/errorlist.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.0/assets/icloudlist.json:
--------------------------------------------------------------------------------
1 | ["10.1038_s41598-018-36882-3.pdf"]
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.0/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/文献下载/历史版本备份/文献下载助手4.0/assets/icon.png
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.0/assets/locallist.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.0/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "info": {
3 | "name": "",
4 | "url": "",
5 | "version": "1.0.0",
6 | "author": "",
7 | "website": "",
8 | "types": 0
9 | },
10 | "settings": {
11 | "theme": "light",
12 | "minSDKVer": "2.0.0",
13 | "minOSVer": "12.0.0",
14 | "idleTimerDisabled": false,
15 | "autoKeyboardEnabled": false,
16 | "keyboardToolbarEnabled": false,
17 | "rotateDisabled": false
18 | },
19 | "widget": {
20 | "height": 0,
21 | "staticSize": false,
22 | "tintColor": "",
23 | "iconColor": ""
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.0/main.js:
--------------------------------------------------------------------------------
1 | $ui.render("main");
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.0/scripts/app.js:
--------------------------------------------------------------------------------
1 | $app.tips("使用技巧请查看readme")
2 |
3 | if (typeof $cache.get("rename") == "undefined") {
4 | $cache.set("rename", false);
5 | }
6 | if (typeof $cache.get("iCloud") == "undefined") {
7 | $cache.set("iCloud", false);
8 | }
9 | if (typeof $cache.get("share") == "undefined") {
10 | $cache.set("share", false);
11 | }
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.0/strings/en.strings:
--------------------------------------------------------------------------------
1 | "OK" = "OK";
2 | "DONE" = "Done";
3 | "HELLO_WORLD" = "Hello, World!";
4 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.0/strings/zh-Hans.strings:
--------------------------------------------------------------------------------
1 | "OK" = "好的";
2 | "DONE" = "完成";
3 | "HELLO_WORLD" = "你好,世界!";
4 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档 (获取链接后下载 隐藏label定位)/README.md:
--------------------------------------------------------------------------------
1 | 输入doi号(默认复制剪贴板文本),点击“下载”按钮即可下载文献。
2 | 若error,可点击输出的链接尝试手动下载,会自动去掉链接中最前面两个"//"
3 | 在文献界面,点击文献可以删除,长按可以分享。
4 | 有时启动会报错,删掉assets中对应的重复文件_2即可。
5 | 打开重命名开关将采用标题-期刊-卷-doi方式命名,因为需要向同一网址请求数据,大量下载时建议关闭。
6 | 不打开iCloud Drive,文献存储在脚本目录download下;打开iCloud Drive,文献存储在JSBox/download目录下(需建立对应文件夹)。
7 | Windows用户可在Microsoft Store下载iCloud进行同步。
8 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档 (获取链接后下载 隐藏label定位)/assets/icloudlist.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档 (获取链接后下载 隐藏label定位)/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/文献下载/历史版本备份/文献下载助手4.1 归档 (获取链接后下载 隐藏label定位)/assets/icon.png
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档 (获取链接后下载 隐藏label定位)/assets/linklist.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档 (获取链接后下载 隐藏label定位)/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "info": {
3 | "name": "",
4 | "url": "",
5 | "version": "1.0.0",
6 | "author": "",
7 | "website": "",
8 | "types": 0
9 | },
10 | "settings": {
11 | "theme": "light",
12 | "minSDKVer": "2.0.0",
13 | "minOSVer": "12.0.0",
14 | "idleTimerDisabled": false,
15 | "autoKeyboardEnabled": false,
16 | "keyboardToolbarEnabled": false,
17 | "rotateDisabled": false
18 | },
19 | "widget": {
20 | "height": 0,
21 | "staticSize": false,
22 | "tintColor": "",
23 | "iconColor": ""
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档 (获取链接后下载 隐藏label定位)/main.js:
--------------------------------------------------------------------------------
1 | $ui.render("main");
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档 (获取链接后下载 隐藏label定位)/scripts/app.js:
--------------------------------------------------------------------------------
1 | //$app.tips("使用技巧请查看readme")
2 |
3 | if (typeof $cache.get("rename") == "undefined") {
4 | $cache.set("rename", false);
5 | }
6 | if (typeof $cache.get("iCloud") == "undefined") {
7 | $cache.set("iCloud", false);
8 | }
9 | if (typeof $cache.get("share") == "u
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档 (获取链接后下载 隐藏label定位)/strings/en.strings:
--------------------------------------------------------------------------------
1 | "OK" = "OK";
2 | "DONE" = "Done";
3 | "HELLO_WORLD" = "Hello, World!";
4 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档 (获取链接后下载 隐藏label定位)/strings/zh-Hans.strings:
--------------------------------------------------------------------------------
1 | "OK" = "好的";
2 | "DONE" = "完成";
3 | "HELLO_WORLD" = "你好,世界!";
4 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档(批量下载bug 尝试await或者if switch太快了(可能有bug))/README.md:
--------------------------------------------------------------------------------
1 | 此版本可能存在触发JSBox闪退bug,归档留存
2 |
3 |
4 |
5 |
6 |
7 | 输入doi号(默认复制剪贴板文本),点击“下载”按钮即可下载文献。
8 | 若error,可点击输出的链接尝试手动下载,会自动去掉链接中最前面两个"//"
9 | 在文献界面,点击文献可以删除,长按可以分享。
10 | 有时启动会报错,删掉assets中对应的重复文件_2即可。
11 | 打开重命名开关将采用标题-期刊-卷-doi方式命名,因为需要向同一网址请求数据,大量下载时建议关闭。
12 | 不打开iCloud Drive,文献存储在脚本目录download下;打开iCloud Drive,文献存储在JSBox/download目录下(需建立对应文件夹)。
13 | Windows用户可在Microsoft Store下载iCloud进行同步。
14 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档(批量下载bug 尝试await或者if switch太快了(可能有bug))/assets/errorlist.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档(批量下载bug 尝试await或者if switch太快了(可能有bug))/assets/icloudlist.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档(批量下载bug 尝试await或者if switch太快了(可能有bug))/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/文献下载/历史版本备份/文献下载助手4.1 归档(批量下载bug 尝试await或者if switch太快了(可能有bug))/assets/icon.png
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档(批量下载bug 尝试await或者if switch太快了(可能有bug))/assets/locallist.json:
--------------------------------------------------------------------------------
1 | ["10.1039_c8lc00510a.pdf","10.1002_adhm.201700024.pdf","10.1016_j.nanoen.2019.06.025.pdf","10.1016_j.alcohol.2018.10.006.pdf","10.1016_j.talanta.2019.06.031.pdf","10.1021_ac5031682.pdf","10.3390_s18082651.pdf","10.1149_2.0231808jes.pdf","10.1016_j.ejpb.2012.04.009.pdf","10.1016_j.biomaterials.2013.08.078.pdf","10.1016_j.bios.2017.06.053.pdf","10.1002_adfm.202000591.pdf","10.3390_bios9010013.pdf","10.1002_adhm.201701150.pdf","10.1038_srep14586.pdf","10.1038_srep14586.pdf","10.1557_mrc.2018.134.pdf","10.1002_smll.201601049.pdf","10.1016_j.biomaterials.2019.119740.pdf","10.1038_s41467-019-10401-y.pdf","10.1002_elan.201600018.pdf","10.1016_j.biomaterials.2018.03.039.pdf","10.1016_j.elecom.2015.03.018.pdf","10.1021_jacs.0c00043.pdf","10.1021_jacs.0c00043.pdf","A coordination polymer nanobelt (CPNB)-based aptasensor for sulfadimethoxine__Biosensors and Bioelectronics__volume 33, issue 1 (2012)__ 10.1016_j.bios.2011.12.034.pdf",null,"A coordination polymer nanobelt (CPNB)-based aptasensor for sulfadimethoxine__Biosensors and Bioelectronics__volume 33, issue 1 (2012)__ 10.1016_j.bios.2011.12.034.pdf","A coordination polymer nanobelt (CPNB)-based aptasensor for sulfadimethoxine__Biosensors and Bioelectronics__volume 33, issue 1 (2012)__ 10.1016_j.bios.2011.12.034.pdf","Universal Design of Structure-Switching Aptamers with Signal Reporting Functionality__Analytical Chemistry__ (2019)__ 10.1021_acs.analchem.9b03368.pdf",null,"Affinity Improvement of a VEGF Aptamer by\n in Silico\n Maturation for a Sensitive VEGF-Detection System__Analytical Chemistry__volume 85, issue 2 (2013)__ 10.1021_ac303023d.pdf","Aptamer Affinity Maturation by Resampling and Microarray Selection__Analytical Chemistry__ (2016)__ 10.1021_acs.analchem.6b01635.pdf","Aptamers as therapeutics__Nature Reviews Drug Discovery__volume 9, issue 7 (2010)__ 10.1038_nrd3141.pdf",null,"Bioinformatic Analysis of the Contribution of Primer Sequences to Aptamer Structures__Journal of Molecular Evolution__volume 67, issue 1 (2008)__ 10.1007_s00239-008-9130-4.pdf",null,"Construction and optimization of an efficient amplification method of a random ssDNA library by asymmetric emulsion PCR__Biotechnology and Applied Biochemistry__ (2015)__ 10.1002_bab.1467.pdf"]
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档(批量下载bug 尝试await或者if switch太快了(可能有bug))/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "info": {
3 | "name": "",
4 | "url": "",
5 | "version": "1.0.0",
6 | "author": "",
7 | "website": "",
8 | "types": 0
9 | },
10 | "settings": {
11 | "theme": "light",
12 | "minSDKVer": "2.0.0",
13 | "minOSVer": "12.0.0",
14 | "idleTimerDisabled": false,
15 | "autoKeyboardEnabled": false,
16 | "keyboardToolbarEnabled": false,
17 | "rotateDisabled": false
18 | },
19 | "widget": {
20 | "height": 0,
21 | "staticSize": false,
22 | "tintColor": "",
23 | "iconColor": ""
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档(批量下载bug 尝试await或者if switch太快了(可能有bug))/main.js:
--------------------------------------------------------------------------------
1 | $ui.render("main");
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档(批量下载bug 尝试await或者if switch太快了(可能有bug))/scripts/app.js:
--------------------------------------------------------------------------------
1 | //$app.tips("使用技巧请查看readme")
2 |
3 | if (typeof $cache.get("rename") == "undefined") {
4 | $cache.set("rename", false);
5 | }
6 | if (typeof $cache.get("iCloud") == "undefined") {
7 | $cache.set("iCloud", false);
8 | }
9 | if (typeof $cache.get("share") == "u
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档(批量下载bug 尝试await或者if switch太快了(可能有bug))/strings/en.strings:
--------------------------------------------------------------------------------
1 | "OK" = "OK";
2 | "DONE" = "Done";
3 | "HELLO_WORLD" = "Hello, World!";
4 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.1 归档(批量下载bug 尝试await或者if switch太快了(可能有bug))/strings/zh-Hans.strings:
--------------------------------------------------------------------------------
1 | "OK" = "好的";
2 | "DONE" = "完成";
3 | "HELLO_WORLD" = "你好,世界!";
4 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.9/README.md:
--------------------------------------------------------------------------------
1 | 输入doi号(默认复制剪贴板文本),点击“下载”按钮即可下载文献;可批量下载,doi用空格隔开。
2 | 长按地址栏可检测链接是否可用。
3 | 若提示错误,长按对应的链接尝试手动下载。
4 | 在文献界面,点击文献可以删除,长按可以分享。
5 | 有时启动报错,删掉assets中对应的重复文件_2即可。
6 | 打开重命名开关将采用标题-期刊-卷-doi方式命名,因为需要向同一网址请求数据,批量下载时建议关闭,否则有拉黑ip风险。
7 | 关闭iCloud Drive,文献存储在脚本目录articles下(可打包分享);打开iCloud Drive,文献存储在JSBox/articles目录下。
8 | iCloud中的download目录用来存储wos下载的html记录。具体方法:Safari下载html格式的wos文献记录,下载完成后打开目录,转存至JSBox内的download文件夹,打开脚本,通过载入文件解析doi,若有多篇文献记录默认载入最后一个文件的doi。所有文献记录以txt格式保存在articles目录下,可通过文献界面下拉刷新对解析记录进行管理。
9 | Windows用户可在Microsoft Store下载iCloud进行同步。
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.9/assets/icloudlist.json:
--------------------------------------------------------------------------------
1 | ["10.1016_j.talanta.2020.120791.pdf","10.1166_jnn.2020.17831.pdf","A Combinatorial Electrochemical Biosensor for Sweat Biomarker Benchmarking__SLAS Technology__ (2019)__ 10.1177_2472630319882003.pdf","A coordination polymer nanobelt (CPNB)-based aptasensor for sulfadimethoxine__Biosensors and Bioelectronics__volume 33, issue 1 (2012)__ 10.1016_j.bios.2011.12.034.pdf","A nuclease-assisted label-free aptasensor for fluorescence turn-on detection of ATP based on the in situ formation of copper nanoparticles__Biosensors and Bioelectronics__ (2016)__ 10.1016_j.bios.2016.09.029.pdf","Advancements in Aptamer Discovery Technologies__Accounts of Chemical Research__ (2016)__ 10.1021_acs.accounts.6b00283.pdf","savedrecs.html.txt","undefined"]
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.9/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/文献下载/历史版本备份/文献下载助手4.9/assets/icon.png
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.9/assets/locallist.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.9/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "info": {
3 | "name": "",
4 | "url": "",
5 | "version": "1.0.0",
6 | "author": "",
7 | "website": "",
8 | "types": 0
9 | },
10 | "settings": {
11 | "theme": "auto",
12 | "minSDKVer": "2.0.0",
13 | "minOSVer": "12.0.0",
14 | "idleTimerDisabled": false,
15 | "autoKeyboardEnabled": false,
16 | "keyboardToolbarEnabled": false,
17 | "rotateDisabled": false
18 | },
19 | "widget": {
20 | "height": 0,
21 | "staticSize": false,
22 | "tintColor": "",
23 | "iconColor": ""
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.9/main.js:
--------------------------------------------------------------------------------
1 | $ui.render("main");
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.9/scripts/app.js:
--------------------------------------------------------------------------------
1 | //$app.tips("使用技巧请查看readme")
2 |
3 | if (typeof $cache.get("rename") == "undefined") {
4 | $cache.set("rename", false);
5 | }
6 | if (typeof $cache.get("iCloud") == "undefined") {
7 | $cache.set("iCloud", false);
8 | }
9 | if (typeof $cache.get("share") == "u
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.9/strings/en.strings:
--------------------------------------------------------------------------------
1 | "OK" = "OK";
2 | "DONE" = "Done";
3 | "HELLO_WORLD" = "Hello, World!";
4 |
--------------------------------------------------------------------------------
/文献下载/历史版本备份/文献下载助手4.9/strings/zh-Hans.strings:
--------------------------------------------------------------------------------
1 | "OK" = "好的";
2 | "DONE" = "完成";
3 | "HELLO_WORLD" = "你好,世界!";
4 |
--------------------------------------------------------------------------------
/文献下载/文献下载助手/README.md:
--------------------------------------------------------------------------------
1 | 1、输入doi号(默认复制剪贴板文本),点击“下载”按钮即可下载文献;可批量下载,doi用英文逗号(,)隔开。
2 | 2、长按地址栏可检测链接是否可用。
3 | 3、若提示错误,长按对应的链接尝试手动下载。
4 | 4、在文献界面,点击文献可以删除,长按可以分享。
5 | 5、打开重命名开关将采用标题-期刊-卷-doi方式命名,因为需要向同一网址请求数据,批量下载大于5篇时会关闭,否则有拉黑ip风险。
6 | 6、关闭iCloud Drive,文献存储在脚本目录articles下(可打包分享);打开iCloud Drive,文献存储在JSBox/ArticlesHelper/articles目录下。
7 | 7、iCloud中的ArticlesHelper/download目录用来存储wos下载的html记录。具体方法:Safari下载html格式的wos文献记录,下载完成后打开目录,转存至ArticlesHelper/download文件夹,打开脚本,通过载入文件解析doi,若有多篇文献记录默认载入最后一个文件的doi。所有文献记录以txt格式保存在ArticlesHelper/articles目录下,可通过文献界面下拉刷新对解析记录进行管理。
8 | 8、Windows用户可在Microsoft Store下载iCloud进行同步。
9 |
--------------------------------------------------------------------------------
/文献下载/文献下载助手/assets/icloudlist.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/文献下载/文献下载助手/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/文献下载/文献下载助手/assets/icon.png
--------------------------------------------------------------------------------
/文献下载/文献下载助手/assets/locallist.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/文献下载/文献下载助手/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "info": {
3 | "name": "ArticlesHelper",
4 | "url": "",
5 | "version": "1.0.0",
6 | "author": "evil",
7 | "website": "",
8 | "types": 0
9 | },
10 | "settings": {
11 | "theme": "auto",
12 | "minSDKVer": "2.0.0",
13 | "minOSVer": "12.0.0",
14 | "idleTimerDisabled": true,
15 | "autoKeyboardEnabled": true,
16 | "keyboardToolbarEnabled": false,
17 | "rotateDisabled": false
18 | },
19 | "widget": {
20 | "height": 0,
21 | "staticSize": false,
22 | "tintColor": "",
23 | "iconColor": ""
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/文献下载/文献下载助手/main.js:
--------------------------------------------------------------------------------
1 | $ui.render("main");
2 |
3 | const inputtext = $("inputtext");
4 | const switchrename = $("switchrename");
5 | const switchicloud = $("switchicloud");
6 | const switchshare = $("switchshare");
7 | const tabdlpt = $("tabdlpt");
8 | const spin = $("spinner");
9 | const erlist = $("erlist");
10 | const local = $("local");
11 | const icloud = $("icloud");
12 | const linklist = $("linklist");
13 | var reg = new RegExp(/https:/);
14 | var doi = $clipboard.text;
15 | var word;
16 | var name = [];
17 | var findarticle;
18 | var icljson;
19 | var locjson;
20 | var erjson = [];
21 | var linkjson = [];
22 | var checklinkjson = [];
23 | var array = [];
24 | var parsefilename = [];
25 | var outputlink;
26 | var i;
27 |
28 | if ($app.env == 1 || $app.env == 2 || $app.env == 4) {
29 | $app.tips(
30 | "通过doi号(复制剪贴板文本)下文献;\n批量下载时doi号用英文逗号隔开;\n长按地址栏检测可用链接;\n长按对应的链接手动下载文献;\n文献界面单点删除、长按分享;\n重命名采用标题-期刊-卷-doi方式;\n批量下载大于5篇重命名默认关闭;\n关闭iCloud Drive,文献存储在脚本目录articles下(可打包分享);\n打开iCloud Drive,文献存储在JSBox/ArticlesHelper/articles中(Windows可在Microsoft Store下载iCloud同步);\niCloud中的ArticlesHelper/download目录用来存储wos下载的html记录;\n具体方法:Safari下载html格式的wos文献记录,下载完成后打开目录,转存至ArticlesHelper/download文件夹,打开脚本,通过载入文件解析doi,若有多篇文献记录默认载入最后一个文件的doi。所有文献记录以txt格式保存在ArticlesHelper/articles目录下,可通过文献界面下拉刷新对解析记录进行管理;\n如有问题可查看readme。"
31 | );
32 | $("spinner").loading = false;
33 | $("view[0]").hidden = false;
34 | $("view[1]").hidden = true;
35 | $("view[2]").hidden = true;
36 | if (doi == undefined) {
37 | inputtext.placeholder = "请输入doi...";
38 | } else {
39 | inputtext.placeholder = doi;
40 | }
41 | switchrename.on = $cache.get("rename");
42 | switchicloud.on = $cache.get("iCloud");
43 | switchshare.on = $cache.get("share");
44 | //检查文件
45 | if ($file.exists("articles") == false) {
46 | $file.mkdir("articles");
47 | }
48 | if ($drive.exists("ArticlesHelper/articles") == false) {
49 | $drive.mkdir("ArticlesHelper/articles");
50 | }
51 | if ($drive.exists("ArticlesHelper/download") == false) {
52 | $drive.mkdir("ArticlesHelper/download");
53 | }
54 | erjson = [];
55 | erlist.data = erjson;
56 | linkjson = [];
57 | linklist.data = linkjson;
58 | if ($file.exists("assets/icloudlist.json") == false) {
59 | $file.write({
60 | data: $data({ string: "[]" }),
61 | path: "assets/icloudlist.json"
62 | });
63 | }
64 | if ($file.exists("assets/locallist.json") == false) {
65 | $file.write({
66 | data: $data({ string: "[]" }),
67 | path: "assets/locallist.json"
68 | });
69 | }
70 | $file.delete("assets/locallist 2.json");
71 | $file.delete("assets/icloudlist 2.json");
72 | //读取文件记录
73 | refresh();
74 | if (switchicloud.on == true) {
75 | local.hidden = true;
76 | icloud.hidden = false;
77 | $("tablocation").index = 1;
78 | $("zip").hidden = true;
79 | } else {
80 | local.hidden = false;
81 | icloud.hidden = true;
82 | $("tablocation").index = 0;
83 | $("zip").hidden = false;
84 | }
85 | findarticle = "found";
86 | } else {
87 | $push.schedule({
88 | title: "请避免在此环境下运行。"
89 | });
90 | $app.close();
91 | }
92 |
93 | function refresh() {
94 | icljson = $drive.list("ArticlesHelper/articles");
95 | $file.write({
96 | data: $data({ string: JSON.stringify(icljson) }),
97 | path: "assets/icloudlist.json"
98 | });
99 | icloud.data = icljson;
100 | locjson = $file.list("articles");
101 | $file.write({
102 | data: $data({ string: JSON.stringify(locjson) }),
103 | path: "assets/locallist.json"
104 | });
105 | local.data = locjson;
106 | }
--------------------------------------------------------------------------------
/文献下载/文献下载助手/scripts/app.js:
--------------------------------------------------------------------------------
1 | //$app.idleTimerDisabled = true;
2 | if (typeof $cache.get("rename") == "undefined") {
3 | $cache.set("rename", false);
4 | }
5 | if (typeof $cache.get("iCloud") == "undefined") {
6 | $cache.set("iCloud", false);
7 | }
8 | if (typeof $cache.get("share") == "undefined") {
9 | $cache.set("share", false);
10 | }
--------------------------------------------------------------------------------
/文献下载/文献下载助手/strings/en.strings:
--------------------------------------------------------------------------------
1 | "OK" = "OK";
2 | "DONE" = "Done";
3 | "HELLO_WORLD" = "Hello, World!";
4 |
--------------------------------------------------------------------------------
/文献下载/文献下载助手/strings/zh-Hans.strings:
--------------------------------------------------------------------------------
1 | "OK" = "好的";
2 | "DONE" = "完成";
3 | "HELLO_WORLD" = "你好,世界!";
4 |
--------------------------------------------------------------------------------
/样例学习/MyApp/README.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/样例学习/MyApp/README.md
--------------------------------------------------------------------------------
/样例学习/MyApp/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/样例学习/MyApp/assets/icon.png
--------------------------------------------------------------------------------
/样例学习/MyApp/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "info": {
3 | "name": "",
4 | "url": "",
5 | "version": "1.0.0",
6 | "author": "",
7 | "website": "",
8 | "types": 0
9 | },
10 | "settings": {
11 | "theme": "auto",
12 | "minSDKVer": "2.0.0",
13 | "minOSVer": "12.0.0",
14 | "idleTimerDisabled": false,
15 | "autoKeyboardEnabled": false,
16 | "keyboardToolbarEnabled": false,
17 | "rotateDisabled": false
18 | },
19 | "widget": {
20 | "height": 0,
21 | "staticSize": false,
22 | "tintColor": "",
23 | "iconColor": ""
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/样例学习/MyApp/main.js:
--------------------------------------------------------------------------------
1 | const app = require("./scripts/app");
2 |
3 | app.init()
--------------------------------------------------------------------------------
/样例学习/MyApp/scripts/app.js:
--------------------------------------------------------------------------------
1 | const utils = require("./utils");
2 | const spinner = require("./spinner");
3 | const groups = require("./groups");
4 | const tabBar = require("./tabBar");
5 | const navigationBar = require("./navigationBar");
6 |
7 |
8 | const id = [
9 | "pageId0",
10 | "pageId1",
11 | "pageId2"
12 | ];
13 |
14 |
15 | const list = {
16 | type: "list",
17 | props: {
18 | style: 2, // 使用复选类型时这个应该选择 2
19 | rowHeight: 45,
20 | separatorInset: $insets(0, 66, 0, 0),
21 | indicatorInsets: $insets(100, 0, 49, 0),
22 | separatorColor: $color("systemSeparator"),
23 | header: {
24 | type: "view",
25 | props: {height: 100}
26 | },
27 | data: groups.init({
28 | groups: [{
29 | title: "\u5916\u89c2",
30 | items: [{
31 | type: "check",
32 | on: false,
33 | async: true,
34 | key: "theme",
35 | value: "light",
36 | symbol: "sun.min",
37 | title: "\u59cb\u7ec8\u6d45\u8272",
38 | iconColor: $color("teal"),
39 | handler: mode => utils.window.theme = mode
40 | },
41 | {
42 | type: "check",
43 | on: false,
44 | async: true,
45 | key: "theme",
46 | value: "dark",
47 | symbol: "moon.circle",
48 | title: "\u59cb\u7ec8\u6df1\u8272",
49 | iconColor: $color("navy"),
50 | handler: mode => utils.window.theme = mode
51 | },
52 | {
53 | type: "check",
54 | on: true,
55 | async: true,
56 | key: "theme",
57 | value: "auto",
58 | symbol: "circle.righthalf.fill",
59 | title: "\u8ddf\u968f\u7cfb\u7edf",
60 | iconColor: $color("tintColor"),
61 | handler: mode => utils.window.theme = mode
62 | }]
63 | },
64 | {
65 | title: "开关",
66 | items: [{
67 | type: "switch",
68 | on: false,
69 | key: "switch.off",
70 | symbol: "sun.min",
71 | title: "Off",
72 | iconColor: $color("red")
73 | },
74 | {
75 | type: "switch",
76 | on: true,
77 | key: "switch.on",
78 | symbol: "moon.circle",
79 | title: "on",
80 | iconColor: $color("blue")
81 | }]
82 | },
83 | {
84 | title: "箭头",
85 | items: [{
86 | type: "arrow",
87 | async: true,
88 | title: "右边显示 loading",
89 | symbol: "icloud.and.arrow.up.fill",
90 | iconColor: utils.systemColor("orange"),
91 | handler: async () => {
92 | await $wait(10)
93 | }
94 | },
95 | {
96 | type: "arrow",
97 | async: false,
98 | title: "无需加载",
99 | symbol: "list.bullet",
100 | iconColor: utils.systemColor("pink"),
101 | handler: () => {}
102 | }]
103 | }]
104 | })
105 | },
106 | layout: $layout.fillSafeArea,
107 | events: {
108 | didScroll: sender => {
109 | navigationBar.changeLayout(id[0], sender.contentOffset.y, true)
110 | }
111 | }
112 | };
113 |
114 |
115 | exports.init = () => $ui.render({
116 | props: {
117 | id: "window",
118 | statusBarStyle: 0,
119 | navBarHidden: true
120 | },
121 | views: [
122 | {
123 | type: "view",
124 | props: {
125 | id: id[0],
126 | hidden: true,
127 | bgcolor: $color("insetGroupedBackground")
128 | },
129 | layout: (make, view) => {
130 | make.width.equalTo(view.super);
131 | make.height.equalTo(view.super);
132 | make.top.left.inset(0);
133 | },
134 | views: [navigationBar.view({
135 | style: 0,
136 | title: "第1页",
137 | pageName: id[0],
138 | largeTitleInset: 20
139 | }),
140 | list
141 | ]
142 | },
143 | {
144 | type: "view",
145 | props: {
146 | id: id[1],
147 | hidden: true,
148 | bgcolor: utils.systemColor("red")
149 | },
150 | layout: (make, view) => {
151 | make.width.equalTo(view.super);
152 | make.height.equalTo(view.super);
153 | make.top.inset(0);
154 | make.left.equalTo(view.prev.right);
155 | },
156 | views: [navigationBar.view({
157 | style: 1,
158 | title: "第2页",
159 | pageName: id[1]
160 | }),
161 | {
162 | type: "label",
163 | props: {
164 | text: "第2页"
165 | },
166 | layout: $layout.center
167 | }]
168 | },
169 | {
170 | type: "view",
171 | props: {
172 | id: id[2],
173 | hidden: true,
174 | bgcolor: utils.systemColor("green")
175 | },
176 | layout: (make, view) => {
177 | make.width.equalTo(view.super);
178 | make.height.equalTo(view.super);
179 | make.top.inset(0);
180 | make.left.equalTo(view.prev.right);
181 | },
182 | views: [navigationBar.view({
183 | style: 1,
184 | title: "第3页",
185 | pageName: id[2]
186 | }),
187 | {
188 | type: "label",
189 | props: {
190 | text: "第3页"
191 | },
192 | layout: $layout.center
193 | }]
194 | },
195 | tabBar.init({
196 | initialTab: 0,
197 | views: [{
198 | title: "第1页",
199 | tabID: "tabbar.btn0",
200 | pageID: id[0],
201 | symbols: ["house", "house.fill"]
202 | },
203 | {
204 | title: "第2页",
205 | tabID: "tabbar.btn1",
206 | pageID: id[1],
207 | symbols: ["heart", "heart.fill"]
208 | },
209 | {
210 | title: "第3页",
211 | tabID: "tabbar.btn2",
212 | pageID: id[2],
213 | symbols: ["gear"]
214 | }]
215 | })
216 | ]
217 | });
--------------------------------------------------------------------------------
/样例学习/MyApp/scripts/groups.js:
--------------------------------------------------------------------------------
1 | const utils = require("./utils");
2 | const spinner = require("./spinner");
3 |
4 | exports.init = ({ groups }) => groups.map(item => {
5 | return {
6 | title: item.title || "",
7 | rows: item.items.map(parameters => {
8 | const { type, key, on, value, title, symbol, text, titleColor, iconColor, handler, async } = parameters;
9 |
10 | if (type === "switch" && $cache.get(key) === undefined) $cache.set(key, on);
11 | if (type === "check" && on && $cache.get(key) === undefined) $cache.set(key, value);
12 |
13 | const types = {
14 | switch: {
15 | type: "switch",
16 | props: {
17 | on: $cache.get(key),
18 | onColor: utils.systemColor("green")
19 | },
20 | layout: (make, view) => {
21 | make.right.inset(20);
22 | make.centerY.equalTo(view.super);
23 | },
24 | events: {
25 | changed: sender => $cache.set(key, sender.on)
26 | }
27 | },
28 | arrow: {
29 | type: "image",
30 | props: {
31 | id: "arrowmark",
32 | contentMode: 1,
33 | symbol: "chevron.right",
34 | tintColor: $color("systemGray2")
35 | },
36 | layout: (make, view) => {
37 | make.height.equalTo(17);
38 | make.right.inset(20);
39 | make.centerY.equalTo(view.super);
40 | }
41 | },
42 | check: {
43 | type: "image",
44 | props: {
45 | id: "checkmark",
46 | info: value,
47 | contentMode: 1,
48 | symbol: "checkmark",
49 | tintColor: utils.systemColor("blue")
50 | },
51 | layout: (make, view) => {
52 | make.height.equalTo(20);
53 | make.right.inset(20);
54 | make.centerY.equalTo(view.super);
55 | },
56 | events: {
57 | ready: sender => sender.hidden = sender.info !== $cache.get(key)
58 | }
59 | },
60 | text: {
61 | type: "label",
62 | props: {
63 | text: text,
64 | font: $font(16),
65 | align: $align.right,
66 | textColor: $color("systemSecondaryLabel")
67 | },
68 | layout: (make, view) => {
69 | make.right.inset(20);
70 | make.centerY.equalTo(view.super);
71 | }
72 | }
73 | };
74 |
75 | const handlerAsync = async sender => {
76 | const id = "setting.item.async.spinner";
77 | const marks = {
78 | arrow: sender.get("arrowmark"),
79 | check: sender.get("checkmark")
80 | };
81 | sender.userInteractionEnabled = false;
82 | if ($(id)) $(id).remove();
83 | sender.add(spinner.init({
84 | id: id,
85 | diameter: 17,
86 | color: $color("systemGray2"),
87 | layout: (make, view) => {
88 | make.size.equalTo($size(17, 17));
89 | make.center.equalTo(marks[type]);
90 | },
91 | events: {
92 | ready: spinner => {
93 | marks[type].hidden = true;
94 | spinner.play();
95 | }
96 | }
97 | }));
98 | await $wait(0.4);
99 | await handler(value);
100 | $(id).remove();
101 | marks[type].hidden = false;
102 | sender.userInteractionEnabled = true;
103 | };
104 |
105 | return {
106 | type: "view",
107 | props: {
108 | selectable: type === "arrow" || type === "check"
109 | },
110 | layout: $layout.fill,
111 | events: {
112 | touchesEnded: sender => {
113 | if (typeof handler !== "function") return;
114 | if (type === "arrow") async ? handlerAsync(sender) : handler();
115 | if (type === "check") {
116 | sender.super.super.super.views.forEach(item => item.get("checkmark").hidden = item.get("checkmark").info !== value);
117 | $cache.set(key, value);
118 | async ? handlerAsync(sender) : handler(value);
119 | }
120 | }
121 | },
122 | views: [types[type], {
123 | type: "view",
124 | props: {
125 | cornerRadius: 31 * 0.222,
126 | smoothCorners: true,
127 | bgcolor: iconColor,
128 | hidden: !symbol
129 | },
130 | layout: (make, view) => {
131 | make.size.equalTo($size(symbol ? 31 : 0, 31));
132 | make.left.inset(20);
133 | make.centerY.equalTo(view.super);
134 | },
135 | views: [{
136 | type: "image",
137 | props: {
138 | contentMode: 1,
139 | symbol: symbol,
140 | tintColor: $color("white")
141 | },
142 | layout: (make, view) => {
143 | make.size.equalTo($size(20, 20));
144 | make.center.equalTo(view.super);
145 | }
146 | }]
147 | },
148 | {
149 | type: "label",
150 | props: {
151 | text: title,
152 | textColor: titleColor
153 | },
154 | layout: (make, view) => {
155 | make.left.equalTo(view.prev.right).inset(symbol ? 15 : 0);
156 | make.centerY.equalTo(view.super);
157 | }
158 | }]
159 | };
160 | })
161 | };
162 | });
--------------------------------------------------------------------------------
/样例学习/MyApp/scripts/navigationBar.js:
--------------------------------------------------------------------------------
1 | const utils = require("./utils");
2 |
3 | const view = ({
4 | style = 0,
5 | title = "",
6 | pageName = "",
7 | btnTitle = "",
8 | subviews = [],
9 | largeTitleInset = 16
10 | } = {}) => {
11 | const id = [
12 | pageName + ".navigationBar.view",
13 | pageName + ".navbar.blurEffect",
14 | pageName + ".standard.title",
15 | pageName + ".large.title",
16 | pageName + ".large.title.container",
17 | ];
18 |
19 | const largeTitle = {
20 | type: "view",
21 | props: {
22 | id: id[4],
23 | clipsToBounds: true
24 | },
25 | layout: (make, view) => {
26 | make.height.equalTo(56);
27 | make.left.equalTo($ui.window.safeAreaLeft);
28 | make.right.equalTo($ui.window.safeAreaRight);
29 | make.bottom.inset(0);
30 | },
31 | views: [{
32 | type: "label",
33 | props: {
34 | id: id[3],
35 | text: title,
36 | font: $font("bold", 34),
37 | textColor: $color("systemLabel")
38 | },
39 | layout: (make, view) => {
40 | make.width.equalTo(view.super);
41 | make.height.equalTo(56);
42 | make.left.inset(largeTitleInset);
43 | make.bottom.inset(0);
44 | }
45 | }]
46 | };
47 |
48 | const btnTitleSize = utils.sizeThatFits(btnTitle, {
49 | font: $font(16),
50 | size: {
51 | width: 100,
52 | height: 44
53 | }
54 | });
55 |
56 | const backButton = {
57 | type: "button",
58 | props: {
59 | cornerRadius: 0,
60 | bgcolor: $color("clear")
61 | },
62 | layout: (make, view) => {
63 | make.width.equalTo(btnTitleSize.width + (btnTitle ? 32 : 26));
64 | make.height.equalTo(44);
65 | make.top.equalTo($ui.window.safeAreaTop);
66 | make.left.equalTo($ui.window.safeAreaLeft).inset(10);
67 | },
68 | events: {
69 | tapped: sender => $ui.pop()
70 | },
71 | views: [{
72 | type: "image",
73 | props: {
74 | symbol: "chevron.left",
75 | tintColor: $color("systemLabel"),
76 | contentMode: 1
77 | },
78 | layout: (make, view) => {
79 | make.size.equalTo($size(26, 26));
80 | make.left.centerY.equalTo(view.super);
81 | }
82 | },
83 | {
84 | type: "label",
85 | props: {
86 | text: btnTitle,
87 | font: $font(16),
88 | textColor: $color("systemLabel")
89 | },
90 | layout: (make, view) => {
91 | make.left.equalTo(view.prev.right);
92 | make.centerY.equalTo(view.super);
93 | }
94 | }]
95 | };
96 |
97 | return {
98 | type: "view",
99 | props: {
100 | id: id[0],
101 | hidden: $app.env !== $env.app
102 | },
103 | layout: (make, view) => {
104 | make.top.left.right.inset(0);
105 | make.bottom.equalTo($ui.window.safeAreaTop).offset($app.env !== $env.app ? 0 : style ? 44 : 100);
106 | },
107 | events: {
108 | ready: sender => sender.moveToFront()
109 | },
110 | views: [{
111 | type: "blur",
112 | props: {
113 | id: id[1],
114 | style: 10,
115 | alpha: style
116 | },
117 | layout: $layout.fill,
118 | views: [{
119 | type: "view",
120 | props: {
121 | bgcolor: $color("separatorColor")
122 | },
123 | layout: (make, view) => {
124 | make.height.equalTo(1 / $device.info.screen.scale);
125 | make.left.right.bottom.inset(0);
126 | }
127 | }]
128 | },
129 | {
130 | type: "view",
131 | layout: (make, view) => {
132 | make.height.equalTo(44);
133 | make.top.equalTo($ui.window.safeAreaTop);
134 | make.left.equalTo($ui.window.safeAreaLeft);
135 | make.right.equalTo($ui.window.safeAreaRight);
136 | },
137 | views: [...subviews, {
138 | type: "label",
139 | props: {
140 | id: id[2],
141 | text: title,
142 | font: $font("bold", 17),
143 | align: $align.center,
144 | alpha: style
145 | },
146 | layout: (make, view) => {
147 | make.left.right.inset(btnTitleSize.width + (btnTitle ? 72 : 66));
148 | make.centerY.equalTo(view.super);
149 | }
150 | }]
151 | }, style ? backButton : largeTitle]
152 | };
153 | };
154 |
155 | const changeLayout = (pageName, offsetY, animate = true) => {
156 | const id = [
157 | pageName + ".navigationBar.view",
158 | pageName + ".navbar.blurEffect",
159 | pageName + ".standard.title",
160 | pageName + ".large.title",
161 | pageName + ".large.title.container",
162 | ];
163 | const isHorizontalScreen = utils.statusBarOrientation() === 3 || utils.statusBarOrientation() === 4;
164 | const trigger = 56 - offsetY <= 16;
165 | const opacity = parseFloat(((offsetY - 40) / 100 / 0.16).toFixed(2));
166 | const _size = parseFloat((34 - offsetY * 0.04).toFixed(2));
167 | animate = opacity >= -0.2 && opacity <= 0.2;
168 | $(id[0]).updateLayout((make, view) => make.bottom.equalTo(view.super.super.safeAreaTop).offset(isHorizontalScreen ? 44 : offsetY <= 0 ? Math.abs(offsetY) + 100 : offsetY < 56 ? 100 - offsetY : 44));
169 | $(id[4]).updateLayout(make => make.height.equalTo(isHorizontalScreen ? 0 : 56 - offsetY));
170 | $(id[0]).relayout();
171 | $(id[4]).relayout();
172 | $(id[1]).alpha = isHorizontalScreen || opacity > 1 ? 1 : opacity < 0 ? 0 : opacity;
173 | $(id[3]).font = $font("bold", _size > 38 ? 38 : _size < 34 ? 34 : _size);
174 | $ui.animate({
175 | duration: animate ? 0.25 : 0.01,
176 | animation: () => {
177 | $(id[2]).alpha = isHorizontalScreen || trigger ? 1 : 0;
178 | $(id[3]).alpha = isHorizontalScreen || trigger ? 0 : 1;
179 | }
180 | });
181 | };
182 |
183 |
184 | module.exports = {view, changeLayout};
185 |
--------------------------------------------------------------------------------
/样例学习/MyApp/scripts/spinner.js:
--------------------------------------------------------------------------------
1 | exports.init = ({
2 | id, weight = 2,
3 | diameter = 24,
4 | color = $color("gray"),
5 | bgcolor = $color("clear"),
6 | layout = (make, view) => {
7 | make.size.equalTo($size(diameter, diameter));
8 | make.center.equalTo(view.super);
9 | },
10 | events = {
11 | ready: sender => sender.play()
12 | }
13 | } = {}) => {
14 | const r = color.components.red / 255;
15 | const g = color.components.green / 255;
16 | const b = color.components.blue / 255;
17 | const a = color.components.alpha;
18 | const json = {
19 | v: "5.5.7",
20 | fr: 60,
21 | ip: 0,
22 | op: 120,
23 | w: 24,
24 | h: 24,
25 | nm: "spinner",
26 | ddd: 0,
27 | assets: [],
28 | layers: [{
29 | ddd: 0,
30 | ind: 1,
31 | ty: 4,
32 | nm: "circle",
33 | sr: 1,
34 | ks: {
35 | o: {a: 0, k: 100, ix: 11},
36 | r: {
37 | a: 1,
38 | k: [{
39 | i: {x: [0.833], y: [0.833]},
40 | o: {x: [0.167], y: [0.167]},
41 | t: 0,
42 | s: [0]
43 | },
44 | {
45 | t: 119,
46 | s: [720]
47 | }],
48 | ix: 10
49 | },
50 | p: {a: 0, k: [12, 12, 0], ix: 2},
51 | a: {a: 0, k: [1, 1, 0], ix: 1},
52 | s: {a: 0, k: [100, 100, 100], ix: 6}
53 | },
54 | ao: 0,
55 | shapes: [{
56 | ty: "gr",
57 | it: [{
58 | ind: 0,
59 | ty: "sh",
60 | ix: 1,
61 | ks: {
62 | a: 0,
63 | k: {
64 | i: [[0, -5.523], [5.523, 0], [0, 5.523], [-5.523, 0]],
65 | o: [[0, 5.523], [-5.523, 0], [0, -5.523], [5.523, 0]],
66 | v: [[11, 1], [1, 11], [-9, 1], [1, -9]],
67 | c: true
68 | },
69 | ix: 2
70 | },
71 | nm: "Path 1",
72 | mn: "ADBE Vector Shape - Group",
73 | hd: false
74 | },
75 | {
76 | ty: "mm",
77 | mm: 3,
78 | nm: "Merge Paths 1",
79 | mn: "ADBE Vector Filter - Merge",
80 | hd: false
81 | },
82 | {
83 | ty: "tm",
84 | s: {
85 | a: 1,
86 | k: [{
87 | i: {x: [0.833], y: [0.833]},
88 | o: {x: [0.167], y: [0.167]},
89 | t: 0,
90 | s: [0]
91 | },
92 | {
93 | i: {x: [0.833], y: [0.833]},
94 | o: {x: [0.167], y: [0.167]},
95 | t: 60,
96 | s: [0]
97 | },
98 | {
99 | i: {x: [0.833], y: [0.833]},
100 | o: {x: [0.167], y: [0.167]},
101 | t: 90,
102 | s: [60]
103 | },
104 | {
105 | t: 119,
106 | s: [100]
107 | }],
108 | ix: 1
109 | },
110 | e: {
111 | a: 1,
112 | k: [{
113 | i: {x: [0.833], y: [0.833]},
114 | o: {x: [0.167], y: [0.167]},
115 | t: 0,
116 | s: [0]
117 | },
118 | {
119 | i: {x: [0.833], y: [0.833]},
120 | o: {x: [0.167], y: [0.167]},
121 | t: 30,
122 | s: [70]
123 | },
124 | {
125 | i: {x: [0.833], y: [0.833]},
126 | o: {x: [0.167], y: [0.167]},
127 | t: 60,
128 | s: [90]
129 | },
130 | {
131 | i: {x: [0.833], y: [0.833]},
132 | o: {x: [0.167], y: [0.167]},
133 | t: 90,
134 | s: [90]
135 | },
136 | {
137 | t: 119,
138 | s: [99]
139 | }],
140 | ix: 2
141 | },
142 | o: {a: 0, k: 0, ix: 3},
143 | m: 1,
144 | ix: 3,
145 | nm: "Trim Paths 1",
146 | mn: "ADBE Vector Filter - Trim",
147 | hd: false
148 | },
149 | {
150 | ty: "st",
151 | c: {a: 0, k: [r, g, b, a], ix: 3},
152 | o: {a: 0, k: 100, ix: 4},
153 | w: {a: 0, k: weight, ix: 5},
154 | lc: 2,
155 | lj: 1,
156 | ml: 4,
157 | bm: 0,
158 | nm: "Stroke 1",
159 | mn: "ADBE Vector Graphic - Stroke",
160 | hd: false
161 | },
162 | {
163 | ty: "tr",
164 | p: {a: 0, k: [0, 0], ix: 2},
165 | a: {a: 0, k: [0, 0], ix: 1},
166 | s: {a: 0, k: [100, 100], ix: 3},
167 | r: {a: 0, k: 0, ix: 6},
168 | o: {a: 0, k: 100, ix: 7},
169 | sk: {a: 0, k: 0, ix: 4},
170 | sa: {a: 0, k: 0, ix: 5},
171 | nm: "Transform"
172 | }],
173 | nm: "circle",
174 | np: 4,
175 | cix: 2,
176 | bm: 0,
177 | ix: 1,
178 | mn: "ADBE Vector Group",
179 | hd: false
180 | }],
181 | ip: 0,
182 | op: 120,
183 | st: 0,
184 | bm: 0
185 | }],
186 | markers: []
187 | };
188 | return {
189 | type: "lottie",
190 | props: {
191 | loop: true,
192 | contentMode: 1,
193 | circular: true,
194 | id, json, bgcolor
195 | },
196 | layout, events
197 | };
198 | };
199 |
--------------------------------------------------------------------------------
/样例学习/MyApp/scripts/tabBar.js:
--------------------------------------------------------------------------------
1 | const utils = require("./utils");
2 |
3 | exports.init = ({initialTab = 0, views}) => {
4 | const pageIds = views.map(item => item.pageID);
5 |
6 | return {
7 | type: "blur",
8 | props: {style: 10},
9 | layout: (make, view) => {
10 | make.top.equalTo($ui.window.safeAreaBottom).offset(-49);
11 | make.left.right.bottom.inset(0);
12 | },
13 | views: [{
14 | type: "stack",
15 | props: {
16 | spacing: 16,
17 | axis: 0,
18 | distribution: 1,
19 | alignment: 0,
20 | stack: {
21 | views: views.map((item, index) => {
22 | return {
23 | type: "view",
24 | props: {
25 | id: item.tabID,
26 | info: index
27 | },
28 | events: {
29 | ready: sender => pageIds.forEach((id, index) => $(id).hidden = index !== initialTab),
30 | layoutSubviews: sender => {
31 | const isVerticalScreen = utils.statusBarOrientation() === 1 || utils.statusBarOrientation() === 2;
32 | $(pageIds[0]).updateLayout((make, view) => make.left.inset(-(initialTab * view.super.frame.width)));
33 | $(pageIds[0]).relayout();
34 | sender.super.views.forEach((item, index) => {
35 | item.views[1].font = $font(isVerticalScreen ? 10 : 14);
36 | item.views[0].updateLayout((make, view) => {
37 | make.centerX.equalTo(view.super).offset(isVerticalScreen ? 0 : -17);
38 | make.centerY.equalTo(view.super).offset(isVerticalScreen ? -6 : 0);
39 | });
40 | item.views[1].remakeLayout((make, view) => {
41 | if (isVerticalScreen) {
42 | make.top.equalTo(view.prev.bottom).inset(2);
43 | make.centerX.equalTo(view.super);
44 | } else {
45 | make.left.equalTo(view.prev.right).inset(5);
46 | make.centerY.equalTo(view.super);
47 | }
48 | });
49 | item.views[0].relayout();
50 | item.views[1].relayout();
51 | });
52 | },
53 | tapped: sender => {
54 | sender.super.views.forEach((view, index) => {
55 | $ui.animate({
56 | duration: 0.25,
57 | animation: () => {
58 | view.views[0].symbol = views[index].symbols[index === sender.info && item.symbols[1] ? 1 : 0];
59 | view.views[0].tintColor = utils.systemColor(index === sender.info ? "blue" : "gray");
60 | view.views[1].textColor = utils.systemColor(index === sender.info ? "blue" : "gray");
61 | }
62 | });
63 | });
64 | pageIds.forEach((id, index) => $(id).hidden = sender.info !== index);
65 | $(pageIds[0]).updateLayout((make, view) => make.left.inset(-(sender.info * view.super.frame.width)));
66 | $ui.animate({
67 | duration: 0.25,
68 | animation: () => $(pageIds[0]).relayout()
69 | });
70 | initialTab = sender.info;
71 | }
72 | },
73 | views: [{
74 | type: "image",
75 | props: {
76 | symbol: item.symbols[index === initialTab && item.symbols[1] ? 1 : 0],
77 | contentMode: 1,
78 | clipsToBounds: false,
79 | alpha: 0.9,
80 | tintColor: utils.systemColor(index === initialTab ? "blue" : "gray")
81 | },
82 | layout: (make, view) => {
83 | make.size.equalTo($size(29, 29));
84 | make.centerX.equalTo(view.super);
85 | make.centerY.equalTo(view.super).offset(-6);
86 | }
87 | },
88 | {
89 | type: "label",
90 | props: {
91 | text: item.title,
92 | font: $font(10),
93 | textColor: utils.systemColor(index === initialTab ? "blue" : "gray")
94 | },
95 | layout: (make, view) => {
96 | make.top.equalTo(view.prev.bottom).inset(2);
97 | make.centerX.equalTo(view.super);
98 | }
99 | }]
100 | };
101 | })
102 | }
103 | },
104 | layout: (make, view) => {
105 | make.height.equalTo(49);
106 | make.top.inset(0);
107 | make.left.equalTo($ui.window.safeAreaLeft).inset(16);
108 | make.right.equalTo($ui.window.safeAreaRight).inset(16);
109 | }
110 | },
111 | {
112 | type: "view",
113 | props: {
114 | bgcolor: $color("separatorColor")
115 | },
116 | layout: (make, view) => {
117 | make.height.equalTo(1 / $device.info.screen.scale);
118 | make.top.left.right.inset(0);
119 | }
120 | }]
121 | };
122 | };
--------------------------------------------------------------------------------
/样例学习/MyApp/scripts/utils.js:
--------------------------------------------------------------------------------
1 | /*-- 获取App最顶层Window对象 --*/
2 | const window = $objc("UIApplication").$sharedApplication().invoke("delegate.window").jsValue();
3 |
4 | /*-- 获取系统Adaptable颜色 --*/
5 | const systemColor = name => $objc("UIColor").invoke(`system${name.charAt(0).toUpperCase() + name.slice(1)}Color`).jsValue();
6 |
7 | /*-- 获取设备方向 (返回上下左右、正面和背面) --*/
8 | const deviceOrientation = $objc("UIDevice").invoke("currentDevice.orientation");
9 |
10 | /*-- 获取状态栏方向 (返回上下左右) --*/
11 | const statusBarOrientation = () => $objc("UIApplication").invoke("sharedApplication.statusBarOrientation");
12 |
13 | /*-- 获取字体占用空间大小的 --*/
14 | const sizeThatFits = (text, {
15 | font = $font(17), lineSpacing,
16 | size = $ui.vc.view.frame
17 | } = {}) => {
18 | return $text.sizeThatFits({
19 | text, font, lineSpacing,
20 | width: size.width,
21 | height: size.height
22 | });
23 | };
24 |
25 |
26 | module.exports = {
27 | window,
28 | systemColor,
29 | deviceOrientation,
30 | statusBarOrientation,
31 | sizeThatFits
32 | };
--------------------------------------------------------------------------------
/样例学习/MyApp/strings/en.strings:
--------------------------------------------------------------------------------
1 | "OK" = "OK";
2 | "DONE" = "Done";
3 | "HELLO_WORLD" = "Hello, World!";
4 |
--------------------------------------------------------------------------------
/样例学习/MyApp/strings/zh-Hans.strings:
--------------------------------------------------------------------------------
1 | "OK" = "好的";
2 | "DONE" = "完成";
3 | "HELLO_WORLD" = "你好,世界!";
4 |
--------------------------------------------------------------------------------
/样例学习/cview-widget-views/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cview-widget-views",
3 | "version": "0.1.0",
4 | "lockfileVersion": 1
5 | }
6 |
--------------------------------------------------------------------------------
/样例学习/cview-widget-views/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cview-widget-views",
3 | "version": "0.1.0",
4 | "description": "",
5 | "main": "./index.js",
6 | "keywords": [
7 | "jsbox",
8 | "cview"
9 | ],
10 | "files": [
11 | "index.js",
12 | "package.json",
13 | "package-lock.json"
14 | ],
15 | "exports": {
16 | ".": [
17 | {
18 | "require": "./index.js",
19 | "default": "./index.js"
20 | },
21 | "./index.js"
22 | ]
23 | },
24 | "author": "gandum2077",
25 | "license": "MIT"
26 | }
--------------------------------------------------------------------------------
/样例学习/react-jsbox-example/README.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/样例学习/react-jsbox-example/README.md
--------------------------------------------------------------------------------
/样例学习/react-jsbox-example/assets/code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/样例学习/react-jsbox-example/assets/code.png
--------------------------------------------------------------------------------
/样例学习/react-jsbox-example/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evilbutcher/Code/3d73a04c3e734ab79e8fa9626be67dcdc631cf80/样例学习/react-jsbox-example/assets/icon.png
--------------------------------------------------------------------------------
/样例学习/react-jsbox-example/assets/prism.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Code
9 |
27 |
28 |
29 |
30 | <%=code%>
31 |
32 |
33 |
34 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/样例学习/react-jsbox-example/assets/react-lottie.json:
--------------------------------------------------------------------------------
1 | {"v":"4.6.3","fr":29.9700012207031,"ip":0,"op":141.000005743048,"w":800,"h":800,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"center_circle","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":0,"k":[401,389,0]},"a":{"a":0,"k":[-13.063,-22.86,0]},"s":{"a":0,"k":[119.72,119.72,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[77.344,77.344]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"st","c":{"a":0,"k":[0.898039,0.223529,0.207843,1]},"o":{"a":0,"k":100},"w":{"a":0,"k":0},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke"},{"ty":"fl","c":{"a":0,"k":[0.0196078,0.6470588,0.8196078,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-14.328,-25.328],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":24,"s":[0,0],"e":[160,160]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":45,"s":[160,160],"e":[70,70]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":61,"s":[70,70],"e":[130,130]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":73,"s":[130,130],"e":[80,80]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":84,"s":[80,80],"e":[110,110]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":98,"s":[110,110],"e":[100,100]},{"t":116.000004724777}],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":900.000036657751,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":2,"ty":4,"nm":"circle3","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":-120.543},"p":{"a":0,"k":[406,375,0]},"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[104.627,108.478,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[497.445,195.844]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p833_1_0p333_0"],"t":64,"s":[100],"e":[0]},{"t":110.000004480392}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.333],"y":[0.333]},"n":["0p833_0p833_0p333_0p333"],"t":64,"s":[100],"e":[100]},{"t":110.000004480392}],"ix":2},"o":{"a":1,"k":[{"i":{"x":[0.69],"y":[3.268]},"o":{"x":[0.294],"y":[0]},"n":["0p69_3p268_0p294_0"],"t":64,"s":[1886.781],"e":[1765.781]},{"t":115.000004684046}],"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim"},{"ty":"st","c":{"a":0,"k":[0.0196078,0.6470588,0.8196078,1]},"o":{"a":0,"k":100},"w":{"a":1,"k":[{"i":{"x":[0.667],"y":[0.936]},"o":{"x":[0.333],"y":[0]},"n":["0p667_0p936_0p333_0"],"t":55,"s":[0],"e":[23.039]},{"i":{"x":[0.667],"y":[1.13]},"o":{"x":[0.333],"y":[-0.043]},"n":["0p667_1p13_0p333_-0p043"],"t":74,"s":[23.039],"e":[3]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0.158]},"n":["0p667_1_0p333_0p158"],"t":85,"s":[3],"e":[24]},{"t":99.0000040323527}]},"lc":2,"lj":2,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke"},{"ty":"tr","p":{"a":0,"k":[-6.277,-10.078],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[89.823,86.077],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":900.000036657751,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":3,"ty":4,"nm":"circle2","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":-59.94},"p":{"a":0,"k":[413,385,0]},"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[104.627,108.478,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[497.445,195.844]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":46,"s":[100],"e":[84.162]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.333],"y":[-0.084]},"n":["0p833_1_0p333_-0p084"],"t":73,"s":[84.162],"e":[100]},{"t":104.000004236007}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.324],"y":[0]},"n":["0p833_1_0p324_0"],"t":46,"s":[100],"e":[0]},{"t":104.000004236007}],"ix":2},"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[0.953]},"o":{"x":[0.327],"y":[0]},"n":["0p667_0p953_0p327_0"],"t":46,"s":[50],"e":[2101.915]},{"t":105.000004276738}],"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim"},{"ty":"st","c":{"a":0,"k":[0.0196078,0.6470588,0.8196078,1]},"o":{"a":0,"k":100},"w":{"a":1,"k":[{"i":{"x":[0.667],"y":[0.91]},"o":{"x":[0.333],"y":[0]},"n":["0p667_0p91_0p333_0"],"t":60,"s":[0],"e":[13]},{"i":{"x":[0.667],"y":[1.258]},"o":{"x":[0.333],"y":[-0.085]},"n":["0p667_1p258_0p333_-0p085"],"t":75,"s":[13],"e":[2]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0.183]},"n":["0p667_1_0p333_0p183"],"t":87,"s":[2],"e":[24]},{"t":104.000004236007}]},"lc":2,"lj":2,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke"},{"ty":"tr","p":{"a":0,"k":[-7.277,-10.078],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[89.823,86.077],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":900.000036657751,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":4,"ty":4,"nm":"circle1","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":0,"k":[407,397,0]},"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[104.627,108.478,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[497.445,195.844]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[100],"e":[100]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":53,"s":[100],"e":[55.162]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.333],"y":[0.01]},"n":["0p833_1_0p333_0p01"],"t":92,"s":[55.162],"e":[0]},{"t":105.000004276738}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[100],"e":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.333],"y":[0.333]},"n":["0p833_0p833_0p333_0p333"],"t":53,"s":[100],"e":[100]},{"t":103.000004195276}],"ix":2},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_1_0p167_0p167"],"t":0,"s":[100],"e":[50]},{"i":{"x":[0.714],"y":[0.721]},"o":{"x":[0.303],"y":[0]},"n":["0p714_0p721_0p303_0"],"t":53,"s":[50],"e":[958.781]},{"t":104.000004236007}],"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim"},{"ty":"st","c":{"a":0,"k":[0.0196078,0.6470588,0.8196078,1]},"o":{"a":0,"k":100},"w":{"a":1,"k":[{"i":{"x":[0.667],"y":[0.908]},"o":{"x":[0.333],"y":[0]},"n":["0p667_0p908_0p333_0"],"t":52,"s":[0],"e":[16.039]},{"i":{"x":[0.667],"y":[1.259]},"o":{"x":[0.333],"y":[-0.085]},"n":["0p667_1p259_0p333_-0p085"],"t":71,"s":[16.039],"e":[6]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0.184]},"n":["0p667_1_0p333_0p184"],"t":82,"s":[6],"e":[24]},{"t":96.0000039101602}]},"lc":2,"lj":2,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke"},{"ty":"tr","p":{"a":0,"k":[-7.277,-10.078],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[89.823,86.077],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":900.000036657751,"st":0,"bm":0,"sr":1}]}
--------------------------------------------------------------------------------
/样例学习/react-jsbox-example/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "info": {
3 | "name": "react-jsbox-example",
4 | "url": "https://github.com/Nicify/react-jsbox-example",
5 | "version": "1.0.0",
6 | "author": "Eva1ent",
7 | "website": "https://github.com/Nicify/react-jsbox-example",
8 | "types": 1
9 | },
10 | "settings": {
11 | "theme": "auto",
12 | "minSDKVer": "1.0.0",
13 | "minOSVer": "12.0.0",
14 | "idleTimerDisabled": false,
15 | "autoKeyboardEnabled": false,
16 | "keyboardToolbarEnabled": true,
17 | "rotateDisabled": true
18 | },
19 | "widget": {
20 | "height": 0,
21 | "staticSize": false,
22 | "tintColor": "",
23 | "iconColor": ""
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/样例学习/react-jsbox-example/scripts/components/CodeView.js:
--------------------------------------------------------------------------------
1 | import React, { useMemo } from 'react'
2 | import pupa from 'pupa'
3 |
4 | const { width } = $device.info.screen
5 |
6 | const HLTemplate = $file.read('assets/prism.html').string
7 |
8 | export default function CodeView(props) {
9 | const { content } = props
10 | // return
11 | const html = useMemo(() => pupa(HLTemplate, { code: content }), [content])
12 |
13 | return
14 | }
15 |
--------------------------------------------------------------------------------
/样例学习/react-jsbox-example/scripts/components/ExampleView.js:
--------------------------------------------------------------------------------
1 | import React, { memo, useState } from 'react'
2 | import { codeIcon } from '../constants'
3 | const { width } = $device.info.screen
4 |
5 | const ExampleView = ({ demo, code }) => {
6 | const [showCode, setShowCode] = useState(false)
7 |
8 | return (
9 | <>
10 | {showCode ? code : demo}
11 |