mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-05 10:38:30 +00:00
4.0.0-rc15.4
* Added: Options to hide `Recommended Live Channels` and `Based on your viewing history` from the Following Directory page. * Fixed: Position of the FrankerFaceZ Control Center icon, broken when Twitch changed the style of the user menu.
This commit is contained in:
parent
b9daa659f4
commit
53de0dff18
3 changed files with 73 additions and 3 deletions
|
@ -149,7 +149,7 @@ ${typeof x[1] === 'string' ? x[1] : JSON.stringify(x[1], null, 4)}`
|
|||
FrankerFaceZ.Logger = Logger;
|
||||
|
||||
const VER = FrankerFaceZ.version_info = {
|
||||
major: 4, minor: 0, revision: 0, extra: '-rc15.3',
|
||||
major: 4, minor: 0, revision: 0, extra: '-rc15.4',
|
||||
commit: __git_commit__,
|
||||
build: __webpack_hash__,
|
||||
toString: () =>
|
||||
|
|
|
@ -52,6 +52,18 @@ export default class Directory extends SiteModule {
|
|||
DIR_ROUTES
|
||||
);
|
||||
|
||||
this.DirectoryShelf = this.fine.define(
|
||||
'directory-shelf',
|
||||
n => n.onEmptyShelfRender && n.shouldRenderShelf,
|
||||
DIR_ROUTES
|
||||
);
|
||||
|
||||
this.DirectoryVideos = this.fine.define(
|
||||
'directory-videos',
|
||||
n => n.props && n.props.directoryWidth && n.props.data && n.render && n.render.toString().includes('SuggestedVideos'),
|
||||
DIR_ROUTES
|
||||
);
|
||||
|
||||
this.settings.add('directory.uptime', {
|
||||
default: 1,
|
||||
|
||||
|
@ -125,6 +137,27 @@ export default class Directory extends SiteModule {
|
|||
}
|
||||
});
|
||||
|
||||
this.settings.add('directory.hide-recommended', {
|
||||
default: false,
|
||||
ui: {
|
||||
path: 'Directory > Following >> Categories',
|
||||
title: 'Do not show `Recommended Live Channels` in the Following Directory.',
|
||||
component: 'setting-check-box'
|
||||
},
|
||||
|
||||
changed: () => this.DirectoryShelf.forceUpdate()
|
||||
});
|
||||
|
||||
this.settings.add('directory.hide-viewing-history', {
|
||||
default: false,
|
||||
ui: {
|
||||
path: 'Directory > Following >> Categories',
|
||||
title: 'Do not show `Based on your viewing history` in the Following Directory.',
|
||||
component: 'setting-check-box'
|
||||
},
|
||||
|
||||
changed: () => this.DirectoryVideos.forceUpdate()
|
||||
});
|
||||
|
||||
this.routeClick = this.routeClick.bind(this);
|
||||
}
|
||||
|
@ -141,6 +174,43 @@ export default class Directory extends SiteModule {
|
|||
|
||||
const createElement = React && React.createElement;
|
||||
|
||||
this.DirectoryShelf.ready(cls => {
|
||||
const old_render = cls.prototype.render;
|
||||
cls.prototype.render = function() {
|
||||
try {
|
||||
if ( t.settings.get('directory.hide-recommended') ) {
|
||||
const key = get('props.shelf.title.key', this);
|
||||
if ( key === 'live_recs_following' )
|
||||
return null;
|
||||
}
|
||||
|
||||
} catch(err) {
|
||||
t.log.capture(err);
|
||||
}
|
||||
|
||||
return old_render.call(this);
|
||||
}
|
||||
|
||||
this.DirectoryShelf.forceUpdate();
|
||||
});
|
||||
|
||||
this.DirectoryVideos.ready(cls => {
|
||||
const old_render = cls.prototype.render;
|
||||
cls.prototype.render = function() {
|
||||
try {
|
||||
if ( t.settings.get('directory.hide-viewing-history') )
|
||||
return null;
|
||||
|
||||
} catch(err) {
|
||||
t.log.capture(err);
|
||||
}
|
||||
|
||||
return old_render.call(this);
|
||||
}
|
||||
|
||||
this.DirectoryVideos.forceUpdate();
|
||||
})
|
||||
|
||||
this.DirectoryCard.ready(cls => {
|
||||
//const old_render = cls.prototype.render,
|
||||
const old_render_iconic = cls.prototype.renderIconicImage,
|
||||
|
|
|
@ -122,7 +122,7 @@ export default class MenuButton extends SiteModule {
|
|||
</div>
|
||||
</div>
|
||||
</div>)}
|
||||
<div class="tw-tooltip tw-tooltip--down tw-tooltip--align-center">
|
||||
<div class="tw-tooltip tw-tooltip--down tw-tooltip--align-right">
|
||||
{this.i18n.t('site.menu_button', 'FrankerFaceZ Control Center')}
|
||||
{this.has_update && (<div class="tw-mg-t-1">
|
||||
{this.i18n.t('site.menu_button.update-desc', 'There is an update available. Please refresh your page.')}
|
||||
|
@ -139,7 +139,7 @@ export default class MenuButton extends SiteModule {
|
|||
if ( user_menu )
|
||||
container.insertBefore(el, user_menu);
|
||||
else
|
||||
container.insertBefore(el, container.firstElementChild);
|
||||
container.insertBefore(el, container.lastElementChild);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue