1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-07 06:40:54 +00:00
* Added: New UI for clearing FrankerFaceZ settings (Data Management > Storage).
* Fixed: Do not display duplicate bot badges in tool-tips when a bot has both a global bot badge and a channel-specific bot badge.
* Fixed: Do not add click URLs for FFZ badges to add-on badges.
* Fixed: Remove `debugger;` from automatic error reporting method.
* Fixed: IndexedDBProvider not synchronizing settings correctly.
* Fixed: Change a CSS class name used when changing emote visibility to avoid bad UX due to misbehaving third-party extensions.
* Fixed: Color calculations for chat messages, including highlight colors. (Closes #947)
* Changed: Use rounded images from the CDN for FFZ badges in tool-tips.
* Changed: Use Twitch IDs rather than usernames for assigning channel-specific badges to users.
* API Added: `settings.addClearable(key, definition)` for adding new UI to `Data Management > Storage >> Clear`.
This commit is contained in:
SirStendec 2020-12-01 18:19:17 -05:00
parent 7adee6556c
commit ef4ff0c13a
15 changed files with 394 additions and 27 deletions

View file

@ -5,7 +5,7 @@
// ============================================================================
import Module from 'utilities/module';
import {deep_equals, has, debounce} from 'utilities/object';
import {deep_equals, has, debounce, deep_copy} from 'utilities/object';
import {IndexedDBProvider, LocalStorageProvider} from './providers';
import SettingsProfile from './profile';
@ -13,6 +13,7 @@ import SettingsContext from './context';
import MigrationManager from './migration';
import * as FILTERS from './filters';
import * as CLEARABLES from './clearables';
// ============================================================================
@ -51,6 +52,13 @@ export default class SettingsManager extends Module {
this.ui_structures = new Map;
this.definitions = new Map;
// Clearable Data Rules
this.clearables = {};
for(const key in CLEARABLES)
if ( has(CLEARABLES, key) )
this.clearables[key] = CLEARABLES[key];
// Filters
this.filters = {};
@ -607,6 +615,22 @@ export default class SettingsManager extends Module {
this.ui_structures.set(key, definition);
this.emit(':added-definition', key, definition);
}
addClearable(key, definition) {
if ( typeof key === 'object' ) {
for(const k in key)
if ( has(key, k) )
this.addClearable(k, key[k]);
return;
}
this.clearables[key] = definition;
}
getClearables() {
return deep_copy(this.clearables);
}
}