1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-29 23:58:31 +00:00

3.5.37 to 3.5.40. Added Twitch emote mirror. Fixed emote sorting in My Emoticons. Fixed failure to leave chat rooms. Added /ffz reload chat command. Fixed Stream Latency again. Added new API methods. Made settings.get try to load unloaded settings.

This commit is contained in:
SirStendec 2015-10-27 14:25:13 -04:00
parent d934508b04
commit acc0010247
15 changed files with 295 additions and 73 deletions

View file

@ -240,6 +240,24 @@ FFZ.src_to_id = function(src) {
};
FFZ._emote_mirror_swap = function(img) {
var src, attempts = parseInt(img.getAttribute('data-alt-attempts')) || 0;
if ( attempts > 3 )
return;
img.setAttribute('data-alt-attempts', attempts + 1);
var id = img.getAttribute('data-emote');
if ( img.src.substr(0, TWITCH_BASE.length) === TWITCH_BASE ) {
img.src = constants.EMOTE_MIRROR_BASE + id + ".png";
img.srcset = "";
} else {
img.src = TWITCH_BASE + id + "/1.0";
img.srcset = build_srcset(id);
}
}
// ---------------------
// Settings
// ---------------------
@ -582,7 +600,9 @@ FFZ.prototype.render_tokens = function(tokens, render_links) {
}
}
extra = ' data-emote="' + id + '"';
var mirror_url = utils.quote_attr(constants.EMOTE_MIRROR_BASE + id + '.png');
extra = ' data-emote="' + id + '" onerror="FrankerFaceZ._emote_mirror_swap(this)"';
if ( ! constants.EMOTE_REPLACEMENTS[id] )
srcset = build_srcset(id);