1
0
Fork 0
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:
SirStendec 2017-02-14 12:43:53 -05:00
parent 7e88c18ead
commit b80731985f
6 changed files with 23 additions and 17 deletions

View file

@ -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>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Not Found bug when clicking links to game directory pages.</li>

View file

@ -129,18 +129,20 @@ FFZ.settings_info.hidden_badges = {
if ( badgeCollection.global )
for(var badge in badgeCollection.global)
if ( badgeCollection.global.hasOwnProperty(badge) && badge !== 'broadcasterName' ) {
var badge_data = badgeCollection.global[badge],
version = Object.keys(badge_data.versions)[0];
var badge_data = badgeCollection.global[badge] || {},
version = badge_data.versions && Object.keys(badge_data.versions)[0];
if ( version )
values.push([badge, f.render_badges(f.get_twitch_badges(badge + "/" + version))]);
}
if ( badgeCollection.channel )
for(var badge in badgeCollection.channel)
if ( badgeCollection.channel.hasOwnProperty(badge) && badge !== 'broadcasterName' ) {
var badge_data = badgeCollection.channel[badge],
version = Object.keys(badge_data.versions)[0];
var badge_data = badgeCollection.channel[badge] || {},
version = badge_data.versions && Object.keys(badge_data.versions)[0];
if ( version )
values.push([badge, f.render_badges(f.get_twitch_badges(badge + "/" + version))]);
}
}

View file

@ -1154,9 +1154,6 @@ FFZ.prototype._load_room_json = function(room_id, callback, 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 )
utils.update_css(this._room_style, room_id, moderator_css(model) + (model.css || ""));

View file

@ -508,7 +508,7 @@ API.prototype.user_add_badge = function(username, slot, badge_id) {
badges = user.badges = 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;
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: []},
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;
ffz_badges[slot] = badge;

View file

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

View file

@ -1107,7 +1107,7 @@ module.exports = FFZ.utils = {
},
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},
image_set = image = 'url("' + urls[1] + '")';
@ -1123,21 +1123,21 @@ module.exports = FFZ.utils = {
var out = '.badges .' + klass + (badge.no_color ? ':not(.colored){' : '{') +
'background-color:' + badge.color + ';' +
'background-image:' + image + ';' +
(image !== image_set ? 'background-image:' + image + ';' : '') +
'background-image:' + image_set + ';' +
(badge.css || '') + '}' +
'.badges .badge.ffz-badge-replacement.ffz-replacer-' + klass + ':not(.colored){' +
'background-image:' + image + ';' +
(image !== image_set ? 'background-image:' + image + ';' : '') +
'background-image:' + image_set + '}';
if ( ! badge.no_color )
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 + '}' +
'.badges .' + klass + '.colored {' +
'background: linear-gradient(' + badge.color + ',' + badge.color + ');' +
WEBKIT + 'mask-image:' + image + ';' +
(image !== image_set ? WEBKIT + 'mask-image:' + image + ';' : '') +
WEBKIT + 'mask-image:' + image_set + ';' +
(badge.css || '') + '}';