xmoj-script 2.4.7 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Update.json +46 -0
- package/XMOJ.user.js +3 -20
- package/package.json +1 -1
package/Update.json
CHANGED
@@ -3157,6 +3157,52 @@
|
|
3157
3157
|
}
|
3158
3158
|
],
|
3159
3159
|
"Notes": "funny"
|
3160
|
+
},
|
3161
|
+
"2.5.0": {
|
3162
|
+
"UpdateDate": 1759568103629,
|
3163
|
+
"Prerelease": false,
|
3164
|
+
"UpdateContents": [
|
3165
|
+
{
|
3166
|
+
"PR": 861,
|
3167
|
+
"Description": "Update CSS selector"
|
3168
|
+
},
|
3169
|
+
{
|
3170
|
+
"PR": 863,
|
3171
|
+
"Description": "修复“NaN年前“"
|
3172
|
+
},
|
3173
|
+
{
|
3174
|
+
"PR": 865,
|
3175
|
+
"Description": "删除获取数据功能"
|
3176
|
+
},
|
3177
|
+
{
|
3178
|
+
"PR": 866,
|
3179
|
+
"Description": "比赛题目页面里左侧栏加入题目序号列表"
|
3180
|
+
},
|
3181
|
+
{
|
3182
|
+
"PR": 869,
|
3183
|
+
"Description": "Update CSS selector (again...)"
|
3184
|
+
},
|
3185
|
+
{
|
3186
|
+
"PR": 871,
|
3187
|
+
"Description": "Add tooltip for ProblemSwitcher"
|
3188
|
+
},
|
3189
|
+
{
|
3190
|
+
"PR": 872,
|
3191
|
+
"Description": "修复获取数据"
|
3192
|
+
}
|
3193
|
+
],
|
3194
|
+
"Notes": "XMOJ-Script 2.5.0 新增了比赛题目切换器,方便您在题目之间快速切换。此功能默认启用,您也可以在设置中禁用它。本版本还修复了一个导致时间显示为“NaN年前”的错误, 更新了一些 CSS selector,以适应 XMOJ 网站的最新变化."
|
3195
|
+
},
|
3196
|
+
"2.5.1": {
|
3197
|
+
"UpdateDate": 1759830659949,
|
3198
|
+
"Prerelease": true,
|
3199
|
+
"UpdateContents": [
|
3200
|
+
{
|
3201
|
+
"PR": 876,
|
3202
|
+
"Description": "refactor: simplify SubmitLink selection by querying all anchors and finding by text"
|
3203
|
+
}
|
3204
|
+
],
|
3205
|
+
"Notes": "No release notes were provided for this release."
|
3160
3206
|
}
|
3161
3207
|
}
|
3162
3208
|
}
|
package/XMOJ.user.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
// ==UserScript==
|
2
2
|
// @name XMOJ
|
3
|
-
// @version 2.
|
3
|
+
// @version 2.5.1
|
4
4
|
// @description XMOJ增强脚本
|
5
5
|
// @author @XMOJ-Script-dev, @langningchen and the community
|
6
6
|
// @namespace https://github/langningchen
|
@@ -1710,25 +1710,8 @@ async function main() {
|
|
1710
1710
|
document.querySelector("body > div > div.mt-3 > center").lastElementChild.style.marginLeft = "10px";
|
1711
1711
|
}
|
1712
1712
|
//修复提交按钮
|
1713
|
-
|
1714
|
-
|
1715
|
-
SubmitLink = document.querySelector('.mt-3 > center:nth-child(1) > a:nth-child(10)');
|
1716
|
-
}
|
1717
|
-
if (SubmitLink == null) {
|
1718
|
-
SubmitLink = document.querySelector('.mt-3 > center:nth-child(1) > a:nth-child(11)');
|
1719
|
-
}
|
1720
|
-
if (SubmitLink == null) {
|
1721
|
-
SubmitLink = document.querySelector('.mt-3 > center:nth-child(1) > a:nth-child(13)');
|
1722
|
-
}
|
1723
|
-
if (SubmitLink == null) {
|
1724
|
-
SubmitLink = document.querySelector('.mt-3 > center:nth-child(1) > a:nth-child(9)');
|
1725
|
-
}
|
1726
|
-
if (SubmitLink == null) { //为什么这个破东西老是换位置
|
1727
|
-
SubmitLink = document.querySelector('.mt-3 > center:nth-child(1) > a:nth-child(7)');
|
1728
|
-
}
|
1729
|
-
if (SubmitLink == null) { //tmd又换位置
|
1730
|
-
SubmitLink = document.querySelector('.mt-3 > center:nth-child(1) > a:nth-child(8)');
|
1731
|
-
}
|
1713
|
+
const links = document.querySelectorAll('.mt-3 > center:nth-child(1) > a');
|
1714
|
+
const SubmitLink = Array.from(links).find(a => a.textContent.trim() === '提交');
|
1732
1715
|
let SubmitButton = document.createElement('button');
|
1733
1716
|
SubmitButton.id = 'SubmitButton';
|
1734
1717
|
SubmitButton.className = 'btn btn-outline-secondary';
|