Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

加速API, 增加姓名等小幅度更新 #27

Merged
merged 7 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Update.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
]
},
"1.0.201": {
"UpdateDate": 1696255471868,
"Prerelease": false,
"UpdateDate": 1696315453970,
"Prerelease": true,
"UpdateContents": [
{
"PR": 13,
"Description": ""
"PR": 26,
"Description": "增加名字"
}
]
}
}
}
}
32 changes: 18 additions & 14 deletions XMOJ.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
// @grant GM_xmlhttpRequest
// @grant GM_setClipboard
// @grant unsafeWindow
// @connect api.seanoj.edu.eu.org
// @connect api.xmoj-bbs.tech
// @connect challenges.cloudflare.com
// @connect cppinsights.io
Expand Down Expand Up @@ -165,7 +164,11 @@ let GetUsernameHTML = async (Element, Username, Simple = false, Href = "http://w
HTMLData += `<a href="${Href}${Username}" class="link-offset-2 link-underline-opacity-50 `
if (UtilityEnabled("Rating")) {
let Rating = UserInfo.Rating;
if (Rating > 500) {
// if(AdminUserList.includes(Username)){
// HTMLData += "link-fuchsia"
// }
// else
if (Rating > 500) {
HTMLData += "link-danger";
} else if (Rating >= 400) {
HTMLData += "link-warning";
Expand Down Expand Up @@ -290,7 +293,7 @@ let RequestAPI = (Action, Data, CallBack) => {
let DataString = JSON.stringify(PostData);
GM_xmlhttpRequest({
method: "POST",
url: "https://api.seanoj.edu.eu.org/" + Action,
url: "https://api.xmoj-bbs.tech/" + Action,
// url: "http://127.0.0.1:8787/" + Action,
headers: {
"Content-Type": "application/json"
Expand Down Expand Up @@ -331,7 +334,7 @@ GM_registerMenuCommand("重置数据", () => {
});

let SearchParams = new URLSearchParams(location.search);
let ServerURL = (UtilityEnabled("DebugMode") ? "https://PythonSmall-Q.github.io/XMOJ-Script" : "https://www.seanoj.edu.eu.org")
let ServerURL = (UtilityEnabled("DebugMode") ? "https://xmoj-script-dev.github.io/XMOJ-Script" : "https://www.seanoj.edu.eu.org")
let CurrentUsername = document.querySelector("#profile").innerText;
CurrentUsername = CurrentUsername.replaceAll(/[^a-zA-Z0-9]/g, "");
let IsAdmin = AdminUserList.indexOf(CurrentUsername) !== -1;
Expand Down Expand Up @@ -734,13 +737,13 @@ else {
let UpdateDataCardListItem = document.createElement("li"); UpdateDataCardList.appendChild(UpdateDataCardListItem);
UpdateDataCardListItem.className = "list-group-item";
UpdateDataCardListItem.innerHTML =
"(<a href=\"https://github.com/PythonSmall-Q/XMOJ-Script/pull/" + Data.UpdateContents[j].PR + "\" target=\"_blank\">" +
"(<a href=\"https://github.com/XMOJ-Script-dev/XMOJ-Script/pull/" + Data.UpdateContents[j].PR + "\" target=\"_blank\">" +
"#" + Data.UpdateContents[j].PR + "</a>) " +
Data.UpdateContents[j].Description;
}
let UpdateDataCardLink = document.createElement("a"); UpdateDataCardBody.appendChild(UpdateDataCardLink);
UpdateDataCardLink.className = "card-link";
UpdateDataCardLink.href = "https://github.com/PythonSmall-Q/XMOJ-Script/releases/tag/" + Version;
UpdateDataCardLink.href = "https://github.com/XMOJ-Script-dev/XMOJ-Script/releases/tag/" + Version;
UpdateDataCardLink.target = "_blank";
UpdateDataCardLink.innerText = "查看该版本";
new bootstrap.Modal(document.getElementById("UpdateModal")).show();
Expand Down Expand Up @@ -1028,7 +1031,7 @@ else {
let FeedbackCardLink = document.createElement("a");
FeedbackCardLink.className = "card-link";
FeedbackCardLink.innerText = "GitHub";
FeedbackCardLink.href = "https://github.com/PythonSmall-Q/XMOJ-Script";
FeedbackCardLink.href = "https://github.com/XMOJ-Script-dev/XMOJ-Script";
FeedbackCardBody.appendChild(FeedbackCardLink);
FeedbackCard.appendChild(FeedbackCardBody);
Container.appendChild(FeedbackCard);
Expand Down Expand Up @@ -1934,7 +1937,7 @@ else {
}
if (RowData.QuickSubmitCount >= 2) {
let QuickSubmitBadge = document.createElement("span"); UsernameCell.appendChild(QuickSubmitBadge);
QuickSubmitBadge.innerText = "疑似抄当年代码";
QuickSubmitBadge.innerText = "疑似提交当年代码";
QuickSubmitBadge.className = "badge text-bg-warning ms-2";
}

Expand All @@ -1950,7 +1953,8 @@ else {
"xiaoguanxun": "肖贯勋", "xiaojiasheng": "肖嘉盛", "xiaruicheng": "夏瑞成", "xiaweimin": "夏蔚民", "xiaxuran": "夏诩然", "xiebingxiu": "谢秉修", "xiebingxiu": "谢秉修", "xieliren": "谢立仁", "xinyihan": "辛轶涵", "xuconghan": "徐从瀚", "xukan": "徐衎",
"xuweiyi": "徐维易", "yanghaochen": "杨皓宸", "yezijiong": "叶梓炅", "youzhouhang": "尤周杭", "yuanruiqing": "袁瑞擎", "yutingjun": "于庭郡", "zhangchenming": "张宸铭", "zhangqiuze": "张秋泽", "zhangshuxuan": "张澍萱", "zhangwenda": "张闻达", "zhangyifu": "张亦夫",
"zhangyouheng": "张佑恒", "zhaochenshen": "赵晨神", "zhaochenwei": "赵晨伟", "zhengyinan": "郑逸楠", "zhonghongyi": "钟弘毅", "zhoujunyu": "周峻瑜", "zhouziyi": "周子逸", "zhouziyou": "周子游", "zhuchenrui2": "朱晨瑞", "zhuruichen": "朱睿宸", "zhuxule": "朱徐乐",
"zhuyikun": "朱奕坤", "leiwenda": "雷文达", "wangyuancheng": "王源成", "zhuyiyang": "朱奕阳", "hanjialin": "韩佳霖"
"zhuyikun": "朱奕坤", "leiwenda": "雷文达", "wangyuancheng": "王源成", "zhuyiyang": "朱奕阳", "hanjialin": "韩佳霖", "zhaozichen": "赵紫辰", "zhuaiwei": "朱艾薇", "linlitong": "林立桐", "xuyan":"徐衍", "fenghaochen": "冯皓宸" ,"lutianlang": "陆天朗", "tangyuhan": "唐钰涵",
"jiangbowen": "姜博文", "shangguanbocheng": "上官伯呈" , "wangchengqi": "王呈齐", "yanpeitong": "颜培桐", "gongcheng": "龚橙", "weijiefu": "韦杰夫", "": ""
};
NameCell.innerText = (Names[RowData.Username] == undefined ? "" : Names[RowData.Username]);

Expand Down Expand Up @@ -2298,13 +2302,13 @@ else {
let UpdateDataCardListItem = document.createElement("li"); UpdateDataCardList.appendChild(UpdateDataCardListItem);
UpdateDataCardListItem.className = "list-group-item";
UpdateDataCardListItem.innerHTML =
"(<a href=\"https://github.com/PythonSmall-Q/XMOJ-Script/pull/" + Data.UpdateContents[j].PR + "\" target=\"_blank\">" +
"(<a href=\"https://github.com/XMOJ-Script-dev/XMOJ-Script/pull/" + Data.UpdateContents[j].PR + "\" target=\"_blank\">" +
"#" + Data.UpdateContents[j].PR + "</a>) " +
Data.UpdateContents[j].Description;
}
let UpdateDataCardLink = document.createElement("a"); UpdateDataCardBody.appendChild(UpdateDataCardLink);
UpdateDataCardLink.className = "card-link";
UpdateDataCardLink.href = "https://github.com/PythonSmall-Q/XMOJ-Script/releases/tag/" + Version;
UpdateDataCardLink.href = "https://github.com/XMOJ-Script-dev/XMOJ-Script/releases/tag/" + Version;
UpdateDataCardLink.target = "_blank";
UpdateDataCardLink.innerText = "查看该版本";
}
Expand Down Expand Up @@ -3733,7 +3737,7 @@ int main()
"Image": Reader.result
}, (ResponseData) => {
if (ResponseData.Success) {
ContentElement.value += `![](https://api.seanoj.edu.eu.org/GetImage?ImageID=${ResponseData.Data.ImageID})`;
ContentElement.value += `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})`;
ContentElement.dispatchEvent(new Event("input"));
}
});
Expand Down Expand Up @@ -3901,7 +3905,7 @@ int main()
"Image": Reader.result
}, (ResponseData) => {
if (ResponseData.Success) {
ContentElement.value += `![](https://api.seanoj.edu.eu.org/GetImage?ImageID=${ResponseData.Data.ImageID})`;
ContentElement.value += `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})`;
ContentElement.dispatchEvent(new Event("input"));
}
});
Expand Down Expand Up @@ -4126,7 +4130,7 @@ int main()
"Image": Reader.result
}, (ResponseData) => {
if (ResponseData.Success) {
ContentEditor.value += `![](https://api.seanoj.edu.eu.org/GetImage?ImageID=${ResponseData.Data.ImageID})`;
ContentEditor.value += `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})`;
ContentEditor.dispatchEvent(new Event("input"));
}
});
Expand Down
Loading