Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3955,6 +3955,17 @@
}
],
"Notes": "Add [liushangchen](https://www.xmoj.tech/userinfo.php?user=liushangchen) to AdminUserList"
},
"4.0.2": {
"UpdateDate": 1791284765643,
"Prerelease": true,
"UpdateContents": [
{
"PR": 1061,
"Description": "Hide the message button on your own profile"
}
],
"Notes": "查看自己的个人中心时不再显示“短消息”按钮。"
}
}
}
8 changes: 6 additions & 2 deletions XMOJ.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name XMOJ
// @version 4.0.1
// @version 4.0.2
// @description XMOJ增强脚本
// @author @XMOJ-Script-dev, @langningchen and the community
// @namespace https://github/langningchen
Expand Down Expand Up @@ -2666,7 +2666,11 @@ function InitializeUserProfile(isAdmin = false) {

// Move the original statistics nodes so their links and handlers survive.
table.insertAdjacentElement("beforebegin", profile);
for (let link of table.caption?.querySelectorAll("a") || []) info.appendChild(link);
for (let link of table.caption?.querySelectorAll("a") || []) {
// There is no point in messaging yourself.
if (userID == CurrentUsername && link.getAttribute("href")?.includes("mail.php")) continue;
info.appendChild(link);
}
table.caption?.remove();
let solvedCell = [...table.querySelectorAll("td[rowspan]")].find(cell =>
cell.querySelector('a[href*="problem.php"]') || [...cell.querySelectorAll("script")].some(script => /\bfunction\s+p\s*\(/.test(script.textContent)));
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": "4.0.1",
"version": "4.0.2",
"description": "an improvement script for xmoj.tech",
"main": "AddonScript.js",
"scripts": {
Expand Down