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

Feat: Channel Member Icons + Load Custom Channel Emojis in Comments #1819

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@fortawesome/vue-fontawesome": "^2.0.2",
"@freetube/youtube-chat": "^1.1.2",
"@freetube/yt-comment-scraper": "^6.0.0",
"@freetube/yt-comment-scraper": "^6.1.0",
"@silvermine/videojs-quality-selector": "^1.2.5",
"autolinker": "^3.15.0",
"bulma-pro": "^0.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@
font-size: 12px;
}

.commentMemberIcon {
margin-left: 5px;
width: 14px;
height: 14px;
}

.commentLikeCount {
font-size: 11px;
margin-left: 70px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ export default Vue.extend({
comment.likes = null
}
comment.text = autolinker.link(comment.text.replace(/(<(?!br>)([^>]+)>)/ig, ''))
if (comment.customEmojis.length > 0) {
comment.customEmojis.forEach(emoji => {
comment.text = comment.text.replace(emoji.text, `<img width="14" height="14" class="commentCustomEmoji" alt="${emoji.text.substring(2, emoji.text.length - 1)}" src="${emoji.emojiThumbnails[0].url}">`)
})
}

return comment
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@
>
{{ comment.author }}
</span>
<img
v-if="comment.isMember"
:src="comment.memberIconUrl"
:title="$t('Comments.Member')"
:aria-label="$t('Comments.Member')"
class="commentMemberIcon"
alt=""
>
<span class="commentDate">
{{ comment.time }}
</span>
Expand Down Expand Up @@ -137,6 +145,12 @@
>
{{ reply.author }}
</span>
<img
v-if="reply.isMember"
:src="reply.memberIconUrl"
class="commentMemberIcon"
alt=""
>
<span class="commentDate">
{{ reply.time }}
</span>
Expand Down
1 change: 1 addition & 0 deletions static/locales/en-US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,7 @@ Comments:
Load More Comments: Load More Comments
No more comments available: No more comments available
Pinned by: Pinned by
Member: Member
Up Next: Up Next

#Tooltips
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1332,10 +1332,10 @@
axios "^0.21.1"
tslib "^1.11.1"

"@freetube/yt-comment-scraper@^6.0.0":
version "6.0.0"
resolved "https://registry.npmjs.org/@freetube/yt-comment-scraper/-/yt-comment-scraper-6.0.0.tgz"
integrity sha512-QZbfuuhjT1ZmEUd15CQ9rvBiNfW9BCtciaB06qW9z7xC22ViC9NmRTlwSXTS/a5OxUH8app13O05xgGhZbxnmA==
"@freetube/yt-comment-scraper@^6.1.0":
version "6.1.0"
resolved "https://registry.yarnpkg.com/@freetube/yt-comment-scraper/-/yt-comment-scraper-6.1.0.tgz#13583dedf5cf0cff6d42d155ef5f2474c64fd4ee"
integrity sha512-Cj6Of7DPkTH1ax1AcaOn0xul179YsnfaNNoH11lQ4xUxUrmtf70Qj04+FDI+7/O/qsOR3RMq1mreCvM6BQI6Aw==
dependencies:
axios "^0.21.1"

Expand Down