From 6eb87a2260733385e71cd620dc2ee522718e019c Mon Sep 17 00:00:00 2001 From: boomzero Date: Mon, 25 Nov 2024 22:34:12 +0800 Subject: [PATCH 01/11] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=95=BF=E5=BA=A6=E5=8D=95=E4=BD=8D=E6=8D=A2=E7=AE=97?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ._.idea | Bin 0 -> 4096 bytes ._XMOJ.user.js | Bin 0 -> 4096 bytes XMOJ.user.js | 24 +++++++++++++++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 ._.idea create mode 100644 ._XMOJ.user.js diff --git a/._.idea b/._.idea new file mode 100644 index 0000000000000000000000000000000000000000..7ebf9cdf135839bd623f3afa65ac105ff13d8a81 GIT binary patch literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vf+zv$ zV3+~K+-O=D5#plB`MG+D1qC^&dId%KWvO|IdC92^j7$uQQ=E0*oDyG!rgfA%8Umvs zFd71*Aut*OqaiRF0;3@?8UmvsFd71*Aut*O*h2u+*#u!QkPFGkELJE=EzU13N={Ws y%P-1S$jmEA%`3^w&r8h7sZ_{GO)F7I%1O-22KI%ax`s4`>VLRbWEkZB{|5j(DJSOu literal 0 HcmV?d00001 diff --git a/._XMOJ.user.js b/._XMOJ.user.js new file mode 100644 index 0000000000000000000000000000000000000000..7ebf9cdf135839bd623f3afa65ac105ff13d8a81 GIT binary patch literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vf+zv$ zV3+~K+-O=D5#plB`MG+D1qC^&dId%KWvO|IdC92^j7$uQQ=E0*oDyG!rgfA%8Umvs zFd71*Aut*OqaiRF0;3@?8UmvsFd71*Aut*O*h2u+*#u!QkPFGkELJE=EzU13N={Ws y%P-1S$jmEA%`3^w&r8h7sZ_{GO)F7I%1O-22KI%ax`s4`>VLRbWEkZB{|5j(DJSOu literal 0 HcmV?d00001 diff --git a/XMOJ.user.js b/XMOJ.user.js index 8c77db53..b539a7bc 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -340,6 +340,28 @@ let SizeToStringSize = (Memory) => { } } }; +let CodeSizeToStringSize = (Memory) => { + try { + if (UtilityEnabled("AddUnits")) { + if (Memory < 1024) { + return Memory + "B"; + } else if (Memory < 1024 * 1024) { + return (Memory / 1024).toFixed(2) + "KB"; + } else if (Memory < 1024 * 1024 * 1024) { + return (Memory / 1024 / 1024).toFixed(2) + "MB"; + } else { + return (Memory / 1024 / 1024 / 1024).toFixed(2) + "GB"; + } + } else { + return Memory; + } + } catch (e) { + console.error(e); + if (UtilityEnabled("DebugMode")) { + SmartAlert("XMOJ-Script internal error!\n\n" + e + "\n\n" + "If you see this message, please report it to the developer.\nDon't forget to include console logs and a way to reproduce the error!\n\nDon't want to see this message? Disable DebugMode."); + } + } +}; /** * Converts a time value to a string representation. * @param {number} Time - The time value to convert. @@ -1836,7 +1858,7 @@ async function main() { Temp[i].childNodes[3].childNodes[0].innerText = SizeToStringSize(Temp[i].childNodes[3].childNodes[0].innerText); Temp[i].childNodes[4].childNodes[0].innerText = TimeToStringTime(Temp[i].childNodes[4].childNodes[0].innerText); Temp[i].childNodes[5].innerText = Temp[i].childNodes[5].childNodes[0].innerText; - Temp[i].childNodes[6].innerText = SizeToStringSize(Temp[i].childNodes[6].innerText.substring(0, Temp[i].childNodes[6].innerText.length - 1)); + Temp[i].childNodes[6].innerText = CodeSizeToStringSize(Temp[i].childNodes[6].innerText.substring(0, Temp[i].childNodes[6].innerText.length - 1)); Temp[i].childNodes[9].innerText = (Temp[i].childNodes[9].innerText == "" ? "否" : "是"); } if (SearchParams.get("cid") === null) { From f2b4db57d32da255873e83982c48279c4df8ee2a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 25 Nov 2024 14:37:58 +0000 Subject: [PATCH 02/11] 1.2.71 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b41cd6a6..27699298 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "1.2.70", + "version": "1.2.71", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": { From b7d06e65ea1b6a0b6f9eac2aa97a61504662d68a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 25 Nov 2024 14:37:59 +0000 Subject: [PATCH 03/11] Update version info to 1.2.71 --- Update.json | 11 +++++++++++ XMOJ.user.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 2992dfee..6d5c0cc5 100644 --- a/Update.json +++ b/Update.json @@ -2644,6 +2644,17 @@ } ], "Notes": "No release notes were provided for this release." + }, + "1.2.71": { + "UpdateDate": 1732545478542, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 753, + "Description": "fix: 修复代码长度单位换算错误" + } + ], + "Notes": "No release notes were provided for this release." } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index b539a7bc..ecc74f71 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 1.2.70 +// @version 1.2.71 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen From 2bd4ee597ec0ffde1f5958f7e6a7cb54a327b940 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 01:26:48 +0000 Subject: [PATCH 04/11] Bump JetBrains/qodana-action from 2024.1 to 2024.3 Bumps [JetBrains/qodana-action](https://github.com/jetbrains/qodana-action) from 2024.1 to 2024.3. - [Release notes](https://github.com/jetbrains/qodana-action/releases) - [Commits](https://github.com/jetbrains/qodana-action/compare/v2024.1...v2024.3) --- updated-dependencies: - dependency-name: JetBrains/qodana-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 45570f86..e16f678d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,6 +20,6 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit fetch-depth: 0 # a full history is required for pull request analysis - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2024.1 + uses: JetBrains/qodana-action@v2024.3 env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} From cf8ab52bf52c04c0f0055d26a6d08a7316c798d1 Mon Sep 17 00:00:00 2001 From: boomzero Date: Tue, 28 Jan 2025 23:13:47 +0800 Subject: [PATCH 05/11] fix #714 I wonder what this line was for... Ignore the branch name. --- XMOJ.user.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index ecc74f71..b5e01bb2 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -132,6 +132,7 @@ let GetUserInfo = async (Username) => { return Response.text(); }).then((Response) => { if (Response.indexOf("No such User!") !== -1) { + console.log("No such user: ", Username); return null; } const ParsedDocument = new DOMParser().parseFromString(Response, "text/html"); @@ -215,7 +216,8 @@ let GetUserBadge = async (Username) => { */ let GetUsernameHTML = async (Element, Username, Simple = false, Href = "https://www.xmoj.tech/userinfo.php?user=") => { try { - Username = Username.replaceAll(/[^a-zA-Z0-9]/g, ""); + console.log(Username); + //Username = Username.replaceAll(/[^a-zA-Z0-9]/g, ""); let ID = "Username-" + Username + "-" + Math.random(); Element.id = ID; Element.innerHTML = `
`; From 21e575b65d9c081e929c025eae50cce9636f9e4d Mon Sep 17 00:00:00 2001 From: boomzero Date: Tue, 28 Jan 2025 23:16:33 +0800 Subject: [PATCH 06/11] del debug code --- XMOJ.user.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index b5e01bb2..77f64743 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -132,7 +132,6 @@ let GetUserInfo = async (Username) => { return Response.text(); }).then((Response) => { if (Response.indexOf("No such User!") !== -1) { - console.log("No such user: ", Username); return null; } const ParsedDocument = new DOMParser().parseFromString(Response, "text/html"); @@ -216,7 +215,6 @@ let GetUserBadge = async (Username) => { */ let GetUsernameHTML = async (Element, Username, Simple = false, Href = "https://www.xmoj.tech/userinfo.php?user=") => { try { - console.log(Username); //Username = Username.replaceAll(/[^a-zA-Z0-9]/g, ""); let ID = "Username-" + Username + "-" + Math.random(); Element.id = ID; From dbf27bb5348851a7f9513d68650770e64fe73222 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 28 Jan 2025 15:17:47 +0000 Subject: [PATCH 07/11] 1.2.72 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 27699298..8be737d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "1.2.71", + "version": "1.2.72", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": { From 07f50c67e90f19398a6942819edf8e0ca8bc9253 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 28 Jan 2025 15:17:47 +0000 Subject: [PATCH 08/11] Update version info to 1.2.72 --- Update.json | 11 +++++++++++ XMOJ.user.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 6d5c0cc5..413f3e09 100644 --- a/Update.json +++ b/Update.json @@ -2655,6 +2655,17 @@ } ], "Notes": "No release notes were provided for this release." + }, + "1.2.72": { + "UpdateDate": 1738077467342, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 758, + "Description": "Fix #714" + } + ], + "Notes": "No release notes were provided for this release." } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 77f64743..adadb13e 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 1.2.71 +// @version 1.2.72 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen From 9f2e7fab6d6f0664f58fa59991a5bf45cff4378a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 28 Jan 2025 15:17:58 +0000 Subject: [PATCH 09/11] Update time and description of 1.2.72 --- Update.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 413f3e09..9409a7ce 100644 --- a/Update.json +++ b/Update.json @@ -2657,7 +2657,7 @@ "Notes": "No release notes were provided for this release." }, "1.2.72": { - "UpdateDate": 1738077467342, + "UpdateDate": 1738077477956, "Prerelease": true, "UpdateContents": [ { From 59cf12d113d578fc2d0805afe65446b03ea8c0b7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 7 Feb 2025 10:52:30 +0000 Subject: [PATCH 10/11] 1.2.73 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8be737d1..a150a192 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "1.2.72", + "version": "1.2.73", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": { From f38804093a7282b3ebcc99b2891b634a5618de42 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 7 Feb 2025 10:52:31 +0000 Subject: [PATCH 11/11] Update to release 1.2.73 --- Update.json | 15 +++++++++++++++ XMOJ.user.js | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 9409a7ce..13f16985 100644 --- a/Update.json +++ b/Update.json @@ -2666,6 +2666,21 @@ } ], "Notes": "No release notes were provided for this release." + }, + "1.2.73": { + "UpdateDate": 1738925550389, + "Prerelease": false, + "UpdateContents": [ + { + "PR": 753, + "Description": "fix: 修复代码长度单位换算错误" + }, + { + "PR": 758, + "Description": "Fix #714" + } + ], + "Notes": "No release notes were provided for this release." } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index adadb13e..b1be1f7a 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 1.2.72 +// @version 1.2.73 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen