Skip to content
Merged
11 changes: 11 additions & 0 deletions Update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3894,6 +3894,17 @@
}
],
"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- 回放页面增加页面标题"
}
}
}
16 changes: 13 additions & 3 deletions XMOJ.user.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -613,7 +614,7 @@ const MonochromeSkinCSS = `
}
}
/* Contain images */
img {
img:not(.prism-player img) {
max-width: 100% !important;
height: auto !important;
}
Expand Down Expand Up @@ -6246,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) {
Expand Down Expand Up @@ -8983,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")) {
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": "3.8.7",
"version": "3.8.8",
"description": "an improvement script for xmoj.tech",
"main": "AddonScript.js",
"scripts": {
Expand Down