Skip to content

Commit c5a8676

Browse files
committed
1.4.2
Signed-off-by: RC1844 <[email protected]>
1 parent 2ecafe2 commit c5a8676

File tree

3 files changed

+45
-38
lines changed

3 files changed

+45
-38
lines changed

FastGithub.js

Lines changed: 42 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
// @namespace https://github.com/RC1844
55
// @author RC1844
66
// @license MIT License
7-
// @description 镜像访问GitHub、加速克隆和下载前往项目Github仓库查看免费搭建Github镜像站点方法
7+
// @description 镜像访问GitHub、加速克隆和下载;适配Github新UI;前往项目Github仓库查看免费搭建Github镜像站点方法
88
// @include *://github.com/*
99
// @include *://github*
1010
// @include *://hub.fastgit.org/*
1111
// @require http://cdn.bootcss.com/jquery/1.8.3/jquery.min.js
12-
// @version 1.4.1
12+
// @version 1.4.2
1313
// @grant GM_addStyle
1414
// ==/UserScript==
1515

@@ -89,44 +89,43 @@
8989
for (let i in clone_set) {
9090
info += `<div class="input-group">
9191
<input type="text" class="form-control input-monospace input-sm"
92-
value="${str1 + mirror_url[clone_set[i]] + str2}" data-autoselect="" readonly="">
92+
value="${str1 + mirror_url[clone_set[i]] + str2}" readonly="" data-autoselect="">
9393
<div class="input-group-button">
94-
<clipboard-copy value="${str1 + mirror_url[clone_set[i]] + str2}" class="btn btn-sm">
95-
<svg class="octicon octicon-clippy" viewBox="0 0 14 16" version="1.1" width="14" height="16"
94+
<clipboard-copy value="${str1 + mirror_url[clone_set[i]] + str2}" class="btn btn-sm"><svg
95+
class="octicon octicon-clippy" viewBox="0 0 16 16" version="1.1" width="16" height="16"
9696
aria-hidden="true">
9797
<path fill-rule="evenodd"
98-
d="M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z">
98+
d="M5.75 1a.75.75 0 00-.75.75v3c0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75v-3a.75.75 0 00-.75-.75h-4.5zm.75 3V2.5h3V4h-3zm-2.874-.467a.75.75 0 00-.752-1.298A1.75 1.75 0 002 3.75v9.5c0 .966.784 1.75 1.75 1.75h8.5A1.75 1.75 0 0014 13.25v-9.5a1.75 1.75 0 00-.874-1.515.75.75 0 10-.752 1.298.25.25 0 01.126.217v9.5a.25.25 0 01-.25.25h-8.5a.25.25 0 01-.25-.25v-9.5a.25.25 0 01.126-.217z">
9999
</path>
100-
</svg>
101-
</clipboard-copy>
100+
</svg></clipboard-copy>
102101
</div>
103102
</div>`;
104103
}
105104

106105
//浏览列表
107106
for (let i in mirror_set) {
108-
info += `<a class="SelectMenu-item" href="${mirror_url[mirror_set[i]] + str3}" target="_blank" role="menuitemradio"
109-
aria-checked="false" rel="nofollow">
110-
<svg class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check" viewBox="0 0 16 16" version="1.1"
111-
width="16" height="16" aria-hidden="true">
112-
<path fill-rule="evenodd"
113-
d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z">
114-
</path>
115-
</svg>
116-
<span class="break-word">镜像浏览${i}</span>
117-
</a>`
107+
info += `<a class="SelectMenu-item" href="${mirror_url[mirror_set[i]] + str3}" target="_blank"
108+
role="menuitemradio" aria-checked="false" rel="nofollow">
109+
<svg class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check" viewBox="0 0 16 16"
110+
version="1.1" width="16" height="16" aria-hidden="true">
111+
<path fill-rule="evenodd"
112+
d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z">
113+
</path>
114+
</svg>
115+
<span class="break-word">镜像浏览${i}</span>
116+
</a>`
118117
}
119118
if (location.hostname != "github.com") {
120119
info += `<a class="SelectMenu-item" href="https://github.com${str3}" target="_blank" role="menuitemradio"
121-
aria-checked="false" rel="nofollow">
122-
<svg class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check" viewBox="0 0 16 16" version="1.1"
123-
width="16" height="16" aria-hidden="true">
124-
<path fill-rule="evenodd"
125-
d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z">
126-
</path>
127-
</svg>
128-
<span class="break-word">返回GitHub</span>
129-
</a>`
120+
aria-checked="false" rel="nofollow">
121+
<svg class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check" viewBox="0 0 16 16"
122+
version="1.1" width="16" height="16" aria-hidden="true">
123+
<path fill-rule="evenodd"
124+
d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z">
125+
</path>
126+
</svg>
127+
<span class="break-word">返回GitHub</span>
128+
</a>`
130129
}
131130

132131
info += `
@@ -137,14 +136,14 @@
137136
<div class="SelectMenu-list">
138137
<a class="SelectMenu-item" href="https://github.com/RC1844/FastGithub" target="_blank" role="menuitemradio"
139138
aria-checked="false" rel="nofollow">
140-
<span class="css-truncate css-truncate-overflow"style="text-align:center;">
139+
<span class="css-truncate css-truncate-overflow" style="text-align:center;">
141140
Github仓库地址,点个赞谢谢
142141
</span>
143142
</a>
144-
<a class="SelectMenu-item" href="https://greasyfork.org/zh-CN/scripts/397419" target="_blank" role="menuitemradio"
145-
aria-checked="false" rel="nofollow">
146-
<span class="css-truncate css-truncate-overflow"style="text-align:center;">
147-
GreasyFork地址,喜欢的可以收藏
143+
<a class="SelectMenu-item" href="https://greasyfork.org/zh-CN/scripts/397419" target="_blank"
144+
role="menuitemradio" aria-checked="false" rel="nofollow">
145+
<span class="css-truncate css-truncate-overflow" style="text-align:center;">
146+
GreasyFork地址,喜欢的可以收藏
148147
</span>
149148
</a>
150149
</div>
@@ -158,16 +157,22 @@
158157

159158

160159
//Fast Download ZIP
161-
$('get-repo-controller > details > div > div > div > div.mt-2.d-flex').each(function () {
162-
var span = `<div class="mt-2 d-flex">`;
160+
$('ul >li.Box-row.Box-row--hover-gray.p-0').each(function () {
161+
var span = `<li class="Box-row p-0">`;
163162
$(this).find("a[rel='nofollow']").each(function () {
164163
var href = $(this).attr('href');
165164
for (let i in download_set) {
166-
span += `<a class="btn btn-outline get-repo-btn btn-block" rel="nofollow"
167-
href="${mirror_url[download_set[i]] + href}">Download ZIP${i}</a>`;
165+
span += `<a class="d-flex flex-items-center text-gray-dark text-bold no-underline Box-row Box-row--hover-gray p-3"
166+
rel="nofollow" href="${mirror_url[download_set[i]] + href}">
167+
<svg class="octicon octicon-file-zip mr-3" viewBox="0 0 16 16" version="1.1" width="16" height="16"
168+
aria-hidden="true">
169+
<path fill-rule="evenodd"
170+
d="M3.5 1.75a.25.25 0 01.25-.25h3a.75.75 0 000 1.5h.5a.75.75 0 000-1.5h2.086a.25.25 0 01.177.073l2.914 2.914a.25.25 0 01.073.177v8.586a.25.25 0 01-.25.25h-.5a.75.75 0 000 1.5h.5A1.75 1.75 0 0014 13.25V4.664c0-.464-.184-.909-.513-1.237L10.573.513A1.75 1.75 0 009.336 0H3.75A1.75 1.75 0 002 1.75v11.5c0 .649.353 1.214.874 1.515a.75.75 0 10.752-1.298.25.25 0 01-.126-.217V1.75zM8.75 3a.75.75 0 000 1.5h.5a.75.75 0 000-1.5h-.5zM6 5.25a.75.75 0 01.75-.75h.5a.75.75 0 010 1.5h-.5A.75.75 0 016 5.25zm2 1.5A.75.75 0 018.75 6h.5a.75.75 0 010 1.5h-.5A.75.75 0 018 6.75zm-1.25.75a.75.75 0 000 1.5h.5a.75.75 0 000-1.5h-.5zM8 9.75A.75.75 0 018.75 9h.5a.75.75 0 010 1.5h-.5A.75.75 0 018 9.75zm-.75.75a1.75 1.75 0 00-1.75 1.75v3c0 .414.336.75.75.75h2.5a.75.75 0 00.75-.75v-3a1.75 1.75 0 00-1.75-1.75h-.5zM7 12.25a.25.25 0 01.25-.25h.5a.25.25 0 01.25.25v2.25H7v-2.25z">
171+
</path>
172+
</svg>Fast Download ZIP${i}</a>`;
168173
}
169-
span += `</div>`;
170174
});
175+
span += `</li>`;
171176
$(this).after(span);
172177
});
173178

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@
3030

3131
### 更新日志
3232

33-
v1.4.0
33+
v1.4.0-1.4.2
3434
1. 更换插入位置
3535
2. releases页改为相对布局,不再为对齐而使用绝对布局
3636
3. 弹出页面再改版,支持手机浏览
37+
4. 适配Github新UI样式
38+
5. 修复插入失效
3739

3840
v1.3.1
3941
1. 取消新提供的下载站点

REANDME/releases2.png

-6.65 KB
Loading

0 commit comments

Comments
 (0)