mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-16 10:06:54 +00:00
Added: Ability to hide re-runs in sidebar channel lists (#687)
This commit is contained in:
parent
903b0b234c
commit
3e653c0381
2 changed files with 34 additions and 0 deletions
|
@ -19,6 +19,7 @@ const CLASSES = {
|
||||||
'side-closed-friends': '.side-nav--collapsed .online-friends',
|
'side-closed-friends': '.side-nav--collapsed .online-friends',
|
||||||
'side-closed-rec-channels': '.side-nav--collapsed .recommended-channels,.side-nav--collapsed .ffz--popular-channels',
|
'side-closed-rec-channels': '.side-nav--collapsed .recommended-channels,.side-nav--collapsed .ffz--popular-channels',
|
||||||
'side-offline-channels': '.side-nav-card__link[href*="/videos/"],.side-nav-card[href*="/videos/"]',
|
'side-offline-channels': '.side-nav-card__link[href*="/videos/"],.side-nav-card[href*="/videos/"]',
|
||||||
|
'side-rerun-channels': '.side-nav .ffz--side-nav-card-rerun',
|
||||||
|
|
||||||
'prime-offers': '.top-nav__prime',
|
'prime-offers': '.top-nav__prime',
|
||||||
|
|
||||||
|
@ -133,6 +134,16 @@ export default class CSSTweaks extends Module {
|
||||||
changed: val => this.toggleHide('side-offline-channels', val)
|
changed: val => this.toggleHide('side-offline-channels', val)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.settings.add('layout.side-nav.hide-reruns', {
|
||||||
|
default: false,
|
||||||
|
ui: {
|
||||||
|
path: 'Appearance > Layout >> Side Navigation',
|
||||||
|
title: 'Hide Reruns',
|
||||||
|
component: 'setting-check-box'
|
||||||
|
},
|
||||||
|
changed: val => this.toggleHide('side-rerun-channels', val)
|
||||||
|
});
|
||||||
|
|
||||||
this.settings.add('layout.swap-sidebars', {
|
this.settings.add('layout.swap-sidebars', {
|
||||||
default: false,
|
default: false,
|
||||||
ui: {
|
ui: {
|
||||||
|
@ -282,6 +293,7 @@ export default class CSSTweaks extends Module {
|
||||||
this.toggleHide('side-nav', !this.settings.get('layout.side-nav.show'));
|
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('side-rec-friends', !this.settings.get('layout.side-nav.show-rec-friends'));
|
||||||
this.toggleHide('side-offline-channels', this.settings.get('layout.side-nav.hide-offline'));
|
this.toggleHide('side-offline-channels', this.settings.get('layout.side-nav.hide-offline'));
|
||||||
|
this.toggleHide('side-rerun-channels', this.settings.get('layout.side-nav.hide-reruns'));
|
||||||
this.toggleHide('prime-offers', !this.settings.get('layout.prime-offers'));
|
this.toggleHide('prime-offers', !this.settings.get('layout.prime-offers'));
|
||||||
this.toggleHide('top-discover', !this.settings.get('layout.discover'));
|
this.toggleHide('top-discover', !this.settings.get('layout.discover'));
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,11 @@ export default class Layout extends Module {
|
||||||
n => n.getPopularChannels && n.props && has(n.props, 'locale')
|
n => n.getPopularChannels && n.props && has(n.props, 'locale')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
this.SideBarChannels = this.fine.define(
|
||||||
|
'nav-cards',
|
||||||
|
t => t.getCardSlideInContent && t.props && has(t.props, 'tooltipContent')
|
||||||
|
);
|
||||||
|
|
||||||
this.settings.add('layout.portrait', {
|
this.settings.add('layout.portrait', {
|
||||||
default: false,
|
default: false,
|
||||||
ui: {
|
ui: {
|
||||||
|
@ -179,6 +184,14 @@ export default class Layout extends Module {
|
||||||
this.PopularChannels.on('mount', this.updatePopular, this);
|
this.PopularChannels.on('mount', this.updatePopular, this);
|
||||||
this.PopularChannels.on('update', this.updatePopular, this);
|
this.PopularChannels.on('update', this.updatePopular, this);
|
||||||
|
|
||||||
|
this.SideBarChannels.ready((cls, instances) => {
|
||||||
|
for(const inst of instances)
|
||||||
|
this.updateCardClass(inst);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.SideBarChannels.on('mount', this.updateCardClass, this);
|
||||||
|
this.SideBarChannels.on('update', this.updateCardClass, this);
|
||||||
|
|
||||||
const t = this;
|
const t = this;
|
||||||
this.RightColumn.ready((cls, instances) => {
|
this.RightColumn.ready((cls, instances) => {
|
||||||
cls.prototype.ffzHideOnBreakpoint = function() {
|
cls.prototype.ffzHideOnBreakpoint = function() {
|
||||||
|
@ -229,6 +242,15 @@ export default class Layout extends Module {
|
||||||
return this.settings.get('layout.is-minimal')
|
return this.settings.get('layout.is-minimal')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateCardClass(inst) {
|
||||||
|
const node = this.fine.getChildNode(inst);
|
||||||
|
|
||||||
|
if ( node )
|
||||||
|
node.classList.toggle('ffz--side-nav-card-rerun',
|
||||||
|
inst.props?.tooltipContent?.props?.streamType === 'rerun'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
updateNavLinks() {
|
updateNavLinks() {
|
||||||
for(const inst of this.TopNav.instances)
|
for(const inst of this.TopNav.instances)
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue