mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 16:21:11 +08:00
Update index.html
This commit is contained in:
parent
5d08993cbc
commit
99d6cef368
1 changed files with 7 additions and 7 deletions
|
|
@ -369,17 +369,17 @@
|
||||||
let formattedLink = "";
|
let formattedLink = "";
|
||||||
|
|
||||||
if (githubLink.startsWith("https://github.com/") || githubLink.startsWith("http://github.com/")) {
|
if (githubLink.startsWith("https://github.com/") || githubLink.startsWith("http://github.com/")) {
|
||||||
formattedLink = "https://" + currentHost + "/github.com" + githubLink.substring(githubLink.indexOf("/", 8));
|
formattedLink = window.location.protocol + "//" + currentHost + "/github.com" + githubLink.substring(githubLink.indexOf("/", 8));
|
||||||
} else if (githubLink.startsWith("github.com/")) {
|
} else if (githubLink.startsWith("github.com/")) {
|
||||||
formattedLink = "https://" + currentHost + "/" + githubLink;
|
formattedLink = window.location.protocol + "//" + currentHost + "/" + githubLink;
|
||||||
} else if (githubLink.startsWith("https://raw.githubusercontent.com/") || githubLink.startsWith("http://raw.githubusercontent.com/")) {
|
} else if (githubLink.startsWith("https://raw.githubusercontent.com/") || githubLink.startsWith("http://raw.githubusercontent.com/")) {
|
||||||
formattedLink = "https://" + currentHost + githubLink.substring(githubLink.indexOf("/", 7));
|
formattedLink = window.location.protocol + "//" + currentHost + githubLink.substring(githubLink.indexOf("/", 7));
|
||||||
} else if (githubLink.startsWith("raw.githubusercontent.com/")) {
|
} else if (githubLink.startsWith("raw.githubusercontent.com/")) {
|
||||||
formattedLink = "https://" + currentHost + "/" + githubLink;
|
formattedLink = window.location.protocol + "//" + currentHost + "/" + githubLink;
|
||||||
} else if (githubLink.startsWith("https://gist.githubusercontent.com/") || githubLink.startsWith("http://gist.githubusercontent.com/")) {
|
} else if (githubLink.startsWith("https://gist.githubusercontent.com/") || githubLink.startsWith("http://gist.githubusercontent.com/")) {
|
||||||
formattedLink = "https://" + currentHost + "/gist.github.com" + githubLink.substring(githubLink.indexOf("/", 18));
|
formattedLink = window.location.protocol + "//" + currentHost + "/gist.github.com" + githubLink.substring(githubLink.indexOf("/", 18));
|
||||||
} else if (githubLink.startsWith("gist.githubusercontent.com/")) {
|
} else if (githubLink.startsWith("gist.githubusercontent.com/")) {
|
||||||
formattedLink = "https://" + currentHost + "/" + githubLink;
|
formattedLink = window.location.protocol + "//" + currentHost + "/" + githubLink;
|
||||||
} else {
|
} else {
|
||||||
showToast('请输入有效的GitHub链接');
|
showToast('请输入有效的GitHub链接');
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue