1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-24 19:48:30 +00:00

3.5.145. Fixed component:twitch-chat-input not being found. Fixed modification of the live hosts collection. Refactored how layout CSS is calculated. Fixed ban, unban, and timeout buttons in chat. Fixed an error in the API if a room's extra sets aren't defined. Fixed an error with the Following tooltip if it's destroyed first frame, somehow.

This commit is contained in:
SirStendec 2016-03-25 18:32:35 -04:00
parent fbf891378d
commit 5b784aa4f8
7 changed files with 82 additions and 63 deletions

View file

@ -99,7 +99,7 @@ FFZ.prototype.setup_chat_input = function() {
this._modify_chat_input(Input); this._modify_chat_input(Input);
var views = this._roomv && this._roomv._viewRegistry || utils.ember_views(); var views = utils.ember_views();
for(var key in views) { for(var key in views) {
var v = views[key]; var v = views[key];
if ( v instanceof Input ) { if ( v instanceof Input ) {
@ -277,6 +277,8 @@ FFZ.prototype._modify_chat_input = function(component) {
if ( ! e.shiftKey && ! e.shiftLeft ) if ( ! e.shiftKey && ! e.shiftLeft )
this.set('ffz_mru_index', -1); this.set('ffz_mru_index', -1);
setTimeout(this.ffzResizeInput.bind(this),10);
default: default:
return this._onKeyDown(event); return this._onKeyDown(event);
} }

View file

@ -291,12 +291,10 @@ FFZ.prototype._modify_following = function() {
valid_hosts.push(host); valid_hosts.push(host);
} }
f.log("Stuff!", [this, e, valid_hosts, skipped]); //f.log("Stuff!", [this, e, valid_hosts, skipped]);
this.set('ffz_skipped', skipped); this.set('ffz_skipped', skipped);
this.setContent(valid_hosts); this.setContent(valid_hosts);
this.set('total', e._total);
return;
// We could get non-empty results even with no new hosts. // We could get non-empty results even with no new hosts.
this.set('gotNonEmptyResults', e.hosts && e.hosts.length); this.set('gotNonEmptyResults', e.hosts && e.hosts.length);

View file

@ -227,68 +227,74 @@ FFZ.prototype.setup_layout = function() {
}.property("playerSize"), }.property("playerSize"),
ffzPortraitWarning: function() { ffzPortraitWarning: function() {
if ( ! f.settings.portrait_mode || f._portrait_warning || f.settings.portrait_warning || ! this.get('isTooSmallForRightColumn') ) var t = this;
return; // Delay this, in case we're just resizing the window.
setTimeout(function() {
if ( ! f.settings.portrait_mode || f._portrait_warning || f.settings.portrait_warning || document.body.getAttribute('data-current-path').indexOf('user.') !== 0 || ! t.get('isTooSmallForRightColumn') )
return;
f._portrait_warning = true; f._portrait_warning = true;
f.show_message('Twitch\'s Chat Sidebar has been hidden as a result of FrankerFaceZ\'s Portrait Mode because the window is too wide.<br><br>Please <a href="#" onclick="ffz.settings.set(\'portrait_mode\',0);jQuery(this).parents(\'.ffz-noty\').remove();ffz._portrait_warning = false;return false">disable Portrait Mode</a> or make your window narrower.<br><br><a href="#" onclick="ffz.settings.set(\'portrait_warning\',true);jQuery(this).parents(\'.ffz-noty\').remove();return false">Do not show this message again</a>'); f.show_message('Twitch\'s Chat Sidebar has been hidden as a result of FrankerFaceZ\'s Portrait Mode because the window is too wide.<br><br>Please <a href="#" onclick="ffz.settings.set(\'portrait_mode\',0);jQuery(this).parents(\'.ffz-noty\').remove();ffz._portrait_warning = false;return false">disable Portrait Mode</a> or make your window narrower.<br><br><a href="#" onclick="ffz.settings.set(\'portrait_warning\',true);jQuery(this).parents(\'.ffz-noty\').remove();return false">Do not show this message again</a>');
}, 50);
}.observes("isTooSmallForRightColumn"), }.observes("isTooSmallForRightColumn"),
ffzUpdateCss: function() { ffzUpdateCss: function() {
// TODO: Fix this mess of duplicate code.
var out = ''; var out = '';
if ( ! f.has_bttv ) { if ( ! f.has_bttv ) {
if ( this.get('portraitMode') ) { if ( this.get('isRightColumnClosed') )
var size = this.get('playerSize'), out = '';
height = size[1], else {
top = height + 120 + 60; if ( this.get('portraitMode') ) {
var size = this.get('playerSize'),
video_below = this.get('portraitVideoBelow'),
window_height = this.get('windowHeight'),
window_width = this.get('windowWidth'),
if ( this.get('portraitVideoBelow') ) { video_height = size[1] + 120 + 60,
var wh = this.get("windowHeight"), chat_height = window_height - video_height,
mch = wh - top;
out = (this.get('isRightColumnClosed') ? '' : 'body[data-current-path^="user."] #left_col, ') + video_top = video_below ? chat_height : 0,
'body[data-current-path^="user."]:not(.ffz-sidebar-swap) #main_col:not(.expandRight) { margin-right: 0 !important; top: ' + mch + 'px; height: ' + top + 'px; }' + chat_top = video_below ? 0 : video_height,
'body[data-current-path^="user."].ffz-sidebar-swap #main_col:not(.expandRight) { margin-left: 0 !important; top: ' + mch + 'px; height: ' + top + 'px; }' +
'body[data-current-path^="user."] #right_col { width: 100%; height: ' + mch + 'px; left: 0; }';
} else
out = (this.get('isRightColumnClosed') ? '' : 'body[data-current-path^="user."] #left_col, ') +
'body[data-current-path^="user."]:not(.ffz-sidebar-swap) #main_col:not(.expandRight) { margin-right: 0 !important; height: ' + top + 'px; }' +
'body[data-current-path^="user."].ffz-sidebar-swap #main_col:not(.expandRight) { margin-left: 0 !important; height: ' + top + 'px; }' +
'body[data-current-path^="user."] #right_col { width: 100%; top: ' + top + 'px; left: 0; }';
// Theatre Mode Portrait theatre_video_height = Math.floor(Math.max(window_height * 0.1, Math.min(window_height - 300, 9 * window_width / 16))),
if ( true ) { //this.get('theaterPortraitMode') ) { theatre_chat_height = window_height - theatre_video_height,
// Recalculate the player height, not including the title or anything special.
var width = this.get("windowWidth"),
wh = this.get("windowHeight"),
height = (9 * width / 16);
height = Math.floor(Math.max(wh * 0.1, Math.min(wh - 300, height))); theatre_video_top = video_below ? theatre_chat_height : 0,
theatre_chat_top = video_below ? 0 : theatre_video_height;
if ( this.get('portraitVideoBelow') ) {
var mch = this.get("windowHeight") - height;
out += (this.get('isRightColumnClosed') ? '' : 'body[data-current-path^="user."] .app-main.theatre #left_col, ') + out = 'body[data-current-path^="user."] #left_col,' +
'body[data-current-path^="user."]:not(.ffz-sidebar-swap) .app-main.theatre #main_col:not(.expandRight) { margin-right: 0 !important; top: ' + mch + 'px; height: ' + height + 'px; }' + 'body[data-current-path^="user."]:not(.ffz-sidebar-swap) #main_col{' +
'body[data-current-path^="user."].ffz-sidebar-swap .app-main.theatre #main_col:not(.expandRight) { margin-left: 0 !important; top: ' + mch + 'px; height: ' + height + 'px; }' + 'margin-right:0 !important;' +
'body[data-current-path^="user."] .app-main.theatre #right_col { width: 100%; height: ' + mch + 'px; left: 0; }'; 'top:' + video_top + 'px;' +
} else 'height:' + video_height + 'px}' +
out += 'body[data-current-path^="user."]:not(.ffz-sidebar-swap) .app-main.theatre #main_col:not(.expandRight) { margin-right: 0 !important; height: ' + height + 'px; }' + 'body[data-current-path^="user."].ffz-sidebar-swap #main_col{' +
'body[data-current-path^="user."].ffz-sidebar-swap .app-main.theatre #main_col:not(.expandRight) { margin-left: 0 !important; height: ' + height + 'px; }' + 'margin-left:0 !important;' +
'body[data-current-path^="user."] .app-main.theatre #right_col { width: 100%; top: ' + height + 'px; left: 0; }'; 'top:' + video_top + 'px;' +
} 'height:' + video_height + 'px}' +
'body[data-current-path^="user."] #right_col{' +
'width:100%;' +
'top:' + chat_top + 'px;' +
'height:' + chat_height + 'px}' +
'body[data-current-path^="user."] .app-main.theatre #left_col,' +
'body[data-current-path^="user."] .app-main.theatre #main_col{' +
'top:' + theatre_video_top + 'px;' +
'height:' + theatre_video_height + 'px}' +
'body[data-current-path^="user."] .app-main.theatre #right_col{' +
'top:' + theatre_chat_top + 'px;' +
'height:' + theatre_chat_height + 'px}';
} else { } else {
var width = this.get('rightColumnWidth'); var width = this.get('rightColumnWidth');
out = '#main_col.expandRight #right_close{left: none !important}' +
out = '#main_col.expandRight #right_close { left: none !important; }' + '#right_col{width:' + width + 'px}' +
'#right_col { width: ' + width + 'px; }' + 'body:not(.ffz-sidebar-swap) #main_col:not(.expandRight){' +
'body:not(.ffz-sidebar-swap) #main_col:not(.expandRight) { margin-right: ' + width + 'px; }' + 'margin-right:' + width + 'px}' +
'body.ffz-sidebar-swap #main_col:not(.expandRight) { margin-left: ' + width + 'px; }'; 'body.ffz-sidebar-swap #main_col:not(.expandRight){' +
} 'margin-left:' + width + 'px}';
}
}
f._layout_style.innerHTML = out; f._layout_style.innerHTML = out;
} }

View file

@ -900,13 +900,13 @@ FFZ.prototype._modify_chat_subline = function(component) {
return; return;
} else if ( cl.contains('ban') ) } else if ( cl.contains('ban') )
this.sendAction("banUser", {user:from}); this.sendAction("banUser", from);
else if ( cl.contains('unban') ) else if ( cl.contains('unban') )
this.sendAction("unbanUser", {user:from}); this.sendAction("unbanUser", from);
else if ( cl.contains('timeout') ) else if ( cl.contains('timeout') )
this.sendAction("timeoutUser", {user:from}); this.sendAction("timeoutUser", from);
} else if ( cl.contains('badge') ) { } else if ( cl.contains('badge') ) {
if ( cl.contains('turbo') ) if ( cl.contains('turbo') )
@ -926,10 +926,16 @@ FFZ.prototype._modify_chat_subline = function(component) {
sender: from sender: from
}); });
} else if ( e.target.classList.contains('undelete') ) } else if ( e.target.classList.contains('undelete') ) {
e.preventDefault();
this.set("msgObject.deleted", false); this.set("msgObject.deleted", false);
}
} }
}) });
try {
component.create().destroy()
} catch(err) { }
} }
@ -1005,6 +1011,10 @@ FFZ.prototype._modify_vod_line = function(component) {
} }
} }
}); });
try {
component.create().destroy()
} catch(err) { }
} }

