mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-07 14:50:56 +00:00
3.5.427. Fix API badges not rendering correctly. Fix Hidden Badges UI not opening. Remove unnecessary logging. Remove unnecessary badge CSS when high-DPI images are not available. Fix API badges not supporting just sending in a string ID.
This commit is contained in:
parent
7e88c18ead
commit
b80731985f
6 changed files with 23 additions and 17 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
<div class="list-header">3.5.427 <time datetime="2017-02-14">(2017-02-14)</time></div>
|
||||||
|
<ul class="chat-menu-content menu-side-padding">
|
||||||
|
<li>Fixed: API badges not rendering correctly.</li>
|
||||||
|
<li>Fixed: Hidden Badges UI not opening due to a malformed badge data structure from Ember.</li>
|
||||||
|
<li>Fixed: Remove unnecessary logging mistakenly left in the last build.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<div class="list-header">3.5.426 <time datetime="2017-02-13">(2017-02-13)</time></div>
|
<div class="list-header">3.5.426 <time datetime="2017-02-13">(2017-02-13)</time></div>
|
||||||
<ul class="chat-menu-content menu-side-padding">
|
<ul class="chat-menu-content menu-side-padding">
|
||||||
<li>Fixed: Not Found bug when clicking links to game directory pages.</li>
|
<li>Fixed: Not Found bug when clicking links to game directory pages.</li>
|
||||||
|
|
|
@ -129,19 +129,21 @@ FFZ.settings_info.hidden_badges = {
|
||||||
if ( badgeCollection.global )
|
if ( badgeCollection.global )
|
||||||
for(var badge in badgeCollection.global)
|
for(var badge in badgeCollection.global)
|
||||||
if ( badgeCollection.global.hasOwnProperty(badge) && badge !== 'broadcasterName' ) {
|
if ( badgeCollection.global.hasOwnProperty(badge) && badge !== 'broadcasterName' ) {
|
||||||
var badge_data = badgeCollection.global[badge],
|
var badge_data = badgeCollection.global[badge] || {},
|
||||||
version = Object.keys(badge_data.versions)[0];
|
version = badge_data.versions && Object.keys(badge_data.versions)[0];
|
||||||
|
|
||||||
values.push([badge, f.render_badges(f.get_twitch_badges(badge + "/" + version))]);
|
if ( version )
|
||||||
|
values.push([badge, f.render_badges(f.get_twitch_badges(badge + "/" + version))]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( badgeCollection.channel )
|
if ( badgeCollection.channel )
|
||||||
for(var badge in badgeCollection.channel)
|
for(var badge in badgeCollection.channel)
|
||||||
if ( badgeCollection.channel.hasOwnProperty(badge) && badge !== 'broadcasterName' ) {
|
if ( badgeCollection.channel.hasOwnProperty(badge) && badge !== 'broadcasterName' ) {
|
||||||
var badge_data = badgeCollection.channel[badge],
|
var badge_data = badgeCollection.channel[badge] || {},
|
||||||
version = Object.keys(badge_data.versions)[0];
|
version = badge_data.versions && Object.keys(badge_data.versions)[0];
|
||||||
|
|
||||||
values.push([badge, f.render_badges(f.get_twitch_badges(badge + "/" + version))]);
|
if ( version )
|
||||||
|
values.push([badge, f.render_badges(f.get_twitch_badges(badge + "/" + version))]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1154,9 +1154,6 @@ FFZ.prototype._load_room_json = function(room_id, callback, data) {
|
||||||
|
|
||||||
this.rooms[room_id] = data;*/
|
this.rooms[room_id] = data;*/
|
||||||
|
|
||||||
this.log("Loading Room Data: " + room_id, model);
|
|
||||||
this.log(" -- has CSS: " + ~~(model.css) + " -- has mod URLs: " + ~~(model.mod_urls));
|
|
||||||
|
|
||||||
if ( model.css || model.mod_urls )
|
if ( model.css || model.mod_urls )
|
||||||
utils.update_css(this._room_style, room_id, moderator_css(model) + (model.css || ""));
|
utils.update_css(this._room_style, room_id, moderator_css(model) + (model.css || ""));
|
||||||
|
|
||||||
|
|
|
@ -508,7 +508,7 @@ API.prototype.user_add_badge = function(username, slot, badge_id) {
|
||||||
badges = user.badges = user.badges || {},
|
badges = user.badges = user.badges || {},
|
||||||
ffz_badges = ffz_user.badges = ffz_user.badges || {},
|
ffz_badges = ffz_user.badges = ffz_user.badges || {},
|
||||||
|
|
||||||
badge = typeof badge_id === "number" ? {id: badge_id} : badge_id;
|
badge = typeof badge_id !== "object" ? {id: badge_id} : badge_id;
|
||||||
|
|
||||||
badge.real_id = this.name_key + '-' + badge.id;
|
badge.real_id = this.name_key + '-' + badge.id;
|
||||||
badges[slot] = ffz_badges[slot] = badge;
|
badges[slot] = ffz_badges[slot] = badge;
|
||||||
|
@ -534,7 +534,7 @@ API.prototype.room_add_user_badge = function(room_name, username, slot, badge_id
|
||||||
var ffz_user = ffz_room_users[username] = ffz_room_users[username] || {badges: {}, sets: []},
|
var ffz_user = ffz_room_users[username] = ffz_room_users[username] || {badges: {}, sets: []},
|
||||||
ffz_badges = ffz_user && ffz_user.badges,
|
ffz_badges = ffz_user && ffz_user.badges,
|
||||||
|
|
||||||
badge = typeof badge_id === "number" ? {id: badge_id} : badge_id;
|
badge = typeof badge_id !== "object" ? {id: badge_id} : badge_id;
|
||||||
|
|
||||||
badge.real_id = this.name_key + '-' + badge.id;
|
badge.real_id = this.name_key + '-' + badge.id;
|
||||||
ffz_badges[slot] = badge;
|
ffz_badges[slot] = badge;
|
||||||
|
|
|
@ -61,7 +61,7 @@ FFZ.channel_metadata = {};
|
||||||
|
|
||||||
// Version
|
// Version
|
||||||
var VER = FFZ.version_info = {
|
var VER = FFZ.version_info = {
|
||||||
major: 3, minor: 5, revision: 426,
|
major: 3, minor: 5, revision: 427,
|
||||||
toString: function() {
|
toString: function() {
|
||||||
return [VER.major, VER.minor, VER.revision].join(".") + (VER.extra || "");
|
return [VER.major, VER.minor, VER.revision].join(".") + (VER.extra || "");
|
||||||
}
|
}
|
||||||
|
|
10
src/utils.js
10
src/utils.js
|
@ -1107,7 +1107,7 @@ module.exports = FFZ.utils = {
|
||||||
},
|
},
|
||||||
|
|
||||||
badge_css: function(badge, klass) {
|
badge_css: function(badge, klass) {
|
||||||
klass = klass || ('ffz-badge-' + badge.id);
|
klass = klass || ('ffz-badge-' + (badge.real_id || badge.id));
|
||||||
var urls = badge.urls || {1: badge.image},
|
var urls = badge.urls || {1: badge.image},
|
||||||
image_set = image = 'url("' + urls[1] + '")';
|
image_set = image = 'url("' + urls[1] + '")';
|
||||||
|
|
||||||
|
@ -1123,21 +1123,21 @@ module.exports = FFZ.utils = {
|
||||||
|
|
||||||
var out = '.badges .' + klass + (badge.no_color ? ':not(.colored){' : '{') +
|
var out = '.badges .' + klass + (badge.no_color ? ':not(.colored){' : '{') +
|
||||||
'background-color:' + badge.color + ';' +
|
'background-color:' + badge.color + ';' +
|
||||||
'background-image:' + image + ';' +
|
(image !== image_set ? 'background-image:' + image + ';' : '') +
|
||||||
'background-image:' + image_set + ';' +
|
'background-image:' + image_set + ';' +
|
||||||
(badge.css || '') + '}' +
|
(badge.css || '') + '}' +
|
||||||
|
|
||||||
'.badges .badge.ffz-badge-replacement.ffz-replacer-' + klass + ':not(.colored){' +
|
'.badges .badge.ffz-badge-replacement.ffz-replacer-' + klass + ':not(.colored){' +
|
||||||
'background-image:' + image + ';' +
|
(image !== image_set ? 'background-image:' + image + ';' : '') +
|
||||||
'background-image:' + image_set + '}';
|
'background-image:' + image_set + '}';
|
||||||
|
|
||||||
if ( ! badge.no_color )
|
if ( ! badge.no_color )
|
||||||
out += '.badges .badge.ffz-badge-replacement.ffz-replacer-' + klass + '.colored{' +
|
out += '.badges .badge.ffz-badge-replacement.ffz-replacer-' + klass + '.colored{' +
|
||||||
WEBKIT + 'mask-image:' + image + ';' +
|
(image !== image_set ? WEBKIT + 'mask-image:' + image + ';' : '') +
|
||||||
WEBKIT + 'mask-image:' + image_set + '}' +
|
WEBKIT + 'mask-image:' + image_set + '}' +
|
||||||
'.badges .' + klass + '.colored {' +
|
'.badges .' + klass + '.colored {' +
|
||||||
'background: linear-gradient(' + badge.color + ',' + badge.color + ');' +
|
'background: linear-gradient(' + badge.color + ',' + badge.color + ');' +
|
||||||
WEBKIT + 'mask-image:' + image + ';' +
|
(image !== image_set ? WEBKIT + 'mask-image:' + image + ';' : '') +
|
||||||
WEBKIT + 'mask-image:' + image_set + ';' +
|
WEBKIT + 'mask-image:' + image_set + ';' +
|
||||||
(badge.css || '') + '}';
|
(badge.css || '') + '}';
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue