Skip to content

Commit 75a0bd2

Browse files
committed
1.4.5
Signed-off-by: RC1844 <[email protected]>
1 parent c83db53 commit 75a0bd2

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

FastGithub.js

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
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.3
12+
// @version 1.4.5
1313
// @grant GM_addStyle
1414
// ==/UserScript==
1515

@@ -201,30 +201,46 @@
201201
$(this).after(span);
202202
});
203203

204-
204+
function IsPC() {
205+
var userAgentInfo = navigator.userAgent;
206+
var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
207+
var flag = true;
208+
for (var v = 0; v < Agents.length; v++) {
209+
if (userAgentInfo.indexOf(Agents[v]) > 0) {
210+
flag = false;
211+
break;
212+
}
213+
}
214+
return flag;
215+
}
205216
//Download Releases
206217
$('.release-main-section').each(function () {
207218
$(this).find('.d-flex.Box-body>a').each(function () {
208219
var href = $(this).attr('href');
209-
var span = `<div style="left: 65%;">`;
220+
var span = `<small>`;
210221
for (let i in download_set) {
211222
span += `<a class="flex-1 btn btn-outline get-repo-btn" rel="nofollow"
212223
href="${mirror_url[download_set[i]] + href}">快速下载${i}</a>`;
213224
}
214-
span += `</div>`;
215-
$(this).after(span);
225+
span += `</small>`;
226+
$(this).next().append(span);
227+
if (!IsPC()) {
228+
$('.d-flex').removeClass("d-flex");
229+
}
216230
});
217-
});
218-
$('.release-main-section').each(function () {
231+
219232
$(this).find('.d-block.Box-body>a').each(function () {
220233
var href = $(this).attr('href');
221-
var span = ``;
234+
var span = `<small>`;
222235
for (let i in download_set) {
223236
span += `<a class="flex-1 btn btn-outline get-repo-btn" rel="nofollow"
224237
href="${mirror_url[download_set[i]] + href}">快速下载${i}</a>`;
225238
}
239+
span += `</small>`;
226240
$(this).after(span);
241+
$(this).parent().addClass("d-flex flex-justify-between");
227242
});
243+
228244
});
229245

230246
})();

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333

3434
### 更新日志
3535

36+
v1.4.5
37+
1. releases 页按钮终于对齐了,手机浏览更舒服
38+
3639
v1.4.0-1.4.3
3740

3841
1. 更换插入位置

0 commit comments

Comments
 (0)