diff --git a/Update.json b/Update.json
index c9806c95..3704ea6e 100644
--- a/Update.json
+++ b/Update.json
@@ -3694,6 +3694,17 @@
}
],
"Notes": "No release notes were provided for this release."
+ },
+ "3.6.2": {
+ "UpdateDate": 1787290584604,
+ "Prerelease": true,
+ "UpdateContents": [
+ {
+ "PR": 1013,
+ "Description": "fix: handle PID 0 submission rows"
+ }
+ ],
+ "Notes": "修复提交记录中题目 ID 为 0 时的排版错误。"
}
}
}
\ No newline at end of file
diff --git a/XMOJ.user.js b/XMOJ.user.js
index 50e67894..49947a99 100644
--- a/XMOJ.user.js
+++ b/XMOJ.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name XMOJ
-// @version 3.6.1
+// @version 3.6.2
// @description XMOJ增强脚本
// @author @XMOJ-Script-dev, @langningchen and the community
// @namespace https://github/langningchen
@@ -3502,7 +3502,20 @@ async function main() {
SolutionIDs.push(SID);
if (UtilityEnabled("ResetType")) {
Temp[i].childNodes[0].remove();
- Temp[i].childNodes[0].innerHTML = "" + SID + " " + "重交";
+ let resubmitLink = Temp[i].childNodes[6].children[1] ?? null;
+ let sourceCell = Temp[i].childNodes[0];
+ let sourceLink = document.createElement("a");
+ sourceLink.href = "https://www.xmoj.tech/showsource.php?id=" + SID;
+ sourceLink.innerText = SID;
+ sourceCell.replaceChildren(sourceLink);
+ // Submissions with PID 0 do not have a resubmit link.
+ if (resubmitLink != null) {
+ let newResubmitLink = document.createElement("a");
+ newResubmitLink.href = resubmitLink.href;
+ newResubmitLink.innerText = "重交";
+ sourceCell.appendChild(document.createTextNode(" "));
+ sourceCell.appendChild(newResubmitLink);
+ }
Temp[i].childNodes[1].remove();
Temp[i].childNodes[1].children[0].removeAttribute("class");
Temp[i].childNodes[3].childNodes[0].innerText = SizeToStringSize(Temp[i].childNodes[3].childNodes[0].innerText);
diff --git a/package.json b/package.json
index 7db0ebb2..9244c940 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "xmoj-script",
- "version": "3.6.1",
+ "version": "3.6.2",
"description": "an improvement script for xmoj.tech",
"main": "AddonScript.js",
"scripts": {