mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-27 21:05:53 +00:00
3.5.374. Fixed clicking usernames in ban notices. Add no_tooltip attribute for badges. Add sort attribute to emote sets for the My Emoticons menu. Add source_line attribute to emote sets for customizing tooltips. Add chat-view-init and chat-view-destroy events to the API.
This commit is contained in:
parent
cc5aec5591
commit
9345237327
10 changed files with 83 additions and 41 deletions
|
@ -1,3 +1,13 @@
|
|||
<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>
|
||||
|
@ -59,13 +69,5 @@
|
|||
<li>Fixed: Theater Mode metadata positioned incorrectly for hosted streams.</li>
|
||||
</ul>
|
||||
|
||||
<div class="list-header">3.5.363 <time datetime="2016-11-08">(2016-11-08)</time></div>
|
||||
<ul class="chat-menu-content menu-side-padding">
|
||||
<li>Fixed: Properly position Search popout when sidebars are swapped and in portrait mode.</li>
|
||||
<li>Fixed: Dispatch events correctly when clicking mod icons for TwitchBot responses.</li>
|
||||
<li>Fixed: Friend notices not appearing in chat when BetterTTV is also present.</li>
|
||||
<li>Changed: Dark mode CSS tweaks.</li>
|
||||
</ul>
|
||||
|
||||
<div class="list-header" id="ffz-old-news-button"><a href="#">View Older</a></div>
|
||||
<div id="ffz-old-news"></div>
|
|
@ -1,3 +1,11 @@
|
|||
<div class="list-header">3.5.363 <time datetime="2016-11-08">(2016-11-08)</time></div>
|
||||
<ul class="chat-menu-content menu-side-padding">
|
||||
<li>Fixed: Properly position Search popout when sidebars are swapped and in portrait mode.</li>
|
||||
<li>Fixed: Dispatch events correctly when clicking mod icons for TwitchBot responses.</li>
|
||||
<li>Fixed: Friend notices not appearing in chat when BetterTTV is also present.</li>
|
||||
<li>Changed: Dark mode CSS tweaks.</li>
|
||||
</ul>
|
||||
|
||||
<div class="list-header">3.5.362 <time datetime="2016-11-03">(2016-11-03)</time></div>
|
||||
<ul class="chat-menu-content menu-side-padding">
|
||||
<li>Fixed: Twitch changed how the player is sized, particularly in theater mode. This broke positioning of the player in several configurations.</li>
|
||||
|
|
|
@ -397,6 +397,7 @@ FFZ.prototype._get_badge_object = function(badge, full_badge) {
|
|||
image: badge.image,
|
||||
full_image: full_badge.image,
|
||||
color: badge.color,
|
||||
no_tooltip: badge.no_tooltip || full_badge.no_tooltip,
|
||||
click_action: badge.click_action || full_badge.click_action,
|
||||
click_url: badge.click_url || full_badge.click_url,
|
||||
no_invert: badge.no_invert || full_badge.no_invert,
|
||||
|
@ -548,7 +549,7 @@ FFZ.prototype.render_badges = function(badges) {
|
|||
if ( badge.transparent )
|
||||
klass += ' transparent';
|
||||
|
||||
out.push('<div class="badge html-tooltip ' + utils.quote_attr(klass) + '"' + (badge.click_url ? ' data-badge-id="' + badge.id + '" data-url="' + utils.quote_attr(badge.click_url) + '"' : '') + (css ? ' style="' + utils.quote_attr(css) + '"' : '') + ' title="' + utils.quote_attr(badge.title) + '"></div>');
|
||||
out.push('<div class="badge ' + (badge.no_tooltip ? '' : 'html-tooltip ') + utils.quote_attr(klass) + '"' + (badge.id ? ' data-badge-id="' + badge.id + '"' : '') + (badge.click_url ? ' data-url="' + utils.quote_attr(badge.click_url) + '"' : '') + (css ? ' style="' + utils.quote_attr(css) + '"' : '') + ' title="' + utils.quote_attr(badge.title) + '"></div>');
|
||||
}
|
||||
|
||||
return out.join("");
|
||||
|
|
|
@ -554,18 +554,18 @@ FFZ.prototype.modify_channel_redesign = function(view) {
|
|||
|
||||
handleScroll: function(top) {
|
||||
this._super();
|
||||
var height = this.get('channelCoverHeight') + Layout.get('fullSizePlayerDimensions.height');
|
||||
var height = this.channelCoverHeight + Layout.get('fullSizePlayerDimensions.height');
|
||||
document.body.classList.toggle('ffz-small-player', f.settings.small_player && top >= (height * .8));
|
||||
},
|
||||
|
||||
ffzUpdateCoverHeight: function() {
|
||||
var old_height = this.get('channelCoverHeight'),
|
||||
var old_height = this.channelCoverHeight,
|
||||
setting = f.settings.hide_channel_banner,
|
||||
banner_hidden = setting === 1 ? f.settings.channel_bar_bottom : setting > 0,
|
||||
|
||||
new_height = banner_hidden ? 0 : 380;
|
||||
|
||||
this.set('channelCoverHeight', new_height);
|
||||
this.channelCoverHeight = new_height;
|
||||
this.$("#channel").toggleClass('ffz-bar-fixed', this.get('isFixed'));
|
||||
|
||||
if ( old_height !== new_height )
|
||||
|
|
|
@ -575,6 +575,8 @@ FFZ.prototype.modify_chat_room_manager = function(component) {
|
|||
|
||||
this.ffz_pruner = setInterval(this.ffzPruneTabs.bind(this), 10000);
|
||||
|
||||
f.api_trigger('chat-view-init', el, this);
|
||||
|
||||
setTimeout(function() {
|
||||
if ( f.settings.group_tabs && t._ffz_tabs )
|
||||
t.$('.chat-room').css('top', t._ffz_tabs.offsetHeight + "px");
|
||||
|
@ -599,6 +601,8 @@ FFZ.prototype.modify_chat_room_manager = function(component) {
|
|||
|
||||
this.ffzTeardownMenu();
|
||||
this.ffzUnloadHost();
|
||||
|
||||
f.api_trigger('chat-view-destroy', this.get('element'), this);
|
||||
},
|
||||
|
||||
|
||||
|
|
|
@ -1143,9 +1143,6 @@ FFZ.prototype._modify_chat_subline = function(component) {
|
|||
var cl = e.target.classList,
|
||||
from = this.get("msgObject.from");
|
||||
|
||||
if ( ! from )
|
||||
return;
|
||||
|
||||
/*if ( cl.contains('ffz-old-messages') )
|
||||
return f._show_deleted(this.get('msgObject.room'));*/
|
||||
|
||||
|
@ -1157,6 +1154,7 @@ FFZ.prototype._modify_chat_subline = function(component) {
|
|||
return f._deleted_link_click.call(e.target, e);
|
||||
|
||||
else if ( cl.contains('mod-icon') ) {
|
||||
|
||||
jQuery(e.target).trigger('mouseout');
|
||||
e.preventDefault();
|
||||
|
||||
|
@ -1172,6 +1170,9 @@ FFZ.prototype._modify_chat_subline = function(component) {
|
|||
else if ( cl.contains('tb-allow') )
|
||||
this.actions.clickedTwitchBotResponse.call(this, this.get('msgObject.tags.id'), 'yes');
|
||||
|
||||
else if ( ! from )
|
||||
return;
|
||||
|
||||
else if ( cl.contains('ban') )
|
||||
this.sendAction("banUser", {user:from});
|
||||
|
||||
|
@ -1223,6 +1224,9 @@ FFZ.prototype._modify_chat_subline = function(component) {
|
|||
from :
|
||||
this.get('msgObject.to');
|
||||
|
||||
if ( ! target )
|
||||
return;
|
||||
|
||||
var n = this.get('element'),
|
||||
bounds = n && n.getBoundingClientRect() || document.body.getBoundingClientRect(),
|
||||
x = 0, right;
|
||||
|
|
|
@ -555,6 +555,16 @@ API.prototype.unregister_chat_filter = function(filter) {
|
|||
// Channel Callbacks
|
||||
// -----------------------
|
||||
|
||||
API.prototype.iterate_chat_views = function(func) {
|
||||
if ( func === undefined )
|
||||
func = this.trigger.bind(this, 'chat-view-init');
|
||||
|
||||
if ( this.ffz._chatv ) {
|
||||
var view = this.ffz._chatv;
|
||||
func(view.get('element'), view);
|
||||
}
|
||||
}
|
||||
|
||||
API.prototype.iterate_rooms = function(func) {
|
||||
if ( func === undefined )
|
||||
func = this.trigger.bind(this, 'room-add');
|
||||
|
|
12
src/main.js
12
src/main.js
|
@ -61,7 +61,7 @@ FFZ.channel_metadata = {};
|
|||
|
||||
// Version
|
||||
var VER = FFZ.version_info = {
|
||||
major: 3, minor: 5, revision: 373,
|
||||
major: 3, minor: 5, revision: 374,
|
||||
toString: function() {
|
||||
return [VER.major, VER.minor, VER.revision].join(".") + (VER.extra || "");
|
||||
}
|
||||
|
@ -273,11 +273,11 @@ FFZ.prototype.initialize = function(increment, delay) {
|
|||
// Twitch ember application is ready.
|
||||
|
||||
// Pages we don't want to interact with at all.
|
||||
if ( location.hostname === 'passport.twitch.tv' || /^\/user\/two_factor/.test(location.pathname) )
|
||||
return this.log("Found authentication sub-page. Not initializing.");
|
||||
|
||||
if ( ['im.twitch.tv', 'api.twitch.tv'].indexOf(location.hostname) !== -1 || /^\/products\//.test(location.pathname) || /^\/pr\//.test(location.pathname) )
|
||||
return this.log("Found banned sub-domain. Not initializing.");
|
||||
if ( ['passport.twitch.tv', 'im.twitch.tv', 'api.twitch.tv', 'chatdepot.twitch.tv', 'spade.twitch.tv'].indexOf(location.hostname) !== -1 || /^\/products\//.test(location.pathname) || /^\/pr\//.test(location.pathname) || /^\/user\/two_factor/.test(location.pathname) ) {
|
||||
this.log("Found banned sub-domain. Not initializing.");
|
||||
window.FrankerFaceZ = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for the player
|
||||
if ( location.hostname === 'player.twitch.tv' )
|
||||
|
|
|
@ -422,7 +422,8 @@ FFZ.prototype.render_tooltip = function(el) {
|
|||
if ( emote ) {
|
||||
var owner = emote.owner,
|
||||
title = emote_set.title || "Global",
|
||||
source = emote_set.source || "FFZ";
|
||||
source = emote_set.source || "FFZ",
|
||||
source_line = emote_set.source_line || (source + ' ' + title);
|
||||
|
||||
if ( f.settings.emote_image_hover ) {
|
||||
if ( emote.urls[4] ) {
|
||||
|
@ -444,7 +445,7 @@ FFZ.prototype.render_tooltip = function(el) {
|
|||
|
||||
//image = preview_url ? `<img style="height:${height}px" class="emoticon ffz-image-hover" src="${preview_url}?_=preview">` : '';
|
||||
image = preview_url ? '<img style="height:' + height + 'px" class="emoticon ffz-image-hover" src="' + preview_url + '"?_=preview">' : '';
|
||||
return image + 'Emoticon: ' + (emote.hidden ? '???' : emote.name) + '<br>' + source + ' ' + title + (owner ? '<br>By: ' + owner.display_name : '') + mod_text;
|
||||
return image + 'Emoticon: ' + (emote.hidden ? '???' : emote.name) + '<br>' + source_line + (owner ? '<br>By: ' + owner.display_name : '') + mod_text;
|
||||
|
||||
//return `${image}Emoticon: ${emote.hidden ? '???' : emote.name}<br>${source} ${title}${owner ? '<br>By: ' + owner.display_name : ""}`;
|
||||
}
|
||||
|
|
|
@ -206,9 +206,17 @@ FFZ.menu_pages.myemotes = {
|
|||
if ( ! set.length )
|
||||
continue;
|
||||
|
||||
var menu = FFZ.menu_pages.myemotes.draw_twitch_set.call(this, view, set_id, set, favorites_only);
|
||||
var menu_id = this._twitch_set_to_channel[set_id].toLowerCase(),
|
||||
sort_key = 0,
|
||||
menu = FFZ.menu_pages.myemotes.draw_twitch_set.call(this, view, set_id, set, favorites_only);
|
||||
|
||||
if ( menu_id.indexOf('global') !== -1 )
|
||||
sort_key = 100;
|
||||
else if ( menu_id.substr(0,2) === '--' || menu_id === 'turbo' )
|
||||
sort_key = 75;
|
||||
|
||||
if ( menu )
|
||||
sets.push([this._twitch_set_to_channel[set_id], menu]);
|
||||
sets.push([[sort_key, menu_id], menu]);
|
||||
}
|
||||
|
||||
// Emoji~!
|
||||
|
@ -217,7 +225,7 @@ FFZ.menu_pages.myemotes = {
|
|||
if ( favorites_list && favorites_list.length ) {
|
||||
var menu = FFZ.menu_pages.myemotes.draw_emoji.call(this, view, null, favorites_only);
|
||||
if ( menu )
|
||||
sets.push(["emoji", menu]);
|
||||
sets.push([[200, "emoji"], menu]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -235,9 +243,19 @@ FFZ.menu_pages.myemotes = {
|
|||
if ( ! set || ! set.count || set.hidden || ( ! this.settings.global_emotes_in_menu && this.default_sets.indexOf(set_id) !== -1 ) )
|
||||
continue;
|
||||
|
||||
var menu = FFZ.menu_pages.myemotes.draw_ffz_set.call(this, view, set, favorites_only);
|
||||
var menu_id = set.title.toLowerCase(),
|
||||
sort_key = set.sort,
|
||||
menu = FFZ.menu_pages.myemotes.draw_ffz_set.call(this, view, set, favorites_only);
|
||||
|
||||
if ( sort_key === undefined || sort_key === null ) {
|
||||
if ( menu_id.indexOf('global') !== -1 )
|
||||
sort_key = 100;
|
||||
else
|
||||
sort_key = 0;
|
||||
}
|
||||
|
||||
if ( menu )
|
||||
sets.push([set.title.toLowerCase(), menu]);
|
||||
sets.push([[sort_key, menu_id], menu]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -247,20 +265,14 @@ FFZ.menu_pages.myemotes = {
|
|||
|
||||
// Finally, sort and add them all.
|
||||
sets.sort(function(a,b) {
|
||||
var an = a[0], bn = b[0];
|
||||
if ( an === "--curse--" || an === "--prime--" || an === "--prime-faces--" || an === "turbo" || an === "--turbo-faces--" )
|
||||
an = "zza|" + an;
|
||||
else if ( an === "global" || (an && an.substr(0,16) === "global emoticons") || an === "--global--" )
|
||||
an = "zzy|" + an;
|
||||
else if ( an && an.substr(0,5) === "emoji" )
|
||||
an = "zzz|" + an;
|
||||
var ask = a[0][0],
|
||||
an = a[0][1],
|
||||
|
||||
if ( bn === "--curse--" || bn === "--prime--" || bn === "--prime-faces--" || bn === "turbo" || bn === "--turbo-faces--" )
|
||||
bn = "zza|" + bn;
|
||||
else if ( bn === "global" || (bn && bn.substr(0,16) === "global emoticons") || bn === "--global--" )
|
||||
bn = "zzy|" + bn;
|
||||
else if ( bn && bn.substr(0,5) === "emoji" )
|
||||
bn = "zzz|" + bn;
|
||||
bsk = b[0][0],
|
||||
bn = b[0][1];
|
||||
|
||||
if ( ask < bsk ) return -1;
|
||||
if ( ask > bsk ) return 1;
|
||||
|
||||
if ( an < bn ) return -1;
|
||||
if ( an > bn ) return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue