-
Notifications
You must be signed in to change notification settings - Fork 41
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
天哥,我 review 了一下,有几个小建议
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)}" |
There was a problem hiding this comment.
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))
,希望不会显得太累赘
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
天哥我还是建议加一个 text-overflow: ellipsis;
再限制一下长度,一行内容也可能很长的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
参考上面的回复,这是用户可控的内容,不需要做额外处理。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,我没有其他建议了!
No description provided.