From 13af2f304697b9e71d5abfcd79561815059e6994 Mon Sep 17 00:00:00 2001 From: SirStendec Date: Wed, 22 Apr 2020 14:30:34 -0400 Subject: [PATCH] 4.19.10 * Fixed: The chat input field resizing when a different font size has been set. This is a Twitch bug, but I'm tired of users reporting it so FFZ will temporarily fix it until Twitch patches it themselves. * Fixed: Highlighting messages when viewer cards are not open no longer working. Note: They still don't work in the Mod View, which is coded in a way that makes it harder to work with. * Fixed: Appearance of the tool-tip for the FFZ Control Center button. * Fixed: Player volume not saving correctly when using the mouse wheel to adjust volume, causing it to suddenly return to incorrect values in certain cases. * Fixed: The Picture-in-Picture and Reset Player buttons appearing in the wrong location when using the Mod View. * Changed: Updated strings for several settings to be less confusing, and added a disclaimer to Directory settings that they are currently broken due to changes Twitch made to how the directory functions. --- package-lock.json | 2 +- package.json | 2 +- src/modules/chat/index.js | 5 +++-- .../twitch-twilight/modules/chat/input.jsx | 22 ++++++++++++++++++- .../twitch-twilight/modules/chat/scroller.js | 2 +- .../modules/chat/viewer_card.jsx | 2 +- .../modules/directory/following.jsx | 2 +- .../modules/directory/index.jsx | 2 +- .../twitch-twilight/modules/menu_button.jsx | 4 ++-- src/sites/twitch-twilight/modules/player.jsx | 22 ++++++++++++++----- 10 files changed, 49 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 75f3a55c..fc8e8384 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "frankerfacez", - "version": "4.17.11", + "version": "4.19.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8f75c8eb..0826a040 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.19.9", + "version": "4.19.10", "description": "FrankerFaceZ is a Twitch enhancement suite.", "license": "Apache-2.0", "scripts": { diff --git a/src/modules/chat/index.js b/src/modules/chat/index.js index 69e63ea7..248d0a6e 100644 --- a/src/modules/chat/index.js +++ b/src/modules/chat/index.js @@ -192,7 +192,7 @@ export default class Chat extends Module { default: 1, ui: { path: 'Chat > Behavior >> Deleted Messages', - title: 'Deleted Message Style', + title: 'Detailed Message Style', description: 'This style will be applied to deleted messages showed in Detailed rendering mode to differentiate them from normal chat messages.', component: 'setting-select-box', data: [ @@ -208,8 +208,9 @@ export default class Chat extends Module { default: false, ui: { path: 'Chat > Behavior >> Deleted Messages', + sort: -1, title: 'Rendering Mode', - description: 'This, when set, overrides the mode selected in Twitch chat settings. We do this to allow non-moderators access to the setting.', + description: 'This, when set, overrides the `Deleted Messages` mode selected in Twitch chat settings, which is normally only accessible for moderators. Brief hides messages entirely and shows a notice in chat that a number of messages were hidden. Detailed shows the contents of the message. Legacy shows `` with click to reveal.', component: 'setting-select-box', data: [ {value: false, title: 'Do Not Override'}, diff --git a/src/sites/twitch-twilight/modules/chat/input.jsx b/src/sites/twitch-twilight/modules/chat/input.jsx index e7199ee8..e6bbcfc5 100644 --- a/src/sites/twitch-twilight/modules/chat/input.jsx +++ b/src/sites/twitch-twilight/modules/chat/input.jsx @@ -267,7 +267,27 @@ export default class Input extends Module { const t = this; const originalOnKeyDown = inst.onKeyDown, - originalOnMessageSend = inst.onMessageSend; + originalOnMessageSend = inst.onMessageSend, + old_resize = inst.resizeInput; + + inst.resizeInput = function(msg) { + if ( msg ) { + if ( inst.chatInputRef ) { + const style = getComputedStyle(inst.chatInputRef), + height = style && parseFloat(style.lineHeight || 18) || 18, + t = height * 1 + 20, + i = Math.ceil((inst.chatInputRef.scrollHeight - t) / height), + a = Math.min(1 + i, 4); + + inst.setState({ + numInputRows: a + }); + } + } else + inst.setState({ + numInputRows: 1 + }); + } inst.messageHistory = []; inst.tempInput = ''; diff --git a/src/sites/twitch-twilight/modules/chat/scroller.js b/src/sites/twitch-twilight/modules/chat/scroller.js index 4fd910b8..e76e18b4 100644 --- a/src/sites/twitch-twilight/modules/chat/scroller.js +++ b/src/sites/twitch-twilight/modules/chat/scroller.js @@ -38,7 +38,7 @@ export default class Scroller extends Module { ui: { path: 'Chat > Behavior >> Scrolling', title: 'Pause Chat Scrolling', - description: 'Automatically stop chat from scrolling when moving the mouse over it or holding a key.', + description: 'Automatically stop chat from scrolling when moving the mouse over it or holding a key.\n\n**Note:** Scrolling up in chat will always prevent automatic scrolling, regardless of this setting.', component: 'setting-select-box', data: [ {value: 0, title: 'Disabled'}, diff --git a/src/sites/twitch-twilight/modules/chat/viewer_card.jsx b/src/sites/twitch-twilight/modules/chat/viewer_card.jsx index 813f6b1a..c632fb54 100644 --- a/src/sites/twitch-twilight/modules/chat/viewer_card.jsx +++ b/src/sites/twitch-twilight/modules/chat/viewer_card.jsx @@ -45,7 +45,7 @@ export default class ViewerCards extends Module { this.ViewerCard = this.fine.define( 'chat-viewer-card', - n => n.toggleGiftPage && n.onWhisperButtonClick + n => n.trackViewerCardOpen && n.onWhisperButtonClick ); } diff --git a/src/sites/twitch-twilight/modules/directory/following.jsx b/src/sites/twitch-twilight/modules/directory/following.jsx index 1fc3af6d..9cc8be77 100644 --- a/src/sites/twitch-twilight/modules/directory/following.jsx +++ b/src/sites/twitch-twilight/modules/directory/following.jsx @@ -34,7 +34,7 @@ export default class Following extends SiteModule { default: true, ui: { - path: 'Directory > Following >> Hosts', + path: 'Directory > Following @{"description": "**Note:** These settings do not currently work due to changes made by Twitch to how the directory works."} >> Hosts', title: 'Group Hosts', description: 'Only show a given hosted channel once in the directory.', component: 'setting-check-box' diff --git a/src/sites/twitch-twilight/modules/directory/index.jsx b/src/sites/twitch-twilight/modules/directory/index.jsx index ebe1a009..585a123e 100644 --- a/src/sites/twitch-twilight/modules/directory/index.jsx +++ b/src/sites/twitch-twilight/modules/directory/index.jsx @@ -75,7 +75,7 @@ export default class Directory extends SiteModule { default: 1, ui: { - path: 'Directory > Channels >> Appearance', + path: 'Directory > Channels @{"description": "**Note:** These settings do not currently work due to changes made by Twitch to how the directory works."} >> Appearance', title: 'Stream Uptime', description: 'Display the stream uptime on the channel cards.', component: 'setting-select-box', diff --git a/src/sites/twitch-twilight/modules/menu_button.jsx b/src/sites/twitch-twilight/modules/menu_button.jsx index ca654e65..4fcebbc0 100644 --- a/src/sites/twitch-twilight/modules/menu_button.jsx +++ b/src/sites/twitch-twilight/modules/menu_button.jsx @@ -304,7 +304,7 @@ export default class MenuButton extends SiteModule { )} - {this.has_error && (
+ {this.has_error && (
@@ -321,7 +321,7 @@ export default class MenuButton extends SiteModule {
)} - {! this.has_error && (
+ {! this.has_error && (
{this.i18n.t('site.menu_button', 'FrankerFaceZ Control Center')} {this.has_update && (
{this.i18n.t('site.menu_button.update-desc', 'There is an update available. Please refresh your page.')} diff --git a/src/sites/twitch-twilight/modules/player.jsx b/src/sites/twitch-twilight/modules/player.jsx index 412f84f8..74ce894f 100644 --- a/src/sites/twitch-twilight/modules/player.jsx +++ b/src/sites/twitch-twilight/modules/player.jsx @@ -714,17 +714,23 @@ export default class Player extends Module { return; const delta = event.wheelDelta || -(event.deltaY || event.detail || 0), - player = this.props?.mediaPlayerInstance; + player = this.props?.mediaPlayerInstance, + video = player?.mediaSinkManager?.video; if ( ! player?.getVolume ) return; const amount = t.settings.get('player.volume-scroll-steps'), - volume = Math.max(0, Math.min(1, player.getVolume() + (delta > 0 ? amount : -amount))); + old_volume = video?.volume ?? player.getVolume(), + volume = Math.max(0, Math.min(1, old_volume + (delta > 0 ? amount : -amount))); player.setVolume(volume); - if ( volume !== 0 ) + localStorage.volume = volume; + + if ( volume !== 0 ) { player.setMuted(false); + localStorage.setItem('video-muted', JSON.stringify({default: false})); + } event.preventDefault(); return false; @@ -1183,7 +1189,10 @@ export default class Player extends Module { {tip = (); - const thing = container.querySelector('button[data-a-target="player-theatre-mode-button"]'); + let thing = container.querySelector('button[data-a-target="player-theatre-mode-button"]'); + if ( ! thing ) + thing = container.querySelector('button[data-a-target="player-fullscreen-button"]'); + if ( thing ) { container.insertBefore(cont, thing.parentElement); } else @@ -1283,7 +1292,7 @@ export default class Player extends Module { {tip = (); - const thing = container.querySelector('.ffz--player-pip button') || container.querySelector('button[data-a-target="player-theatre-mode-button"]'); + const thing = container.querySelector('.ffz--player-pip button') || container.querySelector('button[data-a-target="player-theatre-mode-button"]') || container.querySelector('button[data-a-target="player-fullscreen-button"]'); if ( thing ) { container.insertBefore(cont, thing.parentElement); } else @@ -1407,6 +1416,9 @@ export default class Player extends Module { setTimeout(() => { player.setVolume(vol); player.setMuted(muted); + + //localStorage.volume = vol; + //localStorage.setItem('video-muted', JSON.stringify({default: muted})); }, 0); }