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

Dark Mode

This commit is contained in:
SirStendec 2015-02-24 02:48:29 -05:00
parent 4c3b9217a8
commit 2fa93b0a8e
8 changed files with 268 additions and 13 deletions

View file

@ -113,6 +113,15 @@ FFZ.prototype.render_badge = function(view) {
var badge = data.badges[slot],
full_badge = this.badges[badge.id] || {};
if ( full_badge.visible !== undefined ) {
var visible = full_badge.visible;
if ( typeof visible == "function" )
try { visible = visible.bind(this)(room_id, user); } catch(err) { }
if ( ! visible )
continue;
}
var el = document.createElement('div');
el.className = 'badge float-left tooltip ffz-badge-' + badge.id;
el.setAttribute('title', badge.title || full_badge.title);
@ -145,16 +154,26 @@ FFZ.prototype.render_badge = function(view) {
// Legacy Support
// --------------------
FFZ.known_bots = ["quoteconut", "quoconut", "zenwan", "nightbot", "moobot", "xanbot"];
FFZ.prototype._legacy_add_donors = function(tries) {
this.badges[1] = {id: 1, title: "FFZ Donor", color: "#755000", image: "//cdn.frankerfacez.com/channel/global/donoricon.png"};
utils.update_css(this._badge_style, 1, badge_css(this.badges[1]));
// Developer Badges
// TODO: Upload the badge to the proper CDN.
this.badges[0] = {id: 0, title: "FFZ Developer", color: "#FAAF19", image: "//cdn.frankerfacez.com/channel/global/devicon.png"};
utils.update_css(this._badge_style, 0, badge_css(this.badges[0]));
this.users.sirstendec = {badges: {0: {id:0}}};
// Bot Badges
/*this.badges[2] = {id: 2, title: "Bot", color: "#595959", image: "//cdn.frankerfacez.com/channel/global/boticon.png",
visible: function(r,user) { return !(this.has_bttv && FFZ.bttv_known_bots[user]); }};
utils.update_css(this._badge_style, 2, badge_css(this.badges[2]));
for(var i=0;i<FFZ.known_bots.length;i++)
this.users[FFZ.known_bots[i]] = {badges: {1: {id:2}}};*/
jQuery.ajax(constants.SERVER + "script/donors.txt", {cache: false, context: this})
.done(function(data) {
this._legacy_parse_donors(data);