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

3.5.418. Bunch of changes made while I was away at AGDQ. Add a setting for using the mouse wheel to adjust player volume. Fix colors in vod chat when Twitch adds non-messages as messages. (CLEARCHAT go home you're drunk...)

This commit is contained in:
SirStendec 2017-01-18 18:33:56 -05:00
parent 6b13ac3265
commit 03c825c398
13 changed files with 465 additions and 175 deletions

View file

@ -1,3 +1,55 @@
<div class="list-header">3.5.418 <time datetime="2017-01-18">(2017-01-18)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Added: Setting to allow controlling player volume by scrolling the mouse wheel.</li>
<li>Fixed: AutoMod settings dark theme.</li>
</ul>
<div class="list-header">3.5.417 <time datetime="2017-01-13">(2017-01-13)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Twitch broke Chat Replay handling of chat timeouts and bans somehow. Fix color handling with blank usernames.</li>
</ul>
<div class="list-header">3.5.416 <time datetime="2017-01-11">(2017-01-11)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: An issue could prevent bits from rendering correctly in certain situations.</li>
</ul>
<div class="list-header">3.5.415 <time datetime="2017-01-10">(2017-01-10)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Featured Channel follow buttons. FFZ would cache an incomplete user data object without a necessary authentication token.</li>
</ul>
<div class="list-header">3.5.414 <time datetime="2017-01-08">(2017-01-08)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Schedule pop-up not rendering for Safari, Opera, and Edge users.</li>
<li>&nbsp;</li>
<li>This FFZ update brought to you by my AGDQ hotel room.</li>
</ul>
<div class="list-header">3.5.413 <time datetime="2017-01-05">(2017-01-05)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Schedule rendering could goof up if a category was very long, leading to horizontal scrolling.</li>
<li>Changed: Refactor some bits stuff to potentially fix things if they potentially break.</li>
</ul>
<div class="list-header">3.5.412 <time datetime="2017-01-01">(2017-01-01)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Changed: Do not push the entire event schedule to the client every time there's an update.</li>
</ul>
<div class="list-header">3.5.411 <time datetime="2016-12-31">(2016-12-31)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Added: Experimental event schedule feature.</li>
<li>&nbsp;</li>
<li>Yes, I'm spending New Years Eve writing code. Leave me alone.</li>
</ul>
<div class="list-header">3.5.410 <time datetime="2016-12-28">(2016-12-28)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>API Fixed: <code>api.retokenize_messages</code> didn't actually work.</li>
<li>Fixed: Pinned cheers showing with a strange background color.</li>
</ul>
<div class="list-header">3.5.409 <time datetime="2016-12-23">(2016-12-23)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Don't collapse a widget on the dashboard clicking in its settings menu.</li>
@ -6,68 +58,5 @@
<li>Changed: Re-factor chat line CSS to eliminate the need for <code>:before</code> pseudo-elements.</li>
</ul>
<div class="list-header">3.5.408 <time datetime="2016-12-22">(2016-12-22)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Added: Option to hide Cheering with #Charity notices.</li>
<li>Fixed: Highlight notifications not appearing.</li>
</ul>
<div class="list-header">3.5.407 <time datetime="2016-12-21">(2016-12-21)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Cheer rendering when hashtags are present.</li>
</ul>
<div class="list-header">3.5.406 <time datetime="2016-12-19">(2016-12-19)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Another tweak for player positioning. Hopefully fixed properly now.</li>
</ul>
<div class="list-header">3.5.405 <time datetime="2016-12-19">(2016-12-19)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Display Channel Metadata on Theater Mode Hover</li>
<li>Fixed: Twitch goofed up player positioning.</li>
<li>Fixed: Classic Player controls not rendering as the correct height in theater mode with whispers on bottom.</li>
</ul>
<div class="list-header">3.5.404 <time datetime="2016-12-18">(2016-12-18)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Compatibility issue with BetterTTV and FFZ getting into a fight over positioning the player.</li>
</ul>
<div class="list-header">3.5.403 <time datetime="2016-12-16">(2016-12-16)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Whisper display in pop-out chat.</li>
</ul>
<div class="list-header">3.5.402 <time datetime="2016-12-16">(2016-12-16)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>API Changed: <code>api.retokenize_messages(room, user, max_age)</code> now takes a maximum age to prevent it from processing old chat messages.</li>
<li>Fixed: Room status indicator for Follower-Only chat mode wasn't updating.</li>
<li>Added: Enable the tab-completion for <code>/followers</code> and <code>/followersoff</code> as they can be used even if you don't have the tab enabling the UI.</li>
</ul>
<div class="list-header">3.5.401 <time datetime="2016-12-16">(2016-12-16)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>API Added: <code>api.retokenize_messages</code> to force retokenization of old chat messages after emoticons load.</li>
<li>API Fixed: Bug modifying the source data array in metadata click functions.</li>
</ul>
<div class="list-header">3.5.400 <time datetime="2016-12-16">(2016-12-16)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Added: Support for Follower-Only chat mode.</li>
<li>Changed: Include user agent strings in debugging information.</li>
<li>Changed: Minor dark theme CSS tweaks.</li>
<li>&nbsp;</li>
<li>400 revisions is a lot.</li>
</ul>
<div class="list-header">3.5.399 <time datetime="2016-12-15">(2016-12-15)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Added: Holiday cheer.</li>
<li>Changed: The Bits Stacking option now lets you combine all cheer emoticons into one, or combine them by type.</li>
<li>Changed: Refactor metadata rendering internally in preparation to add it to the new dashboard.</li>
<li>Fixed: Bug rendering the My Emoticons menu if the user is registered to have an emote set that isn't currently loaded in the client.</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

@ -1543,16 +1543,16 @@ body.ffz-dark:not([data-page="teams#show"]),
box-shadow: inset 0 -1px 0 #161616, -1px 1px rgba(255,255,255,0.065);
}
.ffz-dark .twitchbot-border-more,
.ffz-dark .twitchbot-settings__border-more,
.ffz-dark .border-t,
.ffz-dark .border-b,
.ffz-dark .cn-metabar__more {
border-color: rgba(255,255,255,0.2) !important;
}
.ffz-dark .twitchbot-hover-text-help,
.ffz-dark .twitchbot-rule-container:hover,
.ffz-dark .twitchbot-right-container {
.ffz-dark .twitchbot-settings__hover-text-help,
.ffz-dark .twitchbot-settings__rule-container:hover,
.ffz-dark .twitchbot-settings__right-container {
background-color: #191919;
}
@ -1564,13 +1564,17 @@ body.ffz-dark:not([data-page="teams#show"]),
}
.ffz-dark .twitchbot-help,
.ffz-dark .twitchbot-level-context,
.ffz-dark .twitchbot-settings__help,
.ffz-dark .twitchbot-settings__level-context,
.ffz-dark .cn-bar__avatar-wrap {
background-color: #101010;
border-color: #101010;
}
.ffz-dark .twitchbot-settings__arrow-up {
border-bottom-color: #101010;
}
.ffz-dark .cn-bar__displayname {
color: #c3c3c3;
}

View file

@ -1,3 +1,66 @@
<div class="list-header">3.5.408 <time datetime="2016-12-22">(2016-12-22)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Added: Option to hide Cheering with #Charity notices.</li>
<li>Fixed: Highlight notifications not appearing.</li>
</ul>
<div class="list-header">3.5.407 <time datetime="2016-12-21">(2016-12-21)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Cheer rendering when hashtags are present.</li>
</ul>
<div class="list-header">3.5.406 <time datetime="2016-12-19">(2016-12-19)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Another tweak for player positioning. Hopefully fixed properly now.</li>
</ul>
<div class="list-header">3.5.405 <time datetime="2016-12-19">(2016-12-19)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Display Channel Metadata on Theater Mode Hover</li>
<li>Fixed: Twitch goofed up player positioning.</li>
<li>Fixed: Classic Player controls not rendering as the correct height in theater mode with whispers on bottom.</li>
</ul>
<div class="list-header">3.5.404 <time datetime="2016-12-18">(2016-12-18)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Compatibility issue with BetterTTV and FFZ getting into a fight over positioning the player.</li>
</ul>
<div class="list-header">3.5.403 <time datetime="2016-12-16">(2016-12-16)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Whisper display in pop-out chat.</li>
</ul>
<div class="list-header">3.5.402 <time datetime="2016-12-16">(2016-12-16)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>API Changed: <code>api.retokenize_messages(room, user, max_age)</code> now takes a maximum age to prevent it from processing old chat messages.</li>
<li>Fixed: Room status indicator for Follower-Only chat mode wasn't updating.</li>
<li>Added: Enable the tab-completion for <code>/followers</code> and <code>/followersoff</code> as they can be used even if you don't have the tab enabling the UI.</li>
</ul>
<div class="list-header">3.5.401 <time datetime="2016-12-16">(2016-12-16)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>API Added: <code>api.retokenize_messages</code> to force retokenization of old chat messages after emoticons load.</li>
<li>API Fixed: Bug modifying the source data array in metadata click functions.</li>
</ul>
<div class="list-header">3.5.400 <time datetime="2016-12-16">(2016-12-16)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Added: Support for Follower-Only chat mode.</li>
<li>Changed: Include user agent strings in debugging information.</li>
<li>Changed: Minor dark theme CSS tweaks.</li>
<li>&nbsp;</li>
<li>400 revisions is a lot.</li>
</ul>
<div class="list-header">3.5.399 <time datetime="2016-12-15">(2016-12-15)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Added: Holiday cheer.</li>
<li>Changed: The Bits Stacking option now lets you combine all cheer emoticons into one, or combine them by type.</li>
<li>Changed: Refactor metadata rendering internally in preparation to add it to the new dashboard.</li>
<li>Fixed: Bug rendering the My Emoticons menu if the user is registered to have an emote set that isn't currently loaded in the client.</li>
</ul>
<div class="list-header">3.5.398 <time datetime="2016-12-14">(2016-12-14)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Added: Standalone Dashboard mode. Append <code>?standalone</code> to the end of the URL for your dashboard to see it. (Thanks to Warchamp7 for this idea.)</li>

View file

@ -37,7 +37,8 @@ FFZ.settings_info.bits_animated = {
help: "Display bits with animation.",
on_update: function() {
var bits = utils.ember_lookup('service:bits-rendering-config');
var bits = utils.ember_lookup('service:bits-emotes') ||
utils.ember_lookup('service:bits-rendering-config');
if ( bits && bits.ffz_has_css )
bits.ffz_update_css();
}
@ -118,52 +119,15 @@ FFZ.prototype.setup_bits = function() {
utils.toggle_cls('ffz-pinned-cheer-expand')(this.settings.bits_pinned_expand === 2);
var f = this,
Service = utils.ember_lookup('service:bits-rendering-config');
if ( ! Service )
return this.error("Unable to locate the Ember service:bits-rendering-config");
Service = utils.ember_lookup('service:bits-emotes'),
Service.reopen({
ffz_has_css: false,
ffz_get_tier: function(prefix, amount) {
if ( ! this.get('isLoaded') ) {
this._actionPromiseCache = false;
this.loadRenderConfig();
} else if ( ! this.ffz_has_css )
this.ffz_update_css();
var config = this._getConfigPrefix(prefix) || {},
tiers = config.tiers || [],
tier = null,
index = null;
for(var i=0, l = tiers.length; i < l; i++) {
var t = tiers[i];
if ( amount < t.min_bits )
break;
tier = t;
index = i;
}
return [index, tier];
},
ffz_get_preview: function(tier) {
return this._constructImageSrc([4], tier, {
background: 'dark',
scale: 4,
state: f.settings.bits_animated ? 'animated' : 'static'
}).src;
},
_ffz_image_css: function(images) {
image_css = function(images) {
return 'background-image: url("' + images[1] + '");' +
'background-image: ' + (constants.IS_WEBKIT ? ' -webkit-' : '') + 'image-set(' +
'url("' + images[1] + '") 1x, url("' + images[2] + '") 2x, url("' + images[4] + '") 4x);';
},
_ffz_tier_css: function(ind, prefix, tier) {
tier_css = function(ind, prefix, tier) {
var selector = '.ffz-bit.bit-prefix-' + prefix + '.bit-tier-' + ind,
color = f._handle_color(tier.color),
animated = f.settings.bits_animated,
@ -178,32 +142,135 @@ FFZ.prototype.setup_bits = function() {
'color: ' + color[1] + ';' +
this._ffz_image_css(tier.images.dark[animated ? 'animated' : 'static']) +
'}';
},
};
ffz_update_css: function() {
var output = [],
config = this.get('config') || {prefixes: []};
if ( Service ) {
Service.reopen({
ffz_has_css: false,
for(var i=0; i < config.prefixes.length; i++) {
var prefix = config.prefixes[i],
data = this._getConfigPrefix(prefix),
tiers = data && data.tiers || [];
ffz_get_tier: function(prefix, amount) {
if ( ! this.ffz_has_css )
this.ffz_update_css();
for(var x=0; x < tiers.length; x++)
output.push(this._ffz_tier_css(x, prefix, tiers[x]));
var config = this.getPrefixData(prefix) || {},
tiers = config.tiers || [],
tier = null,
index = null;
for(var i=0, l = tiers.length; i < l; i++) {
var t = tiers[i];
if ( amount < t.min_bits )
break;
tier = t;
index = i;
}
return [index, tier];
},
ffz_get_preview: function(prefix, amount) {
return this.getImageSrc(amount, prefix, true, !f.settings.bits_animated, 4);
},
_ffz_image_css: image_css,
_ffz_tier_css: tier_css,
ffz_update_css: function() {
var output = [],
prefixes = _.map(this.get('regexes') || [], function(x) {
return x && x.prefix || null;
});
for(var i=0; i < prefixes.length; i++) {
var prefix = prefixes[i],
data = prefix && this.getPrefixData(prefix);
if ( ! data )
continue;
var tiers = data && data.tiers || [];
for(var x=0; x < tiers.length; x++)
output.push(this._ffz_tier_css(x, prefix, tiers[x]));
}
utils.update_css(f._chat_style, 'bit-styles', output.join(''));
this.ffz_has_css = true;
}.observes('emoteConfig', 'regexes')
});
} else {
this.log("Unable to find the Ember service:bits-emotes. Falling back...");
Service = utils.ember_lookup('service:bits-rendering-config');
if ( ! Service )
return this.error("Unable to locate the Ember service:bits-rendering-config");
Service.reopen({
ffz_has_css: false,
ffz_get_tier: function(prefix, amount) {
if ( ! this.get('isLoaded') ) {
this._actionPromiseCache = false;
this.loadRenderConfig();
} else if ( ! this.ffz_has_css )
this.ffz_update_css();
var config = this._getConfigPrefix(prefix) || {},
tiers = config.tiers || [],
tier = null,
index = null;
for(var i=0, l = tiers.length; i < l; i++) {
var t = tiers[i];
if ( amount < t.min_bits )
break;
tier = t;
index = i;
}
return [index, tier];
},
ffz_get_preview: function(prefix, amount) {
var data = this.ffz_get_tier(prefix, amount),
tier = data && data[1];
return tier ? this._constructImageSrc([4], tier, {
background: 'dark',
scale: 4,
state: f.settings.bits_animated ? 'animated' : 'static'
}).src : '';
},
_ffz_image_css: image_css,
_ffz_tier_css: tier_css,
ffz_update_css: function() {
var output = [],
config = this.get('config') || {prefixes: []};
for(var i=0; i < config.prefixes.length; i++) {
var prefix = config.prefixes[i],
data = this._getConfigPrefix(prefix),
tiers = data && data.tiers || [];
for(var x=0; x < tiers.length; x++)
output.push(this._ffz_tier_css(x, prefix, tiers[x]));
}
utils.update_css(f._chat_style, 'bit-styles', output.join(''));
this.ffz_has_css = true;
}.observes('config'),
loadRenderConfig: function() {
var out = this._super();
if ( ! this.get('config') )
this._actionPromiseCache = false;
return out;
}
utils.update_css(f._chat_style, 'bit-styles', output.join(''));
this.ffz_has_css = true;
}.observes('config'),
loadRenderConfig: function() {
var out = this._super();
if ( ! this.get('config') )
this._actionPromiseCache = false;
return out;
}
});
});
}
if ( Service.get('isLoaded') )
Service.loadRenderConfig();

View file

@ -59,6 +59,18 @@ FFZ.settings_info.player_volume_bar = {
};
FFZ.settings_info.player_volume_scroll = {
type: "boolean",
value: false,
no_mobile: true,
category: "Player",
name: "Adjust Volume by Scrolling",
help: "Adjust the player's volume by scrolling up and down with your mouse wheel."
};
/*FFZ.settings_info.player_pause_hosts = {
type: "select",
options: {
@ -89,6 +101,7 @@ FFZ.prototype.setup_player = function() {
Layout.set('PLAYER_CONTROLS_HEIGHT', this.settings.classic_player ? 32 : 0);
this.update_views('component:twitch-player2', this.modify_twitch_player);
this.update_views('component:persistent-player', this.modify_persistent_player);
}
@ -96,6 +109,32 @@ FFZ.prototype.setup_player = function() {
// Component
// ---------------
FFZ.prototype.modify_persistent_player = function(player) {
var f = this;
utils.ember_reopen_view(player, {
ffz_init: function() {
var t = this;
this.$().off('mousewheel').on('mousewheel', function(event) {
f.log("Player-Scroll", event);
if ( ! f.settings.player_volume_scroll )
return;
// I ain't about that life, jQuery.
event = event.originalEvent || event;
var delta = event.wheelDelta || -event.detail,
player = t.childViews && t.childViews[0] && t.childViews[0].get('player');
if ( player )
player.volume += delta > 0 ? .1 : -.1;
event.preventDefault();
return false;
});
}
})
}
FFZ.prototype.modify_twitch_player = function(player) {
var f = this;
utils.ember_reopen_view(player, {
@ -196,7 +235,7 @@ FFZ.prototype.modify_twitch_player = function(player) {
}.observes('channel'),*/
ffzPostPlayer: function() {
var f = this,
var t = this,
/*channel_id = this.get('hostChannel.name'),
hosted_id = this.get('channel.name'),
is_hosting = channel_id !== hosted_id,*/

View file

@ -1894,7 +1894,7 @@ FFZ.prototype._modify_room = function(room) {
return f.settings.timeout_notices === 2 || (f.settings.timeout_notices === 1 && this.get('isModeratorOrHigher'));
},
ffzRetokenizeUser: function(user, max_age) {
ffzRetokenizeUser: function(user, max_age, update_badges) {
// Retokenize all messages by a user, or just all messages.
var messages = this.get('messages'),
i = messages.length,
@ -1909,8 +1909,11 @@ FFZ.prototype._modify_room = function(room) {
if ( ! user || msg.from === user ) {
msg.cachedTokens = null;
if ( msg._line )
if ( msg._line ) {
Ember.propertyDidChange(msg._line, 'ffzTokenizedMessage');
if ( update_badges )
msg._line.ffzUpdateBadges();
}
}
}

View file

@ -25,10 +25,16 @@ FFZ.prototype.setup_vod_chat = function() {
var colors = this.get("colorSettings"),
from = msg.get("from");
if ( ! colors.get(from) )
colors.set(from, constants.CHAT_COLORS[Math.floor(Math.random() * constants.CHAT_COLORS.length)]);
if ( from ) {
var clr = colors.get(from);
if ( ! clr ) {
clr = constants.CHAT_COLORS[Math.floor(Math.random() * constants.CHAT_COLORS.length)];
colors.set(from, clr);
}
msg.set("color", colors.get(from));
if ( typeof clr === 'string' )
msg.set('color', clr);
}
}
this.get("messages").pushObject(msg);

View file

@ -599,10 +599,14 @@ API.prototype.user_remove_set = function(username, set_id) {
}
API.prototype.retokenize_messages = function(room, user, max_age) {
var rooms = room ? [room] : Object.keys(this.ffz.rooms);
for(var i=0; i < rooms.length; i++)
rooms[i] && rooms[i].room && rooms[i].room.ffzRetokenizeUser(user, max_age);
API.prototype.retokenize_messages = function(room, user, max_age, update_badges) {
var rooms = room ? [room] : Object.keys(this.ffz.rooms),
ffz_rooms = this.ffz && this.ffz.rooms || {};
for(var i=0; i < rooms.length; i++) {
var room_id = rooms[i],
room = ffz_rooms[room_id];
room && room.room && room.room.ffzRetokenizeUser(user, max_age, update_badges);
}
}

View file

@ -61,7 +61,7 @@ FFZ.channel_metadata = {};
// Version
var VER = FFZ.version_info = {
major: 3, minor: 5, revision: 409,
major: 3, minor: 5, revision: 418,
toString: function() {
return [VER.major, VER.minor, VER.revision].join(".") + (VER.extra || "");
}
@ -145,7 +145,7 @@ FFZ.prototype._pastebin = function(data) {
// -------------------
FFZ.prototype.get_user = function(force_reload) {
if ( ! force_reload && this.__user )
if ( ! force_reload && this.__user && this.__user.chat_oauth_token )
return this.__user;
var LC = FFZ.utils.ember_lookup('service:login'),
@ -257,6 +257,7 @@ require('./ui/following-count');
require('./ui/races');
require('./ui/my_emotes');
require('./ui/about_page');
require('./ui/schedule');
require('./commands');
require('./ext/api');

View file

@ -213,7 +213,10 @@ FFZ.prototype.setup_tokenization = function() {
this.error("Unable to get bits tokenizer.", err);
}
bits_service = utils.ember_lookup('service:bits-rendering-config');
bits_service = utils.ember_lookup('service:bits-emotes');
if ( ! bits_service )
bits_service = utils.ember_lookup('service:bits-rendering-config');
bits_tags = utils.ember_lookup('service:bits-tags');
try {
@ -388,7 +391,7 @@ FFZ.prototype.render_tooltip = function(el) {
out = utils.number_commas(amount) + ' Bit' + utils.pluralize(amount);
if ( f.settings.emote_image_hover )
preview_url = bits_service.ffz_get_preview(tier[1]);
preview_url = bits_service.ffz_get_preview(prefix, amount); //tier[1]);
if ( individuals && individuals.length > 1 ) {
out += '<br>';

View file

@ -204,7 +204,7 @@ FFZ.channel_metadata.following = {
button: true,
static_label: constants.HEART,
label: function(data) {
if ( ! data || ! data.length )
if ( ! this.settings.follow_buttons || ! data || ! data.length )
return null;
return 'Featured';
@ -294,7 +294,7 @@ FFZ.channel_metadata.following = {
is_notified = notice;
update();
return utils.api.put("users/:login/follows/channels/" + user_id, {notifications: notice})
return utils.api.put("users/:login/follows/channels/" + user_id, {notifications: notice}, undefined, user.chat_oauth_token)
.fail(check_following);
};
@ -307,7 +307,7 @@ FFZ.channel_metadata.following = {
if ( is_following )
do_follow();
else
utils.api.del("users/:login/follows/channels/" + user_id)
utils.api.del("users/:login/follows/channels/" + user_id, undefined, undefined, user.chat_oauth_token)
.fail(check_following);
});
@ -322,8 +322,11 @@ FFZ.channel_metadata.following = {
el.appendChild(avatar);
el.appendChild(name_el);
el.appendChild(btn_follow);
el.appendChild(sw_notif);
if ( user ) {
el.appendChild(btn_follow);
el.appendChild(sw_notif);
} else
this.log("No User", user);
container.appendChild(el);
check_following();

View file

@ -57,6 +57,33 @@ var createElement = function(tag, className, content) {
return parts.join(".");
},
human_time = function(elapsed, factor) {
factor = factor || 1;
elapsed = Math.floor(elapsed);
var years = Math.floor((elapsed*factor) / 31536000) / factor;
if ( years >= 1 )
return years + ' year' + pluralize(years);
var days = Math.floor((elapsed %= 31536000) / 86400);
if ( days >= 1 )
return days + ' day' + pluralize(days);
var hours = Math.floor((elapsed %= 86400) / 3600);
if ( hours >= 1 )
return hours + ' hour' + pluralize(hours);
var minutes = Math.floor((elapsed %= 3600) / 60);
if ( minutes >= 1 )
return minutes + ' minute' + pluralize(minutes);
var seconds = elapsed % 60;
if ( seconds >= 1 )
return seconds + ' second' + pluralize(seconds);
return 'less than a second';
},
pluralize = function(value, singular, plural) {
plural = plural || 's';
singular = singular || '';
@ -918,31 +945,20 @@ module.exports = FFZ.utils = {
return HUMAN_NUMBERS[value] || number_commas(value);
},
human_time: function(elapsed, factor) {
factor = factor || 1;
elapsed = Math.floor(elapsed);
human_time: human_time,
full_human_time: function(elapsed, factor) {
var before = elapsed >= 0,
output = human_time(Math.abs(elapsed), factor);
var years = Math.floor((elapsed*factor) / 31536000) / factor;
if ( years >= 1 )
return years + ' year' + pluralize(years);
return before ? output + ' ago' : 'in ' + output;
},
var days = Math.floor((elapsed %= 31536000) / 86400);
if ( days >= 1 )
return days + ' day' + pluralize(days);
var hours = Math.floor((elapsed %= 86400) / 3600);
if ( hours >= 1 )
return hours + ' hour' + pluralize(hours);
var minutes = Math.floor((elapsed %= 3600) / 60);
if ( minutes >= 1 )
return minutes + ' minute' + pluralize(minutes);
var seconds = elapsed % 60;
if ( seconds >= 1 )
return seconds + ' second' + pluralize(seconds);
return 'less than a second';
human_join: function(list) {
if ( list.length === 2 )
return list[0] + ' and ' + list[1];
else if ( list.length === 1 )
return list[0];
return list.slice(0, -1).join(', ') + ' and ' + list[list.length-1];
},
time_to_string: function(elapsed, separate_days, days_only, no_hours, no_seconds) {

View file

@ -696,7 +696,7 @@ body.ffz-bttv-dark .ffz-ui-toggle.blue.live:hover svg.svg-emoticons path { fill:
.ffz-ui-menu-page { overflow-y: auto; }
.ffz-ui-menu-page[data-page="about"] .ffz-ui-sub-menu-page .chat-menu-content:first-child {
padding: 20px 0 10px;
padding: 20px 0 10px;
}
.ffz-ui-sub-menu-page[data-page="about"],
@ -1375,6 +1375,9 @@ body:not(.ffz-hide-friends) .ffz-moderation-card .follow-button {
.ffz-moderation-card ul.menu span { text-decoration: underline }
.ffz-dark .ffz-schedule-row,
.theatre .ffz-schedule-row,
.ffz-dark .ffz-following-row,
.theatre .ffz-following-row,
@ -1584,6 +1587,7 @@ body:not(.ffz-bttv) .chat-container:not(.chatReplay) .more-messages-indicator {
overflow: hidden;
}
.ffz-loading-spinner:after,
.chat-history.loading:after,
.ffz-ui-sub-menu-page:empty::after,
.ffz-ui-menu-page:empty::after {
@ -3674,6 +3678,92 @@ body:not(.ffz-minimal-channel-bar):not(.ffz-channel-bar-bottom) #channel {
margin: 7px 1rem 0 0;
}
/* Schedule */
.ffz-schedule-row {
position: relative;
margin: 0 -1rem;
padding: 1rem 1rem 1rem 6rem;
border-bottom: 1px solid rgba(0,0,0,0.2);
}
.ffz-schedule-row:first-child { margin-top: -1rem }
.ffz-schedule-row:last-child { margin-bottom: -1rem; border-bottom: none }
.ffz-schedule-row.ffz-old-item { background-color: rgba(0,0,0,0.15); opacity: 0.6 }
.ffz-schedule-date { background-color: rgba(127,127,127,0.1) }
.ffz-schedule-row.ffz-current-item { background-color: rgba(0,0,0,0.2) }
.ffz-dark .ffz-schedule-row.ffz-old-item,
.theatre .ffz-schedule-row.ffz-old-item {
background-color: rgba(255,255,255,0.1)
}
.ffz-dark .ffz-schedule-row.ffz-current-item,
.theatre .ffz-schedule-row.ffz-current-item {
background-color: rgba(255,255,255,0.15)
}
.ffz-schedule-row .heading h2 span,
.ffz-schedule-row .runners,
.ffz-schedule-row .meta,
.ffz-schedule-date {
color: #666;
}
.ffz-dark .ffz-schedule-row .heading h2 span,
.theatre .ffz-schedule-row .heading h2 span,
.ffz-dark .ffz-schedule-row .runners,
.theatre .ffz-schedule-row .runners,
.ffz-dark .ffz-schedule-row .meta,
.theatre .ffz-schedule-row .meta,
.ffz-dark .ffz-schedule-date,
.theatre .ffz-schedule-date {
color: #999;
}
.ffz-schedule-row .runners span { color: #000 }
.ffz-dark .ffz-schedule-row .runners span,
.theatre .ffz-schedule-row .runners span { color: #fff }
.ffz-schedule-row .meta {
margin-bottom: 5px;
}
.ffz-schedule-row .heading h2 {
padding: 0;
margin: 0 0 5px;
font-size: 2rem;
line-height: 1em;
}
.ffz-schedule-row .heading h2 span {
font-size: 1.5rem;
line-height: 1em;
white-space: nowrap;
}
.ffz-schedule-row .time-start {
position: absolute;
left: 1rem;
width: 45px;
font: 16px Sans-Serif;
}
.ffz-schedule-row .time-start { top: 1rem }
.ffz-schedule-date {
padding-left: 0;
text-align: center;
font: bold 1.1rem Sans-Serif;
}
/* Hidden Navigation */
.ffz-sidebar-minimize:not(.ffz-sidebar-swap) #left_col.closed:not(:hover) { left: -40px }
@ -3753,6 +3843,8 @@ body.ffz-sidebar-swap .app-main.theatre #main_col:not(.expandRight) #player[data
.ffz-pinned-cheer-expand .pinned-cheer__expando-arrow,
.pinned-cheers__message:before { display: none }
.pinned-cheers__message .chat-line { background-color: transparent !important }
.pinned-cheers__message .chat-line { padding: 5px }
.pinned-cheers .mod-icons { display: inline !important }