Skip to content

Commit

Permalink
Merge pull request #570 from XMOJ-Script-dev/boomzero/noticeboard
Browse files Browse the repository at this point in the history
增加公告栏
  • Loading branch information
boomzero authored Jul 27, 2024
2 parents c41d558 + 443f67c commit d444444
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
11 changes: 11 additions & 0 deletions Update.json
Original file line number Diff line number Diff line change
Expand Up @@ -1748,6 +1748,17 @@
}
],
"Notes": "No release notes were provided for this release."
},
"1.2.7": {
"UpdateDate": 1722063024309,
"Prerelease": true,
"UpdateContents": [
{
"PR": 570,
"Description": "增加公告栏"
}
],
"Notes": "No release notes were provided for this release."
}
}
}
12 changes: 11 additions & 1 deletion XMOJ.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name XMOJ
// @version 1.2.6
// @version 1.2.7
// @description XMOJ增强脚本
// @author @XMOJ-Script-dev, @langningchen and the community
// @namespace https://github/langningchen
Expand Down Expand Up @@ -1162,6 +1162,16 @@ async function main() {
<div class="cnt-row-head title">倒计时</div>
<div class="cnt-row-body">${CountDownData}</div>
</div>`;
document.querySelector("body > div > div.mt-3 > div > div.col-md-4").innerHTML += `<div class="cnt-row">
<div class="cnt-row-head title">公告</div>
<div class="cnt-row-body">加载中...</div>
</div>`;
RequestAPI("GetNotice", {}, (Response) => {
if (Response.Success) {
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"]);
RenderMathJax();
}
});
}
} else if (location.pathname == "/problemset.php") {
if (UtilityEnabled("Translate")) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xmoj-script",
"version": "1.2.6",
"version": "1.2.7",
"description": "an improvement script for xmoj.tech",
"main": "AddonScript.js",
"scripts": {
Expand Down

0 comments on commit d444444

Please sign in to comment.