Skip to content

Commit

Permalink
增加自动展开楼中楼选项
Browse files Browse the repository at this point in the history
  • Loading branch information
T authored and T committed Apr 26, 2023
1 parent 2aa0ebe commit 9af4cfd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion inject/topicDetail/index.css
Expand Up @@ -127,7 +127,7 @@ div[id^=r_] .reply_content.flod:hover {
transition: all .3s;
}

.cell:hover .nested {
.cell:hover .nested, .auto-nested {
opacity: 1;
max-height: 3600px;
padding: 10px;
Expand Down
3 changes: 3 additions & 0 deletions inject/topicDetail/index.js
Expand Up @@ -322,6 +322,9 @@ chrome.storage.sync.get("options", async (data) => {

let nestedComment = document.createElement('div')
nestedComment.classList.add('nested')
if (data.options.autoNestedComment) {
nestedComment.classList.add('auto-nested')
}
el.append(nestedComment)

let selfUsername = el.querySelector('.avatar').alt
Expand Down
14 changes: 13 additions & 1 deletion pages/options/index.html
Expand Up @@ -158,7 +158,7 @@ <h2 class="title">回复</h2>
</li>
<li>
<label class="item">
<div class="item-content">楼中楼模式<div class="item-content-tip">以楼中楼的方式查看相关对话</div>
<div class="item-content">楼中楼模式<div class="item-content-tip">鼠标移入回复时以楼中楼的方式查看相关对话</div>
</div>
<div class="item-secondary">
<span class="toggle">
Expand All @@ -168,6 +168,18 @@ <h2 class="title">回复</h2>
</div>
</label>
</li>
<li>
<label class="item">
<div class="item-content">楼中楼自动展开<div class="item-content-tip">不需要鼠标移入既可展开全部楼中楼</div>
</div>
<div class="item-secondary">
<span class="toggle">
<input disabled name="autoNestedComment" type="checkbox">
<div></div>
</span>
</div>
</label>
</li>
<li>
<label class="item">
<div class="item-content">图片解析<div class="item-content-tip">常见图床,并支持 3 种方式:图片URL、![]()、&lt;img /&gt;</div>
Expand Down
3 changes: 2 additions & 1 deletion pages/options/index.js
Expand Up @@ -17,7 +17,8 @@ let options = {
// 回复
replyUserNum: 1, // 回复时增加楼层号 默认开启
relateReply: 1, // 快速查看相关回复 默认开启
nestedComment: 1, // 快速查看相关回复 默认开启
nestedComment: 1, // 楼中楼 默认开启
autoNestedComment: 0, // 自动展开楼中楼 默认关闭
imageParsing: 1, // 图片解析 默认开启并隐藏原回复
replyColor: "#fff94d", // 楼主回复背景色
replyA: 0.4, // 楼主回复背景色透明度
Expand Down

0 comments on commit 9af4cfd

Please sign in to comment.