xmoj-script 1.1.42 → 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 +22 -0
- package/XMOJ.user.js +231 -343
- package/package.json +1 -1
package/.idea/vcs.xml
CHANGED
package/Update.json
CHANGED
@@ -1276,6 +1276,28 @@
|
|
1276
1276
|
}
|
1277
1277
|
],
|
1278
1278
|
"Notes": "Popper.js is so stupid..."
|
1279
|
+
},
|
1280
|
+
"1.1.43": {
|
1281
|
+
"UpdateDate": 1707715028113,
|
1282
|
+
"Prerelease": true,
|
1283
|
+
"UpdateContents": [
|
1284
|
+
{
|
1285
|
+
"PR": 447,
|
1286
|
+
"Description": "fix the unpkg-cdn option"
|
1287
|
+
}
|
1288
|
+
],
|
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."
|
1279
1301
|
}
|
1280
1302
|
}
|
1281
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/xEA5tcRAOY8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEA5TISAOa5EgDmaiELxR4jDcNSEQDlZhI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wzCrSINw4EiDcIIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIg3DNCMNwuUjDcP/Iw3D/yINw5kjDMMGIwzDfCIMw7UiDMImAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIwzCDCMNwn4iDMPzIgzCxyINw8MjDcNcHA7GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACIMwhgiDcJ0Ig3CEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////+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
|
}
|
@@ -402,6 +387,7 @@ let ServerURL = (UtilityEnabled("DebugMode") ? "https://ghpages.xmoj-bbs.tech/"
|
|
402
387
|
let CurrentUsername = document.querySelector("#profile").innerText;
|
403
388
|
CurrentUsername = CurrentUsername.replaceAll(/[^a-zA-Z0-9]/g, "");
|
404
389
|
let IsAdmin = AdminUserList.indexOf(CurrentUsername) !== -1;
|
390
|
+
|
405
391
|
async function main() {
|
406
392
|
if (location.href.startsWith('http://')) {
|
407
393
|
//use https
|
@@ -416,12 +402,7 @@ async function main() {
|
|
416
402
|
document.querySelector("body > div > div.jumbotron").className = "mt-3";
|
417
403
|
}
|
418
404
|
|
419
|
-
if (UtilityEnabled("AutoLogin") &&
|
420
|
-
document.querySelector("#profile") != null &&
|
421
|
-
document.querySelector("#profile").innerHTML == "登录" &&
|
422
|
-
location.pathname != "/login.php" &&
|
423
|
-
location.pathname != "/loginpage.php" &&
|
424
|
-
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") {
|
425
406
|
localStorage.setItem("UserScript-LastPage", location.pathname + location.search);
|
426
407
|
location.href = "https://www.xmoj.tech/loginpage.php";
|
427
408
|
}
|
@@ -449,10 +430,7 @@ async function main() {
|
|
449
430
|
}
|
450
431
|
});
|
451
432
|
if (UtilityEnabled("ReplaceLinks")) {
|
452
|
-
document.body.innerHTML =
|
453
|
-
String(document.body.innerHTML).replaceAll(
|
454
|
-
/\[<a href="([^"]*)">([^<]*)<\/a>\]/g,
|
455
|
-
"<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>");
|
456
434
|
}
|
457
435
|
if (UtilityEnabled("ReplaceXM")) {
|
458
436
|
document.body.innerHTML = String(document.body.innerHTML).replaceAll("我", "高老师");
|
@@ -487,36 +465,30 @@ async function main() {
|
|
487
465
|
} else {
|
488
466
|
document.querySelector("html").setAttribute("data-bs-theme", "light");
|
489
467
|
}
|
490
|
-
var resources = [
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
{
|
512
|
-
type: 'script',
|
513
|
-
src: 'https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0-alpha3/js/bootstrap.bundle.min.js',
|
514
|
-
isModule: true
|
515
|
-
}
|
516
|
-
];
|
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
|
+
}];
|
517
489
|
if (UtilityEnabled("UnpkgCdn")) {
|
518
|
-
resources[
|
519
|
-
resources[4].
|
490
|
+
resources[3].href = 'https://unpkg.com/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css';
|
491
|
+
resources[4].src = 'https://unpkg.com/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js';
|
520
492
|
}
|
521
493
|
let loadResources = async () => {
|
522
494
|
let promises = resources.map(resource => {
|
@@ -685,24 +657,16 @@ async function main() {
|
|
685
657
|
let Hours = CurrentDate.getHours();
|
686
658
|
let Minutes = CurrentDate.getMinutes();
|
687
659
|
let Seconds = CurrentDate.getSeconds();
|
688
|
-
document.getElementById("nowdate").innerHTML =
|
689
|
-
Year + "-" +
|
690
|
-
(Month < 10 ? "0" : "") + Month + "-" +
|
691
|
-
(_Date < 10 ? "0" : "") + _Date + " " +
|
692
|
-
(Hours < 10 ? "0" : "") + Hours + ":" +
|
693
|
-
(Minutes < 10 ? "0" : "") + Minutes + ":" +
|
694
|
-
(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;
|
695
661
|
} catch (Error) {
|
696
662
|
}
|
697
663
|
|
698
664
|
if (UtilityEnabled("ResetType")) {
|
699
|
-
if (document.querySelector("#profile") != undefined &&
|
700
|
-
document.querySelector("#profile").innerHTML == "登录") {
|
665
|
+
if (document.querySelector("#profile") != undefined && document.querySelector("#profile").innerHTML == "登录") {
|
701
666
|
if (document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul").childNodes.length == 3) {
|
702
667
|
document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul").childNodes[3].remove();
|
703
668
|
}
|
704
|
-
} else if (document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul > li:nth-child(3) > a > span") != undefined &&
|
705
|
-
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 != "个人中心") {
|
706
670
|
let PopupUL = document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul");
|
707
671
|
PopupUL.innerHTML = `<li class="dropdown-item">修改帐号</li>
|
708
672
|
<li class="dropdown-item">个人中心</li>
|
@@ -749,10 +713,7 @@ async function main() {
|
|
749
713
|
let Hour = CurrentDate.getUTCHours();
|
750
714
|
let Minute = CurrentDate.getUTCMinutes();
|
751
715
|
let Second = CurrentDate.getUTCSeconds();
|
752
|
-
Temp[i].innerHTML = (Day !== 0 ? Day + "天" : "") +
|
753
|
-
(Hour !== 0 ? (Hour < 10 ? "0" : "") + Hour + "小时" : "") +
|
754
|
-
(Minute !== 0 ? (Minute < 10 ? "0" : "") + Minute + "分" : "") +
|
755
|
-
(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 + "秒" : "");
|
756
717
|
}
|
757
718
|
}
|
758
719
|
}, 100);
|
@@ -850,10 +811,7 @@ async function main() {
|
|
850
811
|
let UpdateDataCardListItem = document.createElement("li");
|
851
812
|
UpdateDataCardList.appendChild(UpdateDataCardListItem);
|
852
813
|
UpdateDataCardListItem.className = "list-group-item";
|
853
|
-
UpdateDataCardListItem.innerHTML =
|
854
|
-
"(<a href=\"https://github.com/XMOJ-Script-dev/XMOJ-Script/pull/" + Data.UpdateContents[j].PR + "\" target=\"_blank\">" +
|
855
|
-
"#" + Data.UpdateContents[j].PR + "</a>) " +
|
856
|
-
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;
|
857
815
|
}
|
858
816
|
let UpdateDataCardLink = document.createElement("a");
|
859
817
|
UpdateDataCardBody.appendChild(UpdateDataCardLink);
|
@@ -1079,68 +1037,116 @@ async function main() {
|
|
1079
1037
|
}
|
1080
1038
|
return List;
|
1081
1039
|
};
|
1082
|
-
UtilitiesCardBody.appendChild(CreateList([
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
{"ID": "
|
1095
|
-
|
1096
|
-
{"ID": "ImproveACRate", "Type": "A", "Name": "自动提交已AC题目以提高AC率"},
|
1097
|
-
{"ID": "AutoO2", "Type": "F", "Name": "代码提交界面自动选择O2优化"},
|
1098
|
-
{
|
1099
|
-
"ID": "Beautify", "Type": "F", "Name": "美化界面", "Children": [
|
1100
|
-
{"ID": "NewBootstrap", "Type": "F", "Name": "使用新版的Bootstrap样式库*"},
|
1101
|
-
{"ID": "ResetType", "Type": "F", "Name": "重新排版*"},
|
1102
|
-
{"ID": "AddColorText", "Type": "A", "Name": "增加彩色文字"},
|
1103
|
-
{"ID": "AddUnits", "Type": "A", "Name": "状态界面内存与耗时添加单位"},
|
1104
|
-
{"ID": "DarkMode", "Type": "A", "Name": "使用暗色模式"},
|
1105
|
-
{"ID": "AddAnimation", "Type": "A", "Name": "增加动画"},
|
1106
|
-
{"ID": "ReplaceYN", "Type": "F", "Name": "题目前对错的Y和N替换为勾和叉"},
|
1107
|
-
{"ID": "RemoveAlerts", "Type": "D", "Name": "去除多余反复的提示"},
|
1108
|
-
{"ID": "Translate", "Type": "F", "Name": "统一使用中文,翻译了部分英文*"},
|
1109
|
-
{"ID": "ReplaceLinks", "Type": "F", "Name": "将网站中所有以方括号包装的链接替换为按钮"},
|
1110
|
-
{"ID": "RemoveUseless", "Type": "D", "Name": "删去无法使用的功能*"},
|
1111
|
-
{
|
1112
|
-
"ID": "ReplaceXM",
|
1113
|
-
"Type": "F",
|
1114
|
-
"Name": "将网站中所有“小明”和“我”关键字替换为“高老师”,所有“小红”替换为“徐师娘”,所有“小粉”替换为“彩虹”,所有“下海”、“海上”替换为“上海”"
|
1115
|
-
}
|
1116
|
-
]
|
1117
|
-
},
|
1118
|
-
{"ID": "AutoLogin", "Type": "A", "Name": "在需要登录的界面自动跳转到登陆界面"},
|
1119
|
-
{"ID": "SavePassword", "Type": "A", "Name": "自动保存用户名与密码,免去每次手动输入密码的繁琐"},
|
1120
|
-
{"ID": "CopySamples", "Type": "F", "Name": "题目界面测试样例有时复制无效"},
|
1121
|
-
{"ID": "RefreshSolution", "Type": "F", "Name": "状态页面结果自动刷新每次只能刷新一个"},
|
1122
|
-
{"ID": "CopyMD", "Type": "A", "Name": "复制题目或题解内容"},
|
1123
|
-
{"ID": "OpenAllProblem", "Type": "A", "Name": "比赛题目界面一键打开所有题目"},
|
1124
|
-
{
|
1125
|
-
"ID": "CheckCode", "Type": "A", "Name": "提交代码前对代码进行检查", "Children": [
|
1126
|
-
{"ID": "IOFile", "Type": "A", "Name": "是否使用了文件输入输出(如果需要使用)"},
|
1127
|
-
{"ID": "CompileError", "Type": "A", "Name": "是否有编译错误"}
|
1128
|
-
]
|
1129
|
-
},
|
1130
|
-
{"ID": "ExportACCode", "Type": "F", "Name": "导出AC代码每一道题目一个文件"},
|
1131
|
-
{"ID": "LoginFailed", "Type": "F", "Name": "修复登录后跳转失败*"},
|
1132
|
-
{"ID": "NewDownload", "Type": "A", "Name": "下载页面增加下载内容"},
|
1133
|
-
{"ID": "CompareSource", "Type": "A", "Name": "比较代码"},
|
1134
|
-
{"ID": "BBSPopup", "Type": "A", "Name": "讨论提醒"},
|
1135
|
-
{"ID": "MessagePopup", "Type": "A", "Name": "短消息提醒"},
|
1136
|
-
{"ID": "DebugMode", "Type": "A", "Name": "调试模式(仅供开发者使用)"},
|
1137
|
-
{
|
1138
|
-
"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",
|
1139
1054
|
"Type": "A",
|
1140
|
-
"Name": "
|
1141
|
-
}
|
1142
|
-
|
1143
|
-
|
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 (不建议使用)"},]));
|
1144
1150
|
let UtilitiesCardFooter = document.createElement("div");
|
1145
1151
|
UtilitiesCardFooter.className = "card-footer text-muted";
|
1146
1152
|
UtilitiesCardFooter.innerText = "* 不建议关闭,可能会导致系统不稳定、界面错乱、功能缺失等问题\n绿色:增加功能 黄色:修改功能 红色:删除功能";
|
@@ -1237,15 +1243,11 @@ async function main() {
|
|
1237
1243
|
|
1238
1244
|
let Temp = document.querySelector("#problemset").rows;
|
1239
1245
|
for (let i = 1; i < Temp.length; i++) {
|
1240
|
-
localStorage.setItem("UserScript-Problem-" + Temp[i].children[1].innerText + "-Name",
|
1241
|
-
Temp[i].children[2].innerText);
|
1246
|
+
localStorage.setItem("UserScript-Problem-" + Temp[i].children[1].innerText + "-Name", Temp[i].children[2].innerText);
|
1242
1247
|
}
|
1243
1248
|
} else if (location.pathname == "/problem.php") {
|
1244
1249
|
if (SearchParams.get("cid") != null) {
|
1245
|
-
document.getElementsByTagName("h2")[0].innerHTML += " (" +
|
1246
|
-
localStorage.getItem("UserScript-Contest-" + SearchParams.get("cid") +
|
1247
|
-
"-Problem-" + SearchParams.get("pid") + "-PID") +
|
1248
|
-
")";
|
1250
|
+
document.getElementsByTagName("h2")[0].innerHTML += " (" + localStorage.getItem("UserScript-Contest-" + SearchParams.get("cid") + "-Problem-" + SearchParams.get("pid") + "-PID") + ")";
|
1249
1251
|
}
|
1250
1252
|
if (document.querySelector("body > div > div.mt-3 > h2") != null) {
|
1251
1253
|
document.querySelector("body > div > div.mt-3").innerHTML = "没有此题目或题目对你不可见";
|
@@ -1253,8 +1255,7 @@ async function main() {
|
|
1253
1255
|
location.href = "https://www.xmoj.tech/problemset.php";
|
1254
1256
|
}, 1000);
|
1255
1257
|
} else {
|
1256
|
-
let PID = localStorage.getItem("UserScript-Contest-" + SearchParams.get("cid") +
|
1257
|
-
"-Problem-" + SearchParams.get("pid") + "-PID");
|
1258
|
+
let PID = localStorage.getItem("UserScript-Contest-" + SearchParams.get("cid") + "-Problem-" + SearchParams.get("pid") + "-PID");
|
1258
1259
|
|
1259
1260
|
document.querySelector("body > div > div.mt-3 > center").lastChild.style.marginLeft = "10px";
|
1260
1261
|
//修复提交按钮
|
@@ -1529,10 +1530,7 @@ async function main() {
|
|
1529
1530
|
},
|
1530
1531
|
"referrer": "https://www.xmoj.tech/submitpage.php?id=" + PID,
|
1531
1532
|
"method": "POST",
|
1532
|
-
"body": "id=" + PID + "&" +
|
1533
|
-
"language=1&" +
|
1534
|
-
"source=" + encodeURIComponent(Code) + "&" +
|
1535
|
-
"enable_O2=on"
|
1533
|
+
"body": "id=" + PID + "&" + "language=1&" + "source=" + encodeURIComponent(Code) + "&" + "enable_O2=on"
|
1536
1534
|
});
|
1537
1535
|
Count++;
|
1538
1536
|
}, 1000);
|
@@ -1562,8 +1560,7 @@ async function main() {
|
|
1562
1560
|
SolutionIDs.push(SID);
|
1563
1561
|
if (UtilityEnabled("ResetType")) {
|
1564
1562
|
Temp[i].childNodes[0].remove();
|
1565
|
-
Temp[i].childNodes[0].innerHTML = "<a href=\"https://www.xmoj.tech/showsource.php?id=" + SID + "\">" + SID + "</a> " +
|
1566
|
-
"<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>";
|
1567
1564
|
Temp[i].childNodes[1].remove();
|
1568
1565
|
Temp[i].childNodes[1].children[0].removeAttribute("class");
|
1569
1566
|
Temp[i].childNodes[3].childNodes[0].innerText = SizeToStringSize(Temp[i].childNodes[3].childNodes[0].innerText);
|
@@ -1573,13 +1570,10 @@ async function main() {
|
|
1573
1570
|
Temp[i].childNodes[9].innerText = (Temp[i].childNodes[9].innerText == "" ? "否" : "是");
|
1574
1571
|
}
|
1575
1572
|
if (SearchParams.get("cid") === null) {
|
1576
|
-
localStorage.setItem("UserScript-Solution-" + SID + "-Problem",
|
1577
|
-
Temp[i].childNodes[1].innerText);
|
1573
|
+
localStorage.setItem("UserScript-Solution-" + SID + "-Problem", Temp[i].childNodes[1].innerText);
|
1578
1574
|
} else {
|
1579
|
-
localStorage.setItem("UserScript-Solution-" + SID + "-Contest",
|
1580
|
-
|
1581
|
-
localStorage.setItem("UserScript-Solution-" + SID + "-PID-Contest",
|
1582
|
-
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));
|
1583
1577
|
}
|
1584
1578
|
}
|
1585
1579
|
|
@@ -1647,8 +1641,7 @@ async function main() {
|
|
1647
1641
|
}, 500);
|
1648
1642
|
TempHTML += "<img style=\"margin-left: 5px\" height=\"18\" width=\"18\" src=\"image/loader.gif\">";
|
1649
1643
|
} else if (ResponseData[0] == 4 && UtilityEnabled("UploadStd")) {
|
1650
|
-
if (SearchParams.get("cid") == null)
|
1651
|
-
CurrentRow.cells[1].innerText;
|
1644
|
+
if (SearchParams.get("cid") == null) CurrentRow.cells[1].innerText;
|
1652
1645
|
let Std = StdList.find((Element) => {
|
1653
1646
|
return Element == Number(PID);
|
1654
1647
|
});
|
@@ -1678,8 +1671,7 @@ async function main() {
|
|
1678
1671
|
}
|
1679
1672
|
if (location.href.indexOf("?cid=") == -1) {
|
1680
1673
|
if (UtilityEnabled("ResetType")) {
|
1681
|
-
document.querySelector("body > div > div.mt-3 > center").innerHTML =
|
1682
|
-
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:", "服务器时间:");
|
1683
1675
|
document.querySelector("body > div > div.mt-3 > center > table").style.marginTop = "10px";
|
1684
1676
|
|
1685
1677
|
document.querySelector("body > div > div.mt-3 > center > form").outerHTML = `<div class="row">
|
@@ -1729,8 +1721,7 @@ async function main() {
|
|
1729
1721
|
localStorage.setItem("UserScript-Contest-" + Temp[i].childNodes[0].innerText + "-Name", Temp[i].childNodes[1].innerText);
|
1730
1722
|
}
|
1731
1723
|
} else {
|
1732
|
-
document.getElementsByTagName("h3")[0].innerHTML =
|
1733
|
-
"比赛" + document.getElementsByTagName("h3")[0].innerHTML.substring(7);
|
1724
|
+
document.getElementsByTagName("h3")[0].innerHTML = "比赛" + document.getElementsByTagName("h3")[0].innerHTML.substring(7);
|
1734
1725
|
if (document.querySelector("#time_left") != null) {
|
1735
1726
|
let EndTime = document.querySelector("body > div > div.mt-3 > center").childNodes[3].data;
|
1736
1727
|
EndTime = EndTime.substring(EndTime.indexOf("结束时间是:") + 6, EndTime.lastIndexOf("。"));
|
@@ -1749,8 +1740,7 @@ async function main() {
|
|
1749
1740
|
HTMLData = HTMLData.replaceAll("\n状态:", "<br>状态:")
|
1750
1741
|
document.querySelector("body > div > div.mt-3 > center > div").innerHTML = HTMLData;
|
1751
1742
|
if (UtilityEnabled("RemoveAlerts") && document.querySelector("body > div > div.mt-3 > center").innerHTML.indexOf("尚未开始比赛") != -1) {
|
1752
|
-
document.querySelector("body > div > div.mt-3 > center > a").setAttribute("href",
|
1753
|
-
"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"));
|
1754
1744
|
} else if (UtilityEnabled("AutoRefresh")) {
|
1755
1745
|
addEventListener("focus", async () => {
|
1756
1746
|
await fetch(location.href)
|
@@ -1776,8 +1766,7 @@ async function main() {
|
|
1776
1766
|
});
|
1777
1767
|
document.querySelector("body > div > div.mt-3 > center > br:nth-child(2)").remove();
|
1778
1768
|
document.querySelector("body > div > div.mt-3 > center > br:nth-child(2)").remove();
|
1779
|
-
document.querySelector("body > div > div.mt-3 > center > div > .red").innerHTML =
|
1780
|
-
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>");
|
1781
1770
|
let StaticButton = document.createElement("button");
|
1782
1771
|
document.querySelectorAll("body > div > div.mt-3 > center > div > .red")[1].appendChild(StaticButton);
|
1783
1772
|
StaticButton.className = "btn btn-outline-secondary";
|
@@ -1786,15 +1775,9 @@ async function main() {
|
|
1786
1775
|
location.href = "https://www.xmoj.tech/conteststatistics.php?cid=" + SearchParams.get("cid");
|
1787
1776
|
});
|
1788
1777
|
|
1789
|
-
document.querySelector("#problemset > tbody").innerHTML =
|
1790
|
-
String(document.querySelector("#problemset > tbody").innerHTML).replaceAll(
|
1791
|
-
/\t ([0-9]*) 问题 ([^<]*)/g,
|
1792
|
-
"$2. $1");
|
1778
|
+
document.querySelector("#problemset > tbody").innerHTML = String(document.querySelector("#problemset > tbody").innerHTML).replaceAll(/\t ([0-9]*) 问题 ([^<]*)/g, "$2. $1");
|
1793
1779
|
|
1794
|
-
document.querySelector("#problemset > tbody").innerHTML =
|
1795
|
-
String(document.querySelector("#problemset > tbody").innerHTML).replaceAll(
|
1796
|
-
/\t\*([0-9]*) 问题 ([^<]*)/g,
|
1797
|
-
"拓展$2. $1");
|
1780
|
+
document.querySelector("#problemset > tbody").innerHTML = String(document.querySelector("#problemset > tbody").innerHTML).replaceAll(/\t\*([0-9]*) 问题 ([^<]*)/g, "拓展$2. $1");
|
1798
1781
|
|
1799
1782
|
if (UtilityEnabled("MoreSTD") && document.querySelector("#problemset > thead > tr").innerHTML.indexOf("标程") != -1) {
|
1800
1783
|
let Temp = document.querySelector("#problemset > thead > tr").children;
|
@@ -1826,10 +1809,8 @@ async function main() {
|
|
1826
1809
|
PID = PID.substring(2);
|
1827
1810
|
}
|
1828
1811
|
Temp[i].children[2].children[0].target = "_blank";
|
1829
|
-
localStorage.setItem("UserScript-Contest-" + SearchParams.get("cid") + "-Problem-" + i + "-PID",
|
1830
|
-
|
1831
|
-
localStorage.setItem("UserScript-Problem-" + PID.substring(3) + "-Name",
|
1832
|
-
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);
|
1833
1814
|
}
|
1834
1815
|
let CheatDiv = document.createElement("div");
|
1835
1816
|
CheatDiv.style.marginTop = "20px";
|
@@ -1897,10 +1878,7 @@ async function main() {
|
|
1897
1878
|
},
|
1898
1879
|
"referrer": "https://www.xmoj.tech/submitpage.php?id=" + PID,
|
1899
1880
|
"method": "POST",
|
1900
|
-
"body": "cid=" + CID + "&pid=" + i + "&" +
|
1901
|
-
"language=1&" +
|
1902
|
-
"source=" + encodeURIComponent(Code) + "&" +
|
1903
|
-
"enable_O2=on"
|
1881
|
+
"body": "cid=" + CID + "&pid=" + i + "&" + "language=1&" + "source=" + encodeURIComponent(Code) + "&" + "enable_O2=on"
|
1904
1882
|
});
|
1905
1883
|
//sleep for one second
|
1906
1884
|
await new Promise(r => setTimeout(r, 500));
|
@@ -1910,8 +1888,7 @@ async function main() {
|
|
1910
1888
|
await new Promise(r => setTimeout(r, 1000));
|
1911
1889
|
}
|
1912
1890
|
AutoCheatButton.disabled = false;
|
1913
|
-
if (Submitted) location.reload();
|
1914
|
-
else AutoCheatButton.innerHTML = "自动提交当年代码";
|
1891
|
+
if (Submitted) location.reload(); else AutoCheatButton.innerHTML = "自动提交当年代码";
|
1915
1892
|
});
|
1916
1893
|
}
|
1917
1894
|
|
@@ -1944,8 +1921,7 @@ async function main() {
|
|
1944
1921
|
if (UtilityEnabled("ResetType")) {
|
1945
1922
|
document.querySelector("#problemset > thead > tr > th:nth-child(1)").style.width = "5%";
|
1946
1923
|
}
|
1947
|
-
localStorage.setItem("UserScript-Contest-" + SearchParams.get("cid") + "-ProblemCount",
|
1948
|
-
document.querySelector("#problemset > tbody").rows.length);
|
1924
|
+
localStorage.setItem("UserScript-Contest-" + SearchParams.get("cid") + "-ProblemCount", document.querySelector("#problemset > tbody").rows.length);
|
1949
1925
|
}
|
1950
1926
|
}
|
1951
1927
|
} else if (location.pathname == "/contestrank-oi.php") {
|
@@ -1956,10 +1932,7 @@ async function main() {
|
|
1956
1932
|
if (document.querySelector("body > div > div.mt-3 > center > h3").innerText == "比赛排名") {
|
1957
1933
|
document.querySelector("#rank").innerText = "比赛暂时还没有排名";
|
1958
1934
|
} else {
|
1959
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText =
|
1960
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText.substring(
|
1961
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText.indexOf(" -- ") + 4)
|
1962
|
-
+ "(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排名)";
|
1963
1936
|
document.querySelector("#rank > thead > tr > :nth-child(1)").innerText = "排名";
|
1964
1937
|
document.querySelector("#rank > thead > tr > :nth-child(2)").innerText = "用户";
|
1965
1938
|
document.querySelector("#rank > thead > tr > :nth-child(3)").innerText = "昵称";
|
@@ -2029,10 +2002,7 @@ async function main() {
|
|
2029
2002
|
}
|
2030
2003
|
} else if (UtilityEnabled("ACMRank")) {
|
2031
2004
|
if (document.querySelector("body > div > div.mt-3 > center > h3").innerText != "比赛排名") {
|
2032
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText =
|
2033
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText.substring(
|
2034
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText.indexOf(" -- ") + 4)
|
2035
|
-
+ "(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排名)";
|
2036
2006
|
}
|
2037
2007
|
let RankData = [];
|
2038
2008
|
let RefreshACMRank = async (ProblemCount) => {
|
@@ -2081,9 +2051,7 @@ async function main() {
|
|
2081
2051
|
});
|
2082
2052
|
if (CurrentProblem == null) {
|
2083
2053
|
CurrentProblem = {
|
2084
|
-
Index: CurrentSubmission.num,
|
2085
|
-
Attempts: [],
|
2086
|
-
SolveTime: 0
|
2054
|
+
Index: CurrentSubmission.num, Attempts: [], SolveTime: 0
|
2087
2055
|
};
|
2088
2056
|
CurrentRow.Problem.push(CurrentProblem);
|
2089
2057
|
}
|
@@ -2093,16 +2061,14 @@ async function main() {
|
|
2093
2061
|
CurrentRow.Penalty += parseInt(CurrentSubmission.in_date) + CurrentProblem.Attempts.length * 20 * 60;
|
2094
2062
|
}
|
2095
2063
|
CurrentProblem.Attempts.push({
|
2096
|
-
Time: CurrentSubmission.in_date,
|
2097
|
-
Result: CurrentSubmission.result
|
2064
|
+
Time: CurrentSubmission.in_date, Result: CurrentSubmission.result
|
2098
2065
|
});
|
2099
2066
|
}
|
2100
2067
|
|
2101
2068
|
for (let i = 0; i < RankData.length; i++) {
|
2102
2069
|
for (let j = 0; j < RankData[i].Problem.length; j++) {
|
2103
2070
|
for (let k = 0; k < RankData[i].Problem.length; k++) {
|
2104
|
-
if (j != k && RankData[i].Problem[j].SolveTime != 0 && RankData[i].Problem[k].SolveTime != 0 &&
|
2105
|
-
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) {
|
2106
2072
|
RankData[i].QuickSubmitCount++;
|
2107
2073
|
}
|
2108
2074
|
}
|
@@ -2361,9 +2327,7 @@ async function main() {
|
|
2361
2327
|
TidyTable(Table);
|
2362
2328
|
|
2363
2329
|
scrollTo({
|
2364
|
-
left: LastPositionX,
|
2365
|
-
top: LastPositionY,
|
2366
|
-
behavior: "instant"
|
2330
|
+
left: LastPositionX, top: LastPositionY, behavior: "instant"
|
2367
2331
|
});
|
2368
2332
|
}
|
2369
2333
|
});
|
@@ -2398,10 +2362,7 @@ async function main() {
|
|
2398
2362
|
document.querySelector("#rank").innerText = "比赛暂时还没有排名";
|
2399
2363
|
} else {
|
2400
2364
|
if (UtilityEnabled("ResetType")) {
|
2401
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText =
|
2402
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText.substring(
|
2403
|
-
document.querySelector("body > div > div.mt-3 > center > h3").innerText.indexOf(" -- ") + 4)
|
2404
|
-
+ "(订正排名)";
|
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) + "(订正排名)";
|
2405
2366
|
document.querySelector("body > div > div.mt-3 > center > a").remove();
|
2406
2367
|
}
|
2407
2368
|
document.querySelector("#rank > thead > tr > :nth-child(1)").innerText = "排名";
|
@@ -2471,12 +2432,7 @@ async function main() {
|
|
2471
2432
|
}
|
2472
2433
|
}
|
2473
2434
|
} else if (location.pathname == "/submitpage.php") {
|
2474
|
-
document.querySelector("body > div > div.mt-3").innerHTML = `<center class="mb-3">` +
|
2475
|
-
`<h3>提交代码</h3>` +
|
2476
|
-
(SearchParams.get("id") != null ?
|
2477
|
-
`题目<span class="blue">${Number(SearchParams.get("id"))}</span>` :
|
2478
|
-
`比赛<span class="blue">${Number(SearchParams.get("cid")) + `</span> 题目<span class="blue">` + String.fromCharCode(65 + parseInt(SearchParams.get("pid")))}</span>`) +
|
2479
|
-
`</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>
|
2480
2436
|
<textarea id="CodeInput"></textarea>
|
2481
2437
|
<center class="mt-3">
|
2482
2438
|
<input id="enable_O2" name="enable_O2" type="checkbox"><label for="enable_O2">打开O2开关</label>
|
@@ -2502,8 +2458,7 @@ async function main() {
|
|
2502
2458
|
tabMode: "shift",
|
2503
2459
|
theme: (UtilityEnabled("DarkMode") ? "darcula" : "default"),
|
2504
2460
|
extraKeys: {
|
2505
|
-
"Ctrl-Space": "autocomplete",
|
2506
|
-
"Ctrl-Enter": function (instance) {
|
2461
|
+
"Ctrl-Space": "autocomplete", "Ctrl-Enter": function (instance) {
|
2507
2462
|
Submit.click();
|
2508
2463
|
}
|
2509
2464
|
}
|
@@ -2532,13 +2487,7 @@ async function main() {
|
|
2532
2487
|
},
|
2533
2488
|
"referrer": location.href,
|
2534
2489
|
"method": "POST",
|
2535
|
-
"body":
|
2536
|
-
(SearchParams.get("id") != null ?
|
2537
|
-
"id=" + SearchParams.get("id") :
|
2538
|
-
"cid=" + SearchParams.get("cid") + "&pid=" + SearchParams.get("pid")) +
|
2539
|
-
"&language=1&" +
|
2540
|
-
"source=" + encodeURIComponent(CodeMirrorElement.getValue()) + "&" +
|
2541
|
-
"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"
|
2542
2491
|
}).then((Response) => {
|
2543
2492
|
if (Response.redirected) {
|
2544
2493
|
location.href = Response.url;
|
@@ -2600,19 +2549,11 @@ async function main() {
|
|
2600
2549
|
if (UtilityEnabled("CompileError")) {
|
2601
2550
|
let ResponseData = await new Promise((Resolve) => {
|
2602
2551
|
GM_xmlhttpRequest({
|
2603
|
-
method: "POST",
|
2604
|
-
url: "https://cppinsights.io/api/v1/transform",
|
2605
|
-
headers: {
|
2552
|
+
method: "POST", url: "https://cppinsights.io/api/v1/transform", headers: {
|
2606
2553
|
"content-type": "application/json;charset=UTF-8"
|
2607
|
-
},
|
2608
|
-
|
2609
|
-
|
2610
|
-
"insightsOptions": [
|
2611
|
-
"cpp14"
|
2612
|
-
],
|
2613
|
-
"code": Source
|
2614
|
-
}),
|
2615
|
-
onload: (Response) => {
|
2554
|
+
}, referrer: "https://cppinsights.io/", data: JSON.stringify({
|
2555
|
+
"insightsOptions": ["cpp14"], "code": Source
|
2556
|
+
}), onload: (Response) => {
|
2616
2557
|
Resolve(Response);
|
2617
2558
|
}
|
2618
2559
|
});
|
@@ -2647,8 +2588,7 @@ async function main() {
|
|
2647
2588
|
let UpdateDataCard = document.createElement("div");
|
2648
2589
|
document.querySelector("body > div > div.mt-3").appendChild(UpdateDataCard);
|
2649
2590
|
UpdateDataCard.className = "card mb-3";
|
2650
|
-
if (Data.Prerelease)
|
2651
|
-
UpdateDataCard.classList.add("text-secondary");
|
2591
|
+
if (Data.Prerelease) UpdateDataCard.classList.add("text-secondary");
|
2652
2592
|
let UpdateDataCardBody = document.createElement("div");
|
2653
2593
|
UpdateDataCard.appendChild(UpdateDataCardBody);
|
2654
2594
|
UpdateDataCardBody.className = "card-body";
|
@@ -2677,10 +2617,7 @@ async function main() {
|
|
2677
2617
|
let UpdateDataCardListItem = document.createElement("li");
|
2678
2618
|
UpdateDataCardList.appendChild(UpdateDataCardListItem);
|
2679
2619
|
UpdateDataCardListItem.className = "list-group-item";
|
2680
|
-
UpdateDataCardListItem.innerHTML =
|
2681
|
-
"(<a href=\"https://github.com/XMOJ-Script-dev/XMOJ-Script/pull/" + Data.UpdateContents[j].PR + "\" target=\"_blank\">" +
|
2682
|
-
"#" + Data.UpdateContents[j].PR + "</a>) " +
|
2683
|
-
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;
|
2684
2621
|
}
|
2685
2622
|
let UpdateDataCardLink = document.createElement("a");
|
2686
2623
|
UpdateDataCardBody.appendChild(UpdateDataCardLink);
|
@@ -2832,17 +2769,7 @@ async function main() {
|
|
2832
2769
|
},
|
2833
2770
|
"referrer": location.href,
|
2834
2771
|
"method": "POST",
|
2835
|
-
"body":
|
2836
|
-
"nick=" + encodeURIComponent(Nickname) + "&" +
|
2837
|
-
"opassword=" + encodeURIComponent(OldPassword) + "&" +
|
2838
|
-
"npassword=" + encodeURIComponent(NewPassword) + "&" +
|
2839
|
-
"rptpassword=" + encodeURIComponent(NewPasswordAgain) + "&" +
|
2840
|
-
"school=" + encodeURIComponent(School) + "&" +
|
2841
|
-
"email=" + encodeURIComponent(EmailAddress) + "&" +
|
2842
|
-
"acc_cf=" + encodeURIComponent(CodeforcesAccount) + "&" +
|
2843
|
-
"acc_atc=" + encodeURIComponent(AtcoderAccount) + "&" +
|
2844
|
-
"acc_usaco=" + encodeURIComponent(USACOAccount) + "&" +
|
2845
|
-
"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)
|
2846
2773
|
});
|
2847
2774
|
ModifyInfo.disabled = false;
|
2848
2775
|
ModifyInfo.querySelector("span").style.display = "none";
|
@@ -2855,10 +2782,6 @@ async function main() {
|
|
2855
2782
|
ExportACCode.className = "btn btn-outline-secondary";
|
2856
2783
|
ExportACCode.addEventListener("click", () => {
|
2857
2784
|
ExportACCode.disabled = true;
|
2858
|
-
let ExportProgressBar = document.getElementsByTagName("progress")[0] || document.createElement("progress");
|
2859
|
-
ExportProgressBar.removeAttribute("value");
|
2860
|
-
ExportProgressBar.removeAttribute("max");
|
2861
|
-
document.querySelector("body > div.container > div").appendChild(ExportProgressBar);
|
2862
2785
|
ExportACCode.innerText = "正在导出...";
|
2863
2786
|
let Request = new XMLHttpRequest();
|
2864
2787
|
Request.addEventListener("readystatechange", () => {
|
@@ -2866,32 +2789,31 @@ async function main() {
|
|
2866
2789
|
if (Request.status == 200) {
|
2867
2790
|
let Response = Request.responseText;
|
2868
2791
|
let ACCode = Response.split("------------------------------------------------------\r\n");
|
2869
|
-
|
2870
|
-
|
2871
|
-
|
2872
|
-
|
2873
|
-
|
2874
|
-
|
2875
|
-
|
2876
|
-
|
2877
|
-
|
2878
|
-
|
2879
|
-
|
2880
|
-
|
2881
|
-
|
2882
|
-
let CurrentQuestionID = CurrentCode.substring(7, 11);
|
2883
|
-
CurrentCode = CurrentCode.substring(14);
|
2884
|
-
ExportProgressBar.value = i + 1;
|
2885
|
-
let DownloadLink = document.createElement("a");
|
2886
|
-
DownloadLink.href = window.URL.createObjectURL(new Blob([CurrentCode]));
|
2887
|
-
DownloadLink.download = CurrentQuestionID + ".cpp";
|
2888
|
-
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
|
+
}
|
2889
2805
|
}
|
2890
|
-
|
2891
|
-
|
2892
|
-
|
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
|
+
});
|
2893
2816
|
};
|
2894
|
-
DownloadCode(0);
|
2895
2817
|
} else {
|
2896
2818
|
ExportACCode.disabled = false;
|
2897
2819
|
ExportACCode.innerText = "AC代码导出失败";
|
@@ -3206,17 +3128,13 @@ async function main() {
|
|
3206
3128
|
LoginButton.addEventListener("click", async () => {
|
3207
3129
|
let Username = document.getElementsByName("user_id")[0].value;
|
3208
3130
|
let Password = document.getElementsByName("password")[0].value;
|
3209
|
-
if (Username == "" ||
|
3210
|
-
Password == "") {
|
3131
|
+
if (Username == "" || Password == "") {
|
3211
3132
|
ErrorText.innerText = "用户名或密码不能为空";
|
3212
3133
|
} else {
|
3213
3134
|
await fetch("https://www.xmoj.tech/login.php", {
|
3214
|
-
method: "POST",
|
3215
|
-
headers: {
|
3135
|
+
method: "POST", headers: {
|
3216
3136
|
"Content-Type": "application/x-www-form-urlencoded"
|
3217
|
-
},
|
3218
|
-
body: "user_id=" + encodeURIComponent(Username) +
|
3219
|
-
"&password=" + hex_md5(Password)
|
3137
|
+
}, body: "user_id=" + encodeURIComponent(Username) + "&password=" + hex_md5(Password)
|
3220
3138
|
})
|
3221
3139
|
.then((Response) => {
|
3222
3140
|
return Response.text();
|
@@ -3252,9 +3170,7 @@ async function main() {
|
|
3252
3170
|
});
|
3253
3171
|
}
|
3254
3172
|
});
|
3255
|
-
if (UtilityEnabled("SavePassword") &&
|
3256
|
-
localStorage.getItem("UserScript-Username") != null &&
|
3257
|
-
localStorage.getItem("UserScript-Password") != null) {
|
3173
|
+
if (UtilityEnabled("SavePassword") && localStorage.getItem("UserScript-Username") != null && localStorage.getItem("UserScript-Password") != null) {
|
3258
3174
|
document.querySelector("#login > div:nth-child(1) > div > input").value = localStorage.getItem("UserScript-Username");
|
3259
3175
|
document.querySelector("#login > div:nth-child(2) > div > input").value = localStorage.getItem("UserScript-Password");
|
3260
3176
|
LoginButton.click();
|
@@ -3277,8 +3193,7 @@ async function main() {
|
|
3277
3193
|
let RandomUUID = () => {
|
3278
3194
|
let t = "0123456789abcdef";
|
3279
3195
|
let e = [];
|
3280
|
-
for (let r = 0; r < 36; r++)
|
3281
|
-
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);
|
3282
3197
|
e[14] = "4";
|
3283
3198
|
e[19] = t.substr(3 & e[19] | 8, 1);
|
3284
3199
|
e[8] = e[13] = e[18] = e[23] = "-";
|
@@ -3302,11 +3217,7 @@ async function main() {
|
|
3302
3217
|
"Channel": "HTML5"
|
3303
3218
|
});
|
3304
3219
|
URLParams.sort();
|
3305
|
-
await fetch("https://vod." + VideoData.region + ".aliyuncs.com/?" +
|
3306
|
-
URLParams.toString() +
|
3307
|
-
"&Signature=" +
|
3308
|
-
encodeURIComponent(CryptoJS.HmacSHA1("GET&%2F&" + encodeURIComponent(URLParams.toString()),
|
3309
|
-
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)))
|
3310
3221
|
.then((Response) => {
|
3311
3222
|
return Response.json();
|
3312
3223
|
})
|
@@ -3385,10 +3296,7 @@ int main()
|
|
3385
3296
|
},
|
3386
3297
|
"referrer": "https://www.xmoj.tech/submitpage.php?id=" + PID,
|
3387
3298
|
"method": "POST",
|
3388
|
-
"body": "id=" + PID + "&" +
|
3389
|
-
"language=1&" +
|
3390
|
-
"source=" + encodeURIComponent(Code) + "&" +
|
3391
|
-
"enable_O2=on"
|
3299
|
+
"body": "id=" + PID + "&" + "language=1&" + "source=" + encodeURIComponent(Code) + "&" + "enable_O2=on"
|
3392
3300
|
});
|
3393
3301
|
|
3394
3302
|
let SID = await fetch("https://www.xmoj.tech/status.php").then((Response) => {
|
@@ -3450,9 +3358,7 @@ int main()
|
|
3450
3358
|
headers: {
|
3451
3359
|
"Content-Type": "application/x-www-form-urlencoded"
|
3452
3360
|
},
|
3453
|
-
body: "user_id=" + CurrentUsername + "&" +
|
3454
|
-
"solution_id=" + SearchParams.get("sid") + "&" +
|
3455
|
-
"name=" + ApplyElements[i].getAttribute("name")
|
3361
|
+
body: "user_id=" + CurrentUsername + "&" + "solution_id=" + SearchParams.get("sid") + "&" + "name=" + ApplyElements[i].getAttribute("name")
|
3456
3362
|
}).then((Response) => {
|
3457
3363
|
return Response.json();
|
3458
3364
|
}).then((Response) => {
|
@@ -3528,17 +3434,7 @@ int main()
|
|
3528
3434
|
"URL": "https://sourceforge.net/projects/mingw/"
|
3529
3435
|
}];
|
3530
3436
|
for (let i = 0; i < Softwares.length; i++) {
|
3531
|
-
SoftwareList.innerHTML +=
|
3532
|
-
"<li class=\"software_item\">" +
|
3533
|
-
"<a href=\"" + Softwares[i].URL + "\">" +
|
3534
|
-
"<div class=\"item-info\">" +
|
3535
|
-
"<div class=\"item-img\">" +
|
3536
|
-
"<img height=\"50\" src=\"" + Softwares[i].Image + "\" alt=\"点击下载\">" +
|
3537
|
-
"</div>" +
|
3538
|
-
"<div class=\"item-txt\">" + Softwares[i].Name + "</div>" +
|
3539
|
-
"</div>" +
|
3540
|
-
"</a>" +
|
3541
|
-
"</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>";
|
3542
3438
|
}
|
3543
3439
|
}
|
3544
3440
|
} else if (location.pathname == "/problemstatus.php") {
|
@@ -3551,8 +3447,7 @@ int main()
|
|
3551
3447
|
Temp[i].removeAttribute("class");
|
3552
3448
|
}
|
3553
3449
|
|
3554
|
-
document.querySelector("#problemstatus > thead > tr").innerHTML =
|
3555
|
-
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");
|
3556
3451
|
document.querySelector("#problemstatus > thead > tr > th:nth-child(2)").innerText = "运行编号";
|
3557
3452
|
document.querySelector("#problemstatus > thead > tr > th:nth-child(4)").remove();
|
3558
3453
|
document.querySelector("#problemstatus > thead > tr > th:nth-child(4)").remove();
|
@@ -3674,8 +3569,7 @@ int main()
|
|
3674
3569
|
Code = Response.substring(0, Response.indexOf("/**************************************************************")).trim();
|
3675
3570
|
});
|
3676
3571
|
} else {
|
3677
|
-
if (localStorage.getItem("UserScript-LastUploadedStdTime") === undefined ||
|
3678
|
-
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) {
|
3679
3573
|
location.href = "https://www.xmoj.tech/userinfo.php?ByUserScript=1";
|
3680
3574
|
}
|
3681
3575
|
await new Promise((Resolve) => {
|
@@ -3925,8 +3819,7 @@ int main()
|
|
3925
3819
|
Send.children[0].style.display = "";
|
3926
3820
|
let ContentData = Content.value;
|
3927
3821
|
RequestAPI("SendMail", {
|
3928
|
-
"ToUser": String(SearchParams.get("to_user")),
|
3929
|
-
"Content": String(ContentData)
|
3822
|
+
"ToUser": String(SearchParams.get("to_user")), "Content": String(ContentData)
|
3930
3823
|
}, (ResponseData) => {
|
3931
3824
|
Send.disabled = false;
|
3932
3825
|
Send.children[0].style.display = "none";
|
@@ -4115,8 +4008,7 @@ int main()
|
|
4115
4008
|
let CaptchaSecretKey = "";
|
4116
4009
|
unsafeWindow.CaptchaLoadedCallback = () => {
|
4117
4010
|
turnstile.render("#CaptchaContainer", {
|
4118
|
-
sitekey: CaptchaSiteKey,
|
4119
|
-
callback: function (CaptchaSecretKeyValue) {
|
4011
|
+
sitekey: CaptchaSiteKey, callback: function (CaptchaSecretKeyValue) {
|
4120
4012
|
CaptchaSecretKey = CaptchaSecretKeyValue;
|
4121
4013
|
SubmitElement.disabled = false;
|
4122
4014
|
},
|
@@ -4224,8 +4116,7 @@ int main()
|
|
4224
4116
|
RadioInput.disabled = true;
|
4225
4117
|
}
|
4226
4118
|
if (Data[i].BoardID == 4) {
|
4227
|
-
if (!isNaN(ProblemID))
|
4228
|
-
RadioInput.checked = true;
|
4119
|
+
if (!isNaN(ProblemID)) RadioInput.checked = true;
|
4229
4120
|
RadioInput.disabled = true;
|
4230
4121
|
}
|
4231
4122
|
let RadioLabel = document.createElement("label");
|
@@ -4293,8 +4184,7 @@ int main()
|
|
4293
4184
|
let CaptchaSecretKey = "";
|
4294
4185
|
unsafeWindow.CaptchaLoadedCallback = () => {
|
4295
4186
|
turnstile.render("#CaptchaContainer", {
|
4296
|
-
sitekey: CaptchaSiteKey,
|
4297
|
-
callback: function (CaptchaSecretKeyValue) {
|
4187
|
+
sitekey: CaptchaSiteKey, callback: function (CaptchaSecretKeyValue) {
|
4298
4188
|
CaptchaSecretKey = CaptchaSecretKeyValue;
|
4299
4189
|
SubmitElement.disabled = false;
|
4300
4190
|
},
|
@@ -4364,8 +4254,7 @@ int main()
|
|
4364
4254
|
}
|
4365
4255
|
}
|
4366
4256
|
RequestAPI("GetPost", {
|
4367
|
-
"PostID": Number(ThreadID),
|
4368
|
-
"Page": Number(Page)
|
4257
|
+
"PostID": Number(ThreadID), "Page": Number(Page)
|
4369
4258
|
}, async (ResponseData) => {
|
4370
4259
|
if (ResponseData.Success == true) {
|
4371
4260
|
let OldScrollTop = document.documentElement.scrollTop;
|
@@ -4655,8 +4544,7 @@ int main()
|
|
4655
4544
|
|
4656
4545
|
if (Silent) {
|
4657
4546
|
scrollTo({
|
4658
|
-
top: OldScrollTop,
|
4659
|
-
behavior: "instant"
|
4547
|
+
top: OldScrollTop, behavior: "instant"
|
4660
4548
|
});
|
4661
4549
|
}
|
4662
4550
|
} else {
|
@@ -4719,4 +4607,4 @@ int main()
|
|
4719
4607
|
}
|
4720
4608
|
}
|
4721
4609
|
|
4722
|
-
main();
|
4610
|
+
main();
|