Skip to content

Commit e501759

Browse files
committed
默认开启 Source code 加速,优化 Source code 加速按钮样式(并列一排)
1 parent 66caf6f commit e501759

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

GithubEnhanced-High-Speed-Download.user.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name Github 增强 - 高速下载
3-
// @version 1.0.3
3+
// @version 1.0.4
44
// @author X.I.U
55
// @description 为 Github 的 Releases、Code(ZIP) 添加高速下载
66
// @match https://github.com/*/*
@@ -14,7 +14,7 @@
1414
// ==/UserScript==
1515

1616
(function() {
17-
var source_code = false; // Source code 加速,false=关闭,true=开启
17+
var source_code = true; // Source code 加速,false=关闭,true=开启
1818
var download_url1 = "https://download.fastgit.org";
1919
var download_url1_name = "日本东京";
2020
var download_url2 = "https://github.wuyanzheshui.workers.dev";
@@ -47,7 +47,7 @@
4747

4848
$(this).after(div1);
4949
});
50-
// Source code 加速,默认关闭
50+
// Source code 加速,默认开启
5151
if (source_code){
5252
$(this).find(".d-block.Box-body>a").each(function () {
5353
var href = $(this).attr("href");
@@ -56,15 +56,18 @@
5656
var url3 = download_url3 + '/github.com' + href;
5757
var url4 = download_url4 + '/github.com' + href;
5858
var url5 = download_url5 + '/github.com' + href;
59-
var div1 = `<div style="display: flex;">
60-
<div><a style="${download_releases_style}" class="btn user-btn-link" href="${url1}" rel="nofollow">${download_url1_name}</a></div>
61-
<div><a style="${download_releases_style}" class="btn user-btn-link" href="${url2}" rel="nofollow">${download_url2_name}</a></div>
62-
<div><a style="${download_releases_style}" class="btn user-btn-link" href="${url3}" rel="nofollow">${download_url3_name}</a></div>
63-
<div><a style="${download_releases_style}" class="btn user-btn-link" href="${url4}" rel="nofollow">${download_url4_name}</a></div>
64-
<div><a style="${download_releases_style}" class="btn user-btn-link" href="${url5}" rel="nofollow">${download_url5_name}</a></div>
59+
var div1 = `<div style="display: flex;justify-content: flex-end;flex-grow: 1;">
60+
<div><span style="font-size: 12px;color: #586069;line-height: 23px;">高速下载:</span></div>
61+
<div><a style="${download_releases_style}" class="btn" href="${url1}" rel="nofollow">${download_url1_name}</a></div>
62+
<div><a style="${download_releases_style}" class="btn" href="${url2}" rel="nofollow">${download_url2_name}</a></div>
63+
<div><a style="${download_releases_style}" class="btn" href="${url3}" rel="nofollow">${download_url3_name}</a></div>
64+
<div><a style="${download_releases_style}" class="btn" href="${url4}" rel="nofollow">${download_url4_name}</a></div>
65+
<div><a style="${download_releases_style}" class="btn" href="${url5}" rel="nofollow">${download_url5_name}</a></div>
6566
</div>`
6667
$(this).after(div1);
6768
});
69+
// 修改 Source code 样式,使其和加速按钮并列一排
70+
document.querySelectorAll('.d-block.py-1.py-md-2.Box-body.px-2').forEach(el=>el.className='d-flex py-1 py-md-2 Box-body px-2');
6871
}
6972
});
7073
// Download ZIP 加速

0 commit comments

Comments
 (0)