This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
forked from XMOJ-Script-dev/XMOJ-Script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
XMOJ.user.js
4265 lines (4177 loc) · 267 KB
/
XMOJ.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ==UserScript==
// @name XMOJ
// @version 0.2.200
// @description XMOJ增强脚本
// @author @PythonSmall-Q
// @namespace https://github/langningchen
// @match http://*.xmoj.tech/*
// @match http://116.62.212.172/*
// @require https://cdn.bootcdn.net/ajax/libs/crypto-js/4.1.1/crypto-js.min.js
// @require https://cdn.bootcdn.net/ajax/libs/codemirror/6.65.7/codemirror.min.js
// @require https://cdn.bootcdn.net/ajax/libs/codemirror/6.65.7/mode/clike/clike.min.js
// @require https://cdn.bootcdn.net/ajax/libs/codemirror/6.65.7/addon/merge/merge.js
// @require https://cdn.bootcdn.net/ajax/libs/diff_match_patch/20121119/diff_match_patch_uncompressed.js
// @require https://cdn.bootcdn.net/ajax/libs/dompurify/3.0.2/purify.min.js
// @require https://cdn.bootcdn.net/ajax/libs/marked/4.3.0/marked.min.js
// @grant GM_registerMenuCommand
// @grant GM_xmlhttpRequest
// @grant GM_setClipboard
// @grant unsafeWindow
// @connect api.seanoj.edu.eu.org
// @connect challenges.cloudflare.com
// @connect cppinsights.io
// @connect 127.0.0.1
// @license GPL
// ==/UserScript==
/**
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
* 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.
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const CaptchaSiteKey = "0x4AAAAAAALBT58IhyDViNmv";
const AdminUserList = ["zhuchenrui2", "shanwenxiao", "admin"];
let PurifyHTML = (Input) => {
return DOMPurify.sanitize(Input, {
"ALLOWED_TAGS": ["a", "b", "blockquote", "br", "code", "dd", "del", "div", "dl", "dt", "em", "h1", "h2", "h3", "h4", "h5", "h6", "h7", "h8", "hr", "i", "img", "ins", "kbd", "li", "ol", "p", "pre", "q", "rp", "rt", "ruby", "s", "samp", "strike", "strong", "sub", "sup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "tt", "ul", "var"],
"ALLOWED_ATTR": ["abbr", "accept", "accept-charset", "accesskey", "action", "align", "alt", "axis", "border", "cellpadding", "cellspacing", "char", "charoff", "charset", "checked", "cite", "clear", "color", "cols", "colspan", "compact", "coords", "datetime", "dir", "disabled", "enctype", "for", "frame", "headers", "height", "href", "hreflang", "hspace", "ismap", "itemprop", "label", "lang", "longdesc", "maxlength", "media", "method", "multiple", "name", "nohref", "noshade", "nowrap", "prompt", "readonly", "rel", "rev", "rows", "rowspan", "rules", "scope", "selected", "shape", "size", "span", "src", "start", "summary", "tabindex", "target", "title", "type", "usemap", "valign", "value", "vspace", "width"]
});
}
let GetRelativeTime = (Input) => {
Input = new Date(Input);
let Now = new Date().getTime();
let Delta = Now - Input.getTime();
let RelativeName = "";
if (Delta < 0) { RelativeName = "未来"; }
else if (Delta <= 1000 * 60) { RelativeName = "刚刚"; }
else if (Delta <= 1000 * 60 * 60) { RelativeName = Math.floor((Now - Input) / 1000 / 60) + "分钟前"; }
else if (Delta <= 1000 * 60 * 60 * 24) { RelativeName = Math.floor((Now - Input) / 1000 / 60 / 60) + "小时前"; }
else if (Delta <= 1000 * 60 * 60 * 24 * 31) { RelativeName = Math.floor((Now - Input) / 1000 / 60 / 60 / 24) + "天前"; }
else if (Delta <= 1000 * 60 * 60 * 24 * 365) { RelativeName = Math.floor((Now - Input) / 1000 / 60 / 60 / 24 / 31) + "个月前"; }
else { RelativeName = Math.floor((Now - Input) / 1000 / 60 / 60 / 24 / 365) + "年前"; }
return "<span title=\"" + Input.toLocaleString() + "\">" + RelativeName + "</span>";
};
let RenderMathJax = async () => {
if (document.getElementById("MathJax-script") === null) {
var ScriptElement = document.createElement("script");
ScriptElement.id = "MathJax-script";
ScriptElement.type = "text/javascript";
ScriptElement.src = "https://cdn.bootcdn.net/ajax/libs/mathjax/3.0.5/es5/tex-chtml.js";
document.body.appendChild(ScriptElement);
await new Promise((Resolve) => {
ScriptElement.onload = () => {
Resolve();
};
});
}
MathJax.startup.input[0].findTeX.options.inlineMath.push(["$", "$"]);
MathJax.startup.input[0].findTeX.getPatterns();
MathJax.typeset();
};
let GetUserInfo = async (Username) => {
if (localStorage.getItem("UserScript-User-" + Username + "-UserRating") != null &&
new Date().getTime() - parseInt(localStorage.getItem("UserScript-User-" + Username + "-LastUpdateTime")) < 1000 * 60 * 60 * 24) {
return {
"Rating": localStorage.getItem("UserScript-User-" + Username + "-UserRating"),
"EmailHash": localStorage.getItem("UserScript-User-" + Username + "-EmailHash")
}
}
return await fetch("http://www.xmoj.tech/userinfo.php?user=" + Username).then((Response) => {
return Response.text();
}).then((Response) => {
if (Response.indexOf("No such User!") !== -1) {
return null;
}
const ParsedDocument = new DOMParser().parseFromString(Response, "text/html");
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;
let Temp = ParsedDocument.querySelector("#statics > tbody").children;
let Email = Temp[Temp.length - 1].children[1].innerText.trim();
let EmailHash = CryptoJS.MD5(Email).toString();
localStorage.setItem("UserScript-User-" + Username + "-UserRating", Rating);
if (Email == "") {
EmailHash = undefined;
} else {
localStorage.setItem("UserScript-User-" + Username + "-EmailHash", EmailHash);
}
localStorage.setItem("UserScript-User-" + Username + "-LastUpdateTime", new Date().getTime());
return {
"Rating": Rating,
"EmailHash": EmailHash
}
});
};
let GetUserBadge = async (Username) => {
if (localStorage.getItem("UserScript-User-" + Username + "-Badge-LastUpdateTime") != null &&
new Date().getTime() - parseInt(localStorage.getItem("UserScript-User-" + Username + "-Badge-LastUpdateTime")) < 1000 * 60 * 60 * 24) {
return {
"BackgroundColor": localStorage.getItem("UserScript-User-" + Username + "-Badge-BackgroundColor"),
"Color": localStorage.getItem("UserScript-User-" + Username + "-Badge-Color"),
"Content": localStorage.getItem("UserScript-User-" + Username + "-Badge-Content")
}
} else {
let BackgroundColor = "";
let Color = "";
let Content = "";
await new Promise((Resolve) => {
RequestAPI("GetBadge", {
"UserID": String(Username)
}, (Response) => {
if (Response.Success) {
BackgroundColor = Response.Data.BackgroundColor;
Color = Response.Data.Color;
Content = Response.Data.Content;
}
Resolve();
});
});
localStorage.setItem("UserScript-User-" + Username + "-Badge-BackgroundColor", BackgroundColor);
localStorage.setItem("UserScript-User-" + Username + "-Badge-Color", Color);
localStorage.setItem("UserScript-User-" + Username + "-Badge-Content", Content);
localStorage.setItem("UserScript-User-" + Username + "-Badge-LastUpdateTime", String(new Date().getTime()));
return {
"BackgroundColor": BackgroundColor,
"Color": Color,
"Content": Content
}
}
};
let GetUsernameHTML = async (Element, Username, Simple = false, Href = "http://www.xmoj.tech/userinfo.php?user=") => {
Username = Username.replaceAll(/[^a-zA-Z0-9]/g, "");
let ID = "Username-" + Username + "-" + Math.random();
Element.id = ID;
Element.innerHTML = `<div class="spinner-border spinner-border-sm me-2" role="status"></div>`;
Element.appendChild(document.createTextNode(Username));
let UserInfo = await GetUserInfo(Username);
if (UserInfo === null) {
document.getElementById(ID).innerHTML = "";
document.getElementById(ID).appendChild(document.createTextNode(Username));
return;
}
let HTMLData = "";
if (!Simple) {
HTMLData += `<img src="`;
if (UserInfo.EmailHash == undefined) {
HTMLData += `https://cravatar.cn/avatar/00000000000000000000000000000000?d=mp&f=y`;
}
else {
HTMLData += `https://cravatar.cn/avatar/${UserInfo.EmailHash}?d=retro`;
}
HTMLData += `" class="rounded me-2" style="width: 20px; height: 20px; ">`;
}
HTMLData += `<a href="${Href}${Username}" class="link-offset-2 link-underline-opacity-50 `
if (UtilityEnabled("Rating")) {
let Rating = UserInfo.Rating;
if (Rating > 500) {
HTMLData += "link-danger";
} else if (Rating >= 400) {
HTMLData += "link-warning";
} else if (Rating >= 300) {
HTMLData += "link-success";
} else {
HTMLData += "link-info";
}
}
else {
HTMLData += "link-info";
}
HTMLData += `\";"></a>`;
if (!Simple) {
if (AdminUserList.includes(Username)) {
HTMLData += `<span class="badge text-bg-danger ms-2">管理员</span>`;
}
let BadgeInfo = await GetUserBadge(Username);
if (BadgeInfo.Content != "") {
HTMLData += `<span class="badge ms-2" style="background-color: ${BadgeInfo.BackgroundColor}; color: ${BadgeInfo.Color}">${BadgeInfo.Content}</span>`;
}
}
document.getElementById(ID).innerHTML = HTMLData;
document.getElementById(ID).getElementsByTagName("a")[0].appendChild(document.createTextNode(Username));
};
let SecondsToString = (InputSeconds) => {
let Hours = Math.floor(InputSeconds / 3600);
let Minutes = Math.floor((InputSeconds % 3600) / 60);
let Seconds = InputSeconds % 60;
return (Hours < 10 ? "0" : "") + Hours + ":" +
(Minutes < 10 ? "0" : "") + Minutes + ":" +
(Seconds < 10 ? "0" : "") + Seconds;
}
let StringToSeconds = (InputString) => {
let SplittedString = InputString.split(":");
return parseInt(SplittedString[0]) * 60 * 60 +
parseInt(SplittedString[1]) * 60 +
parseInt(SplittedString[2]);
}
let SizeToStringSize = (Memory) => {
if (UtilityEnabled("AddUnits")) {
if (Memory < 1024) {
return Memory + "B";
} else if (Memory < 1024 * 1024) {
return (Memory / 1024).toFixed(2) + "KB";
} else if (Memory < 1024 * 1024 * 1024) {
return (Memory / 1024 / 1024).toFixed(2) + "MB";
} else {
return (Memory / 1024 / 1024 / 1024).toFixed(2) + "GB";
}
}
else {
return Memory;
}
};
let TimeToStringTime = (Time) => {
if (UtilityEnabled("AddUnits")) {
if (Time < 1000) {
return Time + "ms";
} else if (Time < 1000 * 60) {
return (Time / 1000).toFixed(2) + "s";
} else if (Time < 1000 * 60 * 60) {
return (Time / 1000 / 60).toFixed(2) + "min";
} else {
return (Time / 1000 / 60 / 60).toFixed(2) + "h";
}
}
else {
return Time;
}
};
let TidyTable = (Table) => {
if (UtilityEnabled("NewBootstrap") && Table != null) {
Table.className = "table table-hover";
Table.querySelector("thead > tr").removeAttribute("class");
Table.querySelector("thead > tr").removeAttribute("align");
Table.querySelector("thead > tr").innerHTML = Table.querySelector("thead > tr").innerHTML.replaceAll("td", "th");
let Temp = Table.querySelector("thead > tr").children;
for (let j = 0; j < Temp.length; j++) {
let Width = Temp[j].style.width;
Temp[j].removeAttribute("style");
Temp[j].style.width = Width;
Temp[j].removeAttribute("onclick");
Temp[j].removeAttribute("align");
}
Table.querySelector("tbody").className = "table-group-divider";
Temp = Table.querySelector("tbody").children;
for (let j = 0; j < Temp.length; j++) {
Temp[j].removeAttribute("align");
let Temp2 = Temp[j].querySelectorAll("*");
for (let k = 0; k < Temp2.length; k++) {
Temp2[k].classList.remove("left");
Temp2[k].classList.remove("center");
if (Temp2[k].className == "") {
Temp2[k].removeAttribute("class");
}
}
}
}
};
let UtilityEnabled = (Name) => {
if (localStorage.getItem("UserScript-Setting-" + Name) == null) {
localStorage.setItem("UserScript-Setting-" + Name, (Name == "DebugMode" ? "false" : "true"));
}
return localStorage.getItem("UserScript-Setting-" + Name) == "true";
};
let RequestAPI = (Action, Data, CallBack) => {
let Session = "";
let Temp = document.cookie.split(";");
for (let i = 0; i < Temp.length; i++) {
if (Temp[i].includes("PHPSESSID")) {
Session = Temp[i].split("=")[1];
}
}
let PostData = {
"Authentication": {
"SessionID": Session,
"Username": CurrentUsername,
},
"Data": Data
};
let DataString = JSON.stringify(PostData);
GM_xmlhttpRequest({
method: "POST",
url: "https://api.seanoj.edu.eu.org/" + Action,
// url: "http://127.0.0.1:8787/" + Action,
headers: {
"Content-Type": "application/json"
},
data: DataString,
onload: (Response) => {
try {
CallBack(JSON.parse(Response.responseText));
} catch (Error) {
console.log(Response.responseText);
CallBack({
"Success": false,
"Message": "JSON解析错误:" + Error,
"Data": null
});
}
}
});
};
GM_registerMenuCommand("清除缓存", () => {
let Temp = [];
for (let i = 0; i < localStorage.length; i++) {
if (localStorage.key(i).startsWith("UserScript-User-")) {
Temp.push(localStorage.key(i));
}
}
for (let i = 0; i < Temp.length; i++) {
localStorage.removeItem(Temp[i]);
}
location.reload();
});
GM_registerMenuCommand("重置数据", () => {
if (confirm("确定要重置数据吗?")) {
localStorage.clear();
location.reload();
}
});
let SearchParams = new URLSearchParams(location.search);
let ServerURL = (UtilityEnabled("DebugMode") ? "https://PythonSmall-Q.github.io/XMOJ-Script" : "https://www.seanoj.edu.eu.org")
let CurrentUsername = document.querySelector("#profile").innerText;
CurrentUsername = CurrentUsername.replaceAll(/[^a-zA-Z0-9]/g, "");
let IsAdmin = AdminUserList.indexOf(CurrentUsername) !== -1;
if (location.host != "www.xmoj.tech") {
location.host = "www.xmoj.tech";
}
else {
document.body.classList.add("placeholder-glow");
if (document.querySelector("#navbar") != null) {
if (document.querySelector("body > div > div.jumbotron") != null) {
document.querySelector("body > div > div.jumbotron").className = "mt-3";
}
if (UtilityEnabled("AutoLogin") &&
document.querySelector("#profile") != null &&
document.querySelector("#profile").innerHTML == "登录" &&
location.pathname != "/login.php" &&
location.pathname != "/loginpage.php" &&
location.pathname != "/lostpassword.php") {
localStorage.setItem("UserScript-LastPage", location.pathname + location.search);
location.href = "http://www.xmoj.tech/loginpage.php";
}
let Discussion = null;
if (UtilityEnabled("Discussion")) {
Discussion = document.createElement("li");
document.querySelector("#navbar > ul:nth-child(1)").appendChild(Discussion);
Discussion.innerHTML = "<a href=\"http://www.xmoj.tech/discuss3/discuss.php\">讨论</a>";
}
if (document.querySelector("#navbar > ul:nth-child(1)").childElementCount > 8 && UtilityEnabled("ACMRank")) {
let ACMRank = document.createElement("li");
document.querySelector("#navbar > ul:nth-child(1)").insertBefore(ACMRank, document.querySelector("#navbar > ul:nth-child(1) > li:nth-child(9)"));
ACMRank.innerHTML = "<a href=\"http://www.xmoj.tech/contestrank-oi.php?cid=" + Number(SearchParams.get("cid")) + "&ByUserScript=1\">ACM 排名</a>";
ACMRank.classList.add("active");
}
if (UtilityEnabled("Translate")) {
document.querySelector("#navbar > ul:nth-child(1) > li:nth-child(2) > a").innerText = "题库";
}
if (UtilityEnabled("ReplaceLinks")) {
document.body.innerHTML =
String(document.body.innerHTML).replaceAll(
/\[<a href="([^"]*)">([^<]*)<\/a>\]/g,
"<button onclick=\"location.href='$1'\" class=\"btn btn-outline-secondary\">$2</button>");
}
if (UtilityEnabled("ReplaceXM")) {
document.body.innerHTML = String(document.body.innerHTML).replaceAll("我", "高老师");
document.body.innerHTML = String(document.body.innerHTML).replaceAll("小明", "高老师");
document.body.innerHTML = String(document.body.innerHTML).replaceAll("下海", "上海");
document.body.innerHTML = String(document.body.innerHTML).replaceAll("海上", "上海");
document.body.innerHTML = String(document.body.innerHTML).replaceAll("小红", "低老师");
document.body.innerHTML = String(document.body.innerHTML).replaceAll("高老师们", "我们");
document.body.innerHTML = String(document.body.innerHTML).replaceAll("自高老师", "自我");
document.title = String(document.title).replaceAll("小明", "高老师");
}
if (UtilityEnabled("NewBootstrap")) {
let Temp = document.querySelectorAll("link");
for (var i = 0; i < Temp.length; i++) {
if (Temp[i].href.indexOf("bootstrap.min.css") != -1) {
Temp[i].remove();
}
else if (Temp[i].href.indexOf("white.css") != -1) {
Temp[i].remove();
}
else if (Temp[i].href.indexOf("semantic.min.css") != -1) {
Temp[i].remove();
}
else if (Temp[i].href.indexOf("bootstrap-theme.min.css") != -1) {
Temp[i].remove();
}
else if (Temp[i].href.indexOf("problem.css") != -1) {
Temp[i].remove();
}
}
if (UtilityEnabled("DarkMode")) {
document.querySelector("html").setAttribute("data-bs-theme", "dark");
}
else {
document.querySelector("html").setAttribute("data-bs-theme", "light");
}
let PopperScriptElement = document.createElement("script"); document.head.appendChild(PopperScriptElement);
PopperScriptElement.type = "module";
PopperScriptElement.src = "https://cdn.bootcdn.net/ajax/libs/popper.js/2.11.7/umd/popper.min.js";
let CodeMirrorStyleElement = document.createElement("link"); document.head.appendChild(CodeMirrorStyleElement);
CodeMirrorStyleElement.rel = "stylesheet";
CodeMirrorStyleElement.href = "https://cdn.bootcdn.net/ajax/libs/codemirror/6.65.7/codemirror.min.css";
let CodeMirrorThemeStyleElement = document.createElement("link"); document.head.appendChild(CodeMirrorThemeStyleElement);
CodeMirrorThemeStyleElement.rel = "stylesheet";
CodeMirrorThemeStyleElement.href = "https://cdn.bootcdn.net/ajax/libs/codemirror/6.65.7/theme/darcula.min.css";
let CodeMirrorMergeStyleElement = document.createElement("link"); document.head.appendChild(CodeMirrorMergeStyleElement);
CodeMirrorMergeStyleElement.rel = "stylesheet";
CodeMirrorMergeStyleElement.href = "https://cdn.bootcdn.net/ajax/libs/codemirror/6.65.7/addon/merge/merge.min.css";
let BootstrapStyleElement = document.createElement("link"); document.head.appendChild(BootstrapStyleElement);
BootstrapStyleElement.rel = "stylesheet";
BootstrapStyleElement.href = "https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0-alpha3/css/bootstrap.min.css";
await new Promise((Resolve) => {
PopperScriptElement.onload = () => {
Resolve();
};
});
Temp = document.querySelectorAll("script");
for (var i = 0; i < Temp.length; i++) {
if (Temp[i].src.indexOf("bootstrap.min.js") != -1) {
Temp[i].remove();
let BootstrapScriptElement = document.createElement("script"); document.head.appendChild(BootstrapScriptElement);
BootstrapScriptElement.type = "module";
BootstrapScriptElement.src = "https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0-alpha3/js/bootstrap.min.js";
await new Promise((Resolve) => {
BootstrapScriptElement.onload = () => {
Resolve();
};
});
}
}
document.querySelector("nav").className = "navbar navbar-expand-lg bg-body-tertiary";
document.querySelector("#navbar > ul:nth-child(1)").classList = "navbar-nav me-auto mb-2 mb-lg-0";
document.querySelector("body > div > nav > div > div.navbar-header").outerHTML = `<a class="navbar-brand" href="http://www.xmoj.tech/">${UtilityEnabled("ReplaceXM") ? "高老师" : "小明"}的OJ</a><button type="button" class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#navbar"><span class="navbar-toggler-icon"></span></button>`;
document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li").classList = "nav-item dropdown";
document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > a").className = "nav-link dropdown-toggle";
document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > a > span.caret").remove();
Temp = document.querySelector("#navbar > ul:nth-child(1)").children;
for (var i = 0; i < Temp.length; i++) {
if (Temp[i].classList.contains("active")) {
Temp[i].classList.remove("active");
Temp[i].children[0].classList.add("active");
}
Temp[i].classList.add("nav-item");
Temp[i].children[0].classList.add("nav-link");
}
document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > a").setAttribute("data-bs-toggle", "dropdown");
document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > a").removeAttribute("data-toggle");
}
if (UtilityEnabled("RemoveUseless") && document.getElementsByTagName("marquee")[0] != undefined) {
document.getElementsByTagName("marquee")[0].remove();
}
let Style = document.createElement("style");
document.body.appendChild(Style);
Style.innerHTML = `
nav {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
blockquote {
border-left: 5px solid var(--bs-secondary-bg);
padding: 0.5em 1em;
}
.status_y:hover {
box-shadow: #52c41a 1px 1px 10px 0px !important;
}
.status_n:hover {
box-shadow: #fe4c61 1px 1px 10px 0px !important;
}
.test-case {
border-radius: 5px !important;
}
.test-case:hover {
box-shadow: rgba(0, 0, 0, 0.3) 0px 10px 20px 3px !important;
}
.data[result-item] {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
.software_list {
width: unset !important;
}
.software_item {
margin: 5px 10px !important;
background-color: var(--bs-secondary-bg) !important;
}
.item-txt {
color: var(--bs-emphasis-color) !important;
}
.cnt-row {
justify-content: inherit;
align-items: stretch;
width: 100% !important;
padding: 1rem 0;
}
.cnt-row-head {
padding: 0.8em 1em;
background-color: var(--bs-secondary-bg);
border-radius: 0.3rem 0.3rem 0 0;
width: 100%;
}
.cnt-row-body {
padding: 1em;
border: 1px solid var(--bs-secondary-bg);
border-top: none;
border-radius: 0 0 0.3rem 0.3rem;
}`;
if (UtilityEnabled("AddAnimation")) {
Style.innerHTML += `.status, .test-case {
transition: 0.5s !important;
}`;
}
if (UtilityEnabled("AddColorText")) {
Style.innerHTML += `.red {
color: red !important;
}
.green {
color: green !important;
}
.blue {
color: blue !important;
}`;
}
if (UtilityEnabled("RemoveUseless")) {
if (document.getElementsByClassName("footer")[0] != null) {
document.getElementsByClassName("footer")[0].remove();
}
}
if (UtilityEnabled("ReplaceYN")) {
Temp = document.getElementsByClassName("status_y");
for (let i = 0; i < Temp.length; i++) {
Temp[i].innerText = "✓";
}
Temp = document.getElementsByClassName("status_n");
for (let i = 0; i < Temp.length; i++) {
Temp[i].innerText = "✗";
}
}
Temp = document.getElementsByClassName("page-item");
for (let i = 0; i < Temp.length; i++) {
Temp[i].children[0].className = "page-link";
}
if (document.getElementsByClassName("pagination")[0] != null) {
document.getElementsByClassName("pagination")[0].classList.add("justify-content-center");
}
Temp = document.getElementsByTagName("table");
for (let i = 0; i < Temp.length; i++) {
if (Temp[i].querySelector("thead") != null) {
TidyTable(Temp[i]);
}
}
setInterval(() => {
try {
let CurrentDate = new Date(new Date().getTime() + diff);
let Year = CurrentDate.getFullYear();
if (Year > 3000) {
Year -= 1900;
}
let Month = CurrentDate.getMonth() + 1;
let _Date = CurrentDate.getDate();
let Hours = CurrentDate.getHours();
let Minutes = CurrentDate.getMinutes();
let Seconds = CurrentDate.getSeconds();
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;
} catch (Error) { }
if (UtilityEnabled("ResetType")) {
if (document.querySelector("#profile") != undefined &&
document.querySelector("#profile").innerHTML == "登录") {
if (document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul").childNodes.length == 3) {
document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul").childNodes[3].remove();
}
}
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 != "个人中心") {
let PopupUL = document.querySelector("#navbar > ul.nav.navbar-nav.navbar-right > li > ul");
PopupUL.innerHTML = `<li class="dropdown-item">修改帐号</li>
<li class="dropdown-item">个人中心</li>
<li class="dropdown-item">短消息</li>
<li class="dropdown-item">插件设置</li>
<li class="dropdown-item">注销</li>`
PopupUL.children[0].addEventListener("click", () => {
location.href = "http://www.xmoj.tech/modifypage.php";
});
PopupUL.children[1].addEventListener("click", () => {
location.href = "http://www.xmoj.tech/userinfo.php?user=" + CurrentUsername;
});
PopupUL.children[2].addEventListener("click", () => {
location.href = "http://www.xmoj.tech/mail.php";
});
PopupUL.children[3].addEventListener("click", () => {
location.href = "http://www.xmoj.tech/index.php?ByUserScript=1";
});
PopupUL.children[4].addEventListener("click", () => {
localStorage.removeItem("UserScript-Username");
localStorage.removeItem("UserScript-Password");
location.href = "http://www.xmoj.tech/logout.php";
});
Style.innerHTML += ".dropdown-item {";
Style.innerHTML += " cursor: pointer;";
Style.innerHTML += "}";
}
}
if (UtilityEnabled("AutoCountdown")) {
let Temp = document.getElementsByClassName("UpdateByJS");
for (let i = 0; i < Temp.length; i++) {
let EndTime = Temp[i].getAttribute("EndTime");
if (EndTime === null) {
Temp[i].classList.remove("UpdateByJS");
continue;
}
let TimeStamp = parseInt(EndTime) - new Date().getTime();
if (TimeStamp < 3000) {
Temp[i].classList.remove("UpdateByJS");
location.reload();
}
let CurrentDate = new Date(TimeStamp);
let Day = parseInt((TimeStamp / 1000 / 60 / 60 / 24).toFixed(0));
let Hour = CurrentDate.getUTCHours();
let Minute = CurrentDate.getUTCMinutes();
let Second = CurrentDate.getUTCSeconds();
Temp[i].innerHTML = (Day !== 0 ? Day + "天" : "") +
(Hour !== 0 ? (Hour < 10 ? "0" : "") + Hour + "小时" : "") +
(Minute !== 0 ? (Minute < 10 ? "0" : "") + Minute + "分" : "") +
(Second !== 0 ? (Second < 10 ? "0" : "") + Second + "秒" : "");
}
}
}, 100);
fetch(ServerURL + "/Update.json", { cache: "no-cache" })
.then((Response) => {
return Response.json();
})
.then((Response) => {
let CurrentVersion = GM_info.script.version;
let LatestVersion;
for (let i = Object.keys(Response.UpdateHistory).length - 1; i > 0; i--) {
let VersionInfo = Object.keys(Response.UpdateHistory)[i];
if (UtilityEnabled("DebugMode") || Response.UpdateHistory[VersionInfo].Prerelease == false) {
LatestVersion = VersionInfo;
break;
}
}
if (CurrentVersion < LatestVersion) {
let UpdateDiv = document.createElement("div");
UpdateDiv.innerHTML = `<div class="alert alert-warning alert-dismissible fade show mt-2" role="alert">
<div>
XMOJ用户脚本发现新版本${LatestVersion},当前版本${CurrentVersion},点击
<a href="${ServerURL}/XMOJ.user.js" target="_blank" class="alert-link">此处</a>
更新
</div>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>`;
document.querySelector("body > div").insertBefore(UpdateDiv, document.querySelector("body > div > div.mt-3"));
}
if (localStorage.getItem("UserScript-Update-LastVersion") != GM_info.script.version) {
localStorage.setItem("UserScript-Update-LastVersion", GM_info.script.version);
let UpdateDiv = document.createElement("div"); document.querySelector("body").appendChild(UpdateDiv);
UpdateDiv.className = "modal fade";
UpdateDiv.id = "UpdateModal";
UpdateDiv.tabIndex = -1;
let UpdateDialog = document.createElement("div"); UpdateDiv.appendChild(UpdateDialog);
UpdateDialog.className = "modal-dialog";
let UpdateContent = document.createElement("div"); UpdateDialog.appendChild(UpdateContent);
UpdateContent.className = "modal-content";
let UpdateHeader = document.createElement("div"); UpdateContent.appendChild(UpdateHeader);
UpdateHeader.className = "modal-header";
let UpdateTitle = document.createElement("h5"); UpdateHeader.appendChild(UpdateTitle);
UpdateTitle.className = "modal-title";
UpdateTitle.innerText = "更新日志";
let UpdateCloseButton = document.createElement("button"); UpdateHeader.appendChild(UpdateCloseButton);
UpdateCloseButton.type = "button";
UpdateCloseButton.className = "btn-close";
UpdateCloseButton.setAttribute("data-bs-dismiss", "modal");
let UpdateBody = document.createElement("div"); UpdateContent.appendChild(UpdateBody);
UpdateBody.className = "modal-body";
let UpdateFooter = document.createElement("div"); UpdateContent.appendChild(UpdateFooter);
UpdateFooter.className = "modal-footer";
let UpdateButton = document.createElement("button"); UpdateFooter.appendChild(UpdateButton);
UpdateButton.type = "button";
UpdateButton.className = "btn btn-secondary";
UpdateButton.setAttribute("data-bs-dismiss", "modal");
UpdateButton.innerText = "关闭";
let Version = Object.keys(Response.UpdateHistory)[Object.keys(Response.UpdateHistory).length - 1]
let Data = Response.UpdateHistory[Version];
let UpdateDataCard = document.createElement("div"); UpdateBody.appendChild(UpdateDataCard);
UpdateDataCard.className = "card mb-3";
let UpdateDataCardBody = document.createElement("div"); UpdateDataCard.appendChild(UpdateDataCardBody);
UpdateDataCardBody.className = "card-body";
let UpdateDataCardTitle = document.createElement("h5"); UpdateDataCardBody.appendChild(UpdateDataCardTitle);
UpdateDataCardTitle.className = "card-title";
UpdateDataCardTitle.innerText = Version;
let UpdateDataCardSubtitle = document.createElement("h6"); UpdateDataCardBody.appendChild(UpdateDataCardSubtitle);
UpdateDataCardSubtitle.className = "card-subtitle mb-2 text-muted";
UpdateDataCardSubtitle.innerHTML = GetRelativeTime(Data.UpdateDate);
let UpdateDataCardText = document.createElement("p"); UpdateDataCardBody.appendChild(UpdateDataCardText);
UpdateDataCardText.className = "card-text";
let UpdateDataCardList = document.createElement("ul"); UpdateDataCardText.appendChild(UpdateDataCardList);
UpdateDataCardList.className = "list-group list-group-flush";
for (let j = 0; j < Data.UpdateContents.length; j++) {
let UpdateDataCardListItem = document.createElement("li"); UpdateDataCardList.appendChild(UpdateDataCardListItem);
UpdateDataCardListItem.className = "list-group-item";
UpdateDataCardListItem.innerHTML =
"(<a href=\"https://github.com/PythonSmall-Q/XMOJ-Script/pull/" + Data.UpdateContents[j].PR + "\" target=\"_blank\">" +
"#" + Data.UpdateContents[j].PR + "</a>) " +
Data.UpdateContents[j].Description;
}
let UpdateDataCardLink = document.createElement("a"); UpdateDataCardBody.appendChild(UpdateDataCardLink);
UpdateDataCardLink.className = "card-link";
UpdateDataCardLink.href = "https://github.com/PythonSmall-Q/XMOJ-Script/releases/tag/" + Version;
UpdateDataCardLink.target = "_blank";
UpdateDataCardLink.innerText = "查看该版本";
new bootstrap.Modal(document.getElementById("UpdateModal")).show();
}
});
fetch(ServerURL + "/AddonScript.js", { cache: "no-cache" })
.then((Response) => {
return Response.text();
})
.then((Response) => {
eval(Response);
});
let ToastContainer = document.createElement("div");
ToastContainer.classList.add("toast-container", "position-fixed", "bottom-0", "end-0", "p-3");
document.body.appendChild(ToastContainer);
addEventListener("focus", () => {
if (UtilityEnabled("BBSPopup")) {
RequestAPI("GetBBSMentionList", {}, (Response) => {
if (Response.Success) {
ToastContainer.innerHTML = "";
let MentionList = Response.Data.MentionList;
for (let i = 0; i < MentionList.length; i++) {
let Toast = document.createElement("div");
Toast.classList.add("toast");
Toast.setAttribute("role", "alert");
let ToastHeader = document.createElement("div");
ToastHeader.classList.add("toast-header");
let ToastTitle = document.createElement("strong");
ToastTitle.classList.add("me-auto");
ToastTitle.innerHTML = "提醒";
ToastHeader.appendChild(ToastTitle);
let ToastTime = document.createElement("small");
ToastTime.classList.add("text-body-secondary");
ToastTime.innerHTML = GetRelativeTime(MentionList[i].MentionTime);
ToastHeader.appendChild(ToastTime);
let ToastCloseButton = document.createElement("button");
ToastCloseButton.type = "button";
ToastCloseButton.classList.add("btn-close");
ToastCloseButton.setAttribute("data-bs-dismiss", "toast");
ToastHeader.appendChild(ToastCloseButton);
Toast.appendChild(ToastHeader);
let ToastBody = document.createElement("div");
ToastBody.classList.add("toast-body");
ToastBody.innerHTML = "讨论" + MentionList[i].PostTitle + "有新回复";
let ToastFooter = document.createElement("div");
ToastFooter.classList.add("mt-2", "pt-2", "border-top");
let ToastDismissButton = document.createElement("button");
ToastDismissButton.type = "button";
ToastDismissButton.classList.add("btn", "btn-secondary", "btn-sm", "me-2");
ToastDismissButton.innerText = "忽略";
ToastDismissButton.addEventListener("click", () => {
RequestAPI("ReadBBSMention", {
"MentionID": Number(MentionList[i].MentionID)
}, () => { });
Toast.remove();
});
ToastFooter.appendChild(ToastDismissButton);
let ToastViewButton = document.createElement("button");
ToastViewButton.type = "button";
ToastViewButton.classList.add("btn", "btn-primary", "btn-sm");
ToastViewButton.innerText = "查看";
ToastViewButton.addEventListener("click", () => {
open("http://www.xmoj.tech/discuss3/thread.php?tid=" + MentionList[i].PostID, "_blank");
RequestAPI("ReadBBSMention", {
"MentionID": Number(MentionList[i].MentionID)
}, () => { });
});
ToastFooter.appendChild(ToastViewButton);
ToastBody.appendChild(ToastFooter);
Toast.appendChild(ToastBody);
ToastContainer.appendChild(Toast);
new bootstrap.Toast(Toast).show();
}
}
});
}
if (UtilityEnabled("MessagePopup")) {
RequestAPI("GetMailMentionList", {}, async (Response) => {
if (Response.Success) {
if (!UtilityEnabled("BBSPopup")) {
ToastContainer.innerHTML = "";
}
let MentionList = Response.Data.MentionList;
for (let i = 0; i < MentionList.length; i++) {
let Toast = document.createElement("div");
Toast.classList.add("toast");
Toast.setAttribute("role", "alert");
let ToastHeader = document.createElement("div");
ToastHeader.classList.add("toast-header");
let ToastTitle = document.createElement("strong");
ToastTitle.classList.add("me-auto");
ToastTitle.innerHTML = "提醒";
ToastHeader.appendChild(ToastTitle);
let ToastTime = document.createElement("small");
ToastTime.classList.add("text-body-secondary");
ToastTime.innerHTML = GetRelativeTime(MentionList[i].MentionTime);
ToastHeader.appendChild(ToastTime);
let ToastCloseButton = document.createElement("button");
ToastCloseButton.type = "button";
ToastCloseButton.classList.add("btn-close");
ToastCloseButton.setAttribute("data-bs-dismiss", "toast");
ToastHeader.appendChild(ToastCloseButton);
Toast.appendChild(ToastHeader);
let ToastBody = document.createElement("div");
ToastBody.classList.add("toast-body");
let ToastUser = document.createElement("span");
GetUsernameHTML(ToastUser, MentionList[i].FromUserID);
ToastBody.appendChild(ToastUser);
ToastBody.innerHTML += " 给你发了一封短消息";
let ToastFooter = document.createElement("div");
ToastFooter.classList.add("mt-2", "pt-2", "border-top");
let ToastDismissButton = document.createElement("button");
ToastDismissButton.type = "button";
ToastDismissButton.classList.add("btn", "btn-secondary", "btn-sm", "me-2");
ToastDismissButton.innerText = "忽略";
ToastDismissButton.addEventListener("click", () => {
RequestAPI("ReadMailMention", {
"MentionID": Number(MentionList[i].MentionID)
}, () => { });
});
ToastFooter.appendChild(ToastDismissButton);
let ToastViewButton = document.createElement("button");
ToastViewButton.type = "button";
ToastViewButton.classList.add("btn", "btn-primary", "btn-sm");
ToastViewButton.innerText = "查看";
ToastViewButton.addEventListener("click", () => {
open("http://www.xmoj.tech/mail.php?other=" + MentionList[i].FromUserID, "_blank");
RequestAPI("ReadMailMention", {
"MentionID": Number(MentionList[i].MentionID)
}, () => { });
});
ToastFooter.appendChild(ToastViewButton);
ToastBody.appendChild(ToastFooter);
Toast.appendChild(ToastBody);
ToastContainer.appendChild(Toast);
new bootstrap.Toast(Toast).show();
}
}
});
}
});
dispatchEvent(new Event("focus"));
if (location.pathname == "/index.php" || location.pathname == "/") {
if (new URL(location.href).searchParams.get("ByUserScript") != null) {
localStorage.setItem("UserScript-Opened", "true");
let Container = document.getElementsByClassName("mt-3")[0];
Container.innerHTML = "";
let Alert = document.createElement("div");
Alert.classList.add("alert");
Alert.classList.add("alert-primary");
Alert.role = "alert";
Alert.innerHTML = `欢迎使用XMOJ增强脚本!点击
<a class="alert-link" href="http://www.xmoj.tech/modifypage.php?ByUserScript=1" target="_blank">此处</a>
查看更新日志。`;
Container.appendChild(Alert);
let UtilitiesCard = document.createElement("div");
UtilitiesCard.classList.add("card");
UtilitiesCard.classList.add("mb-3");
let UtilitiesCardHeader = document.createElement("div");
UtilitiesCardHeader.classList.add("card-header");
UtilitiesCardHeader.innerText = "功能列表";
UtilitiesCard.appendChild(UtilitiesCardHeader);
let UtilitiesCardBody = document.createElement("div");
UtilitiesCardBody.classList.add("card-body");
let CreateList = (Data) => {
let List = document.createElement("ul");
List.classList.add("list-group");
for (let i = 0; i < Data.length; i++) {
let Row = document.createElement("li");
Row.classList.add("list-group-item");
if (Data[i].Type == "A") {
Row.classList.add("list-group-item-success");
}
else if (Data[i].Type == "F") {
Row.classList.add("list-group-item-warning");
}
else if (Data[i].Type == "D") {
Row.classList.add("list-group-item-danger");
}
if (Data[i].Children == undefined) {
let CheckBox = document.createElement("input");
CheckBox.classList.add("form-check-input");
CheckBox.classList.add("me-1");
CheckBox.type = "checkbox";
CheckBox.id = Data[i].ID;
if (localStorage.getItem("UserScript-Setting-" + Data[i].ID) == null) {
localStorage.setItem("UserScript-Setting-" + Data[i].ID, "true");
}
if (localStorage.getItem("UserScript-Setting-" + Data[i].ID) == "false") {
CheckBox.checked = false;
}
else {
CheckBox.checked = true;
}
CheckBox.addEventListener("change", () => {
return localStorage.setItem("UserScript-Setting-" + Data[i].ID, CheckBox.checked);
});
Row.appendChild(CheckBox);
let Label = document.createElement("label");
Label.classList.add("form-check-label");
Label.htmlFor = Data[i].ID;
Label.innerText = Data[i].Name;
Row.appendChild(Label);
}
else {
let Label = document.createElement("label");
Label.innerText = Data[i].Name;
Row.appendChild(Label);
}
if (Data[i].Children != undefined) {
Row.appendChild(CreateList(Data[i].Children));
}
List.appendChild(Row);
}
return List;
};
UtilitiesCardBody.appendChild(CreateList([
{ "ID": "ACMRank", "Type": "A", "Name": "比赛ACM排名,并且能下载ACM排名" },
{ "ID": "Discussion", "Type": "F", "Name": "恢复讨论与短消息功能" },
{ "ID": "MoreSTD", "Type": "F", "Name": "查看到更多标程" },
{ "ID": "Rating", "Type": "A", "Name": "添加用户评分和用户名颜色" },
{ "ID": "AutoRefresh", "Type": "A", "Name": "比赛列表、比赛排名界面自动刷新" },
{ "ID": "AutoCountdown", "Type": "A", "Name": "比赛列表等界面的时间自动倒计时" },
{ "ID": "DownloadPlayback", "Type": "A", "Name": "回放视频增加下载功能" },
{ "ID": "ImproveACRate", "Type": "A", "Name": "自动提交已AC题目以提高AC率" },
{ "ID": "AutoO2", "Type": "F", "Name": "代码提交界面自动选择O2优化" },
{
"ID": "Beautify", "Type": "F", "Name": "美化界面", "Children": [
{ "ID": "NewBootstrap", "Type": "F", "Name": "使用新版的Bootstrap样式库*" },
{ "ID": "ResetType", "Type": "F", "Name": "重新排版*" },
{ "ID": "AddColorText", "Type": "A", "Name": "增加彩色文字" },
{ "ID": "AddUnits", "Type": "A", "Name": "状态界面内存与耗时添加单位" },
{ "ID": "DarkMode", "Type": "A", "Name": "使用暗色模式" },
{ "ID": "AddAnimation", "Type": "A", "Name": "增加动画" },
{ "ID": "ReplaceYN", "Type": "F", "Name": "题目前对错的Y和N替换为勾和叉" },
{ "ID": "RemoveAlerts", "Type": "D", "Name": "去除多余反复的提示" },
{ "ID": "Translate", "Type": "F", "Name": "统一使用中文,翻译了部分英文*" },
{ "ID": "ReplaceLinks", "Type": "F", "Name": "将网站中所有以方括号包装的链接替换为按钮" },
{ "ID": "RemoveUseless", "Type": "D", "Name": "删去无法使用的功能*" },
{ "ID": "ReplaceXM", "Type": "F", "Name": "将网站中所有“小明”和“我”关键字替换为“高老师”,所有“小红”替换为“低老师”,所有“下海”、“海上”替换为“上海”" }
]
},
{ "ID": "AutoLogin", "Type": "A", "Name": "在需要登录的界面自动跳转到登陆界面" },
{ "ID": "SavePassword", "Type": "A", "Name": "自动保存用户名与密码,免去每次手动输入密码的繁琐" },
{ "ID": "CopySamples", "Type": "F", "Name": "题目界面测试样例有时复制无效" },
{ "ID": "RefreshSolution", "Type": "F", "Name": "状态页面结果自动刷新每次只能刷新一个" },
{ "ID": "CopyMD", "Type": "A", "Name": "复制题目或题解内容" },
{ "ID": "OpenAllProblem", "Type": "A", "Name": "比赛题目界面一键打开所有题目" },
{
"ID": "CheckCode", "Type": "A", "Name": "提交代码前对代码进行检查", "Children": [
{ "ID": "IOFile", "Type": "A", "Name": "是否使用了文件输入输出(如果需要使用)" },
{ "ID": "CompileError", "Type": "A", "Name": "是否有编译错误" }
]
},