xmoj-script 1.1.56 → 1.1.59
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/.github/pull_request_template.md +1 -20
- package/.github/workflows/pr-check-ci.yml +24 -0
- package/.github/workflows/similar-issue.yml +17 -0
- package/SECURITY.md +3 -11
- package/Update.json +41 -0
- package/XMOJ.user.js +90 -5
- package/package.json +1 -1
- package/.idea/XMOJ-Script.iml +0 -12
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -7
- package/.vscode/settings.json +0 -148
@@ -1,20 +1 @@
|
|
1
|
-
- [ ] 我已认真阅读贡献指南 (contributing guidelines) 和社区公约 (code of conduct),并遵循了如何参与页及格式手册页的相应规范。
|
2
|
-
|
3
|
-
By making a contribution to this project, I certify that:
|
4
|
-
|
5
|
-
The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or
|
6
|
-
|
7
|
-
The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or
|
8
|
-
|
9
|
-
The contribution was provided directly to me by some other person who certified 1., 2. or 3. and I have not modified it.
|
10
|
-
|
11
|
-
I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.
|
12
|
-
|
13
|
-
<!--
|
14
|
-
这是 Pull Request 的描述页面,可拖动输入框右下角调节大小。尽管按下绿色按钮提交后,您仍可以对描述进行修改,但还请您先阅读以下注意事项。
|
15
|
-
- 请不要删去本区域文字,或在此修改内容,因为本区域作为注释内容是不可见的。你应该点击 Preview 查看描述页效果。
|
16
|
-
- 请勾选输入框外的 `Allow edits from maintainers` 的候选框(机器人需要修正格式),并通过蓝色高亮链接阅读、理解了指南和公约后,将上述 [ ] 替换为 [x]。
|
17
|
-
- 若本 Pull Request 能够完全解决某个 Issue,请将该 Pull Request 与对应的 Issue 链接起来,具体做法请参见 <https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue>。
|
18
|
-
- 请对照规范页面,检查 Commit 信息、PR 标题和下方 Compare 页面,例如:
|
19
|
-
- 您的修改是否波及到了其他文件,是否发生了意图之外的文件名修改(这在您启用了翻译软件的情况下较为常见),是否引入了无关文件。
|
20
|
-
-->
|
1
|
+
- [ ] 我已认真阅读贡献指南 (contributing guidelines) 和社区公约 (code of conduct),并遵循了如何参与页及格式手册页的相应规范。
|
@@ -0,0 +1,24 @@
|
|
1
|
+
name: Check PR CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
schedule:
|
5
|
+
- cron: "*/10 * * * *"
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
check-pr-ci:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
steps:
|
11
|
+
- uses: actions-cool/check-pr-ci@v1
|
12
|
+
with:
|
13
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
14
|
+
# filter-label: 'check-ci'
|
15
|
+
# filter-creator-authority: 'write'
|
16
|
+
filter-head-ref: 'master, dev'
|
17
|
+
filter-support-fork: true
|
18
|
+
success-review: true
|
19
|
+
success-review-body: 'PR passes all checks'
|
20
|
+
success-merge: false
|
21
|
+
conflict-review-body: 'PR has conflicts, please fix them first!'
|
22
|
+
failure-review: 'REQUEST_CHANGES'
|
23
|
+
failure-review-body: 'PR fails some checks'
|
24
|
+
failure-close: false
|
@@ -0,0 +1,17 @@
|
|
1
|
+
name: Issues Similarity Analysis
|
2
|
+
|
3
|
+
on:
|
4
|
+
issues:
|
5
|
+
types: [opened, edited]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
similarity-analysis:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
steps:
|
11
|
+
- name: analysis
|
12
|
+
uses: actions-cool/issues-similarity-analysis@v1
|
13
|
+
with:
|
14
|
+
filter-threshold: 0.75
|
15
|
+
title-excludes: 'bug, not, 1234'
|
16
|
+
comment-title: '### We have found some similar issues see'
|
17
|
+
comment-body: '${index}. ${similarity} #${number}'
|
package/SECURITY.md
CHANGED
@@ -1,13 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# Security Policy
|
2
2
|
|
3
|
-
##
|
3
|
+
## Supported Versions
|
4
4
|
|
5
|
-
|
6
|
-
| ------- | ------------------ | --------- | -------- |
|
7
|
-
| > 1.0.251 | :white_check_mark: | 支持 | |
|
8
|
-
| 1.0.x (x < 251) | :x: | 已停止支持 | 后台 api 变动 |
|
9
|
-
| 0.3.x | :x: | 已停止支持 | 开发组人员变动 |
|
10
|
-
| 0.2.x | :x: | 已停止支持 | 讨论功能重大更新 |
|
11
|
-
| 0.1.x | :x: | 已停止支持 | 重大安全隐患 + 依赖问题 (ansi_up) |
|
12
|
-
|
13
|
-
注意:在开发过程中,服务器和用户脚本可能在任何时候发生重大变动,造成非最新版本结束支持。在这种情况下,我们会尽快更新用户脚本!感谢您的谅解。
|
5
|
+
Only the latest stable release is supported
|
package/Update.json
CHANGED
@@ -1439,6 +1439,47 @@
|
|
1439
1439
|
}
|
1440
1440
|
],
|
1441
1441
|
"Notes": "No release notes were provided for this release."
|
1442
|
+
},
|
1443
|
+
"1.1.57": {
|
1444
|
+
"UpdateDate": 1713526164395,
|
1445
|
+
"Prerelease": false,
|
1446
|
+
"UpdateContents": [
|
1447
|
+
{
|
1448
|
+
"PR": 497,
|
1449
|
+
"Description": "move the main msg content into a div with flex!!! :tada:"
|
1450
|
+
},
|
1451
|
+
{
|
1452
|
+
"PR": 499,
|
1453
|
+
"Description": "add markdown support to short messages "
|
1454
|
+
},
|
1455
|
+
{
|
1456
|
+
"PR": 505,
|
1457
|
+
"Description": "让 ctrl + enter 触发自动提交当年代码"
|
1458
|
+
}
|
1459
|
+
],
|
1460
|
+
"Notes": "No release notes were provided for this release."
|
1461
|
+
},
|
1462
|
+
"1.1.58": {
|
1463
|
+
"UpdateDate": 1713668825681,
|
1464
|
+
"Prerelease": true,
|
1465
|
+
"UpdateContents": [
|
1466
|
+
{
|
1467
|
+
"PR": 514,
|
1468
|
+
"Description": "支持跳转到讨论编号 修改讨论区用户界面 在讨论区Page过大时自动跳转 在讨论区最后一页自动删除"
|
1469
|
+
}
|
1470
|
+
],
|
1471
|
+
"Notes": "No release notes were provided for this release."
|
1472
|
+
},
|
1473
|
+
"1.1.59": {
|
1474
|
+
"UpdateDate": 1713676517652,
|
1475
|
+
"Prerelease": true,
|
1476
|
+
"UpdateContents": [
|
1477
|
+
{
|
1478
|
+
"PR": 515,
|
1479
|
+
"Description": "允许管理在用户页管理badge并在修改badge后清除缓存"
|
1480
|
+
}
|
1481
|
+
],
|
1482
|
+
"Notes": "No release notes were provided for this release."
|
1442
1483
|
}
|
1443
1484
|
}
|
1444
1485
|
}
|
package/XMOJ.user.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
// ==UserScript==
|
2
2
|
// @name XMOJ
|
3
|
-
// @version 1.1.
|
3
|
+
// @version 1.1.59
|
4
4
|
// @description XMOJ增强脚本
|
5
5
|
// @author @XMOJ-Script-dev, @langningchen and the community
|
6
6
|
// @namespace https://github/langningchen
|
@@ -2681,7 +2681,15 @@ async function main() {
|
|
2681
2681
|
BadgeContent.value = Response.Data.Content;
|
2682
2682
|
BadgeBackgroundColor.value = Response.Data.BackgroundColor;
|
2683
2683
|
BadgeColor.value = Response.Data.Color;
|
2684
|
-
|
2684
|
+
let Temp = [];
|
2685
|
+
for (let i = 0; i < localStorage.length; i++) {
|
2686
|
+
if (localStorage.key(i).startsWith("UserScript-User-" + CurrentUsername + "-Badge-")) {
|
2687
|
+
Temp.push(localStorage.key(i));
|
2688
|
+
}
|
2689
|
+
}
|
2690
|
+
for (let i = 0; i < Temp.length; i++) {
|
2691
|
+
localStorage.removeItem(Temp[i]);
|
2692
|
+
}
|
2685
2693
|
}
|
2686
2694
|
});
|
2687
2695
|
ModifyInfo.addEventListener("click", async () => {
|
@@ -2855,7 +2863,63 @@ async function main() {
|
|
2855
2863
|
let lastOnlineElement = document.createElement('div');
|
2856
2864
|
lastOnlineElement.innerHTML = "最后在线:加载中...<br>";
|
2857
2865
|
UserInfoElement.appendChild(lastOnlineElement);
|
2858
|
-
|
2866
|
+
let BadgeInfo = await GetUserBadge(UserID);
|
2867
|
+
if (IsAdmin) {
|
2868
|
+
if (BadgeInfo.Content !== "") {
|
2869
|
+
let DeleteBadgeButton = document.createElement("button");
|
2870
|
+
DeleteBadgeButton.className = "btn btn-outline-danger btn-sm";
|
2871
|
+
DeleteBadgeButton.innerText = "删除标签";
|
2872
|
+
DeleteBadgeButton.addEventListener("click", async () => {
|
2873
|
+
if (confirm("您确定要删除此标签吗?")) {
|
2874
|
+
RequestAPI("DeleteBadge", {
|
2875
|
+
"UserID": UserID
|
2876
|
+
}, (Response) => {
|
2877
|
+
if (UtilityEnabled("DebugMode")) console.log(Response);
|
2878
|
+
if (Response.Success) {
|
2879
|
+
let Temp = [];
|
2880
|
+
for (let i = 0; i < localStorage.length; i++) {
|
2881
|
+
if (localStorage.key(i).startsWith("UserScript-User-" + UserID + "-Badge-")) {
|
2882
|
+
Temp.push(localStorage.key(i));
|
2883
|
+
}
|
2884
|
+
}
|
2885
|
+
for (let i = 0; i < Temp.length; i++) {
|
2886
|
+
localStorage.removeItem(Temp[i]);
|
2887
|
+
}
|
2888
|
+
window.location.reload();
|
2889
|
+
} else {
|
2890
|
+
alert(Response.Message);
|
2891
|
+
}
|
2892
|
+
});
|
2893
|
+
}
|
2894
|
+
});
|
2895
|
+
UserInfoElement.appendChild(DeleteBadgeButton);
|
2896
|
+
} else {
|
2897
|
+
let AddBadgeButton = document.createElement("button");
|
2898
|
+
AddBadgeButton.className = "btn btn-outline-primary btn-sm";
|
2899
|
+
AddBadgeButton.innerText = "添加标签";
|
2900
|
+
AddBadgeButton.addEventListener("click", async () => {
|
2901
|
+
RequestAPI("NewBadge", {
|
2902
|
+
"UserID": UserID
|
2903
|
+
}, (Response) => {
|
2904
|
+
if (Response.Success) {
|
2905
|
+
let Temp = [];
|
2906
|
+
for (let i = 0; i < localStorage.length; i++) {
|
2907
|
+
if (localStorage.key(i).startsWith("UserScript-User-" + UserID + "-Badge-")) {
|
2908
|
+
Temp.push(localStorage.key(i));
|
2909
|
+
}
|
2910
|
+
}
|
2911
|
+
for (let i = 0; i < Temp.length; i++) {
|
2912
|
+
localStorage.removeItem(Temp[i]);
|
2913
|
+
}
|
2914
|
+
window.location.reload();
|
2915
|
+
} else {
|
2916
|
+
alert(Response.Message);
|
2917
|
+
}
|
2918
|
+
});
|
2919
|
+
});
|
2920
|
+
UserInfoElement.appendChild(AddBadgeButton);
|
2921
|
+
}
|
2922
|
+
}
|
2859
2923
|
RequestAPI("LastOnline", {"Username": UserID}, (result) => {
|
2860
2924
|
if (result.Success) {
|
2861
2925
|
if (UtilityEnabled("DebugMode")) {
|
@@ -3811,8 +3875,23 @@ int main()
|
|
3811
3875
|
if (location.pathname == "/discuss3/discuss.php") {
|
3812
3876
|
let ProblemID = parseInt(SearchParams.get("pid"));
|
3813
3877
|
let Page = Number(SearchParams.get("page")) || 1;
|
3814
|
-
document.querySelector("body > div > div").innerHTML =
|
3815
|
-
|
3878
|
+
document.querySelector("body > div > div").innerHTML = ` <div style="text-align:center"><h1>讨论列表${(isNaN(ProblemID) ? "" : ` - 题目` + ProblemID)}</h1></div>
|
3879
|
+
<div class="row">
|
3880
|
+
<div class="col-md-5">
|
3881
|
+
<form action="discuss.php" >
|
3882
|
+
<div style="text-align:right">
|
3883
|
+
<button id="NewPost" type="button" class="btn btn-primary">发布新讨论</button>
|
3884
|
+
</div>
|
3885
|
+
</form>
|
3886
|
+
</div>
|
3887
|
+
<div class="col-md-3" style="display: inline">
|
3888
|
+
<form action="thread.php" class="input-group">
|
3889
|
+
<input class="form-control" type="number" name="tid" placeholder="讨论编号" min="1">
|
3890
|
+
<button class="btn btn-outline-secondary" type="submit">跳转</button>
|
3891
|
+
</form>
|
3892
|
+
</div style="display: inline">
|
3893
|
+
</div>
|
3894
|
+
<h><br></h>
|
3816
3895
|
<nav>
|
3817
3896
|
<ul class="pagination justify-content-center" id="DiscussPagination">
|
3818
3897
|
<li class="page-item"><a class="page-link" href="#"><span>«</span></a></li>
|
@@ -3887,6 +3966,7 @@ int main()
|
|
3887
3966
|
PostList.children[1].innerHTML = "";
|
3888
3967
|
if (Posts.length == 0) {
|
3889
3968
|
PostList.children[1].innerHTML = `<tr><td colspan="7">暂无数据</td></tr>`;
|
3969
|
+
location.href = "https://www.xmoj.tech/discuss3/discuss.php";
|
3890
3970
|
}
|
3891
3971
|
for (let i = 0; i < Posts.length; i++) {
|
3892
3972
|
let Row = document.createElement("tr");
|
@@ -3924,6 +4004,11 @@ int main()
|
|
3924
4004
|
let LastReplyTimeCell = document.createElement("td");
|
3925
4005
|
Row.appendChild(LastReplyTimeCell);
|
3926
4006
|
LastReplyTimeCell.innerHTML = GetRelativeTime(Posts[i].LastReplyTime);
|
4007
|
+
if (Posts[i].PostID == 1) {
|
4008
|
+
DiscussPagination.children[DiscussPagination.children.length - 1].classList.add("disabled");
|
4009
|
+
DiscussPagination.children[DiscussPagination.children.length - 2].remove();
|
4010
|
+
break;
|
4011
|
+
}
|
3927
4012
|
}
|
3928
4013
|
} else {
|
3929
4014
|
ErrorElement.innerText = ResponseData.Message;
|
package/package.json
CHANGED
package/.idea/XMOJ-Script.iml
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<module type="WEB_MODULE" version="4">
|
3
|
-
<component name="NewModuleRootManager">
|
4
|
-
<content url="file://$MODULE_DIR$">
|
5
|
-
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
6
|
-
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
7
|
-
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
8
|
-
</content>
|
9
|
-
<orderEntry type="inheritedJdk" />
|
10
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
11
|
-
</component>
|
12
|
-
</module>
|
package/.idea/modules.xml
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project version="4">
|
3
|
-
<component name="ProjectModuleManager">
|
4
|
-
<modules>
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/XMOJ-Script.iml" filepath="$PROJECT_DIR$/.idea/XMOJ-Script.iml" />
|
6
|
-
</modules>
|
7
|
-
</component>
|
8
|
-
</project>
|
package/.idea/vcs.xml
DELETED
package/.vscode/settings.json
DELETED
@@ -1,148 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"github-actions.workflows.pinned.workflows": [],
|
3
|
-
"cSpell.words": [
|
4
|
-
"AAAAAAAI",
|
5
|
-
"aliyuncs",
|
6
|
-
"apos",
|
7
|
-
"Arround",
|
8
|
-
"chenlangning",
|
9
|
-
"chensiru",
|
10
|
-
"chentianle",
|
11
|
-
"chenxuanhe",
|
12
|
-
"chenzecong",
|
13
|
-
"chenzerui",
|
14
|
-
"colspan",
|
15
|
-
"comparesource",
|
16
|
-
"Consolas",
|
17
|
-
"contestrank",
|
18
|
-
"conteststatistics",
|
19
|
-
"danwenxiao",
|
20
|
-
"darcula",
|
21
|
-
"dongminghui",
|
22
|
-
"emsp",
|
23
|
-
"freopen",
|
24
|
-
"gaochenming",
|
25
|
-
"gaolaoshi",
|
26
|
-
"Geany",
|
27
|
-
"guoqingtong",
|
28
|
-
"guoruiqun",
|
29
|
-
"guyuchen",
|
30
|
-
"hanjialin",
|
31
|
-
"hanshujian",
|
32
|
-
"heshuhan",
|
33
|
-
"hexinyi",
|
34
|
-
"huangkai",
|
35
|
-
"huangmingxuan",
|
36
|
-
"huangruina",
|
37
|
-
"huangwei",
|
38
|
-
"huyiyang",
|
39
|
-
"ignorews",
|
40
|
-
"jiangxingyu",
|
41
|
-
"jingtaiyu",
|
42
|
-
"jinweizhe",
|
43
|
-
"jresult",
|
44
|
-
"laquo",
|
45
|
-
"leijiahan",
|
46
|
-
"leiwenda",
|
47
|
-
"lianzhongzhe",
|
48
|
-
"liaoyanxu",
|
49
|
-
"lingzixiang",
|
50
|
-
"linziyi",
|
51
|
-
"liujianhao",
|
52
|
-
"liujiankun",
|
53
|
-
"liuxianyong",
|
54
|
-
"liuxixian",
|
55
|
-
"liyihan",
|
56
|
-
"loginpage",
|
57
|
-
"lostpassword",
|
58
|
-
"luojinyang",
|
59
|
-
"lutianfeng",
|
60
|
-
"meitianyi",
|
61
|
-
"modifypage",
|
62
|
-
"newpost",
|
63
|
-
"nowdate",
|
64
|
-
"panyinliang",
|
65
|
-
"pengyixuan",
|
66
|
-
"PHPSESSID",
|
67
|
-
"problemset",
|
68
|
-
"problemstatus",
|
69
|
-
"progressbar",
|
70
|
-
"putong",
|
71
|
-
"qianqingyuan",
|
72
|
-
"qidekai",
|
73
|
-
"raquo",
|
74
|
-
"reinfo",
|
75
|
-
"remoteip",
|
76
|
-
"sampledata",
|
77
|
-
"SAXKD",
|
78
|
-
"shanwenxiao",
|
79
|
-
"shenxichen",
|
80
|
-
"shihongxi",
|
81
|
-
"shimufan",
|
82
|
-
"shiyichen",
|
83
|
-
"shiyunhao",
|
84
|
-
"showsource",
|
85
|
-
"shuxinmo",
|
86
|
-
"simform",
|
87
|
-
"submitpage",
|
88
|
-
"suiruochen",
|
89
|
-
"sunyihan",
|
90
|
-
"sunyimiao",
|
91
|
-
"syntaxhighlighter",
|
92
|
-
"tangchao",
|
93
|
-
"tangyuhan",
|
94
|
-
"tanhaoxuan",
|
95
|
-
"taoxianyu",
|
96
|
-
"USACO",
|
97
|
-
"wangkangming",
|
98
|
-
"wangminghao",
|
99
|
-
"wangmingshuo",
|
100
|
-
"wangpengyu",
|
101
|
-
"wangsiyuan",
|
102
|
-
"wangtianqi",
|
103
|
-
"wangyuancheng",
|
104
|
-
"wangzetong",
|
105
|
-
"wanxinlian",
|
106
|
-
"wensiyi",
|
107
|
-
"wujinhong",
|
108
|
-
"wurunze",
|
109
|
-
"wuyukai",
|
110
|
-
"xiangjicheng",
|
111
|
-
"xiaoguanxun",
|
112
|
-
"xiaojiasheng",
|
113
|
-
"xiaruicheng",
|
114
|
-
"xiaweimin",
|
115
|
-
"xiaxuran",
|
116
|
-
"xiebingxiu",
|
117
|
-
"xieliren",
|
118
|
-
"xinyihan",
|
119
|
-
"xmlhttp",
|
120
|
-
"XMOJ",
|
121
|
-
"xuconghan",
|
122
|
-
"xukan",
|
123
|
-
"xuweiyi",
|
124
|
-
"yanghaochen",
|
125
|
-
"yezijiong",
|
126
|
-
"youzhouhang",
|
127
|
-
"yuanruiqing",
|
128
|
-
"yutingjun",
|
129
|
-
"zhangchenming",
|
130
|
-
"zhangqiuze",
|
131
|
-
"zhangshuxuan",
|
132
|
-
"zhangwenda",
|
133
|
-
"zhangyifu",
|
134
|
-
"zhangyouheng",
|
135
|
-
"zhaochenshen",
|
136
|
-
"zhaochenwei",
|
137
|
-
"zhengyinan",
|
138
|
-
"zhonghongyi",
|
139
|
-
"zhoujunyu",
|
140
|
-
"zhouziyi",
|
141
|
-
"zhouziyou",
|
142
|
-
"zhuchenrui",
|
143
|
-
"zhuruichen",
|
144
|
-
"zhuxule",
|
145
|
-
"zhuyikun",
|
146
|
-
"zhuyiyang"
|
147
|
-
]
|
148
|
-
}
|