1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-19 12:30:54 +00:00

3.5.249. Add option to hide the Bits Tag display on streams such as EVO.

This commit is contained in:
SirStendec 2016-07-14 23:01:15 -04:00
parent 25eadeb89a
commit 0482887343
16 changed files with 72 additions and 81 deletions

View file

@ -14,13 +14,6 @@ FFZ.settings_info.bits_animated = {
category: "Chat Appearance",
no_bttv: true,
visible: function() {
var globals = utils.ember_lookup('service:globals'),
user = this.get_user();
return (globals && globals.get('isBitsEnabled')) || (user && user.is_staff);
},
name: "Bits Animation",
help: "Display bits with animation.",
@ -28,12 +21,28 @@ FFZ.settings_info.bits_animated = {
}
FFZ.settings_info.bits_tags_container = {
type: "boolean",
value: true,
category: "Chat Appearance",
no_bttv: true,
name: "Bits Tag Display",
help: "Display competitive bits tags at the top of chats that have it enabled.",
on_update: utils.toggle_cls('ffz-show-bits-tags')
}
// --------------------
// Initialization
// --------------------
FFZ.prototype.setup_bits = function() {
utils.toggle_cls('ffz-animate-bits')(this.settings.bits_animated);
utils.toggle_cls('ffz-show-bits-tags')(this.settings.bits_tags_container);
var f = this,
Service = utils.ember_lookup('service:bits-rendering-config');

View file

@ -290,7 +290,7 @@ FFZ.prototype.modify_chat_input = function(component) {
width = item.width ? (246 - item.width) + 'px' : null;
el.setAttribute('data-id', i);
el.classList.toggle('ffz-is-favorite', item.favorite || false);
el.classList.toggle('ffz-favorite', item.favorite || false);
if ( item.image ) {
el.classList.add('has-image');

View file

@ -52,9 +52,13 @@ FFZ.prototype.finalize_ember_wrapper = function() {
FFZ.prototype._update_views = function(klasses) {
this.log("Updating Ember classes and instances.", klasses);
var updated_instances = 0,
updated_klasses = 0;
// Modify all pending classes and clear them from cache.
for(var i=0; i < klasses.length; i++) {
klasses[i][2].call(this, klasses[i][1]);
updated_klasses++;
try {
klasses[i][1].create().destroy()
@ -72,6 +76,8 @@ FFZ.prototype._update_views = function(klasses) {
for(var i=0; i < klasses.length; i++)
if ( view instanceof klasses[i][1] ) {
updated_instances++;
try {
if ( ! view.ffz_modified )
klasses[i][2].call(this, view);
@ -85,4 +91,6 @@ FFZ.prototype._update_views = function(klasses) {
break;
}
}
this.log("Updated " + utils.number_commas(updated_instances) + " existing instances across " + updated_klasses + " classes.");
}

View file

@ -37,7 +37,7 @@ FFZ.msg_commands = {};
// Version
var VER = FFZ.version_info = {
major: 3, minor: 5, revision: 248,
major: 3, minor: 5, revision: 249,
toString: function() {
return [VER.major, VER.minor, VER.revision].join(".") + (VER.extra || "");
}

View file

@ -529,7 +529,7 @@ FFZ.menu_pages.channel = {
}
grid.className = "emoticon-grid";
grid.className = "emoticon-grid top-set";
header.className = "heading";
if ( icon ) {
header.style.backgroundImage = 'url("' + icon + '")';
@ -646,7 +646,7 @@ FFZ.menu_pages.channel = {
var extra_sets = _.union(room && room.extra_sets || [], room && room.ext_sets || [], []);
// Basic Emote Sets
this._emotes_for_sets(inner, view, room && room.set && [room.set] || [], (this.feature_friday || has_product || extra_sets.length ) ? "Channel Emoticons" : null, (room && room.moderator_badge) || "//cdn.frankerfacez.com/script/devicon.png", "FrankerFaceZ");
this._emotes_for_sets(inner, view, room && room.set && [room.set] || [], (this.feature_friday || has_product || extra_sets.length ) ? "Channel Emoticons" : null, (room && room.moderator_badge) || "//cdn.frankerfacez.com/script/devicon.png", "FrankerFaceZ", ! has_product && extra_sets.length);
for(var i=0; i < extra_sets.length; i++) {
// Look up the set name.
@ -669,9 +669,11 @@ FFZ.menu_pages.channel = {
// Emotes for Sets
// --------------------
FFZ.prototype._emotes_for_sets = function(parent, view, sets, header, image, sub_text) {
FFZ.prototype._emotes_for_sets = function(parent, view, sets, header, image, sub_text, top_set) {
var grid = document.createElement('div'), c = 0, f = this;
grid.className = 'emoticon-grid';
if ( top_set )
grid.classList.add('top-set');
if ( header != null ) {
var el_header = document.createElement('div');

View file

@ -168,6 +168,9 @@ FFZ.menu_pages.myemotes = {
return 0;
});
if ( sets.length )
sets[0][1].classList.add('top-set');
for(var i=0; i < sets.length; i++)
container.appendChild(sets[i][1]);
}
@ -264,9 +267,11 @@ FFZ.menu_pages.myemotes = {
container.appendChild(grid);
} else
} else if ( sets.length ) {
sets[0][1].classList.add('top-set');
for(var i=0; i < sets.length; i++)
container.appendChild(sets[i][1]);
}
return true;
},