Skip to content

Commit

Permalink
revert #514 (#516)
Browse files Browse the repository at this point in the history
* Revert "支持跳转到讨论编号 修改讨论区用户界面 在讨论区Page过大时自动跳转 在讨论区最后一页自动删除 (#514)"

This reverts commit 0f8a457

* 1.1.60

* Update version info to 1.1.60

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
boomzero and github-actions[bot] authored Apr 21, 2024
1 parent 2010d36 commit 36e1237
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 25 deletions.
11 changes: 11 additions & 0 deletions Update.json
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,17 @@
}
],
"Notes": "No release notes were provided for this release."
},
"1.1.60": {
"UpdateDate": 1713682768316,
"Prerelease": true,
"UpdateContents": [
{
"PR": 516,
"Description": "revert #514"
}
],
"Notes": "No release notes were provided for this release."
}
}
}
27 changes: 3 additions & 24 deletions XMOJ.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name XMOJ
// @version 1.1.59
// @version 1.1.60
// @description XMOJ增强脚本
// @author @XMOJ-Script-dev, @langningchen and the community
// @namespace https://github/langningchen
Expand Down Expand Up @@ -3875,23 +3875,8 @@ int main()
if (location.pathname == "/discuss3/discuss.php") {
let ProblemID = parseInt(SearchParams.get("pid"));
let Page = Number(SearchParams.get("page")) || 1;
document.querySelector("body > div > div").innerHTML = ` <div style="text-align:center"><h1>讨论列表${(isNaN(ProblemID) ? "" : ` - 题目` + ProblemID)}</h1></div>
<div class="row">
<div class="col-md-5">
<form action="discuss.php" >
<div style="text-align:right">
<button id="NewPost" type="button" class="btn btn-primary">发布新讨论</button>
</div>
</form>
</div>
<div class="col-md-3" style="display: inline">
<form action="thread.php" class="input-group">
<input class="form-control" type="number" name="tid" placeholder="讨论编号" min="1">
<button class="btn btn-outline-secondary" type="submit">跳转</button>
</form>
</div style="display: inline">
</div>
<h><br></h>
document.querySelector("body > div > div").innerHTML = `<h3>讨论列表${(isNaN(ProblemID) ? "" : ` - 题目` + ProblemID)}</h3>
<button id="NewPost" type="button" class="btn btn-primary">发布新讨论</button>
<nav>
<ul class="pagination justify-content-center" id="DiscussPagination">
<li class="page-item"><a class="page-link" href="#"><span>&laquo;</span></a></li>
Expand Down Expand Up @@ -3966,7 +3951,6 @@ int main()
PostList.children[1].innerHTML = "";
if (Posts.length == 0) {
PostList.children[1].innerHTML = `<tr><td colspan="7">暂无数据</td></tr>`;
location.href = "https://www.xmoj.tech/discuss3/discuss.php";
}
for (let i = 0; i < Posts.length; i++) {
let Row = document.createElement("tr");
Expand Down Expand Up @@ -4004,11 +3988,6 @@ int main()
let LastReplyTimeCell = document.createElement("td");
Row.appendChild(LastReplyTimeCell);
LastReplyTimeCell.innerHTML = GetRelativeTime(Posts[i].LastReplyTime);
if (Posts[i].PostID == 1) {
DiscussPagination.children[DiscussPagination.children.length - 1].classList.add("disabled");
DiscussPagination.children[DiscussPagination.children.length - 2].remove();
break;
}
}
} else {
ErrorElement.innerText = ResponseData.Message;
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.1.59",
"version": "1.1.60",
"description": "an improvement script for xmoj.tech",
"main": "AddonScript.js",
"scripts": {
Expand Down

0 comments on commit 36e1237

Please sign in to comment.