Update 0BDFDB.plugin.js

This commit is contained in:
Mirco Wittrien 2020-09-12 18:56:04 +02:00
parent 6435059419
commit 407034d6e2
1 changed files with 6710 additions and 6705 deletions

View File

@ -255,7 +255,7 @@ module.exports = (_ => {
delete window.BDFDB_Global.loaded;
BDFDB.TimeUtils.interval((interval, count) => {
if (count > 60 || window.BDFDB_Global.loaded) BDFDB.TimeUtils.clear(interval);
if (window.BDFDB_Global.loaded) for (let pluginName of [].concat(PluginStores.started).sort()) BDFDB.BDUtils.reloadPlugin(pluginName);
if (window.BDFDB_Global.loaded) for (let pluginName of [].concat(PluginStores.started).sort()) BDFDB.TimeUtils.timeout(_ => BDFDB.BDUtils.reloadPlugin(pluginName));
}, 1000);
}
BDFDB.DOMUtils.removeLocalStyle(plugin.name);
@ -461,7 +461,7 @@ module.exports = (_ => {
plugin: plugin,
title: plugin.name,
controls: [
plugin.changelog && BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.Clickable, {
plugin.changeLog && BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.Clickable, {
className: BDFDB.disCN.settingspanelheaderbutton,
children: BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.TooltipContainer, {
text: BDFDB.LanguageUtils.LanguageStrings.CHANGE_LOG,
@ -514,9 +514,12 @@ module.exports = (_ => {
const loadLibrary = tryAgain => {
require("request").get("https://mwittrien.github.io/BetterDiscordAddons/Library/_res/BDFDB.data.json", BDFDB.TimeUtils.suppress((error, response, body) => {
require("request").get("https://mwittrien.github.io/BetterDiscordAddons/Library/_res/BDFDB.raw.css", (error, response, body) => {
if ((error || !body) && tryAgain) return BDFDB.TimeUtils.timeout(_ => {loadLibrary();}, 10000);
const InternalData = JSON.parse(body);
const css = body;
require("request").get("https://mwittrien.github.io/BetterDiscordAddons/Library/_res/BDFDB.data.json", BDFDB.TimeUtils.suppress((error2, response2, body2) => {
if ((error2 || !body2) && tryAgain) return BDFDB.TimeUtils.timeout(_ => {loadLibrary();}, 10000);
const InternalData = JSON.parse(body2);
BDFDB.ObserverUtils = {};
BDFDB.ObserverUtils.connect = function (plugin, eleOrSelec, observer, config = {childList: true}) {
@ -7434,9 +7437,7 @@ module.exports = (_ => {
BDFDB.LibraryComponents[component] = "div";
}
require("request").get("https://mwittrien.github.io/BetterDiscordAddons/Library/_res/BDFDB.raw.css", (error, response, body) => {
if (!error && body) BDFDB.DOMUtils.appendLocalStyle("BDFDB", body.replace(/[\n\t\r]/g, "").replace(/\[REPLACE_CLASS_([A-z0-9_]+?)\]/g, function(a, b) {return BDFDB.dotCN[b];}));
});
if (css) BDFDB.DOMUtils.appendLocalStyle("BDFDB", css.replace(/[\n\t\r]/g, "").replace(/\[REPLACE_CLASS_([A-z0-9_]+?)\]/g, function(a, b) {return BDFDB.dotCN[b];}));
window.BDFDB_Global.loaded = true;
delete window.BDFDB_Global.loading;
@ -7445,8 +7446,12 @@ module.exports = (_ => {
while (PluginStores.delayedLoad.length) PluginStores.delayedLoad.shift().load();
while (PluginStores.delayedStart.length) PluginStores.delayedStart.shift().start();
while (pluginQueue.length) BDFDB.BDUtils.reloadPlugin(pluginQueue.shift());
}, "Could not initiate library!", config.name))
while (pluginQueue.length) {
let pluginName = pluginQueue.shift();
if (pluginName) BDFDB.TimeUtils.timeout(_ => BDFDB.BDUtils.reloadPlugin(pluginName));
}
}, "Could not initiate library!", config.name));
});
};
loadLibrary(true);