add slug
This commit is contained in:
parent
57ff15ee68
commit
dd5c6556fd
|
@ -191,7 +191,8 @@ export default class AddonManager {
|
|||
if (!meta.author) meta.author = Strings.Addons.unknownAuthor;
|
||||
if (!meta.version) meta.version = "???";
|
||||
if (!meta.description) meta.description = Strings.Addons.noDescription;
|
||||
meta.id = path.basename(filename).replace(self.extension, "").replace(/ /g, "-");
|
||||
meta.id = meta.name;
|
||||
meta.slug = path.basename(filename).replace(self.extension, "").replace(/ /g, "-");
|
||||
meta.filename = path.basename(filename);
|
||||
meta.added = stats.atimeMs;
|
||||
meta.modified = stats.mtimeMs;
|
||||
|
|
|
@ -127,7 +127,7 @@ export default new class PluginManager extends AddonManager {
|
|||
|
||||
const container = document.createElement("script");
|
||||
container.innerHTML = final;
|
||||
container.id = `${meta.id}-script-container`;
|
||||
container.id = `${meta.slug}-script-container`;
|
||||
// container.src = `data:text/javascript;${btoa(final)}`;
|
||||
document.head.append(container);
|
||||
|
||||
|
|
|
@ -66,14 +66,14 @@ export default new class ThemeManager extends AddonManager {
|
|||
addTheme(idOrAddon) {
|
||||
const addon = typeof(idOrAddon) == "string" ? this.addonList.find(p => p.id == idOrAddon) : idOrAddon;
|
||||
if (!addon) return;
|
||||
DOMManager.injectTheme(addon.id + "-theme-container", addon.css);
|
||||
DOMManager.injectTheme(addon.slug + "-theme-container", addon.css);
|
||||
Toasts.show(Strings.Addons.enabled.format({name: addon.name, version: addon.version}));
|
||||
}
|
||||
|
||||
removeTheme(idOrAddon) {
|
||||
const addon = typeof(idOrAddon) == "string" ? this.addonList.find(p => p.id == idOrAddon) : idOrAddon;
|
||||
if (!addon) return;
|
||||
DOMManager.removeTheme(addon.id + "-theme-container");
|
||||
DOMManager.removeTheme(addon.slug + "-theme-container");
|
||||
Toasts.show(Strings.Addons.disabled.format({name: addon.name, version: addon.version}));
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue