Compare commits

..

1 Commits

Author SHA1 Message Date
David Siaw bce25be4a1
Merge 868d3a4b68 into 227244e2d0 2023-05-29 23:21:25 +10:00
1 changed files with 5 additions and 11 deletions

View File

@ -2702,7 +2702,8 @@ function execEmotes(msg) {
}
CHANNEL.emotes.forEach(function (e) {
msg = msg.replace(e.regex, '$1' + emoteToImg(e).outerHTML);
msg = msg.replace(e.regex, '$1<img class="channel-emote" src="' +
e.image + '" title="' + e.name + '">');
});
return msg;
@ -2710,12 +2711,13 @@ function execEmotes(msg) {
function execEmotesEfficient(msg) {
CHANNEL.badEmotes.forEach(function (e) {
msg = msg.replace(e.regex, '$1' + emoteToImg(e).outerHTML);
msg = msg.replace(e.regex, '$1<img class="channel-emote" src="' +
e.image + '" title="' + e.name + '">');
});
msg = msg.replace(/[^\s]+/g, function (m) {
if (CHANNEL.emoteMap.hasOwnProperty(m)) {
var e = CHANNEL.emoteMap[m];
return emoteToImg(e).outerHTML;
return '<img class="channel-emote" src="' + e.image + '" title="' + e.name + '">';
} else {
return m;
}
@ -2723,14 +2725,6 @@ function execEmotesEfficient(msg) {
return msg;
}
function emoteToImg(e) {
var img = document.createElement('img');
img.className = 'channel-emote';
img.title = e.name;
img.src = e.image;
return img;
}
function initPm(user) {
if ($("#pm-" + user).length > 0) {
return $("#pm-" + user);