1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-11 00:20:54 +00:00

3.5.444. Fix bugs with the My Emoticons menu. Dark CSS tweaks.

This commit is contained in:
SirStendec 2017-03-27 18:03:10 -04:00
parent 3b38d12859
commit 3d6acd46dd
13 changed files with 401 additions and 122 deletions

View file

@ -230,18 +230,26 @@ FFZ.prototype.setup_layout = function() {
}.property("ffzExtraHeight", "windowWidth", "rightColumnWidth", "fullSizePlayerDimensions", "windowHeight"),
contentWidth: function() {
var left_width = this.get('ffzMinimizeNavigation') ? 10 : this.get("isLeftColumnClosed") ? 50 : 240,
var left_width = this.get('isSocialColumnEnabled') ? (
f.settings.socialbar_hide ? 0 :
this.get('isSocialColumnCollapsed') ? 50 : 240
) : (
this.get('ffzMinimizeNavigation') ? 10 :
this.get('isLeftColumnClosed') ? 50 : 240
),
right_width = ! f.has_bttv && this.get('portraitMode') ? 0 : this.get("isRightColumnClosed") ? 0 : this.get("rightColumnWidth");
return this.get("windowWidth") - left_width - right_width - 60;
}.property("windowWidth", 'ffzMinimizeNavigation', "portraitMode", "isRightColumnClosed", "isLeftColumnClosed", "rightColumnWidth"),
}.property("windowWidth", 'ffzMinimizeNavigation', "portraitMode", "isRightColumnClosed", "isLeftColumnClosed", "rightColumnWidth", "isSocialColumnCollapsed", "isSocialColumnEnabled"),
ffzExtraHeight: function() {
return (f.settings.channel_bar_collapse ? 10 : 60) + 15 +
return (this.get('isSocialColumnEnabled') ? this.get('ffzMinimizeNavigation') ? 10 : 50 : 0) +
(f.settings.channel_bar_collapse ? 10 : 60) + 15 +
(f.settings.channel_title_top === 2 ? 20 : f.settings.channel_title_top > 0 ? 55 : 0) +
(f.settings.channel_title_top ? 70 : 80);
}.property(""),
}.property("isSocialColumnEnabled", "ffzMinimizeNavigation"),
fullSizePlayerDimensions: function() {
var h = this.get('windowHeight'),
@ -308,6 +316,7 @@ FFZ.prototype.setup_layout = function() {
if ( this.get('portraitMode') ) {
var size = this.get('fullSizePlayerDimensions'),
video_below = this.get('portraitVideoBelow'),
top_height = this.get('isSocialColumnEnabled') ? this.get('ffzMinimizeNavigation') ? 10 : 50 : 0,
video_height = size.height + this.get('ffzExtraHeight'),
chat_height = window_height - video_height,
@ -333,21 +342,25 @@ FFZ.prototype.setup_layout = function() {
'left: 10px !important}' +
'body[data-current-path^="user."] #left_col .warp { min-height: inherit }' +
'body[data-current-path^="user."] #left_col { overflow: hidden }' +
'body[data-current-path^="user."] .social-column {' +
'top:' + video_top + 'px;' +
'height:' + (video_height - top_height) + 'px}' +
'body[data-current-path^="user."] #left_col .warp,' +
'body[data-current-path^="user."] #left_col,' +
'body[data-current-path^="user."] .searchPanel--slide,' +
'body[data-current-path^="user."]:not(.ffz-sidebar-swap) #main_col{' +
'margin-right:0 !important;' +
'top:' + video_top + 'px;' +
'height:' + video_height + 'px}' +
'height:' + (video_height - top_height) + 'px}' +
'body[data-current-path^="user."].ffz-sidebar-swap #main_col{' +
'margin-left:0 !important;' +
'top:' + video_top + 'px;' +
'height:' + video_height + 'px}' +
'height:' + (video_height - top_height) + 'px}' +
'body[data-current-path^="user."] #right_col{' +
'width:100%;' +
'top:' + chat_top + 'px;' +
'top:' + (video_below ? chat_top : chat_top - top_height) + 'px;' +
'height:' + chat_height + 'px}' +
'body[data-current-path^="user."] .app-main.theatre .social-column,' +
'body[data-current-path^="user."] .app-main.theatre #left_col .warp,' +
'body[data-current-path^="user."] .app-main.theatre #left_col,' +
'body[data-current-path^="user."] .app-main.theatre #player,' +
@ -373,20 +386,24 @@ FFZ.prototype.setup_layout = function() {
'body.ffz-sidebar-swap .cn-bar-fixed { left: 0 !important }' +
'.ffz-theater-stats .app-main.theatre .cn-hosting--bottom,' +
'.ffz-theater-stats .app-main.theatre .cn-metabar__more {' +
'max-width: calc(100% - 350px);' +
'bottom: ' + (theatre_video_bottom + 85) + 'px !important}' +
'max-width:calc(100% - 350px);' +
'bottom:' + (theatre_video_bottom + 85) + 'px !important}' +
'.ffz-theater-stats:not(.ffz-theatre-conversations):not(.ffz-top-conversations) .app-main.theatre .cn-metabar__more {' +
'bottom: ' + (theatre_video_bottom + 130) + 'px !important}';
'bottom:' + (theatre_video_bottom + 130) + 'px !important}' +
(video_below ? '.js-player-persistent {' +
'margin-top:-' + video_top + 'px}' +
'.ffz-sidebar-minimize .has-sc .js-player-persistent {' +
'margin-top:-' + (video_top - 40) + 'px}' : '');
} else {
out += '.ffz-sidebar-swap .player-mini{left:' + (width + 10) + 'px !important}' +
'#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}' +
'margin-right:' + width + 'px !important}' +
'body.ffz-sidebar-swap .theatre #main_col:not(.expandRight),' +
'body.ffz-sidebar-swap #main_col:not(.expandRight){' +
'margin-left:' + width + 'px}' +
'margin-left:' + width + 'px !important}' +
'body:not(.ffz-sidebar-swap) .app-main.theatre #main_col:not(.expandRight) #player {' +
'right: ' + width + 'px !important}' +
'body.ffz-sidebar-swap .app-main.theatre #main_col:not(.expandRight) #player {' +

View file

@ -1213,7 +1213,7 @@ FFZ.prototype._modify_chat_subline = function(component, is_whisper) {
else if ( cl.contains('pc-dismiss') )
PinnedCheers.dismissMessage(
this.get('ffzPinnedParent.userData.id'),
this.get('msgObject.is_pinned_cheer') === '2' ? 'top' : 'recent'
this.get('msgObject.is_pinned_cheer') === 2 ? 'top' : 'recent'
);
else if ( cl.contains('tb-reject') )

View file

@ -1383,7 +1383,7 @@ FFZ.prototype._modify_room = function(room) {
if ( ! event.topic || event.topic.substr(-room_id.length) !== room_id || event.created_by === this.get("session.userData.login") )
return;
f.log("Login Moderation for " + this.get('id') + ' [' + room_id + ']', event);
//f.log("Login Moderation for " + this.get('id') + ' [' + room_id + ']', event);
// In case we get unexpected input, do the other thing.
if ( f.has_bttv || ["ban", "unban", "timeout", "untimeout"].indexOf(event.moderation_action) === -1 )

View file

@ -50,6 +50,24 @@ FFZ.settings_info.sidebar_hide_recommended_channels = {
};
FFZ.settings_info.socialbar_hide = {
type: "boolean",
value: false,
no_mobile: true,
category: "Sidebar",
name: "Hide Social Bar",
help: "Hide the social bar to the left of the page.",
on_update: function(val) {
utils.toggle_cls('ffz-hide-socialbar')(val);
var Layout = utils.ember_lookup('service:layout');
Layout && Ember.propertyDidChange(Layout, 'contentWidth');
}
}
FFZ.settings_info.sidebar_hide_prime = {
type: "select",
options: {
@ -166,7 +184,7 @@ FFZ.settings_info.sidebar_disable_friends = {
};
FFZ.settings_info.sidebar_start_open = {
/*FFZ.settings_info.sidebar_start_open = {
type: "boolean",
value: false,
@ -175,7 +193,7 @@ FFZ.settings_info.sidebar_start_open = {
name: "Automatically Open Drawer",
help: "Open the drawer at the bottom of the sidebar by default when the page is loaded."
};
};*/
FFZ.settings_info.sidebar_directly_to_followed_channels = {
@ -204,6 +222,7 @@ FFZ.prototype.setup_sidebar = function() {
utils.toggle_cls('ffz-hide-friends')(this.settings.sidebar_disable_friends);
utils.toggle_cls('ffz-hide-prime')(this.settings.sidebar_hide_prime === 2);
utils.toggle_cls('ffz-hide-prime-collapsed')(this.settings.sidebar_hide_prime === 1);
utils.toggle_cls('ffz-hide-socialbar')(this.settings.socialbar_hide);
if ( this.settings.sidebar_disable_friends ) {
try {
@ -244,13 +263,14 @@ FFZ.prototype.setup_sidebar = function() {
this.update_views('component:recommended-channels', this.modify_recommended_channels);
// Navigation Service
var NavService = utils.ember_lookup('service:navigation');
/*var NavService = utils.ember_lookup('service:navigation');
if ( NavService ) {
// Open Drawer by Default
if ( this.settings.sidebar_start_open )
var Layout = utils.ember_lookup('service:layout');
if ( this.settings.sidebar_start_open && Layout && ! Layout.get('isSocialColumnEnabled') )
NavService.set('isDrawerOpen', true);
} else
this.error("Unable to load the Ember Navigation service.")
this.error("Unable to load the Ember Navigation service.")*/
}

View file

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

View file

@ -346,31 +346,39 @@ FFZ.prototype.format_display_name = function(display_name, user_id, disable_alia
// ---------------------
FFZ.prototype.load_twitch_emote_data = function(tries) {
jQuery.ajax(constants.SERVER + "twitch_emotes.json", {context: this})
var f = this;
f._twitch_set_to_channel[0] = "--global--";
f._twitch_set_to_channel[33] = "--turbo-faces--";
f._twitch_set_to_channel[42] = "--turbo-faces--";
f._twitch_set_to_channel[19194] = "--prime--";
f._twitch_set_to_channel[19151] = "--curse--";
this.log("Loading Twitch Emote Data (Try " + (tries || 0) + ")");
jQuery.ajax(constants.SERVER + "twitch_emotes.json")
.done(function(data) {
f.log("Loaded Twitch Emote Data", data);
for(var set_id in data) {
var set = data[set_id];
var set = data[set_id],
old_id = f._twitch_set_to_channel[set_id];
if ( ! set )
continue;
this._twitch_set_to_channel[set_id] = set.name;
if ( ! old_id || old_id.indexOf('--') === -1 )
f._twitch_set_to_channel[set_id] = set.name;
for(var i=0, l = set.emotes.length; i < l; i++)
this._twitch_emote_to_set[set.emotes[i]] = set_id;
f._twitch_emote_to_set[set.emotes[i]] = set_id;
}
this._twitch_set_to_channel[0] = "--global--";
this._twitch_set_to_channel[33] = "--turbo-faces--";
this._twitch_set_to_channel[42] = "--turbo-faces--";
this._twitch_set_to_channel[19194] = "--prime--";
this._twitch_set_to_channel[19151] = "--curse--";
}).fail(function(data) {
f.log("Error loading Twitch Emote Data", data);
if ( data.status === 404 )
return;
tries = (tries || 0) + 1;
if ( tries < 10 )
setTimeout(this.load_twitch_emote_data.bind(this, tries), 1000);
setTimeout(f.load_twitch_emote_data.bind(f, tries), 1000);
});
}

View file

@ -78,7 +78,7 @@ metadata.uptime = {
};
metadata.player_stats = {
refresh: function() { return this.settings.player_stats },
refresh: function() { return this.settings.player_stats !== 0 },
setup: function(view, maybe_channel, is_hosting, channel) {
var channel_id = channel.get('id'),
@ -371,7 +371,7 @@ FFZ.prototype.render_metadata = function(key, basic_info, metabar, timers, refre
} else {
stat = el.querySelector('span.ffz-label');
old_color = el.dataset.color;
old_color = el.getAttribute('data-color') || '';
if ( dynamic_tooltip )
je = jQuery(el);
}

View file

@ -151,12 +151,13 @@ FFZ.prototype._update_following_count = function() {
HostLive = Host && Host.find("following"),*/
current_path = document.body.getAttribute('data-current-path') || '',
is_directory = current_path === 'directory.following.channels',
f = this;
/*if ( ! this.is_dashboard && HostLive && current_path.indexOf('directory.following') !== -1 )
HostLive.load();*/
if ( ! this.is_dashboard && Live )
if ( ! this.is_dashboard && ! is_directory && Live )
Live.load();
else {
var u = this.get_user();

View file

@ -119,7 +119,14 @@ FFZ.menu_pages.myemotes = {
if ( this.settings.favorite_emotes[key] && this.settings.favorite_emotes[key].length )
return 'favorites';
return 'all';
var has_emotes = FFZ.menu_pages.myemotes.has_sets.call(this);
if ( has_emotes )
return 'all';
if ( this.settings.emoji_in_menu )
return 'emoji';
return 'favorites';
},
pages: {
@ -206,7 +213,8 @@ FFZ.menu_pages.myemotes = {
if ( ! set.length )
continue;
var menu_id = this._twitch_set_to_channel[set_id].toLowerCase(),
var raw_id = this._twitch_set_to_channel[set_id],
menu_id = raw_id ? raw_id.toLowerCase() : 'unknown',
sort_key = 0,
menu = FFZ.menu_pages.myemotes.draw_twitch_set.call(this, view, set_id, set, favorites_only);
@ -407,7 +415,7 @@ FFZ.menu_pages.myemotes = {
collapsed = ! favorites_only && this.settings.emote_menu_collapsed.indexOf('twitch-' + set_id) === -1,
f = this,
channel_id = this._twitch_set_to_channel[set_id], title,
channel_id = this._twitch_set_to_channel[set_id] || 'twitch_unknown', title,
favorites = this.settings.favorite_emotes["twitch-" + set_id] || [],
c = 0;