forgot reload

This commit is contained in:
Zack Rauen 2020-03-23 09:35:49 -04:00
parent 4679c21493
commit 45b36b6a86
6 changed files with 59 additions and 27 deletions

File diff suppressed because one or more lines are too long

2
js/main.min.js vendored

File diff suppressed because one or more lines are too long

44
package-lock.json generated
View File

@ -2980,7 +2980,8 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@ -3001,12 +3002,14 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -3021,17 +3024,20 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -3148,7 +3154,8 @@
"inherits": { "inherits": {
"version": "2.0.4", "version": "2.0.4",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -3160,6 +3167,7 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -3174,6 +3182,7 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@ -3181,12 +3190,14 @@
"minimist": { "minimist": {
"version": "1.2.5", "version": "1.2.5",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.9.0", "version": "2.9.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -3205,6 +3216,7 @@
"version": "0.5.3", "version": "0.5.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "^1.2.5" "minimist": "^1.2.5"
} }
@ -3266,7 +3278,8 @@
"npm-normalize-package-bin": { "npm-normalize-package-bin": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"npm-packlist": { "npm-packlist": {
"version": "1.4.8", "version": "1.4.8",
@ -3294,7 +3307,8 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -3306,6 +3320,7 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -3383,7 +3398,8 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -3419,6 +3435,7 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -3438,6 +3455,7 @@
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@ -3481,12 +3499,14 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.1.1", "version": "3.1.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
} }
} }
}, },

View File

@ -255,38 +255,42 @@ BdApi.setBDData = function(key, data) {
class AddonAPI { class AddonAPI {
constructor(cookie, list, manager) { constructor(cookie, list, manager) {
this.manager = manager; this._manager = manager;
this.cookie = cookie; this._cookie = cookie;
this.list = list; this._list = list;
} }
isEnabled(name) { isEnabled(name) {
return !!this.cookie[name]; return !!this._cookie[name];
} }
enable(name) { enable(name) {
return this.manager.enable(name); return this._manager.enable(name);
} }
disable(name) { disable(name) {
return this.manager.disable(name); return this._manager.disable(name);
} }
toggle(name) { toggle(name) {
if (this.cookie[name]) this.disable(name); if (this._cookie[name]) this.disable(name);
else this.enable(name); else this.enable(name);
} }
reload(name) {
return this._manager.reload(name);
}
get(name) { get(name) {
if (this.list.hasOwnProperty(name)) { if (this._list.hasOwnProperty(name)) {
if (this.list[name].plugin) return this.list[name].plugin; if (this._list[name].plugin) return this._list[name].plugin;
return this.list[name]; return this._list[name];
} }
return null; return null;
} }
getAll() { getAll() {
return Object.keys(this.list).map(k => this.get(k)).filter(a => a); return Object.keys(this._list).map(k => this.get(k)).filter(a => a);
} }
} }

View File

@ -149,6 +149,10 @@ PluginModule.prototype.reloadPlugin = function(filenameOrName) {
BDEvents.dispatch("plugin-reloaded", plugin); BDEvents.dispatch("plugin-reloaded", plugin);
}; };
PluginModule.prototype.reload = function(name) {
return this.reloadPlugin(name);
};
PluginModule.prototype.updatePluginList = function() { PluginModule.prototype.updatePluginList = function() {
const results = ContentManager.loadNewContent("plugin"); const results = ContentManager.loadNewContent("plugin");
for (const filename of results.added) this.loadPlugin(filename); for (const filename of results.added) this.loadPlugin(filename);

View File

@ -100,6 +100,10 @@ ThemeModule.prototype.reloadTheme = function(filenameOrName) {
BDEvents.dispatch("theme-reloaded", theme); BDEvents.dispatch("theme-reloaded", theme);
}; };
ThemeModule.prototype.reload = function(name) {
return this.reloadTheme(name);
};
ThemeModule.prototype.updateThemeList = function() { ThemeModule.prototype.updateThemeList = function() {
const results = ContentManager.loadNewContent("theme"); const results = ContentManager.loadNewContent("theme");
for (const filename of results.added) this.loadTheme(filename); for (const filename of results.added) this.loadTheme(filename);