diff --git a/Update.json b/Update.json
index 61a3363d..ee1aec77 100644
--- a/Update.json
+++ b/Update.json
@@ -3883,6 +3883,28 @@
}
],
"Notes": "用户评分重新设计:从「AC 率 × 1000」改为综合做题量、准确度和坚持度的 0–3000 分,更难刷分,用户名颜色改为六档。详见 https://docs.xmoj-script.uk/features/rating.html"
+ },
+ "3.8.7": {
+ "UpdateDate": 1791247094090,
+ "Prerelease": true,
+ "UpdateContents": [
+ {
+ "PR": 1049,
+ "Description": "Show script admins with violet names instead of a badge"
+ }
+ ],
+ "Notes": "脚本管理员的用户名改为紫色显示(悬停提示「脚本管理员」),不再单独显示「脚本管理员」徽章,为自定义徽章腾出空间。"
+ },
+ "3.8.8": {
+ "UpdateDate": 1791248477470,
+ "Prerelease": true,
+ "UpdateContents": [
+ {
+ "PR": 1051,
+ "Description": "Fix image enlarger and minimalist skin on video replay pages; add page title"
+ }
+ ],
+ "Notes": "- 修复回放视频进度条拖动球被当作图片放大的问题\n- 修复极简黑白界面下视频播放器按钮出现灰色方框的问题\n- 回放页面增加页面标题"
}
}
}
\ No newline at end of file
diff --git a/XMOJ.user.js b/XMOJ.user.js
index 997b2302..121bfeed 100644
--- a/XMOJ.user.js
+++ b/XMOJ.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name XMOJ
-// @version 3.8.6
+// @version 3.8.8
// @description XMOJ增强脚本
// @author @XMOJ-Script-dev, @langningchen and the community
// @namespace https://github/langningchen
@@ -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;
}
@@ -685,10 +686,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 +704,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 +1644,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 +1670,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}`;
@@ -6245,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) {
@@ -8982,6 +8992,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")) {
diff --git a/package.json b/package.json
index 1e542e44..d107405b 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "xmoj-script",
- "version": "3.8.6",
+ "version": "3.8.8",
"description": "an improvement script for xmoj.tech",
"main": "AddonScript.js",
"scripts": {