fix for the @@ bug with mastodon notices

This commit is contained in:
Hannes Mannerheim 2016-11-21 22:44:34 +01:00
parent 440cd110ed
commit 474376938b

View File

@ -1996,13 +1996,13 @@ function detectRTL(s) {
$streamItem.children('.stream-item').children('.queet').addClass('rtl');
}
else {
// for ltr languages we move @, ! and # to inside
$streamItem.find('.queet-text').find('.h-card.mention').prepend('@');
$streamItem.find('.queet-text').find('.h-card.group').prepend('!');
$streamItem.find('.queet-text').find('.vcard .fn.nickname:not(.group)').prepend('@'); // very old style
$streamItem.find('.queet-text').find('.vcard .nickname.mention:not(.fn)').prepend('@'); // old style
$streamItem.find('.queet-text').find('.vcard .nickname.group').prepend('!'); // old style
$streamItem.find('.queet-text').find('a[rel="tag"]').prepend('#');
// for ltr languages we move @, ! and # to inside (only because it looks better)
prependCharIfItDoesntAlreadyExist($streamItem.find('.queet-text').find('.h-card.mention'),'@');
prependCharIfItDoesntAlreadyExist($streamItem.find('.queet-text').find('.h-card.group'),'!');
prependCharIfItDoesntAlreadyExist($streamItem.find('.queet-text').find('.vcard .fn.nickname:not(.group)'),'@'); // very old style
prependCharIfItDoesntAlreadyExist($streamItem.find('.queet-text').find('.vcard .nickname.mention:not(.fn)'),'@'); // old style
prependCharIfItDoesntAlreadyExist($streamItem.find('.queet-text').find('.vcard .nickname.group'),'!'); // old style
prependCharIfItDoesntAlreadyExist($streamItem.find('.queet-text').find('a[rel="tag"]'),'#');
}
// we remove @, ! and #, they are added as pseudo elements, or have been moved to the inside
@ -2010,6 +2010,13 @@ function detectRTL(s) {
}
function prependCharIfItDoesntAlreadyExist(jQueryObject,char) {
if(jQueryObject.text().substring(0,1) != char) {
jQueryObject.prepend(char);
}
}
/* ·
·