mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-29 22:18:31 +00:00
4.9.8
* Fixed: The setting to hide the bits leaderboard at the top of chat. * Fixed: Bug where disabling a module would leave its state as enabled. * Changed: The FFZ Control Center button in the navigation bar will now indicate when add-ons have been loaded from a local development server.
This commit is contained in:
parent
6399a3d97d
commit
5ad0e94a0f
5 changed files with 27 additions and 7 deletions
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "frankerfacez",
|
"name": "frankerfacez",
|
||||||
"author": "Dan Salvato LLC",
|
"author": "Dan Salvato LLC",
|
||||||
"version": "4.9.7",
|
"version": "4.9.8",
|
||||||
"description": "FrankerFaceZ is a Twitch enhancement suite.",
|
"description": "FrankerFaceZ is a Twitch enhancement suite.",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -25,6 +25,7 @@ export default class AddonManager extends Module {
|
||||||
this.inject('settings');
|
this.inject('settings');
|
||||||
this.inject('i18n');
|
this.inject('i18n');
|
||||||
|
|
||||||
|
this.has_dev = false;
|
||||||
this.reload_required = false;
|
this.reload_required = false;
|
||||||
this.addons = {};
|
this.addons = {};
|
||||||
this.enabled_addons = [];
|
this.enabled_addons = [];
|
||||||
|
@ -126,11 +127,14 @@ export default class AddonManager extends Module {
|
||||||
for(const addon of cdn_data )
|
for(const addon of cdn_data )
|
||||||
this.addAddon(addon, false);
|
this.addAddon(addon, false);
|
||||||
|
|
||||||
if ( Array.isArray(local_data) )
|
if ( Array.isArray(local_data) ) {
|
||||||
|
this.has_dev = true;
|
||||||
for(const addon of local_data)
|
for(const addon of local_data)
|
||||||
this.addAddon(addon, true);
|
this.addAddon(addon, true);
|
||||||
|
}
|
||||||
|
|
||||||
this.rebuildAddonSearch();
|
this.rebuildAddonSearch();
|
||||||
|
this.emit(':data-loaded');
|
||||||
}
|
}
|
||||||
|
|
||||||
addAddon(addon, is_dev = false) {
|
addAddon(addon, is_dev = false) {
|
||||||
|
|
|
@ -26,7 +26,7 @@ const CLASSES = {
|
||||||
'player-event-bar': '.channel-root .live-event-banner-ui__header',
|
'player-event-bar': '.channel-root .live-event-banner-ui__header',
|
||||||
'player-rerun-bar': '.channel-root__player-container div.tw-c-text-overlay:not([data-a-target="hosting-ui-header"])',
|
'player-rerun-bar': '.channel-root__player-container div.tw-c-text-overlay:not([data-a-target="hosting-ui-header"])',
|
||||||
|
|
||||||
'pinned-cheer': '.pinned-cheer,.pinned-cheer-v2',
|
'pinned-cheer': '.pinned-cheer,.pinned-cheer-v2,.channel-leaderboard',
|
||||||
'whispers': 'body .whispers',
|
'whispers': 'body .whispers',
|
||||||
|
|
||||||
'dir-live-ind': '.live-channel-card:not([data-a-target*="host"]) .stream-type-indicator.stream-type-indicator--live,.stream-thumbnail__card .stream-type-indicator.stream-type-indicator--live,.preview-card .stream-type-indicator.stream-type-indicator--live,.preview-card .preview-card-stat.preview-card-stat--live',
|
'dir-live-ind': '.live-channel-card:not([data-a-target*="host"]) .stream-type-indicator.stream-type-indicator--live,.stream-thumbnail__card .stream-type-indicator.stream-type-indicator--live,.preview-card .stream-type-indicator.stream-type-indicator--live,.preview-card .preview-card-stat.preview-card-stat--live',
|
||||||
|
|
|
@ -15,6 +15,7 @@ export default class MenuButton extends SiteModule {
|
||||||
this.inject('i18n');
|
this.inject('i18n');
|
||||||
this.inject('settings');
|
this.inject('settings');
|
||||||
this.inject('site.fine');
|
this.inject('site.fine');
|
||||||
|
this.inject('addons');
|
||||||
|
|
||||||
this.should_enable = true;
|
this.should_enable = true;
|
||||||
this._pill_content = null;
|
this._pill_content = null;
|
||||||
|
@ -108,7 +109,9 @@ export default class MenuButton extends SiteModule {
|
||||||
this.on(':clicked', () => this.important_update = false);
|
this.on(':clicked', () => this.important_update = false);
|
||||||
|
|
||||||
this.once(':clicked', this.loadMenu);
|
this.once(':clicked', this.loadMenu);
|
||||||
|
|
||||||
this.on('i18n:update', this.update);
|
this.on('i18n:update', this.update);
|
||||||
|
this.on('addons:data-loaded', this.update);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateButton(inst) {
|
updateButton(inst) {
|
||||||
|
@ -148,11 +151,21 @@ export default class MenuButton extends SiteModule {
|
||||||
<figure class="ffz-i-arrows-cw" />
|
<figure class="ffz-i-arrows-cw" />
|
||||||
</div>
|
</div>
|
||||||
</div>)}
|
</div>)}
|
||||||
{!this.has_update && DEBUG && (<div class="ffz-menu__extra-pill tw-absolute">
|
{!this.has_update && DEBUG && this.addons.has_dev && (<div class="ffz-menu__extra-pill tw-absolute">
|
||||||
<div class="tw-pill">
|
<div class="tw-pill">
|
||||||
{this.i18n.t('site.menu_button.dev', 'dev')}
|
{this.i18n.t('site.menu_button.dev', 'dev')}
|
||||||
</div>
|
</div>
|
||||||
</div>)}
|
</div>)}
|
||||||
|
{!this.has_update && DEBUG && ! this.addons.has_dev && (<div class="ffz-menu__extra-pill tw-absolute">
|
||||||
|
<div class="tw-pill">
|
||||||
|
{this.i18n.t('site.menu_button.main-dev', 'm-dev')}
|
||||||
|
</div>
|
||||||
|
</div>)}
|
||||||
|
{!this.has_update && ! DEBUG && this.addons.has_dev && (<div class="ffz-menu__extra-pill tw-absolute">
|
||||||
|
<div class="tw-pill">
|
||||||
|
{this.i18n.t('site.menu_button.addon-dev', 'a-dev')}
|
||||||
|
</div>
|
||||||
|
</div>)}
|
||||||
{this.has_new && ! pill && (<div class="ffz-menu__pill tw-absolute">
|
{this.has_new && ! pill && (<div class="ffz-menu__pill tw-absolute">
|
||||||
<div class="tw-pill">
|
<div class="tw-pill">
|
||||||
{this.i18n.formatNumber(this.new_settings)}
|
{this.i18n.formatNumber(this.new_settings)}
|
||||||
|
@ -174,7 +187,10 @@ export default class MenuButton extends SiteModule {
|
||||||
{this.i18n.t('site.menu_button.new-desc', 'There {count,plural,one {is one new setting} other {are # new settings}}.', {count: this._new_settings})}
|
{this.i18n.t('site.menu_button.new-desc', 'There {count,plural,one {is one new setting} other {are # new settings}}.', {count: this._new_settings})}
|
||||||
</div>)}
|
</div>)}
|
||||||
{DEBUG && (<div class="tw-mg-t-1">
|
{DEBUG && (<div class="tw-mg-t-1">
|
||||||
{this.i18n.t('site.menu_button.dev-desc', 'You are running a developer build of FrankerFaceZ.')}
|
{this.i18n.t('site.menu_button.main-dev-desc', 'You are running a developer build of FrankerFaceZ.')}
|
||||||
|
</div>)}
|
||||||
|
{this.addons.has_dev && (<div class="tw-mg-t-1">
|
||||||
|
{this.i18n.t('site.menu_button.addon-dev-desc', 'You have loaded add-on data from a local development server.')}
|
||||||
</div>)}
|
</div>)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -303,13 +303,13 @@ export class Module extends EventEmitter {
|
||||||
return this.onDisable(...args);
|
return this.onDisable(...args);
|
||||||
|
|
||||||
})().then(ret => {
|
})().then(ret => {
|
||||||
this.__state = State.ENABLED;
|
this.__state = State.DISABLED;
|
||||||
this.__state_promise = null;
|
this.__state_promise = null;
|
||||||
this.emit(':disabled', this);
|
this.emit(':disabled', this);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.__state = State.DISABLED;
|
this.__state = State.ENABLED;
|
||||||
this.__state_promise = null;
|
this.__state_promise = null;
|
||||||
throw err;
|
throw err;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue