diff --git a/gulpfile.js b/gulpfile.js
index f04400f0..70d7b2f2 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -1,30 +1,13 @@
const gulp = require("gulp");
const rename = require("gulp-rename");
-const minify = require("gulp-babel-minify");
const csso = require("gulp-csso");
-gulp.task("minify-js", minifyJS);
gulp.task("minify-css", minifyCSS);
-gulp.task("watch-js", function() {
- return gulp.watch(["./js/main.js"], minifyJS);
-});
-
gulp.task("watch-css", function() {
return gulp.watch(["./css/main.css"], minifyCSS);
});
-gulp.task("watch", function() {
- return gulp.watch(["./js/main.js", "./css/main.css"], gulp.series(minifyJS, minifyCSS));
-});
-
-function minifyJS() {
- return gulp.src("./js/main.js")
- .pipe(minify({mangle: {keepClassName: true}}))
- .pipe(rename("main.min.js"))
- .pipe(gulp.dest("./js"));
-}
-
function minifyCSS() {
return gulp.src("./css/main.css")
.pipe(csso({restructure: false}))
diff --git a/js/main.js b/js/main.js
index e057ad86..f7795008 100644
--- a/js/main.js
+++ b/js/main.js
@@ -3080,20 +3080,37 @@ const releaseChannel = DiscordNative.globals.releaseChannel; // Schema 1
/* harmony default export */ __webpack_exports__["default"] = (new class DataStore {
constructor() {
- this.data = {};
+ this.data = {
+ misc: {}
+ };
this.pluginData = {};
}
initialize() {
- if (!fs.existsSync(path.resolve(this.BDFile, ".."))) fs.mkdirSync(path.resolve(this.BDFile, ".."));
- if (!fs.existsSync(this.BDFile)) fs.writeFileSync(this.BDFile, JSON.stringify(this.data, null, 4));
- this.data = require(this.BDFile); // if (data.hasOwnProperty("settings")) this.data = data;
+ if (!fs.existsSync(this.baseFolder)) fs.mkdirSync(this.baseFolder);
+ if (!fs.existsSync(this.dataFolder)) fs.mkdirSync(this.dataFolder);
+ if (!fs.existsSync(this.BDFile)) fs.writeFileSync(this.BDFile, JSON.stringify(this.data.misc, null, 4));
+ const dataFiles = fs.readdirSync(this.dataFolder).filter(f => !fs.statSync(path.resolve(this.dataFolder, f)).isDirectory() && f.endsWith(".json"));
+
+ for (const file of dataFiles) {
+ this.data[file.split(".")[0]] = require(path.resolve(this.dataFolder, file));
+ } // this.data = __non_webpack_require__(this.BDFile);
+ // if (data.hasOwnProperty("settings")) this.data = data;
// if (!fs.existsSync(this.settingsFile)) return;
// let settings = __non_webpack_require__(this.settingsFile);
// fs.unlinkSync(this.settingsFile);
// if (settings.hasOwnProperty("settings")) settings = Object.assign({stable: {}, canary: {}, ptb: {}}, {[releaseChannel]: settings});
// else settings = Object.assign({stable: {}, canary: {}, ptb: {}}, settings);
// this.setBDData("settings", settings);
+
+ }
+
+ get baseFolder() {
+ return this._baseFolder || (this._baseFolder = path.resolve(data__WEBPACK_IMPORTED_MODULE_0__["Config"].dataPath, "data"));
+ }
+
+ get dataFolder() {
+ return this._dataFolder || (this._dataFolder = path.resolve(this.baseFolder, `${releaseChannel}`));
}
get BDFile() {
@@ -3112,22 +3129,28 @@ const releaseChannel = DiscordNative.globals.releaseChannel; // Schema 1
// }
+ _getFile(key) {
+ if (key == "settings" || key == "plugins" || key == "themes") return path.resolve(this.dataFolder, `${key}.json`);
+ return path.resolve(this.dataFolder, `misc.json`);
+ }
+
getBDData(key) {
- return this.data[key] || "";
+ return this.data.misc[key] || "";
}
setBDData(key, value) {
- this.data[key] = value;
- fs.writeFileSync(this.BDFile, JSON.stringify(this.data, null, 4));
+ this.data.misc[key] = value;
+ fs.writeFileSync(path.resolve(this.dataFolder, `misc.json`), JSON.stringify(this.data.misc, null, 4));
}
getData(key) {
- return this.data[key] || "";
+ return this.data[key] || ""; // return JSON.parse(fs.readFileSync(path.resolve(this.dataFolder, `${file}.json`)));
}
setData(key, value) {
- this.data[key] = value;
- fs.writeFileSync(this.BDFile, JSON.stringify(this.data, null, 4));
+ this.data[key] = value; // fs.writeFileSync(this.BDFile, JSON.stringify(this.data, null, 4));
+
+ fs.writeFileSync(path.resolve(this.dataFolder, `${key}.json`), JSON.stringify(value, null, 4));
}
getPluginData(pluginName, key) {
@@ -3814,7 +3837,20 @@ PluginModule.prototype.rawObserver = function (e) {
}
};
-/* harmony default export */ __webpack_exports__["default"] = (new PluginModule());
+/* harmony default export */ __webpack_exports__["default"] = (new PluginModule()); // makePlaceholderPlugin(data) {
+// return {plugin: {
+// start: () => {},
+// getName: () => {return data.name || data.filename;},
+// getAuthor: () => {return "???";},
+// getDescription: () => {return data.message ? data.message : "This plugin was unable to be loaded. Check the author's page for updates.";},
+// getVersion: () => {return "???";}
+// },
+// name: data.name || data.filename,
+// filename: data.filename,
+// source: data.source ? data.source : "",
+// website: data.website ? data.website : ""
+// };
+// }
/***/ }),
@@ -4028,7 +4064,6 @@ __webpack_require__.r(__webpack_exports__);
onSettingChange(collection, category, id, value) {
const before = this.config.filter(c => c.disabled).length;
this.state[collection][category][id] = value;
- console.log(this.state);
_emitter__WEBPACK_IMPORTED_MODULE_4__["default"].dispatch("setting-updated", collection, category, id, value);
const after = this.config.filter(c => c.disabled).length;
this.saveSettings();
diff --git a/js/main.min.js b/js/main.min.js
index 83746ad9..fe04bd0e 100644
--- a/js/main.min.js
+++ b/js/main.min.js
@@ -1 +1 @@
-var Core=function(e){var t={};function n(s){if(t[s])return t[s].exports;var o=t[s]={i:s,l:!1,exports:{}};return e[s].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,s){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(s,o,function(t){return e[t]}.bind(null,o));return s},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("electron")},function(e,t){e.exports=require("module")},function(e,t){e.exports=require("events")},function(e,t){e.exports=require("request")},function(e,t,n){"use strict";n.r(t);var s={};n.r(s),n.d(s,"Menu",function(){return be}),n.d(s,"Card",function(){return fe}),n.d(s,"Layer",function(){return ye});var o={};n.r(o),n.d(o,"VoiceMode",function(){return $e}),n.d(o,"ClassNormalizer",function(){return Ne}),n.d(o,"DeveloperMode",function(){return je}),n.d(o,"PublicServers",function(){return Fe}),n.d(o,"DarkMode",function(){return Oe}),n.d(o,"MinimalMode",function(){return Ae}),n.d(o,"TwentyFourHour",function(){return Ie}),n.d(o,"ColoredText",function(){return Re}),n.d(o,"VoiceDisconnect",function(){return Ge}),n.d(o,"EmoteMenu",function(){return He}),n.d(o,"EmoteAutocaps",function(){return ze}),n.d(o,"EmoteModule",function(){return Ue});var r={emotesLoaded:!1},i={"Custom css live update":{id:"bda-css-0",info:"",implemented:!0,hidden:!0,cat:"core"},"Custom css auto udpate":{id:"bda-css-1",info:"",implemented:!0,hidden:!0,cat:"core"},"BetterDiscord Blue":{id:"bda-gs-b",info:"Replace Discord blue with BD Blue",implemented:!1,hidden:!1,cat:"core"},"Public Servers":{id:"bda-gs-1",info:"Display public servers button",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Minimal Mode":{id:"bda-gs-2",info:"Hide elements and reduce the size of elements.",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Voice Mode":{id:"bda-gs-4",info:"Only show voice chat",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Hide Channels":{id:"bda-gs-3",info:"Hide channels in minimal mode",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Dark Mode":{id:"bda-gs-5",info:"Make certain elements dark by default(wip)",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Voice Disconnect":{id:"bda-dc-0",info:"Disconnect from voice server when closing Discord",implemented:!0,hidden:!1,cat:"core",category:"modules"},"24 Hour Timestamps":{id:"bda-gs-6",info:"Replace 12hr timestamps with proper ones",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Coloured Text":{id:"bda-gs-7",info:"Make text colour the same as role colour",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Normalize Classes":{id:"fork-ps-4",info:"Adds stable classes to elements to help themes. (e.g. adds .da-channels to .channels-Ie2l6A)",implemented:!0,hidden:!1,cat:"core",category:"modules"},"Content Error Modal":{id:"fork-ps-1",info:"Shows a modal with plugin/theme errors",implemented:!0,hidden:!1,cat:"core",category:"content manager"},"Show Toasts":{id:"fork-ps-2",info:"Shows a small notification for important information",implemented:!0,hidden:!1,cat:"core",category:"content manager"},"Scroll To Settings":{id:"fork-ps-3",info:"Auto-scrolls to a plugin's settings when the button is clicked (only if out of view)",implemented:!0,hidden:!1,cat:"core",category:"content manager"},"Automatic Loading":{id:"fork-ps-5",info:"Automatically loads, reloads, and unloads plugins and themes",implemented:!0,hidden:!1,cat:"core",category:"content manager"},"Developer Mode":{id:"bda-gs-8",info:"Developer Mode",implemented:!0,hidden:!1,cat:"core",category:"developer settings"},"Copy Selector":{id:"fork-dm-1",info:'Adds a "Copy Selector" option to context menus when developer mode is active',implemented:!0,hidden:!1,cat:"core",category:"developer settings"},"Enable Transparency":{id:"fork-wp-1",info:"Enables the main window to be see-through (requires restart)",implemented:!0,hidden:!1,cat:"core",category:"window preferences"},"Window Frame":{id:"fork-wp-2",info:"Adds the native os window frame to the main window",implemented:!1,hidden:!0,cat:"core",category:"window preferences"},"Download Emotes":{id:"fork-es-3",info:"Download emotes when the cache is expired",implemented:!0,hidden:!1,cat:"emote"},"Twitch Emotes":{id:"bda-es-7",info:"Show Twitch emotes",implemented:!0,hidden:!1,cat:"emote"},"FrankerFaceZ Emotes":{id:"bda-es-1",info:"Show FrankerFaceZ Emotes",implemented:!0,hidden:!1,cat:"emote"},"BetterTTV Emotes":{id:"bda-es-2",info:"Show BetterTTV Emotes",implemented:!0,hidden:!1,cat:"emote"},"Emote Menu":{id:"bda-es-0",info:"Show Twitch/Favourite emotes in emote menu",implemented:!0,hidden:!1,cat:"emote"},"Emoji Menu":{id:"bda-es-9",info:"Show Discord emoji menu",implemented:!0,hidden:!1,cat:"emote"},"Emote Auto Capitalization":{id:"bda-es-4",info:"Autocapitalize emote commands",implemented:!0,hidden:!1,cat:"emote"},"Show Names":{id:"bda-es-6",info:"Show emote names on hover",implemented:!0,hidden:!1,cat:"emote"},"Show emote modifiers":{id:"bda-es-8",info:"Enable emote mods (flip, spin, pulse, spin2, spin3, 1spin, 2spin, 3spin, tr, bl, br, shake, shake2, shake3, flap)",implemented:!0,hidden:!1,cat:"emote"},"Animate On Hover":{id:"fork-es-2",info:"Only animate the emote modifiers on hover",implemented:!0,hidden:!1,cat:"emote"}},a={"bda-gs-1":!0,"bda-gs-2":!1,"bda-gs-3":!1,"bda-gs-4":!1,"bda-gs-5":!0,"bda-gs-6":!1,"bda-gs-7":!1,"bda-gs-8":!1,"bda-es-0":!0,"bda-es-1":!0,"bda-es-2":!0,"bda-es-4":!1,"bda-es-6":!0,"bda-es-7":!0,"bda-gs-b":!1,"bda-es-8":!0,"bda-dc-0":!1,"bda-css-0":!1,"bda-css-1":!1,"bda-es-9":!0,"fork-dm-1":!1,"fork-ps-1":!0,"fork-ps-2":!0,"fork-ps-3":!0,"fork-ps-4":!0,"fork-ps-5":!0,"fork-es-2":!1,"fork-es-3":!0,"fork-wp-1":!1,"fork-wp-2":!1},l={local:!1,localServer:"//localhost:8080",minified:!0,version:"0.3.0",branch:"master",repo:"rauenzi",minSupportedVersion:"0.3.0",bbdVersion:"0.2.17"},c={},d={},u={},h={},p={TwitchGlobal:{},TwitchSubscriber:{},BTTV:{},FrankerFaceZ:{},BTTV2:{}},m=[],g=["flip","spin","pulse","spin2","spin3","1spin","2spin","3spin","tr","bl","br","shake","shake2","shake3","flap"],f=["twitch","bttv","ffz"];class b{static get screenWidth(){return Math.max(document.documentElement.clientWidth,window.innerWidth||0)}static get screenHeight(){return Math.max(document.documentElement.clientHeight,window.innerHeight||0)}static stripBOM(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}static getTextArea(){return $(".channelTextArea-1LDbYG textarea")}static getInternalInstance(e){return e[Object.keys(e).find(e=>e.startsWith("__reactInternalInstance"))]||null}static insertText(e,t){e.focus(),e.selectionStart=0,e.selectionEnd=e.value.length,document.execCommand("insertText",!1,t)}static injectCss(e){$("",{type:"text/css",rel:"stylesheet",href:e}).appendTo($("head"))}static injectJs(e){return new Promise(t=>{$("",{type:"text/javascript",src:e,onload:t}).appendTo($("body"))})}static escapeID(e){return e.replace(/^[^a-z]+|[^\w-]+/gi,"")}static log(e,t){console.log(`%c[BandagedBD]%c [${e}]%c ${t}`,"color: #3a71c1; font-weight: 700;","color: #3a71c1;","")}static warn(e,t){console.warn(`%c[BandagedBD]%c [${e}]%c ${t}`,"color: #E8A400; font-weight: 700;","color: #E8A400;","")}static err(e,t,n){console.log(`%c[BandagedBD]%c [${e}]%c ${t}`,"color: red; font-weight: 700;","color: red;",""),n&&(console.groupCollapsed("%cError: "+n.message,"color: red;"),console.error(n.stack),console.groupEnd())}static escape(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}static testJSON(e){try{return JSON.parse(e),!0}catch(e){return!1}}static suppressErrors(e,t){return(...n)=>{try{return e(...n)}catch(e){this.err("SuppressedError","Error occurred in "+t,e)}}}static monkeyPatch(e,t,n){const{before:s,after:o,instead:r,once:i=!1,silent:a=!1,force:l=!1}=n,c=n.displayName||e.displayName||e.name||e.constructor.displayName||e.constructor.name;if(a||console.log("patch",t,"of",c),!e[t]){if(!l)return console.error(t,"does not exist for",c);e[t]=function(){}}const d=e[t],u=()=>{a||console.log("unpatch",t,"of",c),e[t]=d};return e[t]=function(){const n={thisObject:this,methodArguments:arguments,cancelPatch:u,originalMethod:d,callOriginalMethod:()=>n.returnValue=n.originalMethod.apply(n.thisObject,n.methodArguments)};if(r){const s=b.suppressErrors(r,"`instead` callback of "+e[t].displayName)(n);void 0!==s&&(n.returnValue=s)}else s&&b.suppressErrors(s,"`before` callback of "+e[t].displayName)(n),n.callOriginalMethod(),o&&b.suppressErrors(o,"`after` callback of "+e[t].displayName)(n);return i&&u(),n.returnValue},e[t].__monkeyPatched=!0,e[t].__originalMethod||(e[t].__originalMethod=d),e[t].displayName="patched "+(e[t].displayName||t),u}static onRemoved(e,t){const n=new MutationObserver(s=>{for(let o=0;o-1,l=i.some(t=>t.contains(e));(a||l)&&(n.disconnect(),t())}});n.observe(document.body,{subtree:!0,childList:!0})}static memoizeObject(e){const t=new Proxy(e,{get:function(e,t){if(e.hasOwnProperty(t)){if(Object.getOwnPropertyDescriptor(e,t).get){const n=e[t];delete e[t],e[t]=n}return e[t]}},set:function(e,t,n){return e.hasOwnProperty(t)?this.err("MemoizedObject","Trying to overwrite existing property"):(e[t]=n,e[t])}});return Object.defineProperty(t,"hasOwnProperty",{value:function(e){return void 0!==this[e]}}),t}static className(){const e=[],t={}.hasOwnProperty;for(let n=0;ne)){return n=>{const s=t(n);return!!s&&e.every(e=>void 0!==s[e])}}static byPrototypeFields(e,t=(e=>e)){return n=>{const s=t(n);return!!s&&(!!s.prototype&&e.every(e=>void 0!==s.prototype[e]))}}static byCode(e,t=(e=>e)){return n=>{const s=t(n);return!!s&&-1!==s.toString([]).search(e)}}static byString(...e){return t=>{const n=t.toString([]);for(const t of e)if(!n.includes(t))return!1;return!0}}static byDisplayName(e){return t=>t&&t.displayName===e}static combine(...e){return t=>e.every(e=>e(t))}}class w{static find(e,t=!0){return this.getModule(e,t)}static findAll(e){return this.getModule(e,!1)}static findByUniqueProperties(e,t=!0){return t?this.getByProps(...e):this.getAllByProps(...e)}static findByDisplayName(e){return this.getByDisplayName(e)}static getModule(e,t=!0){const n=this.getAllModules(),s=[];for(const o in n){if(!n.hasOwnProperty(o))continue;const r=n[o],{exports:i}=r;let a=null;if(i&&(i.__esModule&&i.default&&e(i.default)&&(a=i.default),e(i)&&(a=i),a)){if(t)return a;s.push(a)}}return t||0==s.length?void 0:s}static getModules(e){return this.getModule(e,!1)}static getModuleByName(e,t){if(y.hasOwnProperty(e))return y[e];if(!t)return;const n=this.getModule(t,!0);return n?y[e]=n:void 0}static getByDisplayName(e){return this.getModule(v.byDisplayName(e),!0)}static getByRegex(e,t=!0){return this.getModule(v.byCode(e),t)}static getByPrototypes(...e){return this.getModule(v.byPrototypeFields(e),!0)}static getAllByPrototypes(...e){return this.getModule(v.byPrototypeFields(e),!1)}static getByProps(...e){return this.getModule(v.byProperties(e),!0)}static getAllByProps(...e){return this.getModule(v.byProperties(e),!1)}static getByString(...e){return this.getModule(v.byString(...e),!0)}static getAllByString(...e){return this.getModule(v.byString(...e),!1)}static get require(){if(this._require)return this._require;const e="bbd-webpackmodules",t="function"==typeof window.webpackJsonp?window.webpackJsonp([],{[e]:(e,t,n)=>t.default=n},[e]).default:window.webpackJsonp.push([[],{[e]:(e,t,n)=>e.exports=n},[[e]]]);return delete t.m[e],delete t.c[e],this._require=t}static getAllModules(){return this.require.c}}const C=n(0),S=n(1),E=DiscordNative.globals.releaseChannel;var P=new class{constructor(){this.data={settings:{stable:{},canary:{},ptb:{}}},this.pluginData={}}initialize(){C.existsSync(this.BDFile)||C.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4));const e=require(this.BDFile);if(e.hasOwnProperty("settings")&&(this.data=e),!C.existsSync(this.settingsFile))return;let t=require(this.settingsFile);C.unlinkSync(this.settingsFile),t=t.hasOwnProperty("settings")?Object.assign({stable:{},canary:{},ptb:{}},{[E]:t}):Object.assign({stable:{},canary:{},ptb:{}},t),this.setBDData("settings",t)}get BDFile(){return this._BDFile||(this._BDFile=S.resolve(l.dataPath,"bdstorage.json"))}get settingsFile(){return this._settingsFile||(this._settingsFile=S.resolve(l.dataPath,"bdsettings.json"))}getPluginFile(e){return S.resolve(l.dataPath,"plugins",e+".config.json")}getSettingGroup(e){return this.data.settings[E][e]||null}setSettingGroup(e,t){this.data.settings[E][e]=t,C.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4))}getBDData(e){return this.data[e]||""}setBDData(e,t){this.data[e]=t,C.writeFileSync(this.BDFile,JSON.stringify(this.data,null,4))}getPluginData(e,t){return void 0!==this.pluginData[e]?this.pluginData[e][t]||void 0:C.existsSync(this.getPluginFile(e))?(this.pluginData[e]=JSON.parse(C.readFileSync(this.getPluginFile(e))),this.pluginData[e][t]||void 0):void 0}setPluginData(e,t,n){void 0!==n&&(void 0===this.pluginData[e]&&(this.pluginData[e]={}),this.pluginData[e][t]=n,C.writeFileSync(this.getPluginFile(e),JSON.stringify(this.pluginData[e],null,4)))}deletePluginData(e,t){void 0===this.pluginData[e]&&(this.pluginData[e]={}),delete this.pluginData[e][t],C.writeFileSync(this.getPluginFile(e),JSON.stringify(this.pluginData[e],null,4))}};const x=n(4);var k=new class extends x{constructor(){super(),this.setMaxListeners(20)}dispatch(e,...t){this.emit(e,...t)}};function D(){}D.prototype.loadPlugins=function(){this.loadPluginData();const e=L.loadPlugins(),t=Object.keys(h);for(let n=0;nt.filename==e).plugin;try{n.load&&"function"==typeof n.load&&n.load()}catch(e){Se.showContentErrors({plugins:[e]})}b.log("ContentManager",`${n.getName()} v${n.getVersion()} was loaded.`),Ce.show(`${n.getName()} v${n.getVersion()} was loaded.`,{type:"success"}),k.dispatch("plugin-loaded",n.getName())},D.prototype.unloadPlugin=function(e){const t=Object.values(h).find(t=>t.filename==e)||h[e];if(!t)return;const n=t.plugin.getName();c[n]&&this.disablePlugin(n,!0);const s=L.unloadContent(h[n].filename,"plugin");if(delete h[n],s)return Se.showContentErrors({plugins:[s]}),Ce.show(`${n} could not be unloaded. It may have not been loaded yet.`,{type:"error"}),b.err("ContentManager",`${n} could not be unloaded. It may have not been loaded yet.`,s);b.log("ContentManager",`${n} was unloaded.`),Ce.show(`${n} was unloaded.`,{type:"success"}),k.dispatch("plugin-unloaded",n)},D.prototype.reloadPlugin=function(e){const t=Object.values(h).find(t=>t.filename==e)||h[e];if(!t)return this.loadPlugin(e);const n=t.plugin.getName(),s=c[n];s&&this.stopPlugin(n,!0);const o=L.reloadContent(h[n].filename,"plugin");if(o)return Se.showContentErrors({plugins:[o]}),Ce.show(`${n} could not be reloaded.`,{type:"error"}),b.err("ContentManager",`${n} could not be reloaded.`,o);h[n].plugin.load&&"function"==typeof h[n].plugin.load&&h[n].plugin.load(),s&&this.startPlugin(n,!0),b.log("ContentManager",`${n} v${h[n].plugin.getVersion()} was reloaded.`),Ce.show(`${n} v${h[n].plugin.getVersion()} was reloaded.`,{type:"success"}),k.dispatch("plugin-reloaded",n)},D.prototype.updatePluginList=function(){const e=L.loadNewContent("plugin");for(const t of e.added)this.loadPlugin(t);for(const t of e.removed)this.unloadPlugin(t)},D.prototype.loadPluginData=function(){const e=P.getSettingGroup("plugins");e&&Object.assign(c,e)},D.prototype.savePluginData=function(){P.setSettingGroup("plugins",c)},D.prototype.newMessage=function(){const e=Object.keys(h);for(let t=0;t",{id:b.escapeID(n),text:unescape(u[n].css)}))}for(const e in d)u[e]||delete d[e];return this.saveThemeData(),e},B.prototype.enableTheme=function(e,t=!1){d[e]=!0,this.saveThemeData(),$("head").append($("