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

make the upload_std interface prettier #393

Merged
merged 9 commits into from
Jan 26, 2024
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
13 changes: 11 additions & 2 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Update.json
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,17 @@
}
],
"Notes": "No release notes were provided for this release."
},
"1.1.24": {
"UpdateDate": 1706245175892,
"Prerelease": true,
"UpdateContents": [
{
"PR": 393,
"Description": "make the upload_std interface prettier"
}
],
"Notes": "No release notes were provided for this release."
}
}
}
7 changes: 3 additions & 4 deletions XMOJ.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name XMOJ
// @version 1.1.23
// @version 1.1.24
// @description XMOJ增强脚本
// @author @XMOJ-Script-dev, @langningchen and the community
// @namespace https://github/langningchen
Expand Down Expand Up @@ -2833,7 +2833,6 @@ else {
<p class="mt-2 text-muted">
您必须要上传标程以后才能使用“查看标程”功能。点击“上传标程”按钮以后,系统会自动上传标程,请您耐心等待。<br>
首次上传标程可能会比较慢,请耐心等待。后续上传标程将会快很多。请不要直接抄袭或递交标程,否则会给予"作弊者"badge的惩罚!<br>
上传的内容不是您AC的程序,而是您AC的题目对应的用户std的程序。所以您可以放心上传,不会泄露您的代码。<br>
系统每过30天会自动提醒您上传标程,您必须要上传标程,否则将会被禁止使用“查看标程”功能。<br>
</p>`;
UploadStd.addEventListener("click", async () => {
Expand Down Expand Up @@ -2863,14 +2862,14 @@ else {
if (Result.Success) {
let StdList = Result.Data.StdList;
for (let i = 0; i < ACList.length; i++) {
if (StdList.indexOf(ACList[i]) === -1) {
if (StdList.indexOf(ACList[i]) === -1 && ACList[i] !== 0) {
await new Promise((Resolve) => {
RequestAPI("UploadStd", {
"ProblemID": Number(ACList[i])
}, (Result) => {
if (!Result.Success) {
ErrorElement.style.display = "block";
ErrorElement.innerText += Result.Message + "<br>";
ErrorElement.innerText += Result.Message + "\n";
UploadProgress.classList.add("bg-warning");
}
UploadProgress.innerText = (i / ACList.length * 100).toFixed(1) + "% (" + ACList[i] + ")";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xmoj-script",
"version": "1.1.23",
"version": "1.1.24",
"description": "an improvement script for xmoj.tech",
"main": "AddonScript.js",
"scripts": {
Expand Down