xmoj-script 1.7.1 → 1.7.3
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 +9 -6
- package/package.json +1 -1
package/Update.json
CHANGED
@@ -2862,6 +2862,28 @@
|
|
2862
2862
|
}
|
2863
2863
|
],
|
2864
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."
|
2876
|
+
},
|
2877
|
+
"1.7.3": {
|
2878
|
+
"UpdateDate": 1750594769202,
|
2879
|
+
"Prerelease": true,
|
2880
|
+
"UpdateContents": [
|
2881
|
+
{
|
2882
|
+
"PR": 811,
|
2883
|
+
"Description": "fix: Redirect to login page if profile element is missing"
|
2884
|
+
}
|
2885
|
+
],
|
2886
|
+
"Notes": "No release notes were provided for this release."
|
2865
2887
|
}
|
2866
2888
|
}
|
2867
2889
|
}
|
package/XMOJ.user.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
// ==UserScript==
|
2
2
|
// @name XMOJ
|
3
|
-
// @version 1.7.
|
3
|
+
// @version 1.7.3
|
4
4
|
// @description XMOJ增强脚本
|
5
5
|
// @author @XMOJ-Script-dev, @langningchen and the community
|
6
6
|
// @namespace https://github/langningchen
|
@@ -559,6 +559,9 @@ window.addEventListener('DOMContentLoaded', async () => {
|
|
559
559
|
|
560
560
|
let SearchParams = new URLSearchParams(location.search);
|
561
561
|
let ServerURL = (UtilityEnabled("DebugMode") ? "https://ghpages.xmoj-bbs.me/" : "https://www.xmoj-bbs.me")
|
562
|
+
if (document.querySelector("#profile") === null) {
|
563
|
+
location.href = "https://www.xmoj.tech/loginpage.php";
|
564
|
+
}
|
562
565
|
let CurrentUsername = document.querySelector("#profile").innerText;
|
563
566
|
CurrentUsername = CurrentUsername.replaceAll(/[^a-zA-Z0-9]/g, "");
|
564
567
|
let IsAdmin = AdminUserList.indexOf(CurrentUsername) !== -1;
|
@@ -1075,7 +1078,7 @@ window.addEventListener('DOMContentLoaded', async () => {
|
|
1075
1078
|
// Remove the preloader style now that the page is loading and Bootstrap 5 will take over.
|
1076
1079
|
const preloadStyleElement = document.getElementById('tampermonkey-dark-preload');
|
1077
1080
|
if (preloadStyleElement) {
|
1078
|
-
|
1081
|
+
preloadStyleElement.remove();
|
1079
1082
|
console.log("Removed minimal dark preload styles.");
|
1080
1083
|
}
|
1081
1084
|
fetch(ServerURL + "/Update.json", {cache: "no-cache"})
|
@@ -2233,7 +2236,7 @@ window.addEventListener('DOMContentLoaded', async () => {
|
|
2233
2236
|
if (Submitted) location.reload(); else AutoCheatButton.innerHTML = "自动提交当年代码";
|
2234
2237
|
});
|
2235
2238
|
document.addEventListener("keydown", (Event) => {
|
2236
|
-
if (Event.code === 'Enter' && Event.ctrlKey) {
|
2239
|
+
if (Event.code === 'Enter' && (Event.metaKey || Event.ctrlKey)) {
|
2237
2240
|
AutoCheatButton.click();
|
2238
2241
|
}
|
2239
2242
|
});
|
@@ -4211,7 +4214,7 @@ int main()
|
|
4211
4214
|
TurnstileScript.src = "https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit&onload=CaptchaLoadedCallback";
|
4212
4215
|
document.body.appendChild(TurnstileScript);
|
4213
4216
|
ContentElement.addEventListener("keydown", (Event) => {
|
4214
|
-
if (Event.ctrlKey && Event.keyCode == 13) {
|
4217
|
+
if ((Event.metaKey || Event.ctrlKey) && Event.keyCode == 13) {
|
4215
4218
|
SubmitElement.click();
|
4216
4219
|
}
|
4217
4220
|
});
|
@@ -4388,7 +4391,7 @@ int main()
|
|
4388
4391
|
TurnstileScript.src = "https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit&onload=CaptchaLoadedCallback";
|
4389
4392
|
document.body.appendChild(TurnstileScript);
|
4390
4393
|
ContentElement.addEventListener("keydown", (Event) => {
|
4391
|
-
if (Event.ctrlKey && Event.keyCode == 13) {
|
4394
|
+
if ((Event.metaKey || Event.ctrlKey) && Event.keyCode == 13) {
|
4392
4395
|
SubmitElement.click();
|
4393
4396
|
}
|
4394
4397
|
});
|
@@ -4642,7 +4645,7 @@ int main()
|
|
4642
4645
|
ContentEditor.value = ContentEditor.value.substring(0, ContentEditor.value.indexOf("<br>"));
|
4643
4646
|
}
|
4644
4647
|
ContentEditor.addEventListener("keydown", (Event) => {
|
4645
|
-
if (Event.ctrlKey && Event.keyCode == 13) {
|
4648
|
+
if ((Event.metaKey || Event.ctrlKey) && Event.keyCode == 13) {
|
4646
4649
|
OKButton.click();
|
4647
4650
|
}
|
4648
4651
|
});
|