xmoj-script 1.1.43 → 1.1.44
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/.idea/vcs.xml +1 -0
- package/Update.json +11 -0
- package/XMOJ.user.js +228 -341
- package/package.json +1 -1
package/.idea/vcs.xml
CHANGED
package/Update.json
CHANGED
@@ -1287,6 +1287,17 @@
|
|
1287
1287
|
}
|
1288
1288
|
],
|
1289
1289
|
"Notes": "No release notes were provided for this release."
|
1290
|
+
},
|
1291
|
+
"1.1.44": {
|
1292
|
+
"UpdateDate": 1707803296933,
|
1293
|
+
"Prerelease": true,
|
1294
|
+
"UpdateContents": [
|
1295
|
+
{
|
1296
|
+
"PR": 449,
|
1297
|
+
"Description": "regression!"
|
1298
|
+
}
|
1299
|
+
],
|
1300
|
+
"Notes": "No release notes were provided for this release."
|
1290
1301
|
}
|
1291
1302
|
}
|
1292
1303
|
}
|
package/XMOJ.user.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
// ==UserScript==
|
2
2
|
// @name XMOJ
|
3
|
-
// @version 1.1.
|
3
|
+
// @version 1.1.44
|
4
4
|
// @description XMOJ增强脚本
|
5
5
|
// @author @XMOJ-Script-dev, @langningchen and the community
|
6
6
|
// @namespace https://github/langningchen
|
@@ -12,6 +12,7 @@
|
|
12
12
|
// @require https://cdn.bootcdn.net/ajax/libs/codemirror/6.65.7/addon/merge/merge.js
|
13
13
|
// @require https://cdn.bootcdn.net/ajax/libs/diff_match_patch/20121119/diff_match_patch_uncompressed.js
|
14
14
|
// @require https://cdn.bootcdn.net/ajax/libs/dompurify/3.0.2/purify.min.js
|
15
|
+
// @require https://cdn.bootcdn.net/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js
|
15
16
|
// @require https://cdn.bootcdn.net/ajax/libs/marked/4.3.0/marked.min.js
|
16
17
|
// @grant GM_registerMenuCommand
|
17
18
|
// @grant GM_xmlhttpRequest
|
@@ -24,6 +25,7 @@
|
|
24
25
|
// @connect api.xmoj-bbs.tech
|
25
26
|
// @connect challenges.cloudflare.com
|
26
27
|
// @connect cppinsights.io
|
28
|
+
// @connect cdn.bootcdn.net
|
27
29
|
// @connect 127.0.0.1
|
28
30
|
// @license GPL
|
29
31
|
// @icon data:image/x-icon;base64,AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQDmOhEA5gwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQDlGhEA5acSAObREQDl5xIA5WgRAOYEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgDoAhIA5moSAOW9EgDlNBEA5WYSAOb/EgDm/xEA5tcRAOY8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEA5TISAOa5EgDmaiELxR4jDcNSEQDlZhIA5v8SAOb/EgDm/xEA5pEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAOUUEQDmnxYD3R4iDcN4IgzC8yMNwpsRAOVmEgDm/xIA5v8SAOb/EQDmkQAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIwzCDCMNwn4iDMPzIgzCxyINw8MjDcNcHA7GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACIMwhgiDcJ0Ig3CEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////+P////Y////eH///sh///8If//8CF//8AhP/+AIQ/+ACEH/AAhA/wMIYP8PCHD/Dwhw/w8IcP8PCHD/Dwhw/w8IcP8PCHD/Bwhg/wMIAP+DCAH/wwgD//MID//7CD///wh///8J////Dn///w3////H////////////8=
|
@@ -35,7 +37,6 @@
|
|
35
37
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
36
38
|
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
37
39
|
*/
|
38
|
-
|
39
40
|
const CaptchaSiteKey = "0x4AAAAAAALBT58IhyDViNmv";
|
40
41
|
const AdminUserList = ["zhuchenrui2", "shanwenxiao", "admin", "zhouyiqing", "shihongxi"];
|
41
42
|
|
@@ -90,8 +91,7 @@ let RenderMathJax = async () => {
|
|
90
91
|
MathJax.typeset();
|
91
92
|
};
|
92
93
|
let GetUserInfo = async (Username) => {
|
93
|
-
if (localStorage.getItem("UserScript-User-" + Username + "-UserRating") != null &&
|
94
|
-
new Date().getTime() - parseInt(localStorage.getItem("UserScript-User-" + Username + "-LastUpdateTime")) < 1000 * 60 * 60 * 24) {
|
94
|
+
if (localStorage.getItem("UserScript-User-" + Username + "-UserRating") != null && new Date().getTime() - parseInt(localStorage.getItem("UserScript-User-" + Username + "-LastUpdateTime")) < 1000 * 60 * 60 * 24) {
|
95
95
|
return {
|
96
96
|
"Rating": localStorage.getItem("UserScript-User-" + Username + "-UserRating"),
|
97
97
|
"EmailHash": localStorage.getItem("UserScript-User-" + Username + "-EmailHash")
|
@@ -104,8 +104,7 @@ let GetUserInfo = async (Username) => {
|
|
104
104
|
return null;
|
105
105
|
}
|
106
106
|
const ParsedDocument = new DOMParser().parseFromString(Response, "text/html");
|
107
|
-
let Rating = (parseInt(ParsedDocument.querySelector("#statics > tbody > tr:nth-child(4) > td:nth-child(2)").innerText.trim()) /
|
108
|
-
parseInt(ParsedDocument.querySelector("#statics > tbody > tr:nth-child(3) > td:nth-child(2)").innerText.trim())).toFixed(3) * 1000;
|
107
|
+
let Rating = (parseInt(ParsedDocument.querySelector("#statics > tbody > tr:nth-child(4) > td:nth-child(2)").innerText.trim()) / parseInt(ParsedDocument.querySelector("#statics > tbody > tr:nth-child(3) > td:nth-child(2)").innerText.trim())).toFixed(3) * 1000;
|
109
108
|
let Temp = ParsedDocument.querySelector("#statics > tbody").children;
|
110
109
|
let Email = Temp[Temp.length - 1].children[1].innerText.trim();
|
111
110
|
let EmailHash = CryptoJS.MD5(Email).toString();
|
@@ -117,8 +116,7 @@ let GetUserInfo = async (Username) => {
|
|
117
116
|
}
|
118
117
|
localStorage.setItem("UserScript-User-" + Username + "-LastUpdateTime", new Date().getTime());
|
119
118
|
return {
|
120
|
-
"Rating": Rating,
|
121
|
-
"EmailHash": EmailHash
|
119
|
+
"Rating": Rating, "EmailHash": EmailHash
|
122
120
|
}
|
123
121
|
});
|
124
122
|
};
|
@@ -132,8 +130,7 @@ let GetUserInfo = async (Username) => {
|
|
132
130
|
* @property {string} Content - The content of the badge.
|
133
131
|
*/
|
134
132
|
let GetUserBadge = async (Username) => {
|
135
|
-
if (localStorage.getItem("UserScript-User-" + Username + "-Badge-LastUpdateTime") != null &&
|
136
|
-
new Date().getTime() - parseInt(localStorage.getItem("UserScript-User-" + Username + "-Badge-LastUpdateTime")) < 1000 * 60 * 60 * 24) {
|
133
|
+
if (localStorage.getItem("UserScript-User-" + Username + "-Badge-LastUpdateTime") != null && new Date().getTime() - parseInt(localStorage.getItem("UserScript-User-" + Username + "-Badge-LastUpdateTime")) < 1000 * 60 * 60 * 24) {
|
137
134
|
return {
|
138
135
|
"BackgroundColor": localStorage.getItem("UserScript-User-" + Username + "-Badge-BackgroundColor"),
|
139
136
|
"Color": localStorage.getItem("UserScript-User-" + Username + "-Badge-Color"),
|
@@ -160,9 +157,7 @@ let GetUserBadge = async (Username) => {
|
|
160
157
|
localStorage.setItem("UserScript-User-" + Username + "-Badge-Content", Content);
|
161
158
|
localStorage.setItem("UserScript-User-" + Username + "-Badge-LastUpdateTime", String(new Date().getTime()));
|
162
159
|
return {
|
163
|
-
"BackgroundColor": BackgroundColor,
|
164
|
-
"Color": Color,
|
165
|
-
"Content": Content
|
160
|
+
"BackgroundColor": BackgroundColor, "Color": Color, "Content": Content
|
166
161
|
}
|
167
162
|
}
|
168
163
|
};
|
@@ -240,9 +235,7 @@ let SecondsToString = (InputSeconds) => {
|
|
240
235
|
let Hours = Math.floor(InputSeconds / 3600);
|
241
236
|
let Minutes = Math.floor((InputSeconds % 3600) / 60);
|
242
237
|
let Seconds = InputSeconds % 60;
|
243
|
-
return (Hours < 10 ? "0" : "") + Hours + ":" +
|
244
|
-
(Minutes < 10 ? "0" : "") + Minutes + ":" +
|
245
|
-
(Seconds < 10 ? "0" : "") + Seconds;
|
238
|
+
return (Hours < 10 ? "0" : "") + Hours + ":" + (Minutes < 10 ? "0" : "") + Minutes + ":" + (Seconds < 10 ? "0" : "") + Seconds;
|
246
239
|
}
|
247
240
|
/**
|
248
241
|
* Converts a string in the format "hh:mm:ss" to the equivalent number of seconds.
|
@@ -251,9 +244,7 @@ let SecondsToString = (InputSeconds) => {
|
|
251
244
|
*/
|
252
245
|
let StringToSeconds = (InputString) => {
|
253
246
|
let SplittedString = InputString.split(":");
|
254
|
-
return parseInt(SplittedString[0]) * 60 * 60 +
|
255
|
-
parseInt(SplittedString[1]) * 60 +
|
256
|
-
parseInt(SplittedString[2]);
|
247
|
+
return parseInt(SplittedString[0]) * 60 * 60 + parseInt(SplittedString[1]) * 60 + parseInt(SplittedString[2]);
|
257
248
|
}
|
258
249
|
/**
|
259
250
|
* Converts a memory size in bytes to a human-readable string representation.
|
@@ -342,12 +333,8 @@ let RequestAPI = (Action, Data, CallBack) => {
|
|
342
333
|
}
|
343
334
|
let PostData = {
|
344
335
|
"Authentication": {
|
345
|
-
"SessionID": Session,
|
346
|
-
|
347
|
-
},
|
348
|
-
"Data": Data,
|
349
|
-
"Version": GM_info.script.version,
|
350
|
-
"DebugMode": UtilityEnabled("DebugMode")
|
336
|
+
"SessionID": Session, "Username": CurrentUsername,
|
337
|
+
}, "Data": Data, "Version": GM_info.script.version, "DebugMode": UtilityEnabled("DebugMode")
|
351
338
|
};
|
352
339
|
let DataString = JSON.stringify(PostData);
|
353
340
|
GM_xmlhttpRequest({
|
@@ -363,9 +350,7 @@ let RequestAPI = (Action, Data, CallBack) => {
|
|
363
350
|
} catch (Error) {
|
364
351
|
console.log(Response.responseText);
|
365
352
|
CallBack({
|
366
|
-
"Success": false,
|
367
|
-
"Message": "JSON解析错误:" + Error,
|
368
|
-
"Data": null
|
353
|
+
"Success": false, "Message": "JSON解析错误:" + Error, "Data": null
|
369
354
|
});
|
370
355
|
}
|
371
356
|
}
|
@@ -417,12 +402,7 @@ async function main() {
|
|
417
402
|
document.querySelector("body > div > div.jumbotron").className = "mt-3";
|
418
403
|
}
|
419
404
|
|
420
|
-
if (UtilityEnabled("AutoLogin") &&
|
421
|
-
document.querySelector("#profile") != null &&
|
422
|
-
document.querySelector("#profile").innerHTML == "登录" &&
|
423
|
-
location.pathname != "/login.php" &&
|
424
|
-
location.pathname != "/loginpage.php" &&
|
425
|
-
location.pathname != "/lostpassword.php") {
|
405
|
+
if (UtilityEnabled("AutoLogin") && document.querySelector("#profile") != null && document.querySelector("#profile").innerHTML == "登录" && location.pathname != "/login.php" && location.pathname != "/loginpage.php" && location.pathname != "/lostpassword.php") {
|
426
406
|
localStorage.setItem("UserScript-LastPage", location.pathname + location.search);
|
427
407
|
location.href = "https://www.xmoj.tech/loginpage.php";
|
428
408
|
}
|
@@ -450,10 +430,7 @@ async function main() {
|
|
450
430
|
}
|
451
431
|
});
|
452
432
|
if (UtilityEnabled("ReplaceLinks")) {
|
453
|
-
document.body.innerHTML =
|
454
|
-
String(document.body.innerHTML).replaceAll(
|
455
|
-
/\[<a href="([^"]*)">([^<]*)<\/a>\]/g,
|
456
|
-
"<button onclick=\"location.href='$1'\" class=\"btn btn-outline-secondary\">$2</button>");
|
433
|
+
document.body.innerHTML = String(document.body.innerHTML).replaceAll(/\[<a href="([^"]*)">([^<]*)<\/a>\]/g, "<button onclick=\"location.href='$1'\" class=\"btn btn-outline-secondary\">$2</button>");
|
457
434
|
}
|
458
435
|
if (UtilityEnabled("ReplaceXM")) {
|
459
436
|
document.body.innerHTML = String(document.body.innerHTML).replaceAll("我", "高老师");
|
@@ -488,33 +465,27 @@ async function main() {
|
|
488
465
|
} else {
|
489
466
|
document.querySelector("html").setAttribute("data-bs-theme", "light");
|
490
467
|
}
|
491
|
-
var resources = [
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
{
|
513
|
-
type: 'script',
|
514
|
-
src: 'https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0-alpha3/js/bootstrap.bundle.min.js',
|
515
|
-
isModule: true
|
516
|
-
}
|
517
|
-
];
|
468
|
+
var resources = [{
|
469
|
+
type: 'link',
|
470
|
+
href: 'https://cdn.bootcdn.net/ajax/libs/codemirror/6.65.7/codemirror.min.css',
|
471
|
+
rel: 'stylesheet'
|
472
|
+
}, {
|
473
|
+
type: 'link',
|
474
|
+
href: 'https://cdn.bootcdn.net/ajax/libs/codemirror/6.65.7/theme/darcula.min.css',
|
475
|
+
rel: 'stylesheet'
|
476
|
+
}, {
|
477
|
+
type: 'link',
|
478
|
+
href: 'https://cdn.bootcdn.net/ajax/libs/codemirror/6.65.7/addon/merge/merge.min.css',
|
479
|
+
rel: 'stylesheet'
|
480
|
+
}, {
|
481
|
+
type: 'link',
|
482
|
+
href: 'https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0-alpha3/css/bootstrap.min.css',
|
483
|
+
rel: 'stylesheet'
|
484
|
+
}, {
|
485
|
+
type: 'script',
|
486
|
+
src: 'https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0-alpha3/js/bootstrap.bundle.min.js',
|
487
|
+
isModule: true
|
488
|
+
}];
|
518
489
|
if (UtilityEnabled("UnpkgCdn")) {
|
519
490
|
resources[3].href = 'https://unpkg.com/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css';
|
520
491
|
resources[4].src = 'https://unpkg.com/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js';
|
@@ -686,24 +657,16 @@ async function main() {
|
|
686
657
|
let Hours = CurrentDate.getHours();
|
687
658
|
let Minutes = CurrentDate.getMinutes();
|
688
659
|
let Seconds = CurrentDate.getSeconds();
|
689
|
-
document.getElementById("nowdate").innerHTML =
|
690
|
-
Year + "-" +
|
691
|
-
(Month < 10 ? "0" : "") + Month + "-" +
|
692
|
-
(_Date < 10 ? "0" : "") + _Date + " " +
|
693
|
-
(Hours < 10 ? "0" : "") + Hours + ":" +
|
694
|
-
(Minutes < 10 ? "0" : "") + Minutes + ":" +
|
695
|
-
(Seconds < 10 ? "0" : "") + Seconds;
|
660
|
+
document.getElementById("nowdate").innerHTML = Year + "-" + (Month < 10 ? "0" : "") + Month + "-" + (_Date < 10 ? "0" : "") + _Date + " " + (Hours < 10 ? "0" : "") + Hours + ":" + (Minutes < 10 ? "0" : "") + Minutes + ":" + (Seconds < 10 ? "0" : "") + Seconds;
|
696
661
|
} catch (Error) {
|
697
662
|
}
|
698
663
|
|
699
664
|
if (UtilityEnabled("ResetType")) {
|
700
|
-
if (document.querySelector("#profile") != undefined &&
|
701
|
-
document.querySelector("#profile").innerHTML == "登录") {
|
665
|
+
if (document.querySelector("#profile") != undefined && document.querySelector("#profile").innerHTML == "登录") {
|
702
666
|
if (document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul").childNodes.length == 3) {
|
703
667
|
document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul").childNodes[3].remove();
|
704
668
|
}
|
705
|
-
} else if (document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul > li:nth-child(3) > a > span") != undefined &&
|
706
|
-
document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul > li:nth-child(3) > a > span").innerText != "个人中心") {
|
669
|
+
} else if (document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul > li:nth-child(3) > a > span") != undefined && document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul > li:nth-child(3) > a > span").innerText != "个人中心") {
|
707
670
|
let PopupUL = document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul");
|
708
671
|
PopupUL.innerHTML = `<li class="dropdown-item">修改帐号</li>
|
709
672
|
<li class="dropdown-item">个人中心</li>
|
@@ -750,10 +713,7 @@ async function main() {
|
|
750
713
|
let Hour = CurrentDate.getUTCHours();
|
751
714
|
let Minute = CurrentDate.getUTCMinutes();
|
752
715
|
let Second = CurrentDate.getUTCSeconds();
|
753
|
-
Temp[i].innerHTML = (Day !== 0 ? Day + "天" : "") +
|
754
|
-
(Hour !== 0 ? (Hour < 10 ? "0" : "") + Hour + "小时" : "") +
|
755
|
-
(Minute !== 0 ? (Minute < 10 ? "0" : "") + Minute + "分" : "") +
|
756
|
-
(Second !== 0 ? (Second < 10 ? "0" : "") + Second + "秒" : "");
|
716
|
+
Temp[i].innerHTML = (Day !== 0 ? Day + "天" : "") + (Hour !== 0 ? (Hour < 10 ? "0" : "") + Hour + "小时" : "") + (Minute !== 0 ? (Minute < 10 ? "0" : "") + Minute + "分" : "") + (Second !== 0 ? (Second < 10 ? "0" : "") + Second + "秒" : "");
|
757
717
|
}
|
758
718
|
}
|
759
719
|
}, 100);
|
@@ -851,10 +811,7 @@ async function main() {
|
|
851
811
|
let UpdateDataCardListItem = document.createElement("li");
|
852
812
|
UpdateDataCardList.appendChild(UpdateDataCardListItem);
|
853
813
|
UpdateDataCardListItem.className = "list-group-item";
|
854
|
-
UpdateDataCardListItem.innerHTML =
|
855
|
-
"(<a href=\"https://github.com/XMOJ-Script-dev/XMOJ-Script/pull/" + Data.UpdateContents[j].PR + "\" target=\"_blank\">" +
|
856
|
-
"#" + Data.UpdateContents[j].PR + "</a>) " +
|
857
|
-
Data.UpdateContents[j].Description;
|
814
|
+
UpdateDataCardListItem.innerHTML = "(<a href=\"https://github.com/XMOJ-Script-dev/XMOJ-Script/pull/" + Data.UpdateContents[j].PR + "\" target=\"_blank\">" + "#" + Data.UpdateContents[j].PR + "</a>) " + Data.UpdateContents[j].Description;
|
858
815
|
}
|
859
816
|
let UpdateDataCardLink = document.createElement("a");
|
860
817
|
UpdateDataCardBody.appendChild(UpdateDataCardLink);
|
@@ -1080,68 +1037,116 @@ async function main() {
|
|
1080
1037
|
}
|
1081
1038
|
return List;
|
1082
1039
|
};
|
1083
|
-
UtilitiesCardBody.appendChild(CreateList([
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
{"ID": "
|
1096
|
-
|
1097
|
-
{"ID": "ImproveACRate", "Type": "A", "Name": "自动提交已AC题目以提高AC率"},
|
1098
|
-
{"ID": "AutoO2", "Type": "F", "Name": "代码提交界面自动选择O2优化"},
|
1099
|
-
{
|
1100
|
-
"ID": "Beautify", "Type": "F", "Name": "美化界面", "Children": [
|
1101
|
-
{"ID": "NewBootstrap", "Type": "F", "Name": "使用新版的Bootstrap样式库*"},
|
1102
|
-
{"ID": "ResetType", "Type": "F", "Name": "重新排版*"},
|
1103
|
-
{"ID": "AddColorText", "Type": "A", "Name": "增加彩色文字"},
|
1104
|
-
{"ID": "AddUnits", "Type": "A", "Name": "状态界面内存与耗时添加单位"},
|
1105
|
-
{"ID": "DarkMode", "Type": "A", "Name": "使用暗色模式"},
|
1106
|
-
{"ID": "AddAnimation", "Type": "A", "Name": "增加动画"},
|
1107
|
-
{"ID": "ReplaceYN", "Type": "F", "Name": "题目前对错的Y和N替换为勾和叉"},
|
1108
|
-
{"ID": "RemoveAlerts", "Type": "D", "Name": "去除多余反复的提示"},
|
1109
|
-
{"ID": "Translate", "Type": "F", "Name": "统一使用中文,翻译了部分英文*"},
|
1110
|
-
{"ID": "ReplaceLinks", "Type": "F", "Name": "将网站中所有以方括号包装的链接替换为按钮"},
|
1111
|
-
{"ID": "RemoveUseless", "Type": "D", "Name": "删去无法使用的功能*"},
|
1112
|
-
{
|
1113
|
-
"ID": "ReplaceXM",
|
1114
|
-
"Type": "F",
|
1115
|
-
"Name": "将网站中所有“小明”和“我”关键字替换为“高老师”,所有“小红”替换为“徐师娘”,所有“小粉”替换为“彩虹”,所有“下海”、“海上”替换为“上海”"
|
1116
|
-
}
|
1117
|
-
]
|
1118
|
-
},
|
1119
|
-
{"ID": "AutoLogin", "Type": "A", "Name": "在需要登录的界面自动跳转到登陆界面"},
|
1120
|
-
{"ID": "SavePassword", "Type": "A", "Name": "自动保存用户名与密码,免去每次手动输入密码的繁琐"},
|
1121
|
-
{"ID": "CopySamples", "Type": "F", "Name": "题目界面测试样例有时复制无效"},
|
1122
|
-
{"ID": "RefreshSolution", "Type": "F", "Name": "状态页面结果自动刷新每次只能刷新一个"},
|
1123
|
-
{"ID": "CopyMD", "Type": "A", "Name": "复制题目或题解内容"},
|
1124
|
-
{"ID": "OpenAllProblem", "Type": "A", "Name": "比赛题目界面一键打开所有题目"},
|
1125
|
-
{
|
1126
|
-
"ID": "CheckCode", "Type": "A", "Name": "提交代码前对代码进行检查", "Children": [
|
1127
|
-
{"ID": "IOFile", "Type": "A", "Name": "是否使用了文件输入输出(如果需要使用)"},
|
1128
|
-
{"ID": "CompileError", "Type": "A", "Name": "是否有编译错误"}
|
1129
|
-
]
|
1130
|
-
},
|
1131
|
-
{"ID": "ExportACCode", "Type": "F", "Name": "导出AC代码每一道题目一个文件"},
|
1132
|
-
{"ID": "LoginFailed", "Type": "F", "Name": "修复登录后跳转失败*"},
|
1133
|
-
{"ID": "NewDownload", "Type": "A", "Name": "下载页面增加下载内容"},
|
1134
|
-
{"ID": "CompareSource", "Type": "A", "Name": "比较代码"},
|
1135
|
-
{"ID": "BBSPopup", "Type": "A", "Name": "讨论提醒"},
|
1136
|
-
{"ID": "MessagePopup", "Type": "A", "Name": "短消息提醒"},
|
1137
|
-
{"ID": "DebugMode", "Type": "A", "Name": "调试模式(仅供开发者使用)"},
|
1138
|
-
{
|
1139
|
-
"ID": "SuperDebug",
|
1040
|
+
UtilitiesCardBody.appendChild(CreateList([{
|
1041
|
+
"ID": "ACMRank",
|
1042
|
+
"Type": "A",
|
1043
|
+
"Name": "比赛ACM排名,并且能下载ACM排名"
|
1044
|
+
}, {"ID": "Discussion", "Type": "F", "Name": "恢复讨论与短消息功能"}, {
|
1045
|
+
"ID": "MoreSTD",
|
1046
|
+
"Type": "F",
|
1047
|
+
"Name": "查看到更多标程"
|
1048
|
+
}, {
|
1049
|
+
"ID": "StudyMode",
|
1050
|
+
"Type": "A",
|
1051
|
+
"Name": "学术模式",
|
1052
|
+
"Children": [{"ID": "ApplyData", "Type": "A", "Name": "获取数据功能"}, {
|
1053
|
+
"ID": "AutoCheat",
|
1140
1054
|
"Type": "A",
|
1141
|
-
"Name": "
|
1142
|
-
}
|
1143
|
-
|
1144
|
-
|
1055
|
+
"Name": "自动提交当年代码"
|
1056
|
+
}]
|
1057
|
+
}, {"ID": "Rating", "Type": "A", "Name": "添加用户评分和用户名颜色"}, {
|
1058
|
+
"ID": "AutoRefresh",
|
1059
|
+
"Type": "A",
|
1060
|
+
"Name": "比赛列表、比赛排名界面自动刷新"
|
1061
|
+
}, {
|
1062
|
+
"ID": "AutoCountdown",
|
1063
|
+
"Type": "A",
|
1064
|
+
"Name": "比赛列表等界面的时间自动倒计时"
|
1065
|
+
}, {"ID": "DownloadPlayback", "Type": "A", "Name": "回放视频增加下载功能"}, {
|
1066
|
+
"ID": "ImproveACRate",
|
1067
|
+
"Type": "A",
|
1068
|
+
"Name": "自动提交已AC题目以提高AC率"
|
1069
|
+
}, {"ID": "AutoO2", "Type": "F", "Name": "代码提交界面自动选择O2优化"}, {
|
1070
|
+
"ID": "Beautify",
|
1071
|
+
"Type": "F",
|
1072
|
+
"Name": "美化界面",
|
1073
|
+
"Children": [{
|
1074
|
+
"ID": "NewBootstrap",
|
1075
|
+
"Type": "F",
|
1076
|
+
"Name": "使用新版的Bootstrap样式库*"
|
1077
|
+
}, {"ID": "ResetType", "Type": "F", "Name": "重新排版*"}, {
|
1078
|
+
"ID": "AddColorText",
|
1079
|
+
"Type": "A",
|
1080
|
+
"Name": "增加彩色文字"
|
1081
|
+
}, {"ID": "AddUnits", "Type": "A", "Name": "状态界面内存与耗时添加单位"}, {
|
1082
|
+
"ID": "DarkMode",
|
1083
|
+
"Type": "A",
|
1084
|
+
"Name": "使用暗色模式"
|
1085
|
+
}, {"ID": "AddAnimation", "Type": "A", "Name": "增加动画"}, {
|
1086
|
+
"ID": "ReplaceYN",
|
1087
|
+
"Type": "F",
|
1088
|
+
"Name": "题目前对错的Y和N替换为勾和叉"
|
1089
|
+
}, {"ID": "RemoveAlerts", "Type": "D", "Name": "去除多余反复的提示"}, {
|
1090
|
+
"ID": "Translate",
|
1091
|
+
"Type": "F",
|
1092
|
+
"Name": "统一使用中文,翻译了部分英文*"
|
1093
|
+
}, {
|
1094
|
+
"ID": "ReplaceLinks",
|
1095
|
+
"Type": "F",
|
1096
|
+
"Name": "将网站中所有以方括号包装的链接替换为按钮"
|
1097
|
+
}, {"ID": "RemoveUseless", "Type": "D", "Name": "删去无法使用的功能*"}, {
|
1098
|
+
"ID": "ReplaceXM",
|
1099
|
+
"Type": "F",
|
1100
|
+
"Name": "将网站中所有“小明”和“我”关键字替换为“高老师”,所有“小红”替换为“徐师娘”,所有“小粉”替换为“彩虹”,所有“下海”、“海上”替换为“上海”"
|
1101
|
+
}]
|
1102
|
+
}, {
|
1103
|
+
"ID": "AutoLogin",
|
1104
|
+
"Type": "A",
|
1105
|
+
"Name": "在需要登录的界面自动跳转到登陆界面"
|
1106
|
+
}, {
|
1107
|
+
"ID": "SavePassword",
|
1108
|
+
"Type": "A",
|
1109
|
+
"Name": "自动保存用户名与密码,免去每次手动输入密码的繁琐"
|
1110
|
+
}, {
|
1111
|
+
"ID": "CopySamples",
|
1112
|
+
"Type": "F",
|
1113
|
+
"Name": "题目界面测试样例有时复制无效"
|
1114
|
+
}, {
|
1115
|
+
"ID": "RefreshSolution",
|
1116
|
+
"Type": "F",
|
1117
|
+
"Name": "状态页面结果自动刷新每次只能刷新一个"
|
1118
|
+
}, {"ID": "CopyMD", "Type": "A", "Name": "复制题目或题解内容"}, {
|
1119
|
+
"ID": "OpenAllProblem",
|
1120
|
+
"Type": "A",
|
1121
|
+
"Name": "比赛题目界面一键打开所有题目"
|
1122
|
+
}, {
|
1123
|
+
"ID": "CheckCode",
|
1124
|
+
"Type": "A",
|
1125
|
+
"Name": "提交代码前对代码进行检查",
|
1126
|
+
"Children": [{
|
1127
|
+
"ID": "IOFile",
|
1128
|
+
"Type": "A",
|
1129
|
+
"Name": "是否使用了文件输入输出(如果需要使用)"
|
1130
|
+
}, {"ID": "CompileError", "Type": "A", "Name": "是否有编译错误"}]
|
1131
|
+
}, {
|
1132
|
+
"ID": "ExportACCode",
|
1133
|
+
"Type": "F",
|
1134
|
+
"Name": "导出AC代码每一道题目一个文件"
|
1135
|
+
}, {"ID": "LoginFailed", "Type": "F", "Name": "修复登录后跳转失败*"}, {
|
1136
|
+
"ID": "NewDownload",
|
1137
|
+
"Type": "A",
|
1138
|
+
"Name": "下载页面增加下载内容"
|
1139
|
+
}, {"ID": "CompareSource", "Type": "A", "Name": "比较代码"}, {
|
1140
|
+
"ID": "BBSPopup",
|
1141
|
+
"Type": "A",
|
1142
|
+
"Name": "讨论提醒"
|
1143
|
+
}, {"ID": "MessagePopup", "Type": "A", "Name": "短消息提醒"}, {
|
1144
|
+
"ID": "DebugMode",
|
1145
|
+
"Type": "A",
|
1146
|
+
"Name": "调试模式(仅供开发者使用)"
|
1147
|
+
}, {
|
1148
|
+
"ID": "SuperDebug", "Type": "A", "Name": "本地调试模式(仅供开发者使用) (未经授权的擅自开启将导致大部分功能不可用!)"
|
1149
|
+
}, {"ID": "UnpkgCdn", "Type": "A", "Name": "使用 unpkg CDN (不建议使用)"},]));
|
1145
1150
|
let UtilitiesCardFooter = document.createElement("div");
|
1146
1151
|
UtilitiesCardFooter.className = "card-footer text-muted";
|
1147
1152
|
UtilitiesCardFooter.innerText = "* 不建议关闭,可能会导致系统不稳定、界面错乱、功能缺失等问题\n绿色:增加功能 黄色:修改功能 红色:删除功能";
|
@@ -1238,15 +1243,11 @@ async function main() {
|
|
1238
1243
|
|
1239
1244
|
let Temp = document.querySelector("#problemset").rows;
|
1240
1245
|
for (let i = 1; i < Temp.length; i++) {
|
1241
|
-
localStorage.setItem("UserScript-Problem-" + Temp[i].children[1].innerText + "-Name",
|
1242
|
-
Temp[i].children[2].innerText);
|
1246
|
+
localStorage.setItem("UserScript-Problem-" + Temp[i].children[1].innerText + "-Name", Temp[i].children[2].innerText);
|
1243
1247
|
}
|
1244
1248
|
} else if (location.pathname == "/problem.php") {
|
1245
1249
|
if (SearchParams.get("cid") != null) {
|
1246
|
-
document.getElementsByTagName("h2")[0].innerHTML += " (" +
|
1247
|
-
localStorage.getItem("UserScript-Contest-" + SearchParams.get("cid") +
|
1248
|
-
"-Problem-" + SearchParams.get("pid") + "-PID") +
|
1249
|
-
")";
|
1250
|
+
document.getElementsByTagName("h2")[0].innerHTML += " (" + localStorage.getItem("UserScript-Contest-" + SearchParams.get("cid") + "-Problem-" + SearchParams.get("pid") + "-PID") + ")";
|
1250
1251
|
}
|
1251
1252
|
if (document.querySelector("body > div > div.mt-3 > h2") != null) {
|
1252
1253
|
document.querySelector("body > div > div.mt-3").innerHTML = "没有此题目或题目对你不可见";
|
@@ -1254,8 +1255,7 @@ async function main() {
|
|
1254
1255
|
location.href = "https://www.xmoj.tech/problemset.php";
|
1255
1256
|
}, 1000);
|
1256
1257
|
} else {
|
1257
|
-
let PID = localStorage.getItem("UserScript-Contest-" + SearchParams.get("cid") +
|
1258
|
-
"-Problem-" + SearchParams.get("pid") + "-PID");
|
1258
|
+
let PID = localStorage.getItem("UserScript-Contest-" + SearchParams.get("cid") + "-Problem-" + SearchParams.get("pid") + "-PID");
|
1259
1259
|
|
1260
1260
|
document.querySelector("body > div > div.mt-3 > center").lastChild.style.marginLeft = "10px";
|
1261
1261
|
//修复提交按钮
|
@@ -1530,10 +1530,7 @@ async function main() {
|
|
1530
1530
|
},
|
1531
1531
|
"referrer": "https://www.xmoj.tech/submitpage.php?id=" + PID,
|
1532
1532
|
"method": "POST",
|
1533
|
-
"body": "id=" + PID + "&" +
|
1534
|
-
"language=1&" +
|
1535
|
-
"source=" + encodeURIComponent(Code) + "&" +
|
1536
|
-
"enable_O2=on"
|
1533
|
+
"body": "id=" + PID + "&" + "language=1&" + "source=" + encodeURIComponent(Code) + "&" + "enable_O2=on"
|
1537
1534
|
});
|
1538
1535
|
Count++;
|
1539
1536
|
}, 1000);
|
@@ -1563,8 +1560,7 @@ async function main() {
|
|
1563
1560
|
SolutionIDs.push(SID);
|
1564
1561
|
if (UtilityEnabled("ResetType")) {
|
1565
1562
|
Temp[i].childNodes[0].remove();
|
1566
|
-
Temp[i].childNodes[0].innerHTML = "<a href=\"https://www.xmoj.tech/showsource.php?id=" + SID + "\">" + SID + "</a> " +
|
1567
|
-
"<a href=\"" + Temp[i].childNodes[6].children[1].href + "\">重交</a>";
|
1563
|
+
Temp[i].childNodes[0].innerHTML = "<a href=\"https://www.xmoj.tech/showsource.php?id=" + SID + "\">" + SID + "</a> " + "<a href=\"" + Temp[i].childNodes[6].children[1].href + "\">重交</a>";
|
1568
1564
|
Temp[i].childNodes[1].remove();
|
1569
1565
|
Temp[i].childNodes[1].children[0].removeAttribute("class");
|
1570
1566
|
Temp[i].childNodes[3].childNodes[0].innerText = SizeToStringSize(Temp[i].childNodes[3].childNodes[0].innerText);
|
@@ -1574,13 +1570,10 @@ async function main() {
|
|
1574
1570
|
Temp[i].childNodes[9].innerText = (Temp[i].childNodes[9].innerText == "" ? "否" : "是");
|
1575
1571
|
}
|
1576
1572
|
if (SearchParams.get("cid") === null) {
|
1577
|
-
localStorage.setItem("UserScript-Solution-" + SID + "-Problem",
|
1578
|
-
Temp[i].childNodes[1].innerText);
|
1573
|
+
localStorage.setItem("UserScript-Solution-" + SID + "-Problem", Temp[i].childNodes[1].innerText);
|
1579
1574
|
} else {
|
1580
|
-
localStorage.setItem("UserScript-Solution-" + SID + "-Contest",
|
1581
|
-
|
1582
|
-
localStorage.setItem("UserScript-Solution-" + SID + "-PID-Contest",
|
1583
|
-
Temp[i].childNodes[1].innerText.charAt(0));
|
1575
|
+
localStorage.setItem("UserScript-Solution-" + SID + "-Contest", SearchParams.get("cid"));
|
1576
|
+
localStorage.setItem("UserScript-Solution-" + SID + "-PID-Contest", Temp[i].childNodes[1].innerText.charAt(0));
|
1584
1577
|
}
|
1585
1578
|
}
|
1586
1579
|
|
@@ -1648,8 +1641,7 @@ async function main() {
|
|
1648
1641
|
}, 500);
|
1649
1642
|
TempHTML += "<img style=\"margin-left: 5px\" height=\"18\" width=\"18\" src=\"image/loader.gif\">";
|
1650
1643
|
} else if (ResponseData[0] == 4 && UtilityEnabled("UploadStd")) {
|
1651
|
-
if (SearchParams.get("cid") == null)
|
1652
|
-
CurrentRow.cells[1].innerText;
|
1644
|
+
if (SearchParams.get("cid") == null) CurrentRow.cells[1].innerText;
|
1653
1645
|
let Std = StdList.find((Element) => {
|
1654
1646
|
return Element == Number(PID);
|
1655
1647
|
});
|
@@ -1679,8 +1671,7 @@ async function main() {
|
|
1679
1671
|
}
|
1680
1672
|
if (location.href.indexOf("?cid=") == -1) {
|
1681
1673
|
if (UtilityEnabled("ResetType")) {
|
1682
|
-
document.querySelector("body > div > div.mt-3 > center").innerHTML =
|
1683
|
-
String(document.querySelector("body > div > div.mt-3 > center").innerHTML).replaceAll("ServerTime:", "服务器时间:");
|
1674
|
+
document.querySelector("body > div > div.mt-3 > center").innerHTML = String(document.querySelector("body > div > div.mt-3 > center").innerHTML).replaceAll("ServerTime:", "服务器时间:");
|
1684
1675
|
document.querySelector("body > div > div.mt-3 > center > table").style.marginTop = "10px";
|
1685
1676
|
|
1686
1677
|
document.querySelector("body > div > div.mt-3 > center > form").outerHTML = `<div class="row">
|
@@ -1730,8 +1721,7 @@ async function main() {
|
|
1730
1721
|
localStorage.setItem("UserScript-Contest-" + Temp[i].childNodes[0].innerText + "-Name", Temp[i].childNodes[1].innerText);
|
1731
1722
|
}
|
1732
1723
|
} else {
|
1733
|
-
document.getElementsByTagName("h3")[0].innerHTML =
|
1734
|
-
"比赛" + document.getElementsByTagName("h3")[0].innerHTML.substring(7);
|
1724
|
+
document.getElementsByTagName("h3")[0].innerHTML = "比赛" + document.getElementsByTagName("h3")[0].innerHTML.substring(7);
|
1735
1725
|
if (document.querySelector("#time_left") != null) {
|
1736
1726
|
let EndTime = document.querySelector("body > div > div.mt-3 > center").childNodes[3].data;
|
1737
1727
|
EndTime = EndTime.substring(EndTime.indexOf("结束时间是:") + 6, EndTime.lastIndexOf("。"));
|
@@ -1750,8 +1740,7 @@ async function main() {
|
|
1750
1740
|
HTMLData = HTMLData.replaceAll("\n状态:", "<br>状态:")
|
1751
1741
|
document.querySelector("body > div > div.mt-3 > center > div").innerHTML = HTMLData;
|
1752
1742
|
if (UtilityEnabled("RemoveAlerts") && document.querySelector("body > div > div.mt-3 > center").innerHTML.indexOf("尚未开始比赛") != -1) {
|
1753
|
-
document.querySelector("body > div > div.mt-3 > center > a").setAttribute("href",
|
1754
|
-
"start_contest.php?cid=" + SearchParams.get("cid"));
|
1743
|
+
document.querySelector("body > div > div.mt-3 > center > a").setAttribute("href", "start_contest.php?cid=" + SearchParams.get("cid"));
|
1755
1744
|
} else if (UtilityEnabled("AutoRefresh")) {
|
1756
1745
|
addEventListener("focus", async () => {
|
1757
1746
|
await fetch(location.href)
|
@@ -1777,8 +1766,7 @@ async function main() {
|
|
1777
1766
|
});
|
1778
1767
|
document.querySelector("body > div > div.mt-3 > center > br:nth-child(2)").remove();
|
1779
1768
|
document.querySelector("body > div > div.mt-3 > center > br:nth-child(2)").remove();
|
1780
|
-
document.querySelector("body > div > div.mt-3 > center > div > .red").innerHTML =
|
1781
|
-
String(document.querySelector("body > div > div.mt-3 > center > div > .red").innerHTML).replaceAll("<br>", "<br><br>");
|
1769
|
+
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>");
|
1782
1770
|
let StaticButton = document.createElement("button");
|
1783
1771
|
document.querySelectorAll("body > div > div.mt-3 > center > div > .red")[1].appendChild(StaticButton);
|
1784
1772
|
StaticButton.className = "btn btn-outline-secondary";
|
@@ -1787,15 +1775,9 @@ async function main() {
|
|
1787
1775
|
location.href = "https://www.xmoj.tech/conteststatistics.php?cid=" + SearchParams.get("cid");
|
1788
1776
|
});
|
1789
1777
|
|
1790
|
-
document.querySelector("#problemset > tbody").innerHTML =
|
1791
|
-
String(document.querySelector("#problemset > tbody").innerHTML).replaceAll(
|
1792
|
-
/\t ([0-9]*) 问题 ([^<]*)/g,
|
1793
|
-
"$2. $1");
|
1778
|
+
document.querySelector("#problemset > tbody").innerHTML = String(document.querySelector("#problemset > tbody").innerHTML).replaceAll(/\t ([0-9]*) 问题 ([^<]*)/g, "$2. $1");
|
1794
1779
|
|
1795
|
-
document.querySelector("#problemset > tbody").innerHTML =
|
1796
|
-
String(document.querySelector("#problemset > tbody").innerHTML).replaceAll(
|
1797
|
-
/\t\*([0-9]*) 问题 ([^<]*)/g,
|
1798
|
-
"拓展$2. $1");
|
1780
|
+
document.querySelector("#problemset > tbody").innerHTML = String(document.querySelector("#problemset > tbody").innerHTML).replaceAll(/\t\*([0-9]*) 问题 ([^<]*)/g, "拓展$2. $1");
|
1799
1781
|
|
1800
1782
|
if (UtilityEnabled("MoreSTD") && document.querySelector("#problemset > thead > tr").innerHTML.indexOf("标程") != -1) {
|
1801
1783
|
let Temp = document.querySelector("#problemset > thead > tr").children;
|
@@ -1827,10 +1809,8 @@ async function main() {
|
|
1827
1809
|
PID = PID.substring(2);
|
1828
1810
|
}
|
1829
1811
|
Temp[i].children[2].children[0].target = "_blank";
|
1830
|
-
localStorage.setItem("UserScript-Contest-" + SearchParams.get("cid") + "-Problem-" + i + "-PID",
|
1831
|
-
|
1832
|
-
localStorage.setItem("UserScript-Problem-" + PID.substring(3) + "-Name",
|
1833
|
-
Temp[i].childNodes[2].innerText);
|
1812
|
+
localStorage.setItem("UserScript-Contest-" + SearchParams.get("cid") + "-Problem-" + i + "-PID", PID.substring(3));
|
1813
|
+
localStorage.setItem("UserScript-Problem-" + PID.substring(3) + "-Name", Temp[i].childNodes[2].innerText);
|
1834
1814
|
}
|
1835
1815
|
let CheatDiv = document.createElement("div");
|
1836
1816
|
CheatDiv.style.marginTop = "20px";
|
@@ -1898,10 +1878,7 @@ async function main() {
|
|
1898
1878
|
},
|
1899
1879
|
"referrer": "https://www.xmoj.tech/submitpage.php?id=" + PID,
|
1900
1880
|
"method": "POST",
|
1901
|
-
"body": "cid=" + CID + "&pid=" + i + "&" +
|
1902
|
-
"language=1&" +
|
1903
|
-
"source=" + encodeURIComponent(Code) + "&" +
|
1904
|
-
"enable_O2=on"
|
1881
|
+
"body": "cid=" + CID + "&pid=" + i + "&" + "language=1&" + "source=" + encodeURIComponent(Code) + "&" + "enable_O2=on"
|
1905
1882
|
});
|
1906
1883
|
//sleep for one second
|
1907
1884
|
await new Promise(r => setTimeout(r, 500));
|
@@ -1911,8 +1888,7 @@ async function main() {
|
|
1911
1888
|
await new Promise(r => setTimeout(r, 1000));
|
1912
1889
|
}
|
1913
1890
|
AutoCheatButton.disabled = false;
|
1914
|
-
if (Submitted) location.reload();
|
1915
|
-
else AutoCheatButton.innerHTML = "自动提交当年代码";
|
1891
|
+
if (Submitted) location.reload(); else AutoCheatButton.innerHTML = "自动提交当年代码";
|
1916
1892
|
});
|
1917
1893
|
}
|
1918
1894
|
|
@@ -1945,8 +1921,7 @@ async function main() {
|
|
1945
1921
|
if (UtilityEnabled("ResetType")) {
|
1946
1922
|
document.querySelector("#problemset > thead > tr > th:nth-child(1)").style.width = "5%";
|
1947
1923
|
}
|
1948
|
-
localStorage.setItem("UserScript-Contest-" + SearchParams.get("cid") + "-ProblemCount",
|
1949
|
-
document.querySelector("#problemset > tbody").rows.length);
|
1924
|
+
localStorage.setItem("UserScript-Contest-" + SearchParams.get("cid") + "-ProblemCount", document.querySelector("#problemset > tbody").rows.length);
|
1950
1925
|
}
|
1951
1926
|
}
|
1952
1927
|
} else if (location.pathname == "/contestrank-oi.php") {
|
@@ -1957,10 +1932,7 @@ async function main() {
|
|
1957
1932
|
if (document.querySelector("body > div > div.mt-3 > center > h3").innerText == "比赛排名") {
|
1958
1933
|
document.querySelector("#rank").innerText = "比赛暂时还没有排名";
|
1959
1934
|
} else {
|
1960
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText =
|
1961
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText.substring(
|
1962
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText.indexOf(" -- ") + 4)
|
1963
|
-
+ "(OI排名)";
|
1935
|
+
document.querySelector("body > div > div.mt-3 > center > h3").innerText = document.querySelector("body > div > div.mt-3 > center > h3").innerText.substring(document.querySelector("body > div > div.mt-3 > center > h3").innerText.indexOf(" -- ") + 4) + "(OI排名)";
|
1964
1936
|
document.querySelector("#rank > thead > tr > :nth-child(1)").innerText = "排名";
|
1965
1937
|
document.querySelector("#rank > thead > tr > :nth-child(2)").innerText = "用户";
|
1966
1938
|
document.querySelector("#rank > thead > tr > :nth-child(3)").innerText = "昵称";
|
@@ -2030,10 +2002,7 @@ async function main() {
|
|
2030
2002
|
}
|
2031
2003
|
} else if (UtilityEnabled("ACMRank")) {
|
2032
2004
|
if (document.querySelector("body > div > div.mt-3 > center > h3").innerText != "比赛排名") {
|
2033
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText =
|
2034
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText.substring(
|
2035
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText.indexOf(" -- ") + 4)
|
2036
|
-
+ "(ACM排名)";
|
2005
|
+
document.querySelector("body > div > div.mt-3 > center > h3").innerText = document.querySelector("body > div > div.mt-3 > center > h3").innerText.substring(document.querySelector("body > div > div.mt-3 > center > h3").innerText.indexOf(" -- ") + 4) + "(ACM排名)";
|
2037
2006
|
}
|
2038
2007
|
let RankData = [];
|
2039
2008
|
let RefreshACMRank = async (ProblemCount) => {
|
@@ -2082,9 +2051,7 @@ async function main() {
|
|
2082
2051
|
});
|
2083
2052
|
if (CurrentProblem == null) {
|
2084
2053
|
CurrentProblem = {
|
2085
|
-
Index: CurrentSubmission.num,
|
2086
|
-
Attempts: [],
|
2087
|
-
SolveTime: 0
|
2054
|
+
Index: CurrentSubmission.num, Attempts: [], SolveTime: 0
|
2088
2055
|
};
|
2089
2056
|
CurrentRow.Problem.push(CurrentProblem);
|
2090
2057
|
}
|
@@ -2094,16 +2061,14 @@ async function main() {
|
|
2094
2061
|
CurrentRow.Penalty += parseInt(CurrentSubmission.in_date) + CurrentProblem.Attempts.length * 20 * 60;
|
2095
2062
|
}
|
2096
2063
|
CurrentProblem.Attempts.push({
|
2097
|
-
Time: CurrentSubmission.in_date,
|
2098
|
-
Result: CurrentSubmission.result
|
2064
|
+
Time: CurrentSubmission.in_date, Result: CurrentSubmission.result
|
2099
2065
|
});
|
2100
2066
|
}
|
2101
2067
|
|
2102
2068
|
for (let i = 0; i < RankData.length; i++) {
|
2103
2069
|
for (let j = 0; j < RankData[i].Problem.length; j++) {
|
2104
2070
|
for (let k = 0; k < RankData[i].Problem.length; k++) {
|
2105
|
-
if (j != k && RankData[i].Problem[j].SolveTime != 0 && RankData[i].Problem[k].SolveTime != 0 &&
|
2106
|
-
Math.abs(RankData[i].Problem[j].SolveTime - RankData[i].Problem[k].SolveTime) < 60) {
|
2071
|
+
if (j != k && RankData[i].Problem[j].SolveTime != 0 && RankData[i].Problem[k].SolveTime != 0 && Math.abs(RankData[i].Problem[j].SolveTime - RankData[i].Problem[k].SolveTime) < 60) {
|
2107
2072
|
RankData[i].QuickSubmitCount++;
|
2108
2073
|
}
|
2109
2074
|
}
|
@@ -2362,9 +2327,7 @@ async function main() {
|
|
2362
2327
|
TidyTable(Table);
|
2363
2328
|
|
2364
2329
|
scrollTo({
|
2365
|
-
left: LastPositionX,
|
2366
|
-
top: LastPositionY,
|
2367
|
-
behavior: "instant"
|
2330
|
+
left: LastPositionX, top: LastPositionY, behavior: "instant"
|
2368
2331
|
});
|
2369
2332
|
}
|
2370
2333
|
});
|
@@ -2399,10 +2362,7 @@ async function main() {
|
|
2399
2362
|
document.querySelector("#rank").innerText = "比赛暂时还没有排名";
|
2400
2363
|
} else {
|
2401
2364
|
if (UtilityEnabled("ResetType")) {
|
2402
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText =
|
2403
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText.substring(
|
2404
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText.indexOf(" -- ") + 4)
|
2405
|
-
+ "(订正排名)";
|
2365
|
+
document.querySelector("body > div > div.mt-3 > center > h3").innerText = document.querySelector("body > div > div.mt-3 > center > h3").innerText.substring(document.querySelector("body > div > div.mt-3 > center > h3").innerText.indexOf(" -- ") + 4) + "(订正排名)";
|
2406
2366
|
document.querySelector("body > div > div.mt-3 > center > a").remove();
|
2407
2367
|
}
|
2408
2368
|
document.querySelector("#rank > thead > tr > :nth-child(1)").innerText = "排名";
|
@@ -2472,12 +2432,7 @@ async function main() {
|
|
2472
2432
|
}
|
2473
2433
|
}
|
2474
2434
|
} else if (location.pathname == "/submitpage.php") {
|
2475
|
-
document.querySelector("body > div > div.mt-3").innerHTML = `<center class="mb-3">` +
|
2476
|
-
`<h3>提交代码</h3>` +
|
2477
|
-
(SearchParams.get("id") != null ?
|
2478
|
-
`题目<span class="blue">${Number(SearchParams.get("id"))}</span>` :
|
2479
|
-
`比赛<span class="blue">${Number(SearchParams.get("cid")) + `</span> 题目<span class="blue">` + String.fromCharCode(65 + parseInt(SearchParams.get("pid")))}</span>`) +
|
2480
|
-
`</center>
|
2435
|
+
document.querySelector("body > div > div.mt-3").innerHTML = `<center class="mb-3">` + `<h3>提交代码</h3>` + (SearchParams.get("id") != null ? `题目<span class="blue">${Number(SearchParams.get("id"))}</span>` : `比赛<span class="blue">${Number(SearchParams.get("cid")) + `</span> 题目<span class="blue">` + String.fromCharCode(65 + parseInt(SearchParams.get("pid")))}</span>`) + `</center>
|
2481
2436
|
<textarea id="CodeInput"></textarea>
|
2482
2437
|
<center class="mt-3">
|
2483
2438
|
<input id="enable_O2" name="enable_O2" type="checkbox"><label for="enable_O2">打开O2开关</label>
|
@@ -2503,8 +2458,7 @@ async function main() {
|
|
2503
2458
|
tabMode: "shift",
|
2504
2459
|
theme: (UtilityEnabled("DarkMode") ? "darcula" : "default"),
|
2505
2460
|
extraKeys: {
|
2506
|
-
"Ctrl-Space": "autocomplete",
|
2507
|
-
"Ctrl-Enter": function (instance) {
|
2461
|
+
"Ctrl-Space": "autocomplete", "Ctrl-Enter": function (instance) {
|
2508
2462
|
Submit.click();
|
2509
2463
|
}
|
2510
2464
|
}
|
@@ -2533,13 +2487,7 @@ async function main() {
|
|
2533
2487
|
},
|
2534
2488
|
"referrer": location.href,
|
2535
2489
|
"method": "POST",
|
2536
|
-
"body":
|
2537
|
-
(SearchParams.get("id") != null ?
|
2538
|
-
"id=" + SearchParams.get("id") :
|
2539
|
-
"cid=" + SearchParams.get("cid") + "&pid=" + SearchParams.get("pid")) +
|
2540
|
-
"&language=1&" +
|
2541
|
-
"source=" + encodeURIComponent(CodeMirrorElement.getValue()) + "&" +
|
2542
|
-
"enable_O2=on"
|
2490
|
+
"body": (SearchParams.get("id") != null ? "id=" + SearchParams.get("id") : "cid=" + SearchParams.get("cid") + "&pid=" + SearchParams.get("pid")) + "&language=1&" + "source=" + encodeURIComponent(CodeMirrorElement.getValue()) + "&" + "enable_O2=on"
|
2543
2491
|
}).then((Response) => {
|
2544
2492
|
if (Response.redirected) {
|
2545
2493
|
location.href = Response.url;
|
@@ -2601,19 +2549,11 @@ async function main() {
|
|
2601
2549
|
if (UtilityEnabled("CompileError")) {
|
2602
2550
|
let ResponseData = await new Promise((Resolve) => {
|
2603
2551
|
GM_xmlhttpRequest({
|
2604
|
-
method: "POST",
|
2605
|
-
url: "https://cppinsights.io/api/v1/transform",
|
2606
|
-
headers: {
|
2552
|
+
method: "POST", url: "https://cppinsights.io/api/v1/transform", headers: {
|
2607
2553
|
"content-type": "application/json;charset=UTF-8"
|
2608
|
-
},
|
2609
|
-
|
2610
|
-
|
2611
|
-
"insightsOptions": [
|
2612
|
-
"cpp14"
|
2613
|
-
],
|
2614
|
-
"code": Source
|
2615
|
-
}),
|
2616
|
-
onload: (Response) => {
|
2554
|
+
}, referrer: "https://cppinsights.io/", data: JSON.stringify({
|
2555
|
+
"insightsOptions": ["cpp14"], "code": Source
|
2556
|
+
}), onload: (Response) => {
|
2617
2557
|
Resolve(Response);
|
2618
2558
|
}
|
2619
2559
|
});
|
@@ -2648,8 +2588,7 @@ async function main() {
|
|
2648
2588
|
let UpdateDataCard = document.createElement("div");
|
2649
2589
|
document.querySelector("body > div > div.mt-3").appendChild(UpdateDataCard);
|
2650
2590
|
UpdateDataCard.className = "card mb-3";
|
2651
|
-
if (Data.Prerelease)
|
2652
|
-
UpdateDataCard.classList.add("text-secondary");
|
2591
|
+
if (Data.Prerelease) UpdateDataCard.classList.add("text-secondary");
|
2653
2592
|
let UpdateDataCardBody = document.createElement("div");
|
2654
2593
|
UpdateDataCard.appendChild(UpdateDataCardBody);
|
2655
2594
|
UpdateDataCardBody.className = "card-body";
|
@@ -2678,10 +2617,7 @@ async function main() {
|
|
2678
2617
|
let UpdateDataCardListItem = document.createElement("li");
|
2679
2618
|
UpdateDataCardList.appendChild(UpdateDataCardListItem);
|
2680
2619
|
UpdateDataCardListItem.className = "list-group-item";
|
2681
|
-
UpdateDataCardListItem.innerHTML =
|
2682
|
-
"(<a href=\"https://github.com/XMOJ-Script-dev/XMOJ-Script/pull/" + Data.UpdateContents[j].PR + "\" target=\"_blank\">" +
|
2683
|
-
"#" + Data.UpdateContents[j].PR + "</a>) " +
|
2684
|
-
Data.UpdateContents[j].Description;
|
2620
|
+
UpdateDataCardListItem.innerHTML = "(<a href=\"https://github.com/XMOJ-Script-dev/XMOJ-Script/pull/" + Data.UpdateContents[j].PR + "\" target=\"_blank\">" + "#" + Data.UpdateContents[j].PR + "</a>) " + Data.UpdateContents[j].Description;
|
2685
2621
|
}
|
2686
2622
|
let UpdateDataCardLink = document.createElement("a");
|
2687
2623
|
UpdateDataCardBody.appendChild(UpdateDataCardLink);
|
@@ -2833,17 +2769,7 @@ async function main() {
|
|
2833
2769
|
},
|
2834
2770
|
"referrer": location.href,
|
2835
2771
|
"method": "POST",
|
2836
|
-
"body":
|
2837
|
-
"nick=" + encodeURIComponent(Nickname) + "&" +
|
2838
|
-
"opassword=" + encodeURIComponent(OldPassword) + "&" +
|
2839
|
-
"npassword=" + encodeURIComponent(NewPassword) + "&" +
|
2840
|
-
"rptpassword=" + encodeURIComponent(NewPasswordAgain) + "&" +
|
2841
|
-
"school=" + encodeURIComponent(School) + "&" +
|
2842
|
-
"email=" + encodeURIComponent(EmailAddress) + "&" +
|
2843
|
-
"acc_cf=" + encodeURIComponent(CodeforcesAccount) + "&" +
|
2844
|
-
"acc_atc=" + encodeURIComponent(AtcoderAccount) + "&" +
|
2845
|
-
"acc_usaco=" + encodeURIComponent(USACOAccount) + "&" +
|
2846
|
-
"acc_luogu=" + encodeURIComponent(LuoguAccount)
|
2772
|
+
"body": "nick=" + encodeURIComponent(Nickname) + "&" + "opassword=" + encodeURIComponent(OldPassword) + "&" + "npassword=" + encodeURIComponent(NewPassword) + "&" + "rptpassword=" + encodeURIComponent(NewPasswordAgain) + "&" + "school=" + encodeURIComponent(School) + "&" + "email=" + encodeURIComponent(EmailAddress) + "&" + "acc_cf=" + encodeURIComponent(CodeforcesAccount) + "&" + "acc_atc=" + encodeURIComponent(AtcoderAccount) + "&" + "acc_usaco=" + encodeURIComponent(USACOAccount) + "&" + "acc_luogu=" + encodeURIComponent(LuoguAccount)
|
2847
2773
|
});
|
2848
2774
|
ModifyInfo.disabled = false;
|
2849
2775
|
ModifyInfo.querySelector("span").style.display = "none";
|
@@ -2856,10 +2782,6 @@ async function main() {
|
|
2856
2782
|
ExportACCode.className = "btn btn-outline-secondary";
|
2857
2783
|
ExportACCode.addEventListener("click", () => {
|
2858
2784
|
ExportACCode.disabled = true;
|
2859
|
-
let ExportProgressBar = document.getElementsByTagName("progress")[0] || document.createElement("progress");
|
2860
|
-
ExportProgressBar.removeAttribute("value");
|
2861
|
-
ExportProgressBar.removeAttribute("max");
|
2862
|
-
document.querySelector("body > div.container > div").appendChild(ExportProgressBar);
|
2863
2785
|
ExportACCode.innerText = "正在导出...";
|
2864
2786
|
let Request = new XMLHttpRequest();
|
2865
2787
|
Request.addEventListener("readystatechange", () => {
|
@@ -2867,32 +2789,31 @@ async function main() {
|
|
2867
2789
|
if (Request.status == 200) {
|
2868
2790
|
let Response = Request.responseText;
|
2869
2791
|
let ACCode = Response.split("------------------------------------------------------\r\n");
|
2870
|
-
|
2871
|
-
|
2872
|
-
|
2873
|
-
|
2874
|
-
|
2875
|
-
|
2876
|
-
|
2877
|
-
|
2878
|
-
|
2879
|
-
|
2880
|
-
|
2881
|
-
|
2882
|
-
|
2883
|
-
let CurrentQuestionID = CurrentCode.substring(7, 11);
|
2884
|
-
CurrentCode = CurrentCode.substring(14);
|
2885
|
-
ExportProgressBar.value = i + 1;
|
2886
|
-
let DownloadLink = document.createElement("a");
|
2887
|
-
DownloadLink.href = window.URL.createObjectURL(new Blob([CurrentCode]));
|
2888
|
-
DownloadLink.download = CurrentQuestionID + ".cpp";
|
2889
|
-
DownloadLink.click();
|
2792
|
+
let ScriptElement = document.createElement("script");
|
2793
|
+
ScriptElement.src = "https://cdn.bootcdn.net/ajax/libs/jszip/3.10.1/jszip.min.js";
|
2794
|
+
document.head.appendChild(ScriptElement);
|
2795
|
+
ScriptElement.onload = () => {
|
2796
|
+
var Zip = new JSZip();
|
2797
|
+
for (let i = 0; i < ACCode.length; i++) {
|
2798
|
+
let CurrentCode = ACCode[i];
|
2799
|
+
if (CurrentCode != "") {
|
2800
|
+
let CurrentQuestionID = CurrentCode.substring(7, 11);
|
2801
|
+
CurrentCode = CurrentCode.substring(14);
|
2802
|
+
CurrentCode = CurrentCode.replaceAll("\r", "");
|
2803
|
+
Zip.file(CurrentQuestionID + ".cpp", CurrentCode);
|
2804
|
+
}
|
2890
2805
|
}
|
2891
|
-
|
2892
|
-
|
2893
|
-
|
2806
|
+
ExportACCode.innerText = "正在生成压缩包……";
|
2807
|
+
Zip.generateAsync({type: "blob"})
|
2808
|
+
.then(function (Content) {
|
2809
|
+
saveAs(Content, "ACCodes.zip");
|
2810
|
+
ExportACCode.innerText = "AC代码导出成功";
|
2811
|
+
ExportACCode.disabled = false;
|
2812
|
+
setTimeout(() => {
|
2813
|
+
ExportACCode.innerText = "导出AC代码";
|
2814
|
+
}, 1000);
|
2815
|
+
});
|
2894
2816
|
};
|
2895
|
-
DownloadCode(0);
|
2896
2817
|
} else {
|
2897
2818
|
ExportACCode.disabled = false;
|
2898
2819
|
ExportACCode.innerText = "AC代码导出失败";
|
@@ -3207,17 +3128,13 @@ async function main() {
|
|
3207
3128
|
LoginButton.addEventListener("click", async () => {
|
3208
3129
|
let Username = document.getElementsByName("user_id")[0].value;
|
3209
3130
|
let Password = document.getElementsByName("password")[0].value;
|
3210
|
-
if (Username == "" ||
|
3211
|
-
Password == "") {
|
3131
|
+
if (Username == "" || Password == "") {
|
3212
3132
|
ErrorText.innerText = "用户名或密码不能为空";
|
3213
3133
|
} else {
|
3214
3134
|
await fetch("https://www.xmoj.tech/login.php", {
|
3215
|
-
method: "POST",
|
3216
|
-
headers: {
|
3135
|
+
method: "POST", headers: {
|
3217
3136
|
"Content-Type": "application/x-www-form-urlencoded"
|
3218
|
-
},
|
3219
|
-
body: "user_id=" + encodeURIComponent(Username) +
|
3220
|
-
"&password=" + hex_md5(Password)
|
3137
|
+
}, body: "user_id=" + encodeURIComponent(Username) + "&password=" + hex_md5(Password)
|
3221
3138
|
})
|
3222
3139
|
.then((Response) => {
|
3223
3140
|
return Response.text();
|
@@ -3253,9 +3170,7 @@ async function main() {
|
|
3253
3170
|
});
|
3254
3171
|
}
|
3255
3172
|
});
|
3256
|
-
if (UtilityEnabled("SavePassword") &&
|
3257
|
-
localStorage.getItem("UserScript-Username") != null &&
|
3258
|
-
localStorage.getItem("UserScript-Password") != null) {
|
3173
|
+
if (UtilityEnabled("SavePassword") && localStorage.getItem("UserScript-Username") != null && localStorage.getItem("UserScript-Password") != null) {
|
3259
3174
|
document.querySelector("#login > div:nth-child(1) > div > input").value = localStorage.getItem("UserScript-Username");
|
3260
3175
|
document.querySelector("#login > div:nth-child(2) > div > input").value = localStorage.getItem("UserScript-Password");
|
3261
3176
|
LoginButton.click();
|
@@ -3278,8 +3193,7 @@ async function main() {
|
|
3278
3193
|
let RandomUUID = () => {
|
3279
3194
|
let t = "0123456789abcdef";
|
3280
3195
|
let e = [];
|
3281
|
-
for (let r = 0; r < 36; r++)
|
3282
|
-
e[r] = t.substr(Math.floor(16 * Math.random()), 1);
|
3196
|
+
for (let r = 0; r < 36; r++) e[r] = t.substr(Math.floor(16 * Math.random()), 1);
|
3283
3197
|
e[14] = "4";
|
3284
3198
|
e[19] = t.substr(3 & e[19] | 8, 1);
|
3285
3199
|
e[8] = e[13] = e[18] = e[23] = "-";
|
@@ -3303,11 +3217,7 @@ async function main() {
|
|
3303
3217
|
"Channel": "HTML5"
|
3304
3218
|
});
|
3305
3219
|
URLParams.sort();
|
3306
|
-
await fetch("https://vod." + VideoData.region + ".aliyuncs.com/?" +
|
3307
|
-
URLParams.toString() +
|
3308
|
-
"&Signature=" +
|
3309
|
-
encodeURIComponent(CryptoJS.HmacSHA1("GET&%2F&" + encodeURIComponent(URLParams.toString()),
|
3310
|
-
VideoData.accessKeySecret + "&").toString(CryptoJS.enc.Base64)))
|
3220
|
+
await fetch("https://vod." + VideoData.region + ".aliyuncs.com/?" + URLParams.toString() + "&Signature=" + encodeURIComponent(CryptoJS.HmacSHA1("GET&%2F&" + encodeURIComponent(URLParams.toString()), VideoData.accessKeySecret + "&").toString(CryptoJS.enc.Base64)))
|
3311
3221
|
.then((Response) => {
|
3312
3222
|
return Response.json();
|
3313
3223
|
})
|
@@ -3386,10 +3296,7 @@ int main()
|
|
3386
3296
|
},
|
3387
3297
|
"referrer": "https://www.xmoj.tech/submitpage.php?id=" + PID,
|
3388
3298
|
"method": "POST",
|
3389
|
-
"body": "id=" + PID + "&" +
|
3390
|
-
"language=1&" +
|
3391
|
-
"source=" + encodeURIComponent(Code) + "&" +
|
3392
|
-
"enable_O2=on"
|
3299
|
+
"body": "id=" + PID + "&" + "language=1&" + "source=" + encodeURIComponent(Code) + "&" + "enable_O2=on"
|
3393
3300
|
});
|
3394
3301
|
|
3395
3302
|
let SID = await fetch("https://www.xmoj.tech/status.php").then((Response) => {
|
@@ -3451,9 +3358,7 @@ int main()
|
|
3451
3358
|
headers: {
|
3452
3359
|
"Content-Type": "application/x-www-form-urlencoded"
|
3453
3360
|
},
|
3454
|
-
body: "user_id=" + CurrentUsername + "&" +
|
3455
|
-
"solution_id=" + SearchParams.get("sid") + "&" +
|
3456
|
-
"name=" + ApplyElements[i].getAttribute("name")
|
3361
|
+
body: "user_id=" + CurrentUsername + "&" + "solution_id=" + SearchParams.get("sid") + "&" + "name=" + ApplyElements[i].getAttribute("name")
|
3457
3362
|
}).then((Response) => {
|
3458
3363
|
return Response.json();
|
3459
3364
|
}).then((Response) => {
|
@@ -3529,17 +3434,7 @@ int main()
|
|
3529
3434
|
"URL": "https://sourceforge.net/projects/mingw/"
|
3530
3435
|
}];
|
3531
3436
|
for (let i = 0; i < Softwares.length; i++) {
|
3532
|
-
SoftwareList.innerHTML +=
|
3533
|
-
"<li class=\"software_item\">" +
|
3534
|
-
"<a href=\"" + Softwares[i].URL + "\">" +
|
3535
|
-
"<div class=\"item-info\">" +
|
3536
|
-
"<div class=\"item-img\">" +
|
3537
|
-
"<img height=\"50\" src=\"" + Softwares[i].Image + "\" alt=\"点击下载\">" +
|
3538
|
-
"</div>" +
|
3539
|
-
"<div class=\"item-txt\">" + Softwares[i].Name + "</div>" +
|
3540
|
-
"</div>" +
|
3541
|
-
"</a>" +
|
3542
|
-
"</li>";
|
3437
|
+
SoftwareList.innerHTML += "<li class=\"software_item\">" + "<a href=\"" + Softwares[i].URL + "\">" + "<div class=\"item-info\">" + "<div class=\"item-img\">" + "<img height=\"50\" src=\"" + Softwares[i].Image + "\" alt=\"点击下载\">" + "</div>" + "<div class=\"item-txt\">" + Softwares[i].Name + "</div>" + "</div>" + "</a>" + "</li>";
|
3543
3438
|
}
|
3544
3439
|
}
|
3545
3440
|
} else if (location.pathname == "/problemstatus.php") {
|
@@ -3552,8 +3447,7 @@ int main()
|
|
3552
3447
|
Temp[i].removeAttribute("class");
|
3553
3448
|
}
|
3554
3449
|
|
3555
|
-
document.querySelector("#problemstatus > thead > tr").innerHTML =
|
3556
|
-
document.querySelector("#problemstatus > thead > tr").innerHTML.replaceAll("td", "th");
|
3450
|
+
document.querySelector("#problemstatus > thead > tr").innerHTML = document.querySelector("#problemstatus > thead > tr").innerHTML.replaceAll("td", "th");
|
3557
3451
|
document.querySelector("#problemstatus > thead > tr > th:nth-child(2)").innerText = "运行编号";
|
3558
3452
|
document.querySelector("#problemstatus > thead > tr > th:nth-child(4)").remove();
|
3559
3453
|
document.querySelector("#problemstatus > thead > tr > th:nth-child(4)").remove();
|
@@ -3675,8 +3569,7 @@ int main()
|
|
3675
3569
|
Code = Response.substring(0, Response.indexOf("/**************************************************************")).trim();
|
3676
3570
|
});
|
3677
3571
|
} else {
|
3678
|
-
if (localStorage.getItem("UserScript-LastUploadedStdTime") === undefined ||
|
3679
|
-
new Date().getTime() - localStorage.getItem("UserScript-LastUploadedStdTime") > 1000 * 60 * 60 * 24 * 30) {
|
3572
|
+
if (localStorage.getItem("UserScript-LastUploadedStdTime") === undefined || new Date().getTime() - localStorage.getItem("UserScript-LastUploadedStdTime") > 1000 * 60 * 60 * 24 * 30) {
|
3680
3573
|
location.href = "https://www.xmoj.tech/userinfo.php?ByUserScript=1";
|
3681
3574
|
}
|
3682
3575
|
await new Promise((Resolve) => {
|
@@ -3926,8 +3819,7 @@ int main()
|
|
3926
3819
|
Send.children[0].style.display = "";
|
3927
3820
|
let ContentData = Content.value;
|
3928
3821
|
RequestAPI("SendMail", {
|
3929
|
-
"ToUser": String(SearchParams.get("to_user")),
|
3930
|
-
"Content": String(ContentData)
|
3822
|
+
"ToUser": String(SearchParams.get("to_user")), "Content": String(ContentData)
|
3931
3823
|
}, (ResponseData) => {
|
3932
3824
|
Send.disabled = false;
|
3933
3825
|
Send.children[0].style.display = "none";
|
@@ -4116,8 +4008,7 @@ int main()
|
|
4116
4008
|
let CaptchaSecretKey = "";
|
4117
4009
|
unsafeWindow.CaptchaLoadedCallback = () => {
|
4118
4010
|
turnstile.render("#CaptchaContainer", {
|
4119
|
-
sitekey: CaptchaSiteKey,
|
4120
|
-
callback: function (CaptchaSecretKeyValue) {
|
4011
|
+
sitekey: CaptchaSiteKey, callback: function (CaptchaSecretKeyValue) {
|
4121
4012
|
CaptchaSecretKey = CaptchaSecretKeyValue;
|
4122
4013
|
SubmitElement.disabled = false;
|
4123
4014
|
},
|
@@ -4225,8 +4116,7 @@ int main()
|
|
4225
4116
|
RadioInput.disabled = true;
|
4226
4117
|
}
|
4227
4118
|
if (Data[i].BoardID == 4) {
|
4228
|
-
if (!isNaN(ProblemID))
|
4229
|
-
RadioInput.checked = true;
|
4119
|
+
if (!isNaN(ProblemID)) RadioInput.checked = true;
|
4230
4120
|
RadioInput.disabled = true;
|
4231
4121
|
}
|
4232
4122
|
let RadioLabel = document.createElement("label");
|
@@ -4294,8 +4184,7 @@ int main()
|
|
4294
4184
|
let CaptchaSecretKey = "";
|
4295
4185
|
unsafeWindow.CaptchaLoadedCallback = () => {
|
4296
4186
|
turnstile.render("#CaptchaContainer", {
|
4297
|
-
sitekey: CaptchaSiteKey,
|
4298
|
-
callback: function (CaptchaSecretKeyValue) {
|
4187
|
+
sitekey: CaptchaSiteKey, callback: function (CaptchaSecretKeyValue) {
|
4299
4188
|
CaptchaSecretKey = CaptchaSecretKeyValue;
|
4300
4189
|
SubmitElement.disabled = false;
|
4301
4190
|
},
|
@@ -4365,8 +4254,7 @@ int main()
|
|
4365
4254
|
}
|
4366
4255
|
}
|
4367
4256
|
RequestAPI("GetPost", {
|
4368
|
-
"PostID": Number(ThreadID),
|
4369
|
-
"Page": Number(Page)
|
4257
|
+
"PostID": Number(ThreadID), "Page": Number(Page)
|
4370
4258
|
}, async (ResponseData) => {
|
4371
4259
|
if (ResponseData.Success == true) {
|
4372
4260
|
let OldScrollTop = document.documentElement.scrollTop;
|
@@ -4656,8 +4544,7 @@ int main()
|
|
4656
4544
|
|
4657
4545
|
if (Silent) {
|
4658
4546
|
scrollTo({
|
4659
|
-
top: OldScrollTop,
|
4660
|
-
behavior: "instant"
|
4547
|
+
top: OldScrollTop, behavior: "instant"
|
4661
4548
|
});
|
4662
4549
|
}
|
4663
4550
|
} else {
|
@@ -4720,4 +4607,4 @@ int main()
|
|
4720
4607
|
}
|
4721
4608
|
}
|
4722
4609
|
|
4723
|
-
main();
|
4610
|
+
main();
|