1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-28 21:48:31 +00:00

3.5.337. Chatter count on dashboard. Channel-specific badge fixes. Stuff.

This commit is contained in:
SirStendec 2016-10-18 00:35:31 -04:00
parent a89b71f0a2
commit f04edf7f54
10 changed files with 98 additions and 55 deletions

View file

@ -1,5 +1,6 @@
var FFZ = window.FrankerFaceZ,
utils = require('../utils'),
constants = require('../constants'),
update_viewer_count = function(text) {
var vc = jQuery("#channel_viewer_count");
@ -38,6 +39,37 @@ FFZ.msg_commands.chat_message = function(data) {
}
FFZ.msg_commands.chatter_count = function(data) {
if ( ! this.dashboard_channel || data.room !== this.dashboard_channel )
return;
var el = document.querySelector('#ffz-chatter-display span');
if ( ! this.settings.chatter_count || this.has_bttv || ! this.is_dashboard || ! data.chatters ) {
if ( el )
jQuery(el).parent().remove();
return;
}
if ( ! el ) {
var cont = document.querySelector('#stats');
if ( ! cont )
return;
var stat = utils.createElement('span', 'ffz stat', constants.ROOMS + ' ');
stat.id = 'ffz-chatter-display';
stat.title = 'Currently in Chat';
el = utils.createElement('span');
stat.appendChild(el);
cont.appendChild(stat);
jQuery(stat).tipsy({gravity: 's'});
}
el.textContent = utils.number_commas(data.chatters);
}
// -------------------
// Initialization
// -------------------