xmoj-script 1.2.10 → 1.2.11
Sign up to get free protection for your applications and to get access to all the features.
- package/Update.json +11 -0
- package/XMOJ.user.js +17 -8
- package/package.json +1 -1
package/Update.json
CHANGED
@@ -1792,6 +1792,17 @@
|
|
1792
1792
|
}
|
1793
1793
|
],
|
1794
1794
|
"Notes": "No release notes were provided for this release."
|
1795
|
+
},
|
1796
|
+
"1.2.11": {
|
1797
|
+
"UpdateDate": 1722432013017,
|
1798
|
+
"Prerelease": true,
|
1799
|
+
"UpdateContents": [
|
1800
|
+
{
|
1801
|
+
"PR": 575,
|
1802
|
+
"Description": "Upgrade bootstrap + cdnjs"
|
1803
|
+
}
|
1804
|
+
],
|
1805
|
+
"Notes": "No release notes were provided for this release."
|
1795
1806
|
}
|
1796
1807
|
}
|
1797
1808
|
}
|
package/XMOJ.user.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
// ==UserScript==
|
2
2
|
// @name XMOJ
|
3
|
-
// @version 1.2.
|
3
|
+
// @version 1.2.11
|
4
4
|
// @description XMOJ增强脚本
|
5
5
|
// @author @XMOJ-Script-dev, @langningchen and the community
|
6
6
|
// @namespace https://github/langningchen
|
@@ -80,6 +80,9 @@ let RenderMathJax = async () => {
|
|
80
80
|
ScriptElement.id = "MathJax-script";
|
81
81
|
ScriptElement.type = "text/javascript";
|
82
82
|
ScriptElement.src = "https://cdn.bootcdn.net/ajax/libs/mathjax/3.0.5/es5/tex-chtml.js";
|
83
|
+
if (UtilityEnabled("cdnjs")) {
|
84
|
+
ScriptElement.src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.0.5/es5/tex-chtml.js";
|
85
|
+
}
|
83
86
|
document.body.appendChild(ScriptElement);
|
84
87
|
await new Promise((Resolve) => {
|
85
88
|
ScriptElement.onload = () => {
|
@@ -319,7 +322,7 @@ let TidyTable = (Table) => {
|
|
319
322
|
};
|
320
323
|
let UtilityEnabled = (Name) => {
|
321
324
|
if (localStorage.getItem("UserScript-Setting-" + Name) == null) {
|
322
|
-
const defaultOffItems = ["DebugMode", "
|
325
|
+
const defaultOffItems = ["DebugMode", "cdnjs", "SuperDebug", "ReplaceXM"];
|
323
326
|
localStorage.setItem("UserScript-Setting-" + Name, defaultOffItems.includes(Name) ? "false" : "true");
|
324
327
|
}
|
325
328
|
return localStorage.getItem("UserScript-Setting-" + Name) == "true";
|
@@ -485,16 +488,19 @@ async function main() {
|
|
485
488
|
rel: 'stylesheet'
|
486
489
|
}, {
|
487
490
|
type: 'link',
|
488
|
-
href: 'https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.
|
491
|
+
href: 'https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.3/css/bootstrap.min.css',
|
489
492
|
rel: 'stylesheet'
|
490
493
|
}, {
|
491
494
|
type: 'script',
|
492
|
-
src: 'https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.
|
495
|
+
src: 'https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.3/js/bootstrap.bundle.min.js',
|
493
496
|
isModule: true
|
494
497
|
}];
|
495
|
-
if (UtilityEnabled("
|
496
|
-
resources[
|
497
|
-
resources[
|
498
|
+
if (UtilityEnabled("cdnjs")) {
|
499
|
+
resources[0].href = 'https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.css';
|
500
|
+
resources[1].href = 'https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/theme/darcula.min.css';
|
501
|
+
resources[2].href = 'https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/addon/merge/merge.min.css';
|
502
|
+
resources[3].href = 'https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/css/bootstrap.min.css';
|
503
|
+
resources[4].src = 'https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/js/bootstrap.bundle.min.js';
|
498
504
|
}
|
499
505
|
let loadResources = async () => {
|
500
506
|
let promises = resources.map(resource => {
|
@@ -1102,7 +1108,7 @@ async function main() {
|
|
1102
1108
|
"ID": "DebugMode", "Type": "A", "Name": "调试模式(仅供开发者使用)"
|
1103
1109
|
}, {
|
1104
1110
|
"ID": "SuperDebug", "Type": "A", "Name": "本地调试模式(仅供开发者使用) (未经授权的擅自开启将导致大部分功能不可用!)"
|
1105
|
-
}, {"ID": "
|
1111
|
+
}, {"ID": "cdnjs", "Type": "A", "Name": "使用 cdnjs (如果延迟不大, 建议使用)"},]));
|
1106
1112
|
let UtilitiesCardFooter = document.createElement("div");
|
1107
1113
|
UtilitiesCardFooter.className = "card-footer text-muted";
|
1108
1114
|
UtilitiesCardFooter.innerText = "* 不建议关闭,可能会导致系统不稳定、界面错乱、功能缺失等问题\n绿色:增加功能 黄色:修改功能 红色:删除功能";
|
@@ -2776,6 +2782,9 @@ async function main() {
|
|
2776
2782
|
let ACCode = Response.split("------------------------------------------------------\r\n");
|
2777
2783
|
let ScriptElement = document.createElement("script");
|
2778
2784
|
ScriptElement.src = "https://cdn.bootcdn.net/ajax/libs/jszip/3.10.1/jszip.min.js";
|
2785
|
+
if (UtilityEnabled("cdnjs")) {
|
2786
|
+
ScriptElement.src = "https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js";
|
2787
|
+
}
|
2779
2788
|
document.head.appendChild(ScriptElement);
|
2780
2789
|
ScriptElement.onload = () => {
|
2781
2790
|
var Zip = new JSZip();
|