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:
parent
04a8f5dae7
commit
2f7dc1d8d3
14 changed files with 396 additions and 84 deletions
29
src/utils.js
29
src/utils.js
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue