Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable notes on blacklists and increase text limits #46

Merged
merged 2 commits into from
Jun 23, 2023

Conversation

gaogaotiantian
Copy link
Owner

No description provided.

Copy link

@XDcedar XDcedar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

天哥,我 review 了一下,有几个小建议

scripts/ui.js Outdated Show resolved Hide resolved
let noteNode = document.createElement("div");
noteNode.id = "biliscope-profile-note"
noteNode.className = "section user-info"
noteNode.innerHTML = `
<p class="user-info-title"><span class="info-title">备注</span></div>
<div class="be-textarea be-input--append">
<textarea rows="3" type="textarea" maxlength="150" class="be-textarea_inner" id="biliscope-note-textarea">${noteData[userId] || ""}</textarea>
<textarea
rows="${Math.max(3, (noteData[userId] || "").split("\n").length)}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的 rows 是不会考虑折行的,这个是 intended 的么?
另外,我觉得还需要设置一个上界,不然换行太多导致太长了也不好。Math.min(20, Math.max(3, (noteData[userId] || "").split("\n").length)),希望不会显得太累赘

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

肯定不考虑折行,因为browser的设置或者一些其它的插件包括未来B站的变化都可能改变折行位置。所以是明确的\n才变。

显示多少是用户决定的,用户自己要把card填满是用户自由。这里给出的提示是很明确的,不做额外的限制了。

<div class="idc-meta" style="${noteData && noteData[data["mid"]] ? "": "display: none"}">
<span class="idc-meta-item">${noteData ? noteData[data["mid"]]: ""}</span>
<div class="idc-meta" style="${noteDataToDisplay(noteData, data["mid"]) ? "": "display: none"}">
<span class="idc-meta-item">${noteDataToDisplay(noteData, data["mid"])}</span>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

天哥我还是建议加一个 text-overflow: ellipsis; 再限制一下长度,一行内容也可能很长的

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参考上面的回复,这是用户可控的内容,不需要做额外处理。

Copy link

@XDcedar XDcedar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,我没有其他建议了!

@gaogaotiantian gaogaotiantian merged commit 18589c5 into master Jun 23, 2023
@gaogaotiantian gaogaotiantian deleted the improve-note branch June 23, 2023 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

拉黑或被拉黑会导致在个人主页无法查看备注,以及希望提升150字的字数限制
2 participants