xmoj-script 1.7.0 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Update.json +22 -0
- package/XMOJ.user.js +6 -46
- package/package.json +1 -1
package/Update.json
CHANGED
@@ -2851,6 +2851,28 @@
|
|
2851
2851
|
}
|
2852
2852
|
],
|
2853
2853
|
"Notes": "No release notes were provided for this release."
|
2854
|
+
},
|
2855
|
+
"1.7.1": {
|
2856
|
+
"UpdateDate": 1749457101103,
|
2857
|
+
"Prerelease": true,
|
2858
|
+
"UpdateContents": [
|
2859
|
+
{
|
2860
|
+
"PR": 806,
|
2861
|
+
"Description": "Remove the statistics button from contest page"
|
2862
|
+
}
|
2863
|
+
],
|
2864
|
+
"Notes": "No release notes were provided for this release."
|
2865
|
+
},
|
2866
|
+
"1.7.2": {
|
2867
|
+
"UpdateDate": 1749865010938,
|
2868
|
+
"Prerelease": true,
|
2869
|
+
"UpdateContents": [
|
2870
|
+
{
|
2871
|
+
"PR": 808,
|
2872
|
+
"Description": "feat: Enhance keyboard shortcuts for better cross-platform support"
|
2873
|
+
}
|
2874
|
+
],
|
2875
|
+
"Notes": "No release notes were provided for this release."
|
2854
2876
|
}
|
2855
2877
|
}
|
2856
2878
|
}
|
package/XMOJ.user.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
// ==UserScript==
|
2
2
|
// @name XMOJ
|
3
|
-
// @version 1.7.
|
3
|
+
// @version 1.7.2
|
4
4
|
// @description XMOJ增强脚本
|
5
5
|
// @author @XMOJ-Script-dev, @langningchen and the community
|
6
6
|
// @namespace https://github/langningchen
|
@@ -1075,7 +1075,7 @@ window.addEventListener('DOMContentLoaded', async () => {
|
|
1075
1075
|
// Remove the preloader style now that the page is loading and Bootstrap 5 will take over.
|
1076
1076
|
const preloadStyleElement = document.getElementById('tampermonkey-dark-preload');
|
1077
1077
|
if (preloadStyleElement) {
|
1078
|
-
|
1078
|
+
preloadStyleElement.remove();
|
1079
1079
|
console.log("Removed minimal dark preload styles.");
|
1080
1080
|
}
|
1081
1081
|
fetch(ServerURL + "/Update.json", {cache: "no-cache"})
|
@@ -2115,13 +2115,6 @@ window.addEventListener('DOMContentLoaded', async () => {
|
|
2115
2115
|
document.querySelector("body > div > div.mt-3 > center > br:nth-child(2)").remove();
|
2116
2116
|
document.querySelector("body > div > div.mt-3 > center > br:nth-child(2)").remove();
|
2117
2117
|
document.querySelector("body > div > div.mt-3 > center > div > .red").innerHTML = String(document.querySelector("body > div > div.mt-3 > center > div > .red").innerHTML).replaceAll("<br>", "<br><br>");
|
2118
|
-
let StaticButton = document.createElement("button");
|
2119
|
-
document.querySelectorAll("body > div > div.mt-3 > center > div > .red")[1].appendChild(StaticButton);
|
2120
|
-
StaticButton.className = "btn btn-outline-secondary";
|
2121
|
-
StaticButton.innerText = "统计";
|
2122
|
-
StaticButton.addEventListener("click", () => {
|
2123
|
-
location.href = "https://www.xmoj.tech/conteststatistics.php?cid=" + SearchParams.get("cid");
|
2124
|
-
});
|
2125
2118
|
|
2126
2119
|
document.querySelector("#problemset > tbody").innerHTML = String(document.querySelector("#problemset > tbody").innerHTML).replaceAll(/\t ([0-9]*) 问题 ([^<]*)/g, "$2. $1");
|
2127
2120
|
|
@@ -2240,7 +2233,7 @@ window.addEventListener('DOMContentLoaded', async () => {
|
|
2240
2233
|
if (Submitted) location.reload(); else AutoCheatButton.innerHTML = "自动提交当年代码";
|
2241
2234
|
});
|
2242
2235
|
document.addEventListener("keydown", (Event) => {
|
2243
|
-
if (Event.code === 'Enter' && Event.ctrlKey) {
|
2236
|
+
if (Event.code === 'Enter' && (Event.metaKey || Event.ctrlKey)) {
|
2244
2237
|
AutoCheatButton.click();
|
2245
2238
|
}
|
2246
2239
|
});
|
@@ -3148,39 +3141,6 @@ window.addEventListener('DOMContentLoaded', async () => {
|
|
3148
3141
|
});
|
3149
3142
|
});
|
3150
3143
|
}
|
3151
|
-
} else if (location.pathname == "/conteststatistics.php") {
|
3152
|
-
if (new URL(location.href).searchParams.get("cid") != null) {
|
3153
|
-
document.title = "比赛 " + new URL(location.href).searchParams.get("cid") + " 统计";
|
3154
|
-
}
|
3155
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText = "比赛统计";
|
3156
|
-
if (UtilityEnabled("ResetType")) {
|
3157
|
-
let Temp = document.getElementById("submission").childNodes;
|
3158
|
-
for (let i = 0; i < Temp.length; i++) {
|
3159
|
-
Temp[i].remove();
|
3160
|
-
}
|
3161
|
-
eval(document.querySelector("body > div.container > div > center > table:nth-child(4) > script:nth-child(6)").innerHTML);
|
3162
|
-
document.querySelector("#cs > thead > tr > th:nth-child(1)").innerText = "题目编号";
|
3163
|
-
document.querySelector("#cs > thead > tr > th:nth-child(10)").remove();
|
3164
|
-
document.querySelector("#cs > thead > tr > th:nth-child(11)").innerText = "总和";
|
3165
|
-
document.querySelector("#cs > thead > tr > th:nth-child(12)").remove();
|
3166
|
-
document.querySelector("#cs > thead > tr > th:nth-child(12)").remove();
|
3167
|
-
document.querySelector("#cs > thead > tr > th:nth-child(12)").remove();
|
3168
|
-
document.querySelector("#cs > tbody > tr:last-child > td").innerText = "总和";
|
3169
|
-
TidyTable(document.getElementById("cs"));
|
3170
|
-
Temp = document.querySelector("#cs > tbody").children;
|
3171
|
-
for (let i = 0; i < Temp.length; i++) {
|
3172
|
-
let CurrentRowChildren = Temp[i].children;
|
3173
|
-
CurrentRowChildren[9].remove();
|
3174
|
-
CurrentRowChildren[11].remove();
|
3175
|
-
CurrentRowChildren[11].remove();
|
3176
|
-
CurrentRowChildren[11].remove();
|
3177
|
-
for (let j = 0; j < CurrentRowChildren.length; j++) {
|
3178
|
-
if (CurrentRowChildren[j].innerText == "") {
|
3179
|
-
CurrentRowChildren[j].innerText = "0";
|
3180
|
-
}
|
3181
|
-
}
|
3182
|
-
}
|
3183
|
-
}
|
3184
3144
|
} else if (location.pathname == "/comparesource.php") {
|
3185
3145
|
if (UtilityEnabled("CompareSource")) {
|
3186
3146
|
if (location.search == "") {
|
@@ -4251,7 +4211,7 @@ int main()
|
|
4251
4211
|
TurnstileScript.src = "https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit&onload=CaptchaLoadedCallback";
|
4252
4212
|
document.body.appendChild(TurnstileScript);
|
4253
4213
|
ContentElement.addEventListener("keydown", (Event) => {
|
4254
|
-
if (Event.ctrlKey && Event.keyCode == 13) {
|
4214
|
+
if ((Event.metaKey || Event.ctrlKey) && Event.keyCode == 13) {
|
4255
4215
|
SubmitElement.click();
|
4256
4216
|
}
|
4257
4217
|
});
|
@@ -4428,7 +4388,7 @@ int main()
|
|
4428
4388
|
TurnstileScript.src = "https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit&onload=CaptchaLoadedCallback";
|
4429
4389
|
document.body.appendChild(TurnstileScript);
|
4430
4390
|
ContentElement.addEventListener("keydown", (Event) => {
|
4431
|
-
if (Event.ctrlKey && Event.keyCode == 13) {
|
4391
|
+
if ((Event.metaKey || Event.ctrlKey) && Event.keyCode == 13) {
|
4432
4392
|
SubmitElement.click();
|
4433
4393
|
}
|
4434
4394
|
});
|
@@ -4682,7 +4642,7 @@ int main()
|
|
4682
4642
|
ContentEditor.value = ContentEditor.value.substring(0, ContentEditor.value.indexOf("<br>"));
|
4683
4643
|
}
|
4684
4644
|
ContentEditor.addEventListener("keydown", (Event) => {
|
4685
|
-
if (Event.ctrlKey && Event.keyCode == 13) {
|
4645
|
+
if ((Event.metaKey || Event.ctrlKey) && Event.keyCode == 13) {
|
4686
4646
|
OKButton.click();
|
4687
4647
|
}
|
4688
4648
|
});
|