1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-06 14:20:56 +00:00

Initial commit for modular FrankerFaceZ rewrite.

This commit is contained in:
SirStendec 2015-01-12 17:58:07 -05:00
parent b74fdaa22b
commit f1377bc989
27 changed files with 2717 additions and 1034 deletions

35
src/ui/menu_button.js Normal file
View file

@ -0,0 +1,35 @@
var FFZ = window.FrankerFaceZ,
constants = require('../constants');
// --------------------
// Initialization
// --------------------
FFZ.prototype.build_ui_link = function(view) {
// TODO: Detect dark mode from BTTV.
var link = document.createElement('a');
link.className = 'ffz-ui-toggle';
link.innerHTML = constants.CHAT_BUTTON;
link.addEventListener('click', this.build_ui_popup.bind(this, view));
this.update_ui_link(link);
return link;
}
FFZ.prototype.update_ui_link = function(link) {
var controller = App.__container__.lookup('controller:chat');
link = link || document.querySelector('a.ffz-ui-toggle');
if ( !link || !controller ) return;
var room_id = controller.get('currentRoom.id'),
room = this.rooms[room_id],
has_emotes = room && room.sets.length > 0;
if ( has_emotes )
link.classList.remove('no-emotes');
else
link.classList.add('no-emotes');
}