From 0111cc12eaa5ac940805d453131b01c01985bf84 Mon Sep 17 00:00:00 2001 From: boomzero Date: Tue, 6 Oct 2026 08:34:51 +0800 Subject: [PATCH 01/12] Show script admins with violet names instead of a badge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 脚本管理员 badge plus a custom badge often wrapped onto a second line. Admins now get a reserved violet username color with a 脚本管理员 tooltip, whether or not ratings are shown, and the badge is removed. No rating tier uses violet, so it cannot be mistaken for a rating. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01E5dr7XTsCeoamqLSiT9rLp --- XMOJ.user.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 997b2302..0a90099c 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -685,10 +685,11 @@ const ThemeCanvasCSS = ` html[data-bs-theme='light'] { background: var(--mono-white, var(--bs-body-bg, #fff)); color-scheme: light; } `; -// Username colors by rating tier. Each color keeps at least 3.3:1 contrast on both -// the light and the dark background, so one palette is used on every page and -// theme instead of Bootstrap's link-* colors, which change with theme. Like -// Bootstrap, hover darkens the color by 20% and makes the underline opaque. +// Username colors by rating tier, plus violet for script admins. Each color keeps +// at least 3.3:1 contrast on both the light and the dark background, so one +// palette is used on every page and theme instead of Bootstrap's link-* colors, +// which change with theme. Like Bootstrap, hover darkens the color by 20% and +// makes the underline opaque. const RatingColorCSS = ` a.xmoj-rating-red { color: #dc2f5a !important; text-decoration-color: rgba(220, 47, 90, 0.5) !important; } a.xmoj-rating-red:hover, a.xmoj-rating-red:focus { color: #b02648 !important; text-decoration-color: #b02648 !important; } @@ -702,6 +703,8 @@ const RatingColorCSS = ` a.xmoj-rating-cyan:hover, a.xmoj-rating-cyan:focus { color: #127a8d !important; text-decoration-color: #127a8d !important; } a.xmoj-rating-gray { color: #78828c !important; text-decoration-color: rgba(120, 130, 140, 0.5) !important; } a.xmoj-rating-gray:hover, a.xmoj-rating-gray:focus { color: #606870 !important; text-decoration-color: #606870 !important; } + a.xmoj-rating-admin { color: #a855f7 !important; text-decoration-color: rgba(168, 85, 247, 0.5) !important; } + a.xmoj-rating-admin:hover, a.xmoj-rating-admin:focus { color: #8644c6 !important; text-decoration-color: #8644c6 !important; } `; // Both UI initializers use this link; loading only in legacy main() leaves /web @@ -1640,13 +1643,14 @@ let GetUsernameHTML = async (Element, Username, Simple = false, Href = "https:// } HTMLData += `" class="rounded me-2" style="width: 20px; height: 20px; ">`; } - HTMLData += `= 2400) { HTMLData += "xmoj-rating-red"; } else if (Rating >= 2000) { @@ -1665,9 +1669,6 @@ let GetUsernameHTML = async (Element, Username, Simple = false, Href = "https:// } HTMLData += `\";">`; if (!Simple) { - if (AdminUserList.includes(Username)) { - HTMLData += `脚本管理员`; - } let BadgeInfo = await GetUserBadge(Username); if (BadgeInfo.Content != "") { HTMLData += `${BadgeInfo.Content}`; From c4cb3598c3013ecc7e18ceb664237ec115237dc9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 6 Oct 2026 00:35:46 +0000 Subject: [PATCH 02/12] 3.8.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1e542e44..77859efc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "3.8.6", + "version": "3.8.7", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": { From 91128f6e2ebd8dc111b0b36adb517a9ffb2d330d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 6 Oct 2026 00:35:52 +0000 Subject: [PATCH 03/12] Update version info to 3.8.7 --- Update.json | 11 +++++++++++ XMOJ.user.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 61a3363d..edc31ae4 100644 --- a/Update.json +++ b/Update.json @@ -3883,6 +3883,17 @@ } ], "Notes": "用户评分重新设计:从「AC 率 × 1000」改为综合做题量、准确度和坚持度的 0–3000 分,更难刷分,用户名颜色改为六档。详见 https://docs.xmoj-script.uk/features/rating.html" + }, + "3.8.7": { + "UpdateDate": 1791246947028, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 1049, + "Description": "Show script admins with violet names instead of a badge" + } + ], + "Notes": "脚本管理员的用户名改为紫色显示(悬停提示「脚本管理员」),不再单独显示「脚本管理员」徽章,为自定义徽章腾出空间。" } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 0a90099c..ae9fc702 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 3.8.6 +// @version 3.8.7 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen From 98ac80c5dc3fba8d58854a757e24ba42e1ec6bbc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 6 Oct 2026 00:38:19 +0000 Subject: [PATCH 04/12] Update time and description of 3.8.7 --- Update.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Update.json b/Update.json index edc31ae4..0c032d65 100644 --- a/Update.json +++ b/Update.json @@ -3885,7 +3885,7 @@ "Notes": "用户评分重新设计:从「AC 率 × 1000」改为综合做题量、准确度和坚持度的 0–3000 分,更难刷分,用户名颜色改为六档。详见 https://docs.xmoj-script.uk/features/rating.html" }, "3.8.7": { - "UpdateDate": 1791246947028, + "UpdateDate": 1791247094090, "Prerelease": true, "UpdateContents": [ { From 63ebf7c1fb810d38afdcbe5cc0dc87f5ac2f2e38 Mon Sep 17 00:00:00 2001 From: boomzero Date: Tue, 6 Oct 2026 08:53:10 +0800 Subject: [PATCH 05/12] Don't treat video player images as enlargeable The Aliyun player on contest/problem replay pages renders its progress bar thumb as an , so clicking or dragging it opened the image enlarger. Skip images inside the player container. Closes #1003 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01E5dr7XTsCeoamqLSiT9rLp --- XMOJ.user.js | 1 + 1 file changed, 1 insertion(+) diff --git a/XMOJ.user.js b/XMOJ.user.js index ae9fc702..e858ffb8 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -8983,6 +8983,7 @@ function InitializeImageEnlarger() { const effectiveSrc = img.currentSrc || img.src; if (!img.classList.contains("xmoj-image-preview") && !img.closest(".xmoj-image-modal") && + !img.closest(".prism-player, [id^=\"J_prismPlayer\"]") && // video player controls (e.g. progress bar thumb) effectiveSrc && !effectiveSrc.includes("gravatar") && !effectiveSrc.includes("cravatar")) { From a884c4bdfb622d6e5ce710dca70bdecea768fab5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 6 Oct 2026 00:54:14 +0000 Subject: [PATCH 06/12] 3.8.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 77859efc..d107405b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "3.8.7", + "version": "3.8.8", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": { From ae766319326cc2ad7f3b6fcd8db4c95d608e4315 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 6 Oct 2026 00:54:21 +0000 Subject: [PATCH 07/12] Update version info to 3.8.8 --- Update.json | 11 +++++++++++ XMOJ.user.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 0c032d65..2473d250 100644 --- a/Update.json +++ b/Update.json @@ -3894,6 +3894,17 @@ } ], "Notes": "脚本管理员的用户名改为紫色显示(悬停提示「脚本管理员」),不再单独显示「脚本管理员」徽章,为自定义徽章腾出空间。" + }, + "3.8.8": { + "UpdateDate": 1791248055026, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 1051, + "Description": "Don't open the image enlarger on video player controls" + } + ], + "Notes": "修复回放视频进度条拖动球被当作图片放大的问题" } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index e858ffb8..29d6ceb6 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 3.8.7 +// @version 3.8.8 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen From 347755e41a14f5ab52a4a3149e948e362c022461 Mon Sep 17 00:00:00 2001 From: boomzero Date: Tue, 6 Oct 2026 08:55:34 +0800 Subject: [PATCH 08/12] Keep the minimalist skin off the video player controls The global border-radius/box-shadow reset squared off Aliplayer's round play button ring (showing a grey box), and the global img sizing rule distorted its control icons. Exclude .prism-player descendants from both. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01E5dr7XTsCeoamqLSiT9rLp --- XMOJ.user.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index e858ffb8..06652749 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -269,7 +269,8 @@ const MonochromeSkinCSS = ` --mono-gray-500: #a3a3a3; } - * { + /* The video player draws its controls with rounded shapes and sized icons; leave it alone */ + *:not(.prism-player *) { border-radius: 0 !important; box-shadow: none !important; } @@ -613,7 +614,7 @@ const MonochromeSkinCSS = ` } } /* Contain images */ - img { + img:not(.prism-player img) { max-width: 100% !important; height: auto !important; } From 7bfbf7ebccfea938b41380903c7ccd71cf3d60cf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 6 Oct 2026 00:56:07 +0000 Subject: [PATCH 09/12] Update time and description of 3.8.8 --- Update.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 2473d250..af7401f3 100644 --- a/Update.json +++ b/Update.json @@ -3896,7 +3896,7 @@ "Notes": "脚本管理员的用户名改为紫色显示(悬停提示「脚本管理员」),不再单独显示「脚本管理员」徽章,为自定义徽章腾出空间。" }, "3.8.8": { - "UpdateDate": 1791248055026, + "UpdateDate": 1791248161258, "Prerelease": true, "UpdateContents": [ { From 64e6fdf998bdf888ad53dbbb8936d497932cf2fe Mon Sep 17 00:00:00 2001 From: boomzero Date: Tue, 6 Oct 2026 09:00:35 +0800 Subject: [PATCH 10/12] Give replay pages a page title Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01E5dr7XTsCeoamqLSiT9rLp --- XMOJ.user.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/XMOJ.user.js b/XMOJ.user.js index ac3cdd64..121bfeed 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -6247,6 +6247,14 @@ async function main() { } } else if (location.pathname == "/contest_video.php" || location.pathname == "/problem_video.php") { let ScriptData = (document.querySelector("body > div > div.mt-3 > center > script") != null) ? document.querySelector("body > div > div.mt-3 > center > script").innerHTML : ""; + let VideoHeading = document.querySelector("center h1, center h2, center h3"); + if (VideoHeading != null && VideoHeading.innerText.trim() != "") { + document.title = "回放: " + VideoHeading.innerText.trim(); + } else if (SearchParams.get("cid") != null) { + document.title = "比赛 " + Number(SearchParams.get("cid")) + " 回放"; + } else { + document.title = "回放"; + } if (document.getElementById("J_prismPlayer0").innerHTML != "") { document.getElementById("J_prismPlayer0").innerHTML = ""; if (player) { From d2f737f160f03be5f946367f6688cecd3a2b6fae Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 6 Oct 2026 01:01:07 +0000 Subject: [PATCH 11/12] Update time and description of 3.8.8 --- Update.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Update.json b/Update.json index af7401f3..3474a151 100644 --- a/Update.json +++ b/Update.json @@ -3896,7 +3896,7 @@ "Notes": "脚本管理员的用户名改为紫色显示(悬停提示「脚本管理员」),不再单独显示「脚本管理员」徽章,为自定义徽章腾出空间。" }, "3.8.8": { - "UpdateDate": 1791248161258, + "UpdateDate": 1791248462381, "Prerelease": true, "UpdateContents": [ { From 1bb14a778122a485c4d31c85101956e4c919dcba Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 6 Oct 2026 01:01:18 +0000 Subject: [PATCH 12/12] Update time and description of 3.8.8 --- Update.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Update.json b/Update.json index 3474a151..ee1aec77 100644 --- a/Update.json +++ b/Update.json @@ -3896,15 +3896,15 @@ "Notes": "脚本管理员的用户名改为紫色显示(悬停提示「脚本管理员」),不再单独显示「脚本管理员」徽章,为自定义徽章腾出空间。" }, "3.8.8": { - "UpdateDate": 1791248462381, + "UpdateDate": 1791248477470, "Prerelease": true, "UpdateContents": [ { "PR": 1051, - "Description": "Don't open the image enlarger on video player controls" + "Description": "Fix image enlarger and minimalist skin on video replay pages; add page title" } ], - "Notes": "修复回放视频进度条拖动球被当作图片放大的问题" + "Notes": "- 修复回放视频进度条拖动球被当作图片放大的问题\n- 修复极简黑白界面下视频播放器按钮出现灰色方框的问题\n- 回放页面增加页面标题" } } } \ No newline at end of file