Skip to content

Commit bbb410e

Browse files
committed
优化 [置顶显示时间] 功能 (短回答则不再保留回答底部时间)
1 parent a1aa292 commit bbb410e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Zhihu-Enhanced.user.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name 知乎增强
3-
// @version 1.9.6
3+
// @version 1.9.7
44
// @author X.I.U
55
// @description 移除登录弹窗、屏蔽首页视频、默认收起回答、快捷收起当前回答/评论(左键两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽用户 (发布的内容)、屏蔽关键词(标题/评论)、移除高亮链接、屏蔽盐选内容、净化标题消息、展开问题描述、显示问题作者、置顶显示时间、完整问题时间、区分问题文章、直达问题按钮、默认高清原图、默认站外直链
66
// @match *://www.zhihu.com/*
@@ -1292,6 +1292,8 @@ function topTime_publishTop(t, _this, _class) {
12921292
if (!t.parentNode.classList.contains(_class)) {
12931293
let temp_time = t.cloneNode(true);
12941294
temp_time.style.padding = '0px';
1295+
// 对于较短的回答,隐藏回答底部的时间
1296+
if (_this.offsetHeight < 400) t.style.display = 'none';
12951297
_this.querySelector('.' + _class).insertAdjacentElement('beforeEnd', temp_time);
12961298
}
12971299
}

0 commit comments

Comments
 (0)