diff --git a/Update.json b/Update.json index afebbac9..ce92ef55 100644 --- a/Update.json +++ b/Update.json @@ -2862,6 +2862,17 @@ } ], "Notes": "No release notes were provided for this release." + }, + "1.7.2": { + "UpdateDate": 1749865010938, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 808, + "Description": "feat: Enhance keyboard shortcuts for better cross-platform support" + } + ], + "Notes": "No release notes were provided for this release." } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 4e01002d..6075d804 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 1.7.1 +// @version 1.7.2 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen @@ -1075,7 +1075,7 @@ window.addEventListener('DOMContentLoaded', async () => { // Remove the preloader style now that the page is loading and Bootstrap 5 will take over. const preloadStyleElement = document.getElementById('tampermonkey-dark-preload'); if (preloadStyleElement) { - preloadStyleElement.remove(); + preloadStyleElement.remove(); console.log("Removed minimal dark preload styles."); } fetch(ServerURL + "/Update.json", {cache: "no-cache"}) @@ -2233,7 +2233,7 @@ window.addEventListener('DOMContentLoaded', async () => { if (Submitted) location.reload(); else AutoCheatButton.innerHTML = "自动提交当年代码"; }); document.addEventListener("keydown", (Event) => { - if (Event.code === 'Enter' && Event.ctrlKey) { + if (Event.code === 'Enter' && (Event.metaKey || Event.ctrlKey)) { AutoCheatButton.click(); } }); @@ -4211,7 +4211,7 @@ int main() TurnstileScript.src = "https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit&onload=CaptchaLoadedCallback"; document.body.appendChild(TurnstileScript); ContentElement.addEventListener("keydown", (Event) => { - if (Event.ctrlKey && Event.keyCode == 13) { + if ((Event.metaKey || Event.ctrlKey) && Event.keyCode == 13) { SubmitElement.click(); } }); @@ -4388,7 +4388,7 @@ int main() TurnstileScript.src = "https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit&onload=CaptchaLoadedCallback"; document.body.appendChild(TurnstileScript); ContentElement.addEventListener("keydown", (Event) => { - if (Event.ctrlKey && Event.keyCode == 13) { + if ((Event.metaKey || Event.ctrlKey) && Event.keyCode == 13) { SubmitElement.click(); } }); @@ -4642,7 +4642,7 @@ int main() ContentEditor.value = ContentEditor.value.substring(0, ContentEditor.value.indexOf("
")); } ContentEditor.addEventListener("keydown", (Event) => { - if (Event.ctrlKey && Event.keyCode == 13) { + if ((Event.metaKey || Event.ctrlKey) && Event.keyCode == 13) { OKButton.click(); } }); diff --git a/package.json b/package.json index 30153282..76b8b358 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "1.7.1", + "version": "1.7.2", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": {