1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-28 15:27:43 +00:00

3.5.203. Improved styling for balloon elements in dark theme. Support the new badge system. Add support for hiding badges. Add support for hiding badges when BetterTTV is present. Remove silly duplicate code from channel.js. Fix the Chat button showing a silly message when you're perma-banned.

This commit is contained in:
SirStendec 2016-06-05 22:12:54 -04:00
parent 04a8f5dae7
commit 2f7dc1d8d3
14 changed files with 396 additions and 84 deletions

View file

@ -76,6 +76,34 @@ var sanitize_el = document.createElement('span'),
return new Date(unix);
},
BADGE_REV = {
'b': 'broadcaster',
's': 'staff',
'a': 'admin',
'g': 'global_mod',
'm': 'moderator',
'u': 'subscriber',
't': 'turbo'
},
uncompressBadges = function(value) {
if ( value === true )
return {};
var output = {},
badges = value.split(","),
l = badges.length;
for(var i=0; i < l; i++) {
var parts = badges[i].split('/');
if ( parts.length !== 2 )
return {};
output[BADGE_REV[parts[0]] || parts[0].substr(1)] = parts[1];
}
return output;
},
uncompressEmotes = function(value) {
var output = {},
@ -373,6 +401,7 @@ module.exports = FFZ.utils = {
}
},
uncompressBadges: uncompressBadges,
uncompressEmotes: uncompressEmotes,
emoji_to_codepoint: emoji_to_codepoint,