1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-01 07:28:31 +00:00

Add-Ons Loader System (#606)

Implements an Add-on Loader so that other add-ons, such as the FFZ Add-on Pack, can be loaded directly by FFZ without requiring the user to install multiple extensions into their browser.
This commit is contained in:
Mike 2019-06-01 02:11:22 -04:00 committed by GitHub
parent d9f252ee4e
commit a305d03b2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 716 additions and 11 deletions

View file

@ -135,6 +135,9 @@ export default class MainMenu extends Module {
async onEnable() {
await this.site.awaitElement(Dialog.EXCLUSIVE);
this.on('addons:added', this.scheduleUpdate, this);
this.on('i18n:update', this.scheduleUpdate, this);
this.dialog.on('show', () => {
this.opened = true;
this.updateButtonUnseen();
@ -362,7 +365,7 @@ export default class MainMenu extends Module {
tok.default = def.default;
}
const terms = [
let terms = [
setting_key,
this.i18n.t(tok.i18n_key, tok.title, tok, true)
];
@ -377,6 +380,9 @@ export default class MainMenu extends Module {
terms.push(this.i18n.t(tok.desc_i18n_key, tok.description, tok));
}
if ( tok.getExtraTerms )
terms = terms.concat(tok.getExtraTerms());
tok.search_terms = terms.map(format_term).join('\n');
if ( settings_seen ) {
@ -712,7 +718,7 @@ export default class MainMenu extends Module {
}
return {
const out = {
context,
query: '',
@ -757,6 +763,8 @@ export default class MainMenu extends Module {
},
version: window.FrankerFaceZ.version_info,
}
};
return out;
}
}