Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3455,6 +3455,17 @@
}
],
"Notes": "Display status.php query content."
},
"3.3.4": {
"UpdateDate": 1773559861504,
"Prerelease": true,
"UpdateContents": [
{
"PR": 939,
"Description": "fix: gate MonochromeUI-specific styling in contestrank pages behind flag"
}
],
"Notes": "修复了未开启「极简黑白界面风格」时,比赛排行榜表头仍显示为黑白样式的问题 (#932)"
}
}
}
58 changes: 35 additions & 23 deletions XMOJ.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name XMOJ
// @version 3.3.3
// @version 3.3.4
// @description XMOJ增强脚本
// @author @XMOJ-Script-dev, @langningchen and the community
// @namespace https://github/langningchen
Expand Down Expand Up @@ -3043,13 +3043,15 @@ async function main() {
HeaderCells[2].innerText = "昵称";
HeaderCells[3].innerText = "AC数";
HeaderCells[4].innerText = "得分";
for (let j = 0; j < HeaderCells.length; j++) {
HeaderCells[j].removeAttribute("bgcolor");
HeaderCells[j].style.setProperty("background-color", "black", "important");
HeaderCells[j].style.setProperty("color", "white", "important");
let Links = HeaderCells[j].querySelectorAll("a");
for (let k = 0; k < Links.length; k++) {
Links[k].style.setProperty("color", "white", "important");
if (UtilityEnabled("MonochromeUI")) {
for (let j = 0; j < HeaderCells.length; j++) {
HeaderCells[j].removeAttribute("bgcolor");
HeaderCells[j].style.setProperty("background-color", "black", "important");
HeaderCells[j].style.setProperty("color", "white", "important");
let Links = HeaderCells[j].querySelectorAll("a");
for (let k = 0; k < Links.length; k++) {
Links[k].style.setProperty("color", "white", "important");
}
}
}
let RefreshOIRank = async () => {
Expand All @@ -3062,7 +3064,9 @@ async function main() {
TidyTable(ParsedDocument.getElementById("rank"));
let Temp = ParsedDocument.getElementById("rank").rows;
for (var i = 1; i < Temp.length; i++) {
Temp[i].style.backgroundColor = "";
if (UtilityEnabled("MonochromeUI")) {
Temp[i].style.backgroundColor = "";
}
let MetalCell = Temp[i].cells[0];
let Metal = document.createElement("span");
Metal.innerText = MetalCell.innerText;
Expand All @@ -3072,9 +3076,11 @@ async function main() {
GetUsernameHTML(Temp[i].cells[1], Temp[i].cells[1].innerText);
Temp[i].cells[2].innerHTML = Temp[i].cells[2].innerText;
Temp[i].cells[3].innerHTML = Temp[i].cells[3].innerText;
for (let j = 0; j < 5 && j < Temp[i].cells.length; j++) {
Temp[i].cells[j].style.backgroundColor = "";
Temp[i].cells[j].style.color = "";
if (UtilityEnabled("MonochromeUI")) {
for (let j = 0; j < 5 && j < Temp[i].cells.length; j++) {
Temp[i].cells[j].style.backgroundColor = "";
Temp[i].cells[j].style.color = "";
}
}
for (let j = 5; j < Temp[i].cells.length; j++) {
let InnerText = Temp[i].cells[j].innerText;
Expand Down Expand Up @@ -3144,13 +3150,15 @@ async function main() {
HeaderCells[2].innerText = "昵称";
HeaderCells[3].innerText = "AC数";
HeaderCells[4].innerText = "得分";
for (let j = 0; j < HeaderCells.length; j++) {
HeaderCells[j].removeAttribute("bgcolor");
HeaderCells[j].style.setProperty("background-color", "black", "important");
HeaderCells[j].style.setProperty("color", "white", "important");
let Links = HeaderCells[j].querySelectorAll("a");
for (let k = 0; k < Links.length; k++) {
Links[k].style.setProperty("color", "white", "important");
if (UtilityEnabled("MonochromeUI")) {
for (let j = 0; j < HeaderCells.length; j++) {
HeaderCells[j].removeAttribute("bgcolor");
HeaderCells[j].style.setProperty("background-color", "black", "important");
HeaderCells[j].style.setProperty("color", "white", "important");
let Links = HeaderCells[j].querySelectorAll("a");
for (let k = 0; k < Links.length; k++) {
Links[k].style.setProperty("color", "white", "important");
}
}
}
let RefreshCorrectRank = async () => {
Expand All @@ -3163,7 +3171,9 @@ async function main() {
TidyTable(ParsedDocument.getElementById("rank"));
let Temp = ParsedDocument.getElementById("rank").rows;
for (var i = 1; i < Temp.length; i++) {
Temp[i].style.backgroundColor = "";
if (UtilityEnabled("MonochromeUI")) {
Temp[i].style.backgroundColor = "";
}
let MetalCell = Temp[i].cells[0];
let Metal = document.createElement("span");
Metal.innerText = MetalCell.innerText;
Expand All @@ -3173,9 +3183,11 @@ async function main() {
GetUsernameHTML(Temp[i].cells[1], Temp[i].cells[1].innerText);
Temp[i].cells[2].innerHTML = Temp[i].cells[2].innerText;
Temp[i].cells[3].innerHTML = Temp[i].cells[3].innerText;
for (let j = 0; j < 5 && j < Temp[i].cells.length; j++) {
Temp[i].cells[j].style.backgroundColor = "";
Temp[i].cells[j].style.color = "";
if (UtilityEnabled("MonochromeUI")) {
for (let j = 0; j < 5 && j < Temp[i].cells.length; j++) {
Temp[i].cells[j].style.backgroundColor = "";
Temp[i].cells[j].style.color = "";
}
}
for (let j = 5; j < Temp[i].cells.length; j++) {
let InnerText = Temp[i].cells[j].innerText;
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.3.3",
"version": "3.3.4",
Copy link

@cubic-dev-ai cubic-dev-ai bot Mar 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Don't manually bump package.json here; version numbers are supposed to be updated by the repository automation and kept in sync with XMOJ.user.js and Update.json.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At package.json, line 3:

<comment>Don't manually bump `package.json` here; version numbers are supposed to be updated by the repository automation and kept in sync with `XMOJ.user.js` and `Update.json`.</comment>

<file context>
@@ -1,6 +1,6 @@
 {
   "name": "xmoj-script",
-  "version": "3.3.3",
+  "version": "3.3.4",
   "description": "an improvement script for xmoj.tech",
   "main": "AddonScript.js",
</file context>
Fix with Cubic

"description": "an improvement script for xmoj.tech",
"main": "AddonScript.js",
"scripts": {
Expand Down
Loading