View file

@ -235,7 +235,7 @@ API.prototype.unload_set = function(id) {
if ( ! room ) if ( ! room )
continue; continue;
var ind = room.ext_sets.indexOf(exact_id); var ind = room.ext_sets ? room.ext_sets.indexOf(exact_id) : -1;
if ( ind !== -1 ) if ( ind !== -1 )
room.ext_sets.splice(ind,1); room.ext_sets.splice(ind,1);
} }
@ -345,7 +345,7 @@ API.prototype.register_room_set = function(room_id, id, emote_set) {
this.ffz.emote_sets[exact_id] = emote_set; this.ffz.emote_sets[exact_id] = emote_set;
// Register it on the room. // Register it on the room.
room.ext_sets.push(exact_id); room.ext_sets && room.ext_sets.push(exact_id);
emote_set.users.push(room_id); emote_set.users.push(room_id);
} }
@ -358,7 +358,7 @@ API.prototype.unregister_room_set = function(room_id, id) {
if ( ! emote_set || ! room ) if ( ! emote_set || ! room )
return; return;
var ind = room.ext_sets.indexOf(exact_id); var ind = room.ext_sets ? room.ext_sets.indexOf(exact_id) : -1;
if ( ind !== -1 ) if ( ind !== -1 )
room.ext_sets.splice(ind,1); room.ext_sets.splice(ind,1);

View file

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

View file

@ -241,8 +241,11 @@ FFZ.prototype._build_following_tooltip = function(el) {
// Reposition the tooltip. // Reposition the tooltip.
setTimeout(function() { setTimeout(function() {
var tip = document.querySelector('.tipsy'), var tip = document.querySelector('.tipsy');
bb = tip.getBoundingClientRect(), if ( ! tip )
return;
var bb = tip.getBoundingClientRect(),
left = parseInt(tip.style.left || '0'), left = parseInt(tip.style.left || '0'),
right = bb.left + tip.scrollWidth; right = bb.left + tip.scrollWidth;