|
4 | 4 | // @namespace https://github.com/RC1844 |
5 | 5 | // @author RC1844 |
6 | 6 | // @license MIT License |
7 | | -// @description 镜像访问GitHub、加速克隆和下载,前往项目Github仓库查看免费搭建Github镜像站点方法 |
| 7 | +// @description 镜像访问GitHub、加速克隆和下载;适配Github新UI;前往项目Github仓库查看免费搭建Github镜像站点方法 |
8 | 8 | // @include *://github.com/* |
9 | 9 | // @include *://github* |
10 | 10 | // @include *://hub.fastgit.org/* |
11 | 11 | // @require http://cdn.bootcss.com/jquery/1.8.3/jquery.min.js |
12 | | -// @version 1.4.1 |
| 12 | +// @version 1.4.2 |
13 | 13 | // @grant GM_addStyle |
14 | 14 | // ==/UserScript== |
15 | 15 |
|
|
89 | 89 | for (let i in clone_set) { |
90 | 90 | info += `<div class="input-group"> |
91 | 91 | <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=""> |
93 | 93 | <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" |
96 | 96 | aria-hidden="true"> |
97 | 97 | <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"> |
99 | 99 | </path> |
100 | | - </svg> |
101 | | - </clipboard-copy> |
| 100 | + </svg></clipboard-copy> |
102 | 101 | </div> |
103 | 102 | </div>`; |
104 | 103 | } |
105 | 104 |
|
106 | 105 | //浏览列表 |
107 | 106 | 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>` |
118 | 117 | } |
119 | 118 | if (location.hostname != "github.com") { |
120 | 119 | 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>` |
130 | 129 | } |
131 | 130 |
|
132 | 131 | info += ` |
|
137 | 136 | <div class="SelectMenu-list"> |
138 | 137 | <a class="SelectMenu-item" href="https://github.com/RC1844/FastGithub" target="_blank" role="menuitemradio" |
139 | 138 | 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;"> |
141 | 140 | Github仓库地址,点个赞谢谢 |
142 | 141 | </span> |
143 | 142 | </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地址,喜欢的可以收藏 |
148 | 147 | </span> |
149 | 148 | </a> |
150 | 149 | </div> |
|
158 | 157 |
|
159 | 158 |
|
160 | 159 | //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">`; |
163 | 162 | $(this).find("a[rel='nofollow']").each(function () { |
164 | 163 | var href = $(this).attr('href'); |
165 | 164 | 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>`; |
168 | 173 | } |
169 | | - span += `</div>`; |
170 | 174 | }); |
| 175 | + span += `</li>`; |
171 | 176 | $(this).after(span); |
172 | 177 | }); |
173 | 178 |
|
|
0 commit comments