1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-27 21:05:53 +00:00

3.5.386. Add high-DPI custom mod badges. Fix mod cards when you're not a mod.

This commit is contained in:
SirStendec 2016-11-30 16:58:11 -05:00
parent 3de30ce618
commit fc9373947a
5 changed files with 66 additions and 41 deletions

View file

@ -1,3 +1,13 @@
<div class="list-header">3.5.386 <time datetime="2016-11-30">(2016-11-30)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Added: Support high-DPI images for custom moderator badges.</li>
</ul>
<div class="list-header">3.5.385 <time datetime="2016-11-30">(2016-11-30)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Mod cards not properly initializing in channels where you're not a mod.</li>
</ul>
<div class="list-header">3.5.384 <time datetime="2016-11-29">(2016-11-29)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Issue causing empty chat lines when badge data has not yet loaded.</li>
@ -49,29 +59,5 @@
<li>Fixed: Cheers aren't working yet, but they also don't break chat completely.</li>
</ul>
<div class="list-header">3.5.375 <time datetime="2016-11-21">(2016-11-21)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Added: Option to disable subscriber loyalty badges in favor of displaying the lowest tier for all subscribers.</li>
<li>Fixed: Default subscriber badge not rendering for partnered channels without a custom subscriber badge set.</li>
</ul>
<div class="list-header">3.5.374 <time datetime="2016-11-20">(2016-11-20)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Clicking a username in a ban notice would not open a mod card.</li>
<li>API Added: <code>chat-view-init</code> and <code>chat-view-destroy</code> events for adding event handlers to chat.</li>
<li>API Added: <code>api.iterate_chat_views</code> method to be used during initialization to call the <code>chat-view-init</code> events for already existing chat views.</li>
<li>API Added: <code>sort</code> property for emote sets for sorting the My Emoticons menu.</li>
<li>API Added: <code>source_line</code> property for emote sets to further customize the source displayed in emoticon tooltips.</li>
<li>API Added: <code>no_tooltip</code> property for badges to avoid adding the default tooltip behavior.</li>
</ul>
<div class="list-header">3.5.373 <time datetime="2016-11-19">(2016-11-19)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Added: Support for <code>target-msg-id</code> when users are banned.</li>
<li>Added: Setting for alternate input handling when doing tab-completion. Hopefully I didn't break tab-completion.</li>
<li>Fixed: Bug causing global emotes to not load.</li>
<li>API Fixed: Pass all attributes through when registering badges and emote sets.</li>
</ul>
<div class="list-header" id="ffz-old-news-button"><a href="#">View Older</a></div>
<div id="ffz-old-news"></div>

View file

@ -1,3 +1,27 @@
<div class="list-header">3.5.375 <time datetime="2016-11-21">(2016-11-21)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Added: Option to disable subscriber loyalty badges in favor of displaying the lowest tier for all subscribers.</li>
<li>Fixed: Default subscriber badge not rendering for partnered channels without a custom subscriber badge set.</li>
</ul>
<div class="list-header">3.5.374 <time datetime="2016-11-20">(2016-11-20)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Clicking a username in a ban notice would not open a mod card.</li>
<li>API Added: <code>chat-view-init</code> and <code>chat-view-destroy</code> events for adding event handlers to chat.</li>
<li>API Added: <code>api.iterate_chat_views</code> method to be used during initialization to call the <code>chat-view-init</code> events for already existing chat views.</li>
<li>API Added: <code>sort</code> property for emote sets for sorting the My Emoticons menu.</li>
<li>API Added: <code>source_line</code> property for emote sets to further customize the source displayed in emoticon tooltips.</li>
<li>API Added: <code>no_tooltip</code> property for badges to avoid adding the default tooltip behavior.</li>
</ul>
<div class="list-header">3.5.373 <time datetime="2016-11-19">(2016-11-19)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Added: Support for <code>target-msg-id</code> when users are banned.</li>
<li>Added: Setting for alternate input handling when doing tab-completion. Hopefully I didn't break tab-completion.</li>
<li>Fixed: Bug causing global emotes to not load.</li>
<li>API Fixed: Pass all attributes through when registering badges and emote sets.</li>
</ul>
<div class="list-header">3.5.372 <time datetime="2016-11-16">(2016-11-16)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Changed: Chat Font Family and Font Size now appear to Pinned Cheers.</li>

View file

@ -978,15 +978,17 @@ FFZ.prototype.modify_moderation_card = function(component) {
var def_actions = el.querySelector('.moderation-card__actions');
if ( def_actions ) {
var def_line = def_actions.querySelector('.clearfix'),
bad_line = def_actions.querySelector('.moderation-card__controls'),
children = bad_line.querySelectorAll('button');
bad_line = def_actions.querySelector('.moderation-card__controls');
for(var i=0; i < children.length; i++) {
bad_line.removeChild(children[i]);
def_line.appendChild(children[i]);
if ( def_line && bad_line ) {
var children = bad_line.querySelectorAll('button');
for(var i=0; i < children.length; i++) {
bad_line.removeChild(children[i]);
def_line.appendChild(children[i]);
}
bad_line.classList.add('hidden');
}
bad_line.classList.add('hidden');
}

View file

@ -41,21 +41,34 @@ var FFZ = window.FrankerFaceZ,
is_android = navigator.userAgent.indexOf('Android') !== -1,
moderator_css = function(room) {
if ( ! room.moderator_badge )
if ( ! room.mod_urls )
return "";
var urls = room.mod_urls,
image_set = image = 'url("' + urls[1] + '")';
if ( urls[2] || urls[4] ) {
image_set += ' 1x';
if ( urls[2] )
image_set += ', url("' + urls[2] + '") 2x';
if ( urls[4] )
image_set += ', url("' + urls[4] + '") 4x';
image_set = (constants.IS_WEBKIT ? '-webkit-' : '') + 'image-set(' + image_set + ')';
}
return '.from-display-preview[data-room="' + room.id + '"] .badges .moderator:not(.ffz-badge-replacement):not(.colored),' +
'.chat-line[data-room="' + room.id + '"] .badges .moderator:not(.ffz-badge-replacement):not(.colored) {' +
'background-repeat: no-repeat;' +
'background-size: initial !important;' +
'background-position: center;' +
'background-image:url("' + room.moderator_badge + '") !important; }' +
'background-repeat:no-repeat;' +
'background-size:initial !important;' +
'background-position:center;' +
'background-image:' + image_set + ' !important}' +
'.from-display-preview[data-room="' + room.id + '"] .badges .moderator:not(.ffz-badge-replacement).colored,' +
'.chat-line[data-room="' + room.id + '"] .badges .moderator:not(.ffz-badge-replacement).colored {' +
'-webkit-mask-repeat: no-repeat;' +
'-webkit-mask-size: initial !important;' +
'-webkit-mask-position: center;' +
'-webkit-mask-image: url("' + room.moderator_badge + '"); }';
'-webkit-mask-repeat:no-repeat;' +
'-webkit-mask-size:initial !important;' +
'-webkit-mask-position:center;' +
'-webkit-mask-image:' + image_set + '}';
};
// --------------------

View file

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