From 2f09bc1369556f3b8b012c7cfa85e1a5b2cd267d Mon Sep 17 00:00:00 2001 From: langningc2009 Date: Fri, 25 Aug 2023 09:49:08 +0800 Subject: [PATCH] =?UTF-8?q?[#60]=20=E5=A2=9E=E5=8A=A0=E5=A7=93=E5=90=8D?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- XMOJ.user.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 488fc5c0..74a28fee 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -3173,7 +3173,7 @@ else { RequestAPI("GetPost", { "PostID": Number(ThreadID), "Page": Number(Page) - }, (ResponseData) => { + }, async (ResponseData) => { if (ResponseData.Success == true) { if (!Silent) { DiscussPagination.children[0].children[0].href = "/discuss3/thread.php?tid=" + ThreadID + "&page=1"; @@ -3194,7 +3194,8 @@ else { } } PostTitle.innerText = ResponseData.Data.Title + (ResponseData.Data.ProblemID == 0 ? "" : ` - 题目` + ResponseData.Data.ProblemID); - PostAuthor.innerText = ResponseData.Data.UserID; + PostAuthor.innerHTML = ResponseData.Data.UserID; + PostAuthor.classList.add(await GetUsernameColorClass(ResponseData.Data.UserID)); PostAuthor.href = "/userinfo.php?user=" + ResponseData.Data.UserID; PostTime.innerText = ResponseData.Data.PostTime; let Replies = ResponseData.Data.Reply; @@ -3211,6 +3212,7 @@ else { CardBodyRowSpan1Element.innerText = "作者:"; let CardBodyRowSpan1AElement = document.createElement("a"); CardBodyRowSpan1AElement.href = "/userinfo.php?user=" + Replies[i].UserID; + CardBodyRowSpan1AElement.classList.add(await GetUsernameColorClass(Replies[i].UserID)) CardBodyRowSpan1AElement.innerText = Replies[i].UserID; CardBodyRowSpan1Element.appendChild(CardBodyRowSpan1AElement); let CardBodyRowSpan2Element = document.createElement("span");