Remove #fedilove on chat and statuses at UI level + some UI improvements

This commit is contained in:
Bofh 2020-12-31 13:02:22 +01:00
parent 0f2bf7fcfe
commit e88cb59b31
4 changed files with 7 additions and 4 deletions

View File

@ -20,8 +20,8 @@
<img alt="Your possible crush" src="/missing.png"/>
</div>
<div id="name">
<a href="/">...</a>
<span>-</span>
<a href="/"><span class="account-display-name">...</span></a>
<span id="acct">-</span>
</div>
<div id="back">
<a href="/direct">

View File

@ -17,6 +17,7 @@
accountName: ({ account }) => (account.display_name || account.username),
massagedAccountName: ({ accountName, emojis, $autoplayGifs, $omitEmojiInDisplayNames }) => {
accountName = escapeHtml(accountName)
accountName = accountName.replace(/#fedilove/gi, '').trim();
if ($omitEmojiInDisplayNames) { // display name emoji are annoying to some screenreader users
const emojiFreeDisplayName = removeEmoji(accountName, emojis)

View File

@ -89,7 +89,7 @@ div#chat-party-global {
margin: auto 0;
color: #000;
}
span {
span#acct {
margin: auto 0;
margin-left: .5em;
color: #8a8a8a;

View File

@ -95,7 +95,7 @@ var fediloveUI = {
// to-do: check is it XSS safe to add it like this :) ??
$('div#chat-party-global > div#image > img').attr('src', avatar);
$('div#chat-party-global > div#name > a').html(name);
$('div#chat-party-global > div#name > a > span').html(name);
$('div#chat-party-global > div#name > span').text(acct);
if (accid != 0) $('div#chat-party-global > div#name > a').attr('href', `/accounts/${accid}`);
}
@ -147,6 +147,8 @@ var fediloveEvents = {
return;
}
if (fediloveData.gotEmojifyTextFunction) {
dname = dname.replace(/#fedilove/gi, '').trim();
dname = dname.replace(/\s+/g, ' ').trim().replace(/\s/g, '&nbsp;');
fediloveUI.paintChatAvatarAndName(accid, acct, avatar, fediloveFunctions.emojifyText(dname, emojis));
clearInterval(_this);
}