1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-07 11:38:32 +00:00

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.
This commit is contained in:
SirStendec 2018-07-24 13:52:11 -04:00
parent 30519a7377
commit 154a587c87
5 changed files with 43 additions and 5 deletions

View file

@ -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,

View file

@ -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: () =>

View file

@ -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);

View file

@ -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'));

View file

@ -0,0 +1,9 @@
.side-nav:not(.side-nav--collapsed) {
.side-nav-card__avatar {
display: none;
& + .tw-mg-l-1 {
margin-left: 0 !important
}
}
}