xmoj-script 1.1.30 → 1.1.33
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 +33 -0
- package/XMOJ.user.js +15 -8
- package/package.json +1 -1
package/Update.json
CHANGED
@@ -1128,6 +1128,39 @@
|
|
1128
1128
|
}
|
1129
1129
|
],
|
1130
1130
|
"Notes": "No release notes were provided for this release."
|
1131
|
+
},
|
1132
|
+
"1.1.31": {
|
1133
|
+
"UpdateDate": 1706507178378,
|
1134
|
+
"Prerelease": false,
|
1135
|
+
"UpdateContents": [
|
1136
|
+
{
|
1137
|
+
"PR": 403,
|
1138
|
+
"Description": "make the script much faster"
|
1139
|
+
}
|
1140
|
+
],
|
1141
|
+
"Notes": "No release notes were provided for this release."
|
1142
|
+
},
|
1143
|
+
"1.1.32": {
|
1144
|
+
"UpdateDate": 1706509019854,
|
1145
|
+
"Prerelease": true,
|
1146
|
+
"UpdateContents": [
|
1147
|
+
{
|
1148
|
+
"PR": 406,
|
1149
|
+
"Description": "more choices"
|
1150
|
+
}
|
1151
|
+
],
|
1152
|
+
"Notes": "Because choices..."
|
1153
|
+
},
|
1154
|
+
"1.1.33": {
|
1155
|
+
"UpdateDate": 1706509685600,
|
1156
|
+
"Prerelease": true,
|
1157
|
+
"UpdateContents": [
|
1158
|
+
{
|
1159
|
+
"PR": 407,
|
1160
|
+
"Description": "superdebug mode"
|
1161
|
+
}
|
1162
|
+
],
|
1163
|
+
"Notes": "No release notes were provided for this release."
|
1131
1164
|
}
|
1132
1165
|
}
|
1133
1166
|
}
|
package/XMOJ.user.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
// ==UserScript==
|
2
2
|
// @name XMOJ
|
3
|
-
// @version 1.1.
|
3
|
+
// @version 1.1.33
|
4
4
|
// @description XMOJ增强脚本
|
5
5
|
// @author @XMOJ-Script-dev, @langningchen and the community
|
6
6
|
// @namespace https://github/langningchen
|
@@ -328,7 +328,7 @@ let TidyTable = (Table) => {
|
|
328
328
|
let UtilityEnabled = (Name) => {
|
329
329
|
if (localStorage.getItem("UserScript-Setting-" + Name) == null) {
|
330
330
|
//DebugMode is off by default
|
331
|
-
localStorage.setItem("UserScript-Setting-" + Name, (Name == "DebugMode" ? "false" : "true"));
|
331
|
+
localStorage.setItem("UserScript-Setting-" + Name, (Name == "DebugMode" || Name == "UnpkgCdn" || Name == "SuperDebug" ? "false" : "true"));
|
332
332
|
}
|
333
333
|
return localStorage.getItem("UserScript-Setting-" + Name) == "true";
|
334
334
|
};
|
@@ -352,8 +352,7 @@ let RequestAPI = (Action, Data, CallBack) => {
|
|
352
352
|
let DataString = JSON.stringify(PostData);
|
353
353
|
GM_xmlhttpRequest({
|
354
354
|
method: "POST",
|
355
|
-
url: "https://api.xmoj-bbs.tech/" + Action,
|
356
|
-
// url: "http://127.0.0.1:8787/" + Action,
|
355
|
+
url: (UtilityEnabled("SuperDebug") ? "http://127.0.0.1:8787/" : "https://api.xmoj-bbs.tech/") + Action,
|
357
356
|
headers: {
|
358
357
|
"Content-Type": "application/json"
|
359
358
|
},
|
@@ -487,8 +486,7 @@ if (location.host != "www.xmoj.tech") {
|
|
487
486
|
} else {
|
488
487
|
document.querySelector("html").setAttribute("data-bs-theme", "light");
|
489
488
|
}
|
490
|
-
|
491
|
-
let resources = [
|
489
|
+
var resources = [
|
492
490
|
{
|
493
491
|
type: 'script',
|
494
492
|
src: 'https://cdn.bootcdn.net/ajax/libs/popper.js/2.11.7/umd/popper.min.js',
|
@@ -520,7 +518,10 @@ if (location.host != "www.xmoj.tech") {
|
|
520
518
|
isModule: true
|
521
519
|
}
|
522
520
|
];
|
523
|
-
|
521
|
+
if (UtilityEnabled("UnpkgCdn")) {
|
522
|
+
resources[0].src = 'https://unpkg.com/@popperjs/core@2.11.8/dist/umd/popper.min.js';
|
523
|
+
resources[4].href = 'https://unpkg.com/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css';
|
524
|
+
}
|
524
525
|
let loadResources = async () => {
|
525
526
|
let promises = resources.map(resource => {
|
526
527
|
return new Promise((resolve, reject) => {
|
@@ -1133,7 +1134,13 @@ if (location.host != "www.xmoj.tech") {
|
|
1133
1134
|
{"ID": "CompareSource", "Type": "A", "Name": "比较代码"},
|
1134
1135
|
{"ID": "BBSPopup", "Type": "A", "Name": "讨论提醒"},
|
1135
1136
|
{"ID": "MessagePopup", "Type": "A", "Name": "短消息提醒"},
|
1136
|
-
{"ID": "DebugMode", "Type": "A", "Name": "调试模式(仅供开发者使用)"}
|
1137
|
+
{"ID": "DebugMode", "Type": "A", "Name": "调试模式(仅供开发者使用)"},
|
1138
|
+
{
|
1139
|
+
"ID": "SuperDebug",
|
1140
|
+
"Type": "A",
|
1141
|
+
"Name": "本地调试模式(仅供开发者使用) (If you don't know what this does, don't enable it!)"
|
1142
|
+
},
|
1143
|
+
{"ID": "UnpkgCdn", "Type": "A", "Name": "使用 unpkg CDN (不建议使用)"},
|
1137
1144
|
]));
|
1138
1145
|
let UtilitiesCardFooter = document.createElement("div");
|
1139
1146
|
UtilitiesCardFooter.className = "card-footer text-muted";
|