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:
parent
fbf891378d
commit
5b784aa4f8
7 changed files with 82 additions and 63 deletions
|
@ -99,7 +99,7 @@ FFZ.prototype.setup_chat_input = function() {
|
|||
|
||||
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) {
|
||||
var v = views[key];
|
||||
if ( v instanceof Input ) {
|
||||
|
@ -277,6 +277,8 @@ FFZ.prototype._modify_chat_input = function(component) {
|
|||
if ( ! e.shiftKey && ! e.shiftLeft )
|
||||
this.set('ffz_mru_index', -1);
|
||||
|
||||
setTimeout(this.ffzResizeInput.bind(this),10);
|
||||
|
||||
default:
|
||||
return this._onKeyDown(event);
|
||||
}
|
||||
|
|
|
@ -291,12 +291,10 @@ FFZ.prototype._modify_following = function() {
|
|||
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.setContent(valid_hosts);
|
||||
this.set('total', e._total);
|
||||
return;
|
||||
|
||||
// We could get non-empty results even with no new hosts.
|
||||
this.set('gotNonEmptyResults', e.hosts && e.hosts.length);
|
||||
|
|
|
@ -227,67 +227,73 @@ FFZ.prototype.setup_layout = function() {
|
|||
}.property("playerSize"),
|
||||
|
||||
ffzPortraitWarning: function() {
|
||||
if ( ! f.settings.portrait_mode || f._portrait_warning || f.settings.portrait_warning || ! this.get('isTooSmallForRightColumn') )
|
||||
var t = this;
|
||||
// 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.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"),
|
||||
|
||||
ffzUpdateCss: function() {
|
||||
// TODO: Fix this mess of duplicate code.
|
||||
var out = '';
|
||||
|
||||
if ( ! f.has_bttv ) {
|
||||
if ( this.get('isRightColumnClosed') )
|
||||
out = '';
|
||||
else {
|
||||
if ( this.get('portraitMode') ) {
|
||||
var size = this.get('playerSize'),
|
||||
height = size[1],
|
||||
top = height + 120 + 60;
|
||||
video_below = this.get('portraitVideoBelow'),
|
||||
window_height = this.get('windowHeight'),
|
||||
window_width = this.get('windowWidth'),
|
||||
|
||||
if ( this.get('portraitVideoBelow') ) {
|
||||
var wh = this.get("windowHeight"),
|
||||
mch = wh - top;
|
||||
video_height = size[1] + 120 + 60,
|
||||
chat_height = window_height - video_height,
|
||||
|
||||
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; top: ' + mch + 'px; height: ' + top + 'px; }' +
|
||||
'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; }';
|
||||
video_top = video_below ? chat_height : 0,
|
||||
chat_top = video_below ? 0 : video_height,
|
||||
|
||||
// Theatre Mode Portrait
|
||||
if ( true ) { //this.get('theaterPortraitMode') ) {
|
||||
// Recalculate the player height, not including the title or anything special.
|
||||
var width = this.get("windowWidth"),
|
||||
wh = this.get("windowHeight"),
|
||||
height = (9 * width / 16);
|
||||
theatre_video_height = Math.floor(Math.max(window_height * 0.1, Math.min(window_height - 300, 9 * window_width / 16))),
|
||||
theatre_chat_height = window_height - theatre_video_height,
|
||||
|
||||
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, ') +
|
||||
'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."].ffz-sidebar-swap .app-main.theatre #main_col:not(.expandRight) { margin-left: 0 !important; top: ' + mch + 'px; height: ' + height + 'px; }' +
|
||||
'body[data-current-path^="user."] .app-main.theatre #right_col { width: 100%; height: ' + mch + 'px; left: 0; }';
|
||||
} else
|
||||
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 .app-main.theatre #main_col:not(.expandRight) { margin-left: 0 !important; height: ' + height + 'px; }' +
|
||||
'body[data-current-path^="user."] .app-main.theatre #right_col { width: 100%; top: ' + height + 'px; left: 0; }';
|
||||
}
|
||||
out = 'body[data-current-path^="user."] #left_col,' +
|
||||
'body[data-current-path^="user."]:not(.ffz-sidebar-swap) #main_col{' +
|
||||
'margin-right:0 !important;' +
|
||||
'top:' + video_top + 'px;' +
|
||||
'height:' + video_height + 'px}' +
|
||||
'body[data-current-path^="user."].ffz-sidebar-swap #main_col{' +
|
||||
'margin-left:0 !important;' +
|
||||
'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 {
|
||||
var width = this.get('rightColumnWidth');
|
||||
|
||||
out = '#main_col.expandRight #right_close { left: none !important; }' +
|
||||
'#right_col { width: ' + width + 'px; }' +
|
||||
'body:not(.ffz-sidebar-swap) #main_col:not(.expandRight) { margin-right: ' + width + 'px; }' +
|
||||
'body.ffz-sidebar-swap #main_col:not(.expandRight) { margin-left: ' + width + 'px; }';
|
||||
out = '#main_col.expandRight #right_close{left: none !important}' +
|
||||
'#right_col{width:' + width + 'px}' +
|
||||
'body:not(.ffz-sidebar-swap) #main_col:not(.expandRight){' +
|
||||
'margin-right:' + width + 'px}' +
|
||||
'body.ffz-sidebar-swap #main_col:not(.expandRight){' +
|
||||
'margin-left:' + width + 'px}';
|
||||
}
|
||||
}
|
||||
|
||||
f._layout_style.innerHTML = out;
|
||||
|
|
|
@ -900,13 +900,13 @@ FFZ.prototype._modify_chat_subline = function(component) {
|
|||
return;
|
||||
|
||||
} else if ( cl.contains('ban') )
|
||||
this.sendAction("banUser", {user:from});
|
||||
this.sendAction("banUser", from);
|
||||
|
||||
else if ( cl.contains('unban') )
|
||||
this.sendAction("unbanUser", {user:from});
|
||||
this.sendAction("unbanUser", from);
|
||||
|
||||
else if ( cl.contains('timeout') )
|
||||
this.sendAction("timeoutUser", {user:from});
|
||||
this.sendAction("timeoutUser", from);
|
||||
|
||||
} else if ( cl.contains('badge') ) {
|
||||
if ( cl.contains('turbo') )
|
||||
|
@ -926,10 +926,16 @@ FFZ.prototype._modify_chat_subline = function(component) {
|
|||
sender: from
|
||||
});
|
||||
|
||||
} else if ( e.target.classList.contains('undelete') )
|
||||
} else if ( e.target.classList.contains('undelete') ) {
|
||||
e.preventDefault();
|
||||
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) { }
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -235,7 +235,7 @@ API.prototype.unload_set = function(id) {
|
|||
if ( ! room )
|
||||
continue;
|
||||
|
||||
var ind = room.ext_sets.indexOf(exact_id);
|
||||
var ind = room.ext_sets ? room.ext_sets.indexOf(exact_id) : -1;
|
||||
if ( 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;
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
@ -358,7 +358,7 @@ API.prototype.unregister_room_set = function(room_id, id) {
|
|||
if ( ! emote_set || ! room )
|
||||
return;
|
||||
|
||||
var ind = room.ext_sets.indexOf(exact_id);
|
||||
var ind = room.ext_sets ? room.ext_sets.indexOf(exact_id) : -1;
|
||||
if ( ind !== -1 )
|
||||
room.ext_sets.splice(ind,1);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ FFZ.msg_commands = {};
|
|||
|
||||
// Version
|
||||
var VER = FFZ.version_info = {
|
||||
major: 3, minor: 5, revision: 142,
|
||||
major: 3, minor: 5, revision: 145,
|
||||
toString: function() {
|
||||
return [VER.major, VER.minor, VER.revision].join(".") + (VER.extra || "");
|
||||
}
|
||||
|
|
|
@ -241,8 +241,11 @@ FFZ.prototype._build_following_tooltip = function(el) {
|
|||
|
||||
// Reposition the tooltip.
|
||||
setTimeout(function() {
|
||||
var tip = document.querySelector('.tipsy'),
|
||||
bb = tip.getBoundingClientRect(),
|
||||
var tip = document.querySelector('.tipsy');
|
||||
if ( ! tip )
|
||||
return;
|
||||
|
||||
var bb = tip.getBoundingClientRect(),
|
||||
|
||||
left = parseInt(tip.style.left || '0'),
|
||||
right = bb.left + tip.scrollWidth;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue