xmoj-script 1.2.7 → 1.2.10
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/README.md +4 -4
- package/Update.json +33 -0
- package/XMOJ.user.js +35 -29
- package/package.json +1 -1
package/README.md
CHANGED
@@ -5,14 +5,14 @@
|
|
5
5
|

|
6
6
|

|
7
7
|
|
8
|
-
[点击此处访问官网查看更多内容](https://
|
8
|
+
[点击此处访问官网查看更多内容](https://xmoj-bbs.me)
|
9
9
|
|
10
10
|
原项目: https://github.com/langningchen/XMOJ-Script
|
11
11
|
|
12
12
|
<a href="https://www.producthunt.com/posts/oj?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-oj" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=458051&theme=light" alt="小明的OJ增强脚本 - 小明的OJ增强脚本 | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
|
13
13
|
|
14
14
|
### 帮助文档
|
15
|
-
地址:https://docs.xmoj-bbs.
|
15
|
+
地址:https://docs.xmoj-bbs.me
|
16
16
|
仓库:https://github.com/XMOJ-Script-dev/docs
|
17
17
|
|
18
18
|
### 介绍
|
@@ -59,7 +59,7 @@
|
|
59
59
|
|
60
60
|

|
61
61
|

|
62
|
-
更多图片可在[官网](https://www.xmoj-bbs.
|
62
|
+
更多图片可在[官网](https://www.xmoj-bbs.me)上查看
|
63
63
|
|
64
64
|
通过小明的OJ增强脚本,您将能够更便捷地参与竞赛,提高AC率,管理代码,优化学习体验,同时享受美化界面带来的愉悦感受。
|
65
65
|
无论是竞技还是学习,这个脚本都将成为您在小明的OJ平台上的得力助手。
|
@@ -68,7 +68,7 @@
|
|
68
68
|
|
69
69
|
|
70
70
|
### 安装
|
71
|
-
请参考 [官网介绍](https://www.xmoj-bbs.
|
71
|
+
请参考 [官网介绍](https://www.xmoj-bbs.me) 。
|
72
72
|
如果您无法打开该网站,请前往[这里](https://scriptcat.org/zh-CN/script-show-page/1500/)安装。
|
73
73
|
|
74
74
|
### 贡献
|
package/Update.json
CHANGED
@@ -1759,6 +1759,39 @@
|
|
1759
1759
|
}
|
1760
1760
|
],
|
1761
1761
|
"Notes": "No release notes were provided for this release."
|
1762
|
+
},
|
1763
|
+
"1.2.8": {
|
1764
|
+
"UpdateDate": 1722070813624,
|
1765
|
+
"Prerelease": false,
|
1766
|
+
"UpdateContents": [
|
1767
|
+
{
|
1768
|
+
"PR": 570,
|
1769
|
+
"Description": "增加公告栏"
|
1770
|
+
}
|
1771
|
+
],
|
1772
|
+
"Notes": "No release notes were provided for this release."
|
1773
|
+
},
|
1774
|
+
"1.2.9": {
|
1775
|
+
"UpdateDate": 1722088781344,
|
1776
|
+
"Prerelease": true,
|
1777
|
+
"UpdateContents": [
|
1778
|
+
{
|
1779
|
+
"PR": 573,
|
1780
|
+
"Description": "add username rendering for noticeboard"
|
1781
|
+
}
|
1782
|
+
],
|
1783
|
+
"Notes": "No release notes were provided for this release."
|
1784
|
+
},
|
1785
|
+
"1.2.10": {
|
1786
|
+
"UpdateDate": 1722425862935,
|
1787
|
+
"Prerelease": true,
|
1788
|
+
"UpdateContents": [
|
1789
|
+
{
|
1790
|
+
"PR": 574,
|
1791
|
+
"Description": "disable tidytable"
|
1792
|
+
}
|
1793
|
+
],
|
1794
|
+
"Notes": "No release notes were provided for this release."
|
1762
1795
|
}
|
1763
1796
|
}
|
1764
1797
|
}
|
package/XMOJ.user.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
// ==UserScript==
|
2
2
|
// @name XMOJ
|
3
|
-
// @version 1.2.
|
3
|
+
// @version 1.2.10
|
4
4
|
// @description XMOJ增强脚本
|
5
5
|
// @author @XMOJ-Script-dev, @langningchen and the community
|
6
6
|
// @namespace https://github/langningchen
|
@@ -289,33 +289,33 @@ let TimeToStringTime = (Time) => {
|
|
289
289
|
* @param {HTMLElement} Table - The table element to be tidied up.
|
290
290
|
*/
|
291
291
|
let TidyTable = (Table) => {
|
292
|
-
if (UtilityEnabled("NewBootstrap") && Table != null) {
|
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
|
-
}
|
292
|
+
// if (UtilityEnabled("NewBootstrap") && Table != null) {
|
293
|
+
// Table.className = "table table-hover";
|
294
|
+
// Table.querySelector("thead > tr").removeAttribute("class");
|
295
|
+
// Table.querySelector("thead > tr").removeAttribute("align");
|
296
|
+
// Table.querySelector("thead > tr").innerHTML = Table.querySelector("thead > tr").innerHTML.replaceAll("td", "th");
|
297
|
+
// let Temp = Table.querySelector("thead > tr").children;
|
298
|
+
// for (let j = 0; j < Temp.length; j++) {
|
299
|
+
// let Width = Temp[j].style.width;
|
300
|
+
// Temp[j].removeAttribute("style");
|
301
|
+
// Temp[j].style.width = Width;
|
302
|
+
// Temp[j].removeAttribute("onclick");
|
303
|
+
// Temp[j].removeAttribute("align");
|
304
|
+
// }
|
305
|
+
// Table.querySelector("tbody").className = "table-group-divider";
|
306
|
+
// Temp = Table.querySelector("tbody").children;
|
307
|
+
// for (let j = 0; j < Temp.length; j++) {
|
308
|
+
// Temp[j].removeAttribute("align");
|
309
|
+
// let Temp2 = Temp[j].querySelectorAll("*");
|
310
|
+
// for (let k = 0; k < Temp2.length; k++) {
|
311
|
+
// Temp2[k].classList.remove("left");
|
312
|
+
// Temp2[k].classList.remove("center");
|
313
|
+
// if (Temp2[k].className == "") {
|
314
|
+
// Temp2[k].removeAttribute("class");
|
315
|
+
// }
|
316
|
+
// }
|
317
|
+
// }
|
318
|
+
// }
|
319
319
|
};
|
320
320
|
let UtilityEnabled = (Name) => {
|
321
321
|
if (localStorage.getItem("UserScript-Setting-" + Name) == null) {
|
@@ -1168,8 +1168,14 @@ async function main() {
|
|
1168
1168
|
</div>`;
|
1169
1169
|
RequestAPI("GetNotice", {}, (Response) => {
|
1170
1170
|
if (Response.Success) {
|
1171
|
-
document.querySelector("body > div.container > div > div > div.col-md-4 > div:nth-child(2) > div.cnt-row-body").innerHTML = marked.parse(Response.Data["Notice"]);
|
1171
|
+
document.querySelector("body > div.container > div > div > div.col-md-4 > div:nth-child(2) > div.cnt-row-body").innerHTML = marked.parse(Response.Data["Notice"]).replaceAll(/@([a-zA-Z0-9]+)/g, `<b>@</b><span class="ms-1 Usernames">$1</span>`);
|
1172
1172
|
RenderMathJax();
|
1173
|
+
let UsernameElements = document.getElementsByClassName("Usernames");
|
1174
|
+
for (let i = 0; i < UsernameElements.length; i++) {
|
1175
|
+
GetUsernameHTML(UsernameElements[i], UsernameElements[i].innerText, true);
|
1176
|
+
}
|
1177
|
+
} else {
|
1178
|
+
document.querySelector("body > div.container > div > div > div.col-md-4 > div:nth-child(2) > div.cnt-row-body").innerHTML = "加载失败: " + Response.Message;
|
1173
1179
|
}
|
1174
1180
|
});
|
1175
1181
|
}
|