diff --git a/CHANGELOG.md b/CHANGELOG.md
index af4f42a..769d538 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,9 +1,9 @@
# 更新日志
-## [1.11.2] - 2024-07-02
-### 新增
+## [1.11.3] - 2024-08-19
+### 修正
-* 查看内容:更新之家表情
+* 查看内容:解决了评论投票状态未完全更新的问题
## [待开发]
1. 设置评论黑名单,自动模糊
@@ -15,6 +15,11 @@
1. 显示评论区用户机型
2. 评论翻页功能
+## [1.11.2] - 2024-07-02
+### 新增
+
+* 查看内容:更新之家表情
+
## [1.11.1] - 2024-06-26
### 新增
diff --git a/package.json b/package.json
index 8d82a7e..e2aafe1 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "ith2ome",
"displayName": "ITH2Ome",
"description": "IT之家第三方插件,划水特供版",
- "version": "1.11.2",
+ "version": "1.11.3",
"author": "https://github.com/Tai-Zhou",
"repository": {
"type": "git",
diff --git a/src/extension.ts b/src/extension.ts
index 28192e2..3032b97 100644
--- a/src/extension.ts
+++ b/src/extension.ts
@@ -214,25 +214,30 @@ function commentVoteFormat(commentId: number, reply: number, support: number, ag
return `回复(${reply})支持(${support})反对(${against})`;
}
-function commentItemFormat(comment: commentJSON): string { // 生成评论
+function commentItemFormat(comment: commentJSON, idPrefix: string): string { // 生成评论
for (let i in ithomeEmoji)
comment.elements[0].content = comment.elements[0].content.replace(RegExp('\\[' + ithomeEmoji[i] + '\\]', 'g'), '');
let commentClass = "";
if (blurNegativeComment && comment.support < comment.against)
commentClass = "blur";
- return '
' + (showAvatar ? `` : '') + `${comment.userInfo.userNick} Lv.${comment.userInfo.level}|${comment.city}${comment.floorStr} @ ${new Date(comment.postTime).toLocaleString('zh-CN')}
${comment.referText ? '
' + comment.referText + '
' : '
'}
`;
+ return '' + (showAvatar ? `` : '') + `${comment.userInfo.userNick} Lv.${comment.userInfo.level}|${comment.city}${comment.floorStr} @ ${new Date(comment.postTime).toLocaleString('zh-CN')}
${comment.referText ? '
' + comment.referText + '
' : '
'}
`;
}
function commentFormat(commentList: commentJSON[], commentTitle: string): string { // 评论JSON生成列表
if (commentList.length == 0)
return '';
let commentContent = `${commentTitle}
`;
+ let idPrefix = '';
+ if (commentTitle == '置顶评论')
+ idPrefix = 'top-';
+ else if (commentTitle == '热门评论')
+ idPrefix = 'hot-';
for (let comment of commentList) {
- commentContent += commentItemFormat(comment);
+ commentContent += commentItemFormat(comment, idPrefix);
if (comment.children.length > 0) {
commentContent += ''
for (let reply of comment.children)
- commentContent += commentItemFormat(reply) + '
';
+ commentContent += commentItemFormat(reply, idPrefix) + '';
commentContent += ''
}
commentContent += ''
@@ -613,7 +618,11 @@ export function activate(context: vscode.ExtensionContext) {
if (message.command == "refreshGrade") // 更新投票信息
document.getElementById("grade").innerHTML = message.text;
else if (message.command == "refreshVote") // 更新评论信息
- document.getElementById("vote-"+message.id).innerHTML = message.text;
+ for (let prefix of ["top-", "hot-", ""]) {
+ let target = document.getElementById("vote-"+prefix+message.id);
+ if (target)
+ target.innerHTML = message.text;
+ }
});`
+ `${resNews.body.title}
` // 标题
+ `新闻源:${resNews.body.newssource}(${resNews.body.newsauthor})|责编:${resNews.body.z}
` // 新闻源、责编