Skip to content

Commit

Permalink
fix: 优化关键词屏蔽功能造成页面下拉失败
Browse files Browse the repository at this point in the history
  • Loading branch information
dlzmoe committed Nov 29, 2024
1 parent 55cb0da commit f16741e
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 31 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- 修复:CSS 样式问题
- 优化:关键词屏蔽功能造成页面下拉失败
22 changes: 11 additions & 11 deletions dist/linuxdo-scripts.user.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions linuxdo-scripts.user.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "linuxdo-scripts",
"version": "0.3.68",
"version": "0.3.69",
"author": "dlzmoe",
"description": "An enhanced script for the linux.do forum",
"type": "module",
Expand Down
10 changes: 5 additions & 5 deletions src/components/CustomText/MenuBlockKeyword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default {
const keywords = this.textarea.split(",").map((keyword) => keyword.trim()).filter(Boolean);
if (keywords.length === 0) return;
// 安全检查jQuery的使用,防止元素不可用时出错
// 安全检查 jQuery 的使用,防止元素不可用时出错
try {
// 检查话题标题
$(".topic-list .main-link .raw-topic-link>*")
Expand All @@ -49,7 +49,7 @@ export default {
return keywords.some((keyword) => text.includes(keyword));
})
.parents("tr.topic-list-item")
.remove();
.hide();
// 检查评论回复
$(".topic-body .cooked")
Expand All @@ -58,9 +58,9 @@ export default {
return keywords.some((keyword) => text.includes(keyword));
})
.parents(".topic-post")
.remove();
.hide();
} catch (error) {
console.error("init方法出错:", error);
console.error("init 方法出错:", error);
}
},
},
Expand All @@ -83,7 +83,7 @@ export default {
this.init();
}
} catch (error) {
console.error("轮询逻辑出错:", error);
console.error("轮询逻辑出错", error);
}
}, 1000);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/CustomText/MenuBlockuserlist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ export default {
return self.list.indexOf(user) !== -1;
})
.parents("tr.topic-list-item")
.remove();
.hide();
$(".topic-post .full-name a")
.filter((index, element) => {
var user = $(element).attr("data-user-card");
return self.list.indexOf(user) !== -1;
})
.parents(".topic-post")
.remove();
.hide();
},
},
created() {
Expand Down
4 changes: 4 additions & 0 deletions version-log.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.69

- 优化:关键词屏蔽功能造成页面下拉失败

## 0.3.68

- 修复:CSS 样式问题
Expand Down

0 comments on commit f16741e

Please sign in to comment.