From 154a587c878f3e1f2cdae0a00c0e5b510b2f538b Mon Sep 17 00:00:00 2001 From: SirStendec Date: Tue, 24 Jul 2018 13:52:11 -0400 Subject: [PATCH] 4.0.0-rc8.5 * Added: Separate setting for hiding the Get Bits button in the site header without hiding the bits UI in chat. * Added: Setting to hide avatars in the side navigation bar. * Fixed: Do not inject FFZ into the Extension Testing Rig. --- src/entry.js | 2 +- src/main.js | 2 +- .../twitch-twilight/modules/bits_button.js | 24 ++++++++++++++++--- .../modules/css_tweaks/index.js | 11 +++++++++ .../styles/hide-side-nav-avatars.scss | 9 +++++++ 5 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 src/sites/twitch-twilight/modules/css_tweaks/styles/hide-side-nav-avatars.scss diff --git a/src/entry.js b/src/entry.js index 2e512f90..51b8c2fd 100644 --- a/src/entry.js +++ b/src/entry.js @@ -2,7 +2,7 @@ 'use strict'; (() => { // Don't run on certain sub-domains. - if ( /^(?:blog|player|im|chatdepot|tmi|api|)\./.test(location.hostname) ) + if ( /^(?:localhost\.rig|blog|player|im|chatdepot|tmi|api|)\./.test(location.hostname) ) return; const DEBUG = localStorage.ffzDebugMode == 'true' && document.body.classList.contains('ffz-dev') && ! window.Ember, diff --git a/src/main.js b/src/main.js index 0983342c..c774cd5a 100644 --- a/src/main.js +++ b/src/main.js @@ -100,7 +100,7 @@ class FrankerFaceZ extends Module { FrankerFaceZ.Logger = Logger; const VER = FrankerFaceZ.version_info = { - major: 4, minor: 0, revision: 0, extra: '-rc8.4', + major: 4, minor: 0, revision: 0, extra: '-rc8.5', commit: __git_commit__, build: __webpack_hash__, toString: () => diff --git a/src/sites/twitch-twilight/modules/bits_button.js b/src/sites/twitch-twilight/modules/bits_button.js index 97726503..d0e53e07 100644 --- a/src/sites/twitch-twilight/modules/bits_button.js +++ b/src/sites/twitch-twilight/modules/bits_button.js @@ -16,6 +16,26 @@ export default class BitsButton extends Module { this.inject('settings'); this.inject('site.fine'); + this.settings.add('layout.display-bits-button', { + requires: ['chat.bits.show'], + default: null, + process(ctx, val) { + if ( val != null ) + return val; + + return ctx.get('chat.bits.show') + }, + + ui: { + path: 'Appearance > Layout >> Top Navigation', + title: 'Show the Get Bits button.', + description: 'By default, this inherits its value from Chat > Bits and Cheering > Display Bits', + component: 'setting-check-box' + }, + + changed: () => this.BitsButton.forceUpdate() + }); + this.BitsButton = this.fine.define( 'bits-button', n => n.renderButton && n.toggleShowTutorial @@ -23,14 +43,12 @@ export default class BitsButton extends Module { } onEnable() { - this.settings.on(':changed:chat.bits.show', this.BitsButton.forceUpdate, this.BitsButton); - this.BitsButton.ready(cls => { const t = this, old_render = cls.prototype.render; cls.prototype.render = function() { - if ( ! t.settings.get('chat.bits.show') ) + if ( ! t.settings.get('layout.display-bits-button') ) return null; return old_render.call(this); diff --git a/src/sites/twitch-twilight/modules/css_tweaks/index.js b/src/sites/twitch-twilight/modules/css_tweaks/index.js index a8a858a5..47013700 100644 --- a/src/sites/twitch-twilight/modules/css_tweaks/index.js +++ b/src/sites/twitch-twilight/modules/css_tweaks/index.js @@ -73,6 +73,16 @@ export default class CSSTweaks extends Module { changed: val => this.toggleHide('side-nav', !val) }); + this.settings.add('layout.side-nav.show-avatars', { + default: true, + ui: { + path: 'Appearance > Layout >> Side Navigation', + title: 'Display Channel Avatars', + component: 'setting-check-box' + }, + changed: val => this.toggle('hide-side-nav-avatars', !val) + }); + this.settings.add('layout.side-nav.show-rec-channels', { default: 1, ui: { @@ -204,6 +214,7 @@ export default class CSSTweaks extends Module { this.toggle('theatre-nav', this.settings.get('layout.theatre-navigation')); //this.toggle('portrait', this.settings.get('layout.portrait')); + this.toggle('hide-side-nav-avatars', ! this.settings.get('layout.side-nav.show-avatars')); this.toggleHide('side-nav', !this.settings.get('layout.side-nav.show')); this.toggleHide('side-rec-friends', !this.settings.get('layout.side-nav.show-rec-friends')); this.toggleHide('prime-offers', !this.settings.get('layout.prime-offers')); diff --git a/src/sites/twitch-twilight/modules/css_tweaks/styles/hide-side-nav-avatars.scss b/src/sites/twitch-twilight/modules/css_tweaks/styles/hide-side-nav-avatars.scss new file mode 100644 index 00000000..9d041cb9 --- /dev/null +++ b/src/sites/twitch-twilight/modules/css_tweaks/styles/hide-side-nav-avatars.scss @@ -0,0 +1,9 @@ +.side-nav:not(.side-nav--collapsed) { + .side-nav-card__avatar { + display: none; + + & + .tw-mg-l-1 { + margin-left: 0 !important + } + } +} \ No newline at end of file