From 34d45f8fbbd2cdc16d43feb98682e8bb5f422a26 Mon Sep 17 00:00:00 2001 From: Shan Wenxiao Date: Wed, 4 Oct 2023 11:04:15 +0800 Subject: [PATCH 01/45] Update XMOJ.user.js Signed-off-by: Shan Wenxiao --- XMOJ.user.js | 64 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 5f735290..2d88358c 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -3735,22 +3735,28 @@ int main() TitleElement.addEventListener("input", () => { TitleElement.classList.remove("is-invalid"); }); - ContentElement.addEventListener("paste", (Event) => { - let Items = Event.clipboardData.items; + ContentElement.addEventListener("paste", (EventData) => { + let Items = EventData.clipboardData.items; if (Items.length !== 0) { for (let i = 0; i < Items.length; i++) { if (Items[i].type.indexOf("image") != -1) { let Reader = new FileReader(); Reader.readAsDataURL(Items[i].getAsFile()); - ContentElement.value += `![Uploading Image]`; - // ContentElement.dispatchEvent(new Event("input")); Reader.onload = () => { + let Before = ContentElement.value.substring(0, ContentElement.selectionStart); + let After = ContentElement.value.substring(ContentElement.selectionEnd, ContentElement.value.length); + const UploadMessage = "![正在上传图片...]()"; + ContentElement.value = Before + UploadMessage + After; + ContentElement.dispatchEvent(new Event("input")); RequestAPI("UploadImage", { "Image": Reader.result }, (ResponseData) => { if (ResponseData.Success) { - ContentElement.value -= `![Uploading Image]`; - ContentElement.value += `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})`; + ContentElement.value = Before + `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; + ContentElement.dispatchEvent(new Event("input")); + } + else { + ContentElement.value = Before + `![上传失败!]()` + After; ContentElement.dispatchEvent(new Event("input")); } }); @@ -3906,31 +3912,30 @@ int main() PreviewTab.innerHTML = PurifyHTML(marked.parse(ContentElement.value)); RenderMathJax(); }); - ContentElement.addEventListener("paste", (Event) => { - let Items = Event.clipboardData.items; + ContentElement.addEventListener("paste", (EventData) => { + let Items = EventData.clipboardData.items; if (Items.length !== 0) { for (let i = 0; i < Items.length; i++) { if (Items[i].type.indexOf("image") != -1) { let Reader = new FileReader(); Reader.readAsDataURL(Items[i].getAsFile()); Reader.onload = () => { - // ContentElement.dispatchEvent(new Event("input")); - ContentElement.value += `![Uploading Image...]`; + let Before = ContentElement.value.substring(0, ContentElement.selectionStart); + let After = ContentElement.value.substring(ContentElement.selectionEnd, ContentElement.value.length); + const UploadMessage = "![正在上传图片...]()"; + ContentElement.value = Before + UploadMessage + After; + ContentElement.dispatchEvent(new Event("input")); RequestAPI("UploadImage", { "Image": Reader.result }, (ResponseData) => { - // ContentElement.dispatchEvent(new Event("input")); if (ResponseData.Success) { - ContentElement.value -= `![Uploading Image...]`; - // ContentElement.value -= `NaN`; - ContentElement.value += `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})`; + ContentElement.value = Before + `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; ContentElement.dispatchEvent(new Event("input")); - } - // else{ - // ContentElement.value -= `![Uploading Image...]`; - // ContentElement.value += `![Upload Failed, Please try again!]`; - // ContentElement.dispatchEvent(new Event("input")); - // } + } + else { + ContentElement.value = Before + `![上传失败!]()` + After; + ContentElement.dispatchEvent(new Event("input")); + } }); }; } @@ -4141,22 +4146,29 @@ int main() PreviewTab.innerHTML = PurifyHTML(marked.parse(ContentEditor.value)); RenderMathJax(); }); - ContentEditor.addEventListener("paste", (Event) => { - let Items = Event.clipboardData.items; + ContentElement.addEventListener("paste", (EventData) => { + let Items = EventData.clipboardData.items; if (Items.length !== 0) { for (let i = 0; i < Items.length; i++) { if (Items[i].type.indexOf("image") != -1) { let Reader = new FileReader(); Reader.readAsDataURL(Items[i].getAsFile()); - ContentEditor.value += `![Uploading]`; Reader.onload = () => { + let Before = ContentElement.value.substring(0, ContentElement.selectionStart); + let After = ContentElement.value.substring(ContentElement.selectionEnd, ContentElement.value.length); + const UploadMessage = "![正在上传图片...]()"; + ContentElement.value = Before + UploadMessage + After; + ContentElement.dispatchEvent(new Event("input")); RequestAPI("UploadImage", { "Image": Reader.result }, (ResponseData) => { if (ResponseData.Success) { - ContentEditor.value -= `![Uploading]` - ContentEditor.value += `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})`; - ContentEditor.dispatchEvent(new Event("input")); + ContentElement.value = Before + `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; + ContentElement.dispatchEvent(new Event("input")); + } + else { + ContentElement.value = Before + `![上传失败!]()` + After; + ContentElement.dispatchEvent(new Event("input")); } }); }; From d51c217b94ca5928d92a60c23dce9cd88bf6b6eb Mon Sep 17 00:00:00 2001 From: Shan Wenxiao Date: Wed, 4 Oct 2023 11:32:15 +0800 Subject: [PATCH 02/45] Update XMOJ.user.js Signed-off-by: Shan Wenxiao --- XMOJ.user.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 2d88358c..9a27b11f 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -972,7 +972,7 @@ else { { "ID": "Discussion", "Type": "F", "Name": "恢复讨论与短消息功能" }, { "ID": "MoreSTD", "Type": "F", "Name": "查看到更多标程" }, { "ID": "StudyMode", "Type": "F", "Name": "学术模式", "Children": [ - { "ID": "ApplyData", "Type": "A", "Name": "获取数据功能" }, + { "ID": "ApplyData", "Type": "A", "Name": "获取数据功能" }, ]}, { "ID": "Rating", "Type": "A", "Name": "添加用户评分和用户名颜色" }, { "ID": "AutoRefresh", "Type": "A", "Name": "比赛列表、比赛排名界面自动刷新" }, @@ -4146,7 +4146,7 @@ int main() PreviewTab.innerHTML = PurifyHTML(marked.parse(ContentEditor.value)); RenderMathJax(); }); - ContentElement.addEventListener("paste", (EventData) => { + ContentEditor.addEventListener("paste", (EventData) => { let Items = EventData.clipboardData.items; if (Items.length !== 0) { for (let i = 0; i < Items.length; i++) { @@ -4154,21 +4154,21 @@ int main() let Reader = new FileReader(); Reader.readAsDataURL(Items[i].getAsFile()); Reader.onload = () => { - let Before = ContentElement.value.substring(0, ContentElement.selectionStart); - let After = ContentElement.value.substring(ContentElement.selectionEnd, ContentElement.value.length); + let Before = ContentEditor.value.substring(0, ContentElement.selectionStart); + let After = ContentEditor.value.substring(ContentElement.selectionEnd, ContentElement.value.length); const UploadMessage = "![正在上传图片...]()"; - ContentElement.value = Before + UploadMessage + After; - ContentElement.dispatchEvent(new Event("input")); + ContentEditor.value = Before + UploadMessage + After; + ContentEditor.dispatchEvent(new Event("input")); RequestAPI("UploadImage", { "Image": Reader.result }, (ResponseData) => { if (ResponseData.Success) { - ContentElement.value = Before + `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; - ContentElement.dispatchEvent(new Event("input")); + ContentEditor.value = Before + `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; + ContentEditor.dispatchEvent(new Event("input")); } else { - ContentElement.value = Before + `![上传失败!]()` + After; - ContentElement.dispatchEvent(new Event("input")); + ContentEditor.value = Before + `![上传失败!]()` + After; + ContentEditor.dispatchEvent(new Event("input")); } }); }; From eb848899c2ffdac099d7b0523121ee4809360334 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 4 Oct 2023 03:34:51 +0000 Subject: [PATCH 03/45] Update to release 1.0.207 --- Update.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Update.json b/Update.json index e768331c..424c8fe2 100644 --- a/Update.json +++ b/Update.json @@ -75,7 +75,7 @@ ] }, "1.0.207": { - "UpdateDate": 1696385023446, + "UpdateDate": 1696390490752, "Prerelease": false, "UpdateContents": [ { From 93c57927a80053777cd5b0dbfa12917aabf572bf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 4 Oct 2023 03:41:53 +0000 Subject: [PATCH 04/45] Update to release 1.0.207 --- Update.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Update.json b/Update.json index e768331c..095a3e00 100644 --- a/Update.json +++ b/Update.json @@ -75,7 +75,7 @@ ] }, "1.0.207": { - "UpdateDate": 1696385023446, + "UpdateDate": 1696390912762, "Prerelease": false, "UpdateContents": [ { From 8c4c93ce222f7ac122daafc531e626a5d031bfe7 Mon Sep 17 00:00:00 2001 From: Shan Wenxiao Date: Wed, 4 Oct 2023 11:44:03 +0800 Subject: [PATCH 05/45] Update Update.json Signed-off-by: Shan Wenxiao --- Update.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Update.json b/Update.json index 424c8fe2..aa2affc6 100644 --- a/Update.json +++ b/Update.json @@ -75,7 +75,7 @@ ] }, "1.0.207": { - "UpdateDate": 1696390490752, + "UpdateDate": 1696390912762, "Prerelease": false, "UpdateContents": [ { @@ -85,4 +85,4 @@ ] } } -} \ No newline at end of file +} From 1694e5bd797e9c98920060ae56f7add2a7b39035 Mon Sep 17 00:00:00 2001 From: Shan Wenxiao Date: Wed, 4 Oct 2023 11:48:05 +0800 Subject: [PATCH 06/45] Update XMOJ.user.js Signed-off-by: Shan Wenxiao --- XMOJ.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 9a27b11f..9f04e615 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -4154,8 +4154,8 @@ int main() let Reader = new FileReader(); Reader.readAsDataURL(Items[i].getAsFile()); Reader.onload = () => { - let Before = ContentEditor.value.substring(0, ContentElement.selectionStart); - let After = ContentEditor.value.substring(ContentElement.selectionEnd, ContentElement.value.length); + let Before = ContentEditor.value.substring(0, ContentEditor.selectionStart); + let After = ContentEditor.value.substring(ContentEditor.selectionEnd, ContentEditor.value.length); const UploadMessage = "![正在上传图片...]()"; ContentEditor.value = Before + UploadMessage + After; ContentEditor.dispatchEvent(new Event("input")); From 65acc5f81495a14c60569fefff75f98903d73bc3 Mon Sep 17 00:00:00 2001 From: Shan Wenxiao Date: Wed, 4 Oct 2023 11:51:54 +0800 Subject: [PATCH 07/45] Update XMOJ.user.js Signed-off-by: Shan Wenxiao --- XMOJ.user.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 44725f9d..6355f81e 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -3742,14 +3742,11 @@ int main() if (Items[i].type.indexOf("image") != -1) { let Reader = new FileReader(); Reader.readAsDataURL(Items[i].getAsFile()); - // ContentElement.value += `![Uploading Image]`; - // ContentElement.dispatchEvent(new Event("input")); Reader.onload = () => { RequestAPI("UploadImage", { "Image": Reader.result }, (ResponseData) => { if (ResponseData.Success) { - // ContentElement.value -= `![Uploading Image]`; ContentElement.value += `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})`; ContentElement.dispatchEvent(new Event("input")); } @@ -3914,23 +3911,14 @@ int main() let Reader = new FileReader(); Reader.readAsDataURL(Items[i].getAsFile()); Reader.onload = () => { - // ContentElement.dispatchEvent(new Event("input")); - // ContentElement.value += `![Uploading Image...]`; RequestAPI("UploadImage", { "Image": Reader.result }, (ResponseData) => { // ContentElement.dispatchEvent(new Event("input")); if (ResponseData.Success) { - // ContentElement.value -= `![Uploading Image...]`; - // ContentElement.value -= `NaN`; ContentElement.value += `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})`; ContentElement.dispatchEvent(new Event("input")); } - // else{ - // ContentElement.value -= `![Uploading Image...]`; - // ContentElement.value += `![Upload Failed, Please try again!]`; - // ContentElement.dispatchEvent(new Event("input")); - // } }); }; } @@ -4148,13 +4136,11 @@ int main() if (Items[i].type.indexOf("image") != -1) { let Reader = new FileReader(); Reader.readAsDataURL(Items[i].getAsFile()); - // ContentEditor.value += `![Uploading]`; Reader.onload = () => { RequestAPI("UploadImage", { "Image": Reader.result }, (ResponseData) => { if (ResponseData.Success) { - // ContentEditor.value -= `![Uploading]` ContentEditor.value += `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})`; ContentEditor.dispatchEvent(new Event("input")); } From 4f1a467cb124e5501320f626638cda29ef0b9bc8 Mon Sep 17 00:00:00 2001 From: Shan Wenxiao Date: Wed, 4 Oct 2023 11:52:53 +0800 Subject: [PATCH 08/45] Update XMOJ.user.js Signed-off-by: Shan Wenxiao --- XMOJ.user.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 6355f81e..d6d1f3cc 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -3747,8 +3747,6 @@ int main() "Image": Reader.result }, (ResponseData) => { if (ResponseData.Success) { - ContentElement.value += `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})`; - ContentElement.dispatchEvent(new Event("input")); } }); }; @@ -3916,8 +3914,6 @@ int main() }, (ResponseData) => { // ContentElement.dispatchEvent(new Event("input")); if (ResponseData.Success) { - ContentElement.value += `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})`; - ContentElement.dispatchEvent(new Event("input")); } }); }; @@ -4141,8 +4137,6 @@ int main() "Image": Reader.result }, (ResponseData) => { if (ResponseData.Success) { - ContentEditor.value += `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})`; - ContentEditor.dispatchEvent(new Event("input")); } }); }; From 534f9e122fe23f1536c9dbca66efe01ab47115c1 Mon Sep 17 00:00:00 2001 From: Shan Wenxiao Date: Wed, 4 Oct 2023 11:54:21 +0800 Subject: [PATCH 09/45] Update XMOJ.user.js Signed-off-by: Shan Wenxiao --- XMOJ.user.js | 50 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index d6d1f3cc..9f04e615 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -972,7 +972,7 @@ else { { "ID": "Discussion", "Type": "F", "Name": "恢复讨论与短消息功能" }, { "ID": "MoreSTD", "Type": "F", "Name": "查看到更多标程" }, { "ID": "StudyMode", "Type": "F", "Name": "学术模式", "Children": [ - { "ID": "ApplyData", "Type": "A", "Name": "获取数据功能" }, + { "ID": "ApplyData", "Type": "A", "Name": "获取数据功能" }, ]}, { "ID": "Rating", "Type": "A", "Name": "添加用户评分和用户名颜色" }, { "ID": "AutoRefresh", "Type": "A", "Name": "比赛列表、比赛排名界面自动刷新" }, @@ -3735,18 +3735,29 @@ int main() TitleElement.addEventListener("input", () => { TitleElement.classList.remove("is-invalid"); }); - ContentElement.addEventListener("paste", (Event) => { - let Items = Event.clipboardData.items; + ContentElement.addEventListener("paste", (EventData) => { + let Items = EventData.clipboardData.items; if (Items.length !== 0) { for (let i = 0; i < Items.length; i++) { if (Items[i].type.indexOf("image") != -1) { let Reader = new FileReader(); Reader.readAsDataURL(Items[i].getAsFile()); Reader.onload = () => { + let Before = ContentElement.value.substring(0, ContentElement.selectionStart); + let After = ContentElement.value.substring(ContentElement.selectionEnd, ContentElement.value.length); + const UploadMessage = "![正在上传图片...]()"; + ContentElement.value = Before + UploadMessage + After; + ContentElement.dispatchEvent(new Event("input")); RequestAPI("UploadImage", { "Image": Reader.result }, (ResponseData) => { if (ResponseData.Success) { + ContentElement.value = Before + `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; + ContentElement.dispatchEvent(new Event("input")); + } + else { + ContentElement.value = Before + `![上传失败!]()` + After; + ContentElement.dispatchEvent(new Event("input")); } }); }; @@ -3901,20 +3912,30 @@ int main() PreviewTab.innerHTML = PurifyHTML(marked.parse(ContentElement.value)); RenderMathJax(); }); - ContentElement.addEventListener("paste", (Event) => { - let Items = Event.clipboardData.items; + ContentElement.addEventListener("paste", (EventData) => { + let Items = EventData.clipboardData.items; if (Items.length !== 0) { for (let i = 0; i < Items.length; i++) { if (Items[i].type.indexOf("image") != -1) { let Reader = new FileReader(); Reader.readAsDataURL(Items[i].getAsFile()); Reader.onload = () => { + let Before = ContentElement.value.substring(0, ContentElement.selectionStart); + let After = ContentElement.value.substring(ContentElement.selectionEnd, ContentElement.value.length); + const UploadMessage = "![正在上传图片...]()"; + ContentElement.value = Before + UploadMessage + After; + ContentElement.dispatchEvent(new Event("input")); RequestAPI("UploadImage", { "Image": Reader.result }, (ResponseData) => { - // ContentElement.dispatchEvent(new Event("input")); if (ResponseData.Success) { - } + ContentElement.value = Before + `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; + ContentElement.dispatchEvent(new Event("input")); + } + else { + ContentElement.value = Before + `![上传失败!]()` + After; + ContentElement.dispatchEvent(new Event("input")); + } }); }; } @@ -4125,18 +4146,29 @@ int main() PreviewTab.innerHTML = PurifyHTML(marked.parse(ContentEditor.value)); RenderMathJax(); }); - ContentEditor.addEventListener("paste", (Event) => { - let Items = Event.clipboardData.items; + ContentEditor.addEventListener("paste", (EventData) => { + let Items = EventData.clipboardData.items; if (Items.length !== 0) { for (let i = 0; i < Items.length; i++) { if (Items[i].type.indexOf("image") != -1) { let Reader = new FileReader(); Reader.readAsDataURL(Items[i].getAsFile()); Reader.onload = () => { + let Before = ContentEditor.value.substring(0, ContentEditor.selectionStart); + let After = ContentEditor.value.substring(ContentEditor.selectionEnd, ContentEditor.value.length); + const UploadMessage = "![正在上传图片...]()"; + ContentEditor.value = Before + UploadMessage + After; + ContentEditor.dispatchEvent(new Event("input")); RequestAPI("UploadImage", { "Image": Reader.result }, (ResponseData) => { if (ResponseData.Success) { + ContentEditor.value = Before + `![](https://api.xmoj-bbs.tech/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; + ContentEditor.dispatchEvent(new Event("input")); + } + else { + ContentEditor.value = Before + `![上传失败!]()` + After; + ContentEditor.dispatchEvent(new Event("input")); } }); }; From 2a1bd960ad4ccd662823d2f9eb3b1abc0bb9a67e Mon Sep 17 00:00:00 2001 From: Shan Wenxiao Date: Wed, 4 Oct 2023 12:01:28 +0800 Subject: [PATCH 10/45] Update XMOJ.user.js Signed-off-by: Shan Wenxiao From 03fa55aaa5564d65b7d215f0552eda91eda5f782 Mon Sep 17 00:00:00 2001 From: Shan Wenxiao Date: Wed, 4 Oct 2023 12:03:42 +0800 Subject: [PATCH 11/45] Update XMOJ.user.js Signed-off-by: Shan Wenxiao --- XMOJ.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 9f04e615..635a65dc 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -2,7 +2,7 @@ // @name XMOJ // @version 1.0.207 // @description XMOJ增强脚本 -// @author @langningchen, @PythonSmall-Q and @boomzero +// @author @XMOJ-Script-dev and @langningchen and the community // @namespace https://github/langningchen // @match http://*.xmoj.tech/* // @match http://116.62.212.172/* From 082a35fed6bda9370735b09059f0be6335f24332 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 4 Oct 2023 04:04:09 +0000 Subject: [PATCH 12/45] Update version info to 1.0.207 --- Update.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Update.json b/Update.json index aa2affc6..4db6f858 100644 --- a/Update.json +++ b/Update.json @@ -75,14 +75,14 @@ ] }, "1.0.207": { - "UpdateDate": 1696390912762, - "Prerelease": false, + "UpdateDate": 1696392248973, + "Prerelease": true, "UpdateContents": [ { - "PR": 67, - "Description": "允许用户关闭获取数据,开启学术模式选择" + "PR": 82, + "Description": "Dev Release" } ] } } -} +} \ No newline at end of file From f865577d7dac316c752ff59db7cf0e4771c0c94a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 4 Oct 2023 06:35:39 +0000 Subject: [PATCH 13/45] Update to release 1.0.207 --- Update.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Update.json b/Update.json index e768331c..2ad514d9 100644 --- a/Update.json +++ b/Update.json @@ -75,7 +75,7 @@ ] }, "1.0.207": { - "UpdateDate": 1696385023446, + "UpdateDate": 1696401338712, "Prerelease": false, "UpdateContents": [ { From ca53fec5239db5a6fd8d5e2c55eb4cd699a7c0a1 Mon Sep 17 00:00:00 2001 From: Shan Wenxiao Date: Wed, 4 Oct 2023 14:43:47 +0800 Subject: [PATCH 14/45] Update Update.json Signed-off-by: Shan Wenxiao --- Update.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Update.json b/Update.json index 2ad514d9..556869af 100644 --- a/Update.json +++ b/Update.json @@ -75,8 +75,8 @@ ] }, "1.0.207": { - "UpdateDate": 1696401338712, - "Prerelease": false, + "UpdateDate": 1696392248973, + "Prerelease": true, "UpdateContents": [ { "PR": 67, @@ -85,4 +85,4 @@ ] } } -} \ No newline at end of file +} From 51916b7dd6ed13627c52e16a7740b657323c0260 Mon Sep 17 00:00:00 2001 From: Zhu Chenrui <85378277+boomzero@users.noreply.github.com> Date: Wed, 4 Oct 2023 22:32:45 +0800 Subject: [PATCH 15/45] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Zhu Chenrui <85378277+boomzero@users.noreply.github.com> --- XMOJ.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 635a65dc..12b8f696 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -4117,7 +4117,7 @@ int main() let ReplyContentElement = document.createElement("div"); CardBodyElement.appendChild(ReplyContentElement); ReplyContentElement.innerHTML = PurifyHTML(marked.parse(Replies[i].Content)).replaceAll(/@([a-zA-Z0-9]+)/g, `@$1`); if (Replies[i].EditTime != null) { - if (Replies[i].EditPerson == CurrentUsername) { + if (Replies[i].EditPerson == Replies[i].UserID) { ReplyContentElement.innerHTML += `最后编辑于${GetRelativeTime(Replies[i].EditTime)}`; } else { From 133078da673f9adf9bd4fc236880b6b99b9553a4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 4 Oct 2023 14:33:17 +0000 Subject: [PATCH 16/45] Update version info to 1.0.208 --- Update.json | 12 +++++++++++- XMOJ.user.js | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Update.json b/Update.json index e032b66b..81c9db3f 100644 --- a/Update.json +++ b/Update.json @@ -83,6 +83,16 @@ "Description": "Dev Release" } ] + }, + "1.0.208": { + "UpdateDate": 1696429996532, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 95, + "Description": "修复编辑用户显示" + } + ] } } -} +} \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 12b8f696..c9965eed 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 1.0.207 +// @version 1.0.208 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev and @langningchen and the community // @namespace https://github/langningchen From 600e1750abe503792d519e2ab9656ce51dc7ffef Mon Sep 17 00:00:00 2001 From: boomzero Date: Thu, 5 Oct 2023 13:13:17 +0800 Subject: [PATCH 17/45] minor improvements --- Server/Source/Initial.sql | 5 +++++ Server/Source/Process.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Server/Source/Initial.sql b/Server/Source/Initial.sql index 01c4ba66..3371e8d9 100644 --- a/Server/Source/Initial.sql +++ b/Server/Source/Initial.sql @@ -53,6 +53,11 @@ CREATE TABLE bbs_board ( board_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, board_name TEXT NOT NULL ); +INSERT INTO bbs_board (board_name) VALUES ('站务版'); +INSERT INTO bbs_board (board_name) VALUES ('学术版'); +INSERT INTO bbs_board (board_name) VALUES ('灌水区'); +INSERT INTO bbs_board (board_name) VALUES ('反馈区'); +INSERT INTO bbs_board (board_name) VALUES ('题目总版'); DROP TABLE IF EXISTS phpsessid; diff --git a/Server/Source/Process.ts b/Server/Source/Process.ts index dd7fefa0..a83da04d 100644 --- a/Server/Source/Process.ts +++ b/Server/Source/Process.ts @@ -7,7 +7,7 @@ import CryptoJS from "crypto-js"; import md5 from "crypto-js/md5"; export class Process { - private AdminUserList: Array = ["chenlangning", "zhuchenrui2", "shanwenxiao"]; + private AdminUserList: Array = ["zhuchenrui2", "shanwenxiao"]; private Username: string; private SessionID: string; private RemoteIP: string; From 787d7457a6036f46512bcb3546f6eaa85971a797 Mon Sep 17 00:00:00 2001 From: boomzero Date: Thu, 5 Oct 2023 14:12:03 +0800 Subject: [PATCH 18/45] explain --- XMOJ.user.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index c9965eed..3b7c542e 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -2964,7 +2964,8 @@ else { if (localStorage.getItem(`UserScript-Problem-${PID}-IOFilename`) !== null) { Code = `#define IOFile "${localStorage.getItem(`UserScript-Problem-${PID}-IOFilename`)}"\n`; } - Code += `#include + Code += `//XMOJ-Script 获取数据代码 + #include using namespace std; string Base64Encode(string Input) { From 0ae4aa37166c0c1c68da3e13807fe787030705c3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Oct 2023 06:12:52 +0000 Subject: [PATCH 19/45] Update version info to 1.0.209 --- Update.json | 10 ++++++++++ XMOJ.user.js | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 81c9db3f..31575bd0 100644 --- a/Update.json +++ b/Update.json @@ -93,6 +93,16 @@ "Description": "修复编辑用户显示" } ] + }, + "1.0.209": { + "UpdateDate": 1696486371774, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 98, + "Description": "minor improvements" + } + ] } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 3b7c542e..b2195a06 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 1.0.208 +// @version 1.0.209 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev and @langningchen and the community // @namespace https://github/langningchen From b26ef3a6781dea040e0cbd040519d41fc96471ba Mon Sep 17 00:00:00 2001 From: boomzero Date: Thu, 5 Oct 2023 15:15:09 +0800 Subject: [PATCH 20/45] fix referrer --- XMOJ.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 3b7c542e..a1608e27 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1369,7 +1369,7 @@ else { "headers": { "content-type": "application/x-www-form-urlencoded" }, - "referrer": "http://www.xmoj.tech/submitpage.php?id=2298", + "referrer": "http://www.xmoj.tech/submitpage.php?id=" + PID, "method": "POST", "body": "id=" + PID + "&" + "language=1&" + From 82e792b25082c89ccca1df1bfb0530a2da0eb67f Mon Sep 17 00:00:00 2001 From: boomzero Date: Thu, 5 Oct 2023 13:13:17 +0800 Subject: [PATCH 21/45] minor improvements --- Server/Source/Initial.sql | 5 +++++ Server/Source/Process.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Server/Source/Initial.sql b/Server/Source/Initial.sql index 01c4ba66..3371e8d9 100644 --- a/Server/Source/Initial.sql +++ b/Server/Source/Initial.sql @@ -53,6 +53,11 @@ CREATE TABLE bbs_board ( board_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, board_name TEXT NOT NULL ); +INSERT INTO bbs_board (board_name) VALUES ('站务版'); +INSERT INTO bbs_board (board_name) VALUES ('学术版'); +INSERT INTO bbs_board (board_name) VALUES ('灌水区'); +INSERT INTO bbs_board (board_name) VALUES ('反馈区'); +INSERT INTO bbs_board (board_name) VALUES ('题目总版'); DROP TABLE IF EXISTS phpsessid; diff --git a/Server/Source/Process.ts b/Server/Source/Process.ts index dd7fefa0..a83da04d 100644 --- a/Server/Source/Process.ts +++ b/Server/Source/Process.ts @@ -7,7 +7,7 @@ import CryptoJS from "crypto-js"; import md5 from "crypto-js/md5"; export class Process { - private AdminUserList: Array = ["chenlangning", "zhuchenrui2", "shanwenxiao"]; + private AdminUserList: Array = ["zhuchenrui2", "shanwenxiao"]; private Username: string; private SessionID: string; private RemoteIP: string; From 3a1f5529ed0aa85ec6236d58860dac9302bc8884 Mon Sep 17 00:00:00 2001 From: boomzero Date: Thu, 5 Oct 2023 14:12:03 +0800 Subject: [PATCH 22/45] explain --- XMOJ.user.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index c9965eed..3b7c542e 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -2964,7 +2964,8 @@ else { if (localStorage.getItem(`UserScript-Problem-${PID}-IOFilename`) !== null) { Code = `#define IOFile "${localStorage.getItem(`UserScript-Problem-${PID}-IOFilename`)}"\n`; } - Code += `#include + Code += `//XMOJ-Script 获取数据代码 + #include using namespace std; string Base64Encode(string Input) { From 1c1859bcb0df38a13bda97718752ba5879636127 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Oct 2023 06:12:52 +0000 Subject: [PATCH 23/45] Update version info to 1.0.209 --- Update.json | 10 ++++++++++ XMOJ.user.js | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 81c9db3f..31575bd0 100644 --- a/Update.json +++ b/Update.json @@ -93,6 +93,16 @@ "Description": "修复编辑用户显示" } ] + }, + "1.0.209": { + "UpdateDate": 1696486371774, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 98, + "Description": "minor improvements" + } + ] } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 3b7c542e..b2195a06 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 1.0.208 +// @version 1.0.209 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev and @langningchen and the community // @namespace https://github/langningchen From 739a93b90b5e72ee5430e5cab7b60490768f3a73 Mon Sep 17 00:00:00 2001 From: boomzero Date: Thu, 5 Oct 2023 15:15:09 +0800 Subject: [PATCH 24/45] fix referrer --- XMOJ.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index b2195a06..41ef75df 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1369,7 +1369,7 @@ else { "headers": { "content-type": "application/x-www-form-urlencoded" }, - "referrer": "http://www.xmoj.tech/submitpage.php?id=2298", + "referrer": "http://www.xmoj.tech/submitpage.php?id=" + PID, "method": "POST", "body": "id=" + PID + "&" + "language=1&" + From 59aa6a363c31f6121c1562a7945353fb41aec5c9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Oct 2023 07:16:13 +0000 Subject: [PATCH 25/45] Update time and description of 1.0.209 --- Update.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 31575bd0..89549b75 100644 --- a/Update.json +++ b/Update.json @@ -95,7 +95,7 @@ ] }, "1.0.209": { - "UpdateDate": 1696486371774, + "UpdateDate": 1696490173345, "Prerelease": true, "UpdateContents": [ { From d9d43639e8baaccb997c20530579c3164ec04ac3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Oct 2023 07:19:38 +0000 Subject: [PATCH 26/45] Update time and description of 1.0.209 --- Update.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Update.json b/Update.json index 89549b75..9dedb106 100644 --- a/Update.json +++ b/Update.json @@ -95,12 +95,12 @@ ] }, "1.0.209": { - "UpdateDate": 1696490173345, + "UpdateDate": 1696490377673, "Prerelease": true, "UpdateContents": [ { "PR": 98, - "Description": "minor improvements" + "Description": "修复部分功能" } ] } From bb1d4334e43f892f7cc94c458a8d93d23d678cb4 Mon Sep 17 00:00:00 2001 From: boomzero Date: Thu, 5 Oct 2023 16:54:11 +0800 Subject: [PATCH 27/45] fix #99 --- Server/Source/Process.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/Source/Process.ts b/Server/Source/Process.ts index a83da04d..8225a2b8 100644 --- a/Server/Source/Process.ts +++ b/Server/Source/Process.ts @@ -515,7 +515,7 @@ export class Process { return new Result(false, "未找到讨论"); } if (!this.IsAdmin()) { - return new Result(false, "没有权限锁定此讨论"); + return new Result(false, "没有权限解锁此讨论"); } if (ThrowErrorIfFailed(await this.XMOJDatabase.GetTableSize("bbs_lock", { post_id: Data["PostID"] From 07783027d970aa993a562f7e90a988b543c657fa Mon Sep 17 00:00:00 2001 From: Zhu Chenrui <85378277+boomzero@users.noreply.github.com> Date: Thu, 5 Oct 2023 20:47:32 +0800 Subject: [PATCH 28/45] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=AB=98=E4=BA=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Zhu Chenrui <85378277+boomzero@users.noreply.github.com> --- XMOJ.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 41ef75df..6b8670cf 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -2,7 +2,7 @@ // @name XMOJ // @version 1.0.209 // @description XMOJ增强脚本 -// @author @XMOJ-Script-dev and @langningchen and the community +// @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen // @match http://*.xmoj.tech/* // @match http://116.62.212.172/* @@ -4186,7 +4186,7 @@ int main() let CodeElements = document.querySelectorAll("#PostReplies > div > div > div:nth-child(3) > pre > code"); for (let i = 0; i < CodeElements.length; i++) { - let ModeName = "text/plain"; + let ModeName = "text/x-c++src"; if (CodeElements[i].className == "language-c") { ModeName = "text/x-csrc"; } From 3d8b99d1f4050281801f92eadef9347a64845cdd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Oct 2023 12:48:55 +0000 Subject: [PATCH 29/45] Update version info to 1.0.210 --- Update.json | 10 ++++++++++ XMOJ.user.js | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 9dedb106..0266fdbe 100644 --- a/Update.json +++ b/Update.json @@ -103,6 +103,16 @@ "Description": "修复部分功能" } ] + }, + "1.0.210": { + "UpdateDate": 1696510135483, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 102, + "Description": "修复高亮" + } + ] } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 6b8670cf..506b2ddb 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 1.0.209 +// @version 1.0.210 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen From e32f5b06a145396849ae2ebb573450db9f7c649d Mon Sep 17 00:00:00 2001 From: boomzero Date: Thu, 5 Oct 2023 21:54:02 +0800 Subject: [PATCH 30/45] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E5=BD=93=E5=B9=B4=E4=BB=A3=E7=A0=81=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- XMOJ.user.js | 78 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 72 insertions(+), 6 deletions(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 41ef75df..5c8f35d2 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -973,6 +973,7 @@ else { { "ID": "MoreSTD", "Type": "F", "Name": "查看到更多标程" }, { "ID": "StudyMode", "Type": "F", "Name": "学术模式", "Children": [ { "ID": "ApplyData", "Type": "A", "Name": "获取数据功能" }, + { "ID": "AutoCheat", "Type": "A", "Name": "自动提交当年代码" }, ]}, { "ID": "Rating", "Type": "A", "Name": "添加用户评分和用户名颜色" }, { "ID": "AutoRefresh", "Type": "A", "Name": "比赛列表、比赛排名界面自动刷新" }, @@ -1678,17 +1679,82 @@ else { localStorage.setItem("UserScript-Problem-" + PID.substring(3) + "-Name", Temp[i].childNodes[2].innerText); } + let CheatDiv = document.createElement("div"); + if (UtilityEnabled("AutoCheat")) { + CheatDiv.style.marginTop = "20px"; + CheatDiv.style.textAlign = "left"; + document.querySelector("body > div > div.mt-3 > center").insertBefore(CheatDiv, document.querySelector("#problemset")); + let AutoCheatButton = document.createElement("button"); + CheatDiv.appendChild(AutoCheatButton); + AutoCheatButton.className = "btn btn-outline-secondary"; + AutoCheatButton.innerText = "自动提交当年代码"; + AutoCheatButton.style.marginRight = "5px"; + AutoCheatButton.disabled = true; + let ACProblems = [], ContestProblems = []; + const UrlParams = new URLSearchParams(window.location.search); + const CID = UrlParams.get("cid"); + console.log(CID); + await fetch("http://www.xmoj.tech/userinfo.php?user=" + CurrentUsername) + .then((Response) => { + return Response.text(); + }).then((Response) => { + let ParsedDocument = new DOMParser().parseFromString(Response, "text/html"); + let Temp = ParsedDocument.querySelector("#statics > tbody > tr:nth-child(2) > td:nth-child(3) > script").innerText.split("\n")[5].split(";"); + for (let i = 0; i < Temp.length; i++) { + ACProblems.push(Number(Temp[i].substring(2, Temp[i].indexOf(",")))); + } + AutoCheatButton.disabled = false; + }); + let Rows = document.querySelector("#problemset > tbody").rows; + for (let i = 0; i < Rows.length; i++) { + ContestProblems.push(Rows[i].children[1].innerText.substring(Rows[i].children[1].innerText.indexOf('.') + 1)); + } + AutoCheatButton.addEventListener("click", async () => { + AutoCheatButton.disabled = true; + for (let i = 0; i < ContestProblems.length; i++){ + let PID = ContestProblems[i]; + if (ACProblems.indexOf(Number(PID)) == -1){ + console.log("Ignoring problem " + PID+ " as it has no been solved yet."); + continue; + } + AutoCheatButton.innerHTML = "正在提交 " + PID; + let SID = 0; + await fetch("http://www.xmoj.tech/status.php?problem_id=" + PID + "&jresult=4") + .then((Result) => { + return Result.text(); + }).then((Result) => { + let ParsedDocument = new DOMParser().parseFromString(Result, "text/html"); + SID = ParsedDocument.querySelector("#result-tab > tbody > tr:nth-child(1) > td:nth-child(2)").innerText; + }); + let Code = ""; + await fetch("http://www.xmoj.tech/getsource.php?id=" + SID) + .then((Response) => { + return Response.text(); + }).then((Response) => { + Code = Response.substring(0, Response.indexOf("/**************************************************************")).trim(); + }); + await fetch("http://www.xmoj.tech/submit.php", { + "headers": { + "content-type": "application/x-www-form-urlencoded" + }, + "referrer": "http://www.xmoj.tech/submitpage.php?id=" + PID, + "method": "POST", + "body": "cid=" + CID + "&id=" + PID + "&" + + "language=1&" + + "source=" + encodeURIComponent(Code) + "&" + + "enable_O2=on" + }); + } + location.reload(); + }); + } if (UtilityEnabled("OpenAllProblem")) { - let OpenAllDiv = document.createElement("div"); - OpenAllDiv.style.marginTop = "20px"; - OpenAllDiv.style.textAlign = "left"; - document.querySelector("body > div > div.mt-3 > center").insertBefore(OpenAllDiv, document.querySelector("#problemset")); let OpenAllButton = document.createElement("button"); OpenAllButton.className = "btn btn-outline-secondary"; OpenAllButton.innerText = "打开全部题目"; OpenAllButton.style.marginRight = "5px"; - OpenAllDiv.appendChild(OpenAllButton); + CheatDiv.appendChild(OpenAllButton); OpenAllButton.addEventListener("click", () => { let Rows = document.querySelector("#problemset > tbody").rows; for (let i = 0; i < Rows.length; i++) { @@ -1698,7 +1764,7 @@ else { let OpenUnsolvedButton = document.createElement("button"); OpenUnsolvedButton.className = "btn btn-outline-secondary"; OpenUnsolvedButton.innerText = "打开未解决题目"; - OpenAllDiv.appendChild(OpenUnsolvedButton); + CheatDiv.appendChild(OpenUnsolvedButton); OpenUnsolvedButton.addEventListener("click", () => { let Rows = document.querySelector("#problemset > tbody").rows; for (let i = 0; i < Rows.length; i++) { From 7340c7fc4626ea0747dfc3c4271c82cae09a261a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Oct 2023 13:55:42 +0000 Subject: [PATCH 31/45] Update version info to 1.0.210 --- Update.json | 10 ++++++++++ XMOJ.user.js | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 31575bd0..53672850 100644 --- a/Update.json +++ b/Update.json @@ -103,6 +103,16 @@ "Description": "minor improvements" } ] + }, + "1.0.210": { + "UpdateDate": 1696514142283, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 104, + "Description": "自动提交当年代码" + } + ] } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 5c8f35d2..60293880 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 1.0.209 +// @version 1.0.210 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev and @langningchen and the community // @namespace https://github/langningchen From 320acc809b58d707306a7e675bd5db4c3ee188ab Mon Sep 17 00:00:00 2001 From: Zhu Chenrui <85378277+boomzero@users.noreply.github.com> Date: Thu, 5 Oct 2023 22:12:21 +0800 Subject: [PATCH 32/45] emergency fix Signed-off-by: Zhu Chenrui <85378277+boomzero@users.noreply.github.com> --- XMOJ.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 33d3194e..4569e071 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -973,7 +973,7 @@ else { { "ID": "MoreSTD", "Type": "F", "Name": "查看到更多标程" }, { "ID": "StudyMode", "Type": "F", "Name": "学术模式", "Children": [ { "ID": "ApplyData", "Type": "A", "Name": "获取数据功能" }, - { "ID": "AutoCheat", "Type": "A", "Name": "自动提交当年代码" }, + { "ID": "AutoCheat", "Type": "A", "Name": "自动提交当年代码" } ]}, { "ID": "Rating", "Type": "A", "Name": "添加用户评分和用户名颜色" }, { "ID": "AutoRefresh", "Type": "A", "Name": "比赛列表、比赛排名界面自动刷新" }, @@ -1680,10 +1680,10 @@ else { Temp[i].childNodes[2].innerText); } let CheatDiv = document.createElement("div"); + CheatDiv.style.marginTop = "20px"; + CheatDiv.style.textAlign = "left"; + document.querySelector("body > div > div.mt-3 > center").insertBefore(CheatDiv, document.querySelector("#problemset")); if (UtilityEnabled("AutoCheat")) { - CheatDiv.style.marginTop = "20px"; - CheatDiv.style.textAlign = "left"; - document.querySelector("body > div > div.mt-3 > center").insertBefore(CheatDiv, document.querySelector("#problemset")); let AutoCheatButton = document.createElement("button"); CheatDiv.appendChild(AutoCheatButton); AutoCheatButton.className = "btn btn-outline-secondary"; From 48e75e56a94f53a23ea86e4a3d7f500286d5dbaa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Oct 2023 14:12:54 +0000 Subject: [PATCH 33/45] Update version info to 1.0.211 --- Update.json | 14 +++++++------- XMOJ.user.js | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Update.json b/Update.json index 8b665e82..6e04ca49 100644 --- a/Update.json +++ b/Update.json @@ -105,22 +105,22 @@ ] }, "1.0.210": { - "UpdateDate": 1696510135483, + "UpdateDate": 1696514142283, "Prerelease": true, "UpdateContents": [ { - "PR": 102, - "Description": "修复高亮" + "PR": 104, + "Description": "自动提交当年代码" } ] }, - "1.0.210": { - "UpdateDate": 1696514142283, + "1.0.211": { + "UpdateDate": 1696515173956, "Prerelease": true, "UpdateContents": [ { - "PR": 104, - "Description": "自动提交当年代码" + "PR": 105, + "Description": "emergency fix" } ] } diff --git a/XMOJ.user.js b/XMOJ.user.js index 4569e071..9d2ccd8b 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 1.0.210 +// @version 1.0.211 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen From 245331709e10deb111def0e644ee8828510d4be3 Mon Sep 17 00:00:00 2001 From: Zhu Chenrui <85378277+boomzero@users.noreply.github.com> Date: Thu, 5 Oct 2023 22:15:45 +0800 Subject: [PATCH 34/45] bump version Signed-off-by: Zhu Chenrui <85378277+boomzero@users.noreply.github.com> --- XMOJ.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 9d2ccd8b..d22b3532 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 1.0.211 +// @version 1.0.212 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen From 396d9801f409f9efc3e3a906711405847582f572 Mon Sep 17 00:00:00 2001 From: Zhu Chenrui <85378277+boomzero@users.noreply.github.com> Date: Thu, 5 Oct 2023 22:16:18 +0800 Subject: [PATCH 35/45] Update Update.json Signed-off-by: Zhu Chenrui <85378277+boomzero@users.noreply.github.com> --- Update.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Update.json b/Update.json index 6e04ca49..cd08e328 100644 --- a/Update.json +++ b/Update.json @@ -114,7 +114,7 @@ } ] }, - "1.0.211": { + "1.0.212": { "UpdateDate": 1696515173956, "Prerelease": true, "UpdateContents": [ @@ -125,4 +125,4 @@ ] } } -} \ No newline at end of file +} From c9da45aebbc5110383d9b5ed957a02754d3cad5d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Oct 2023 14:17:06 +0000 Subject: [PATCH 36/45] Update time and description of 1.0.212 --- Update.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Update.json b/Update.json index cd08e328..a663c8ec 100644 --- a/Update.json +++ b/Update.json @@ -115,7 +115,7 @@ ] }, "1.0.212": { - "UpdateDate": 1696515173956, + "UpdateDate": 1696515426103, "Prerelease": true, "UpdateContents": [ { @@ -125,4 +125,4 @@ ] } } -} +} \ No newline at end of file From 40cd9cb6d9d0a6e069b44ccb4b6496e341795a09 Mon Sep 17 00:00:00 2001 From: Zhu Chenrui <85378277+boomzero@users.noreply.github.com> Date: Thu, 5 Oct 2023 22:18:48 +0800 Subject: [PATCH 37/45] fix logs Signed-off-by: Zhu Chenrui <85378277+boomzero@users.noreply.github.com> --- Update.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index a663c8ec..2be7bee2 100644 --- a/Update.json +++ b/Update.json @@ -105,6 +105,16 @@ ] }, "1.0.210": { + "UpdateDate": 1696510135483, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 102, + "Description": "修复高亮" + } + ] + }, + "1.0.211": { "UpdateDate": 1696514142283, "Prerelease": true, "UpdateContents": [ @@ -125,4 +135,4 @@ ] } } -} \ No newline at end of file +} From c5f1b254d55f8ef9d198b206d61cc3da2d585329 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Oct 2023 14:19:16 +0000 Subject: [PATCH 38/45] Update time and description of 1.0.212 --- Update.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Update.json b/Update.json index 2be7bee2..b4c12737 100644 --- a/Update.json +++ b/Update.json @@ -125,7 +125,7 @@ ] }, "1.0.212": { - "UpdateDate": 1696515426103, + "UpdateDate": 1696515556253, "Prerelease": true, "UpdateContents": [ { @@ -135,4 +135,4 @@ ] } } -} +} \ No newline at end of file From 823e74338b2474086ba1b95fda29631cfec17039 Mon Sep 17 00:00:00 2001 From: Zhu Chenrui <85378277+boomzero@users.noreply.github.com> Date: Thu, 5 Oct 2023 22:38:10 +0800 Subject: [PATCH 39/45] Change repos Signed-off-by: Zhu Chenrui <85378277+boomzero@users.noreply.github.com> --- Server/Source/Process.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Server/Source/Process.ts b/Server/Source/Process.ts index 8225a2b8..bcd696fb 100644 --- a/Server/Source/Process.ts +++ b/Server/Source/Process.ts @@ -1020,7 +1020,7 @@ export class Process { }); }, UploadImage: async (Data: object): Promise => { - const GithubImageRepo = "langningchen/XMOJ-Script-Pictures"; + const GithubImageRepo = "PythonSmall-Q/XMOJ-Script-Pictures"; ThrowErrorIfFailed(this.CheckParams(Data, { "Image": "string" })); @@ -1062,7 +1062,7 @@ export class Process { }); }, GetImage: async (Data: object): Promise => { - const GithubImageRepo = "langningchen/XMOJ-Script-Pictures"; + const GithubImageRepo = "PythonSmall-Q/XMOJ-Script-Pictures"; ThrowErrorIfFailed(this.CheckParams(Data, { "ImageID": "string" })); From d9d722eea3d9fe2e95e7f58f0a5e683614d3b4ad Mon Sep 17 00:00:00 2001 From: boomzero Date: Fri, 6 Oct 2023 07:58:35 +0800 Subject: [PATCH 40/45] fix #107 --- XMOJ.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index d22b3532..a34a3c0a 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1693,7 +1693,6 @@ else { let ACProblems = [], ContestProblems = []; const UrlParams = new URLSearchParams(window.location.search); const CID = UrlParams.get("cid"); - console.log(CID); await fetch("http://www.xmoj.tech/userinfo.php?user=" + CurrentUsername) .then((Response) => { return Response.text(); @@ -1739,12 +1738,13 @@ else { }, "referrer": "http://www.xmoj.tech/submitpage.php?id=" + PID, "method": "POST", - "body": "cid=" + CID + "&id=" + PID + "&" + + "body": "cid=" + CID + "&pid=" + i + "&" + "language=1&" + "source=" + encodeURIComponent(Code) + "&" + "enable_O2=on" }); } + AutoCheatButton.disabled = false; location.reload(); }); } From f91cc29e1472a3027f4564754d1df7eee2e4d66c Mon Sep 17 00:00:00 2001 From: boomzero Date: Fri, 6 Oct 2023 07:59:55 +0800 Subject: [PATCH 41/45] new style --- XMOJ.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index a34a3c0a..00c0c810 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1716,7 +1716,7 @@ else { console.log("Ignoring problem " + PID+ " as it has no been solved yet."); continue; } - AutoCheatButton.innerHTML = "正在提交 " + PID; + AutoCheatButton.innerHTML = "正在提交 " + PID + " ..."; let SID = 0; await fetch("http://www.xmoj.tech/status.php?problem_id=" + PID + "&jresult=4") .then((Result) => { From 89da157c410d6960f3315cf5216a7efc0a3d4eed Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Oct 2023 00:01:51 +0000 Subject: [PATCH 42/45] Update version info to 1.0.213 --- Update.json | 10 ++++++++++ XMOJ.user.js | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index b4c12737..1a82b753 100644 --- a/Update.json +++ b/Update.json @@ -133,6 +133,16 @@ "Description": "emergency fix" } ] + }, + "1.0.213": { + "UpdateDate": 1696550511282, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 108, + "Description": "fix #107 " + } + ] } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 00c0c810..241551f0 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 1.0.212 +// @version 1.0.213 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen From 421b45e275370058e686ee56875c8e6ababaa677 Mon Sep 17 00:00:00 2001 From: Zhu Chenrui <85378277+boomzero@users.noreply.github.com> Date: Fri, 6 Oct 2023 08:07:15 +0800 Subject: [PATCH 43/45] Update Update.json Signed-off-by: Zhu Chenrui <85378277+boomzero@users.noreply.github.com> --- Update.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Update.json b/Update.json index 1a82b753..10a67823 100644 --- a/Update.json +++ b/Update.json @@ -140,9 +140,9 @@ "UpdateContents": [ { "PR": 108, - "Description": "fix #107 " + "Description": "修复自动提交当年代码不计分" } ] } } -} \ No newline at end of file +} From 685ff9a2314c42822b044556e277f9961ad95d71 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Oct 2023 00:09:47 +0000 Subject: [PATCH 44/45] Update to release 1.0.214 --- Update.json | 40 +++++++++++++++++++++++++++++++++++++++- XMOJ.user.js | 2 +- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/Update.json b/Update.json index 10a67823..a94a154e 100644 --- a/Update.json +++ b/Update.json @@ -143,6 +143,44 @@ "Description": "修复自动提交当年代码不计分" } ] + }, + "1.0.214": { + "UpdateDate": 1696550986405, + "Prerelease": false, + "UpdateContents": [ + { + "PR": 67, + "Description": "允许用户关闭获取数据,开启学术模式选择" + }, + { + "PR": 82, + "Description": "Dev Release" + }, + { + "PR": 95, + "Description": "修复编辑用户显示" + }, + { + "PR": 98, + "Description": "修复部分功能" + }, + { + "PR": 102, + "Description": "修复高亮" + }, + { + "PR": 104, + "Description": "自动提交当年代码" + }, + { + "PR": 105, + "Description": "emergency fix" + }, + { + "PR": 108, + "Description": "修复自动提交当年代码不计分" + } + ] } } -} +} \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 241551f0..53b6215b 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 1.0.213 +// @version 1.0.214 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen From 0d2fc148ce3295fa2e677cc378b60efd3a386150 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Oct 2023 00:11:17 +0000 Subject: [PATCH 45/45] Update to release 1.0.214 --- Update.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Update.json b/Update.json index a94a154e..f879db1d 100644 --- a/Update.json +++ b/Update.json @@ -145,7 +145,7 @@ ] }, "1.0.214": { - "UpdateDate": 1696550986405, + "UpdateDate": 1696551077104, "Prerelease": false, "UpdateContents": [ {