Update 0BDFDB.plugin.js
This commit is contained in:
parent
6435059419
commit
407034d6e2
|
@ -255,7 +255,7 @@ module.exports = (_ => {
|
||||||
delete window.BDFDB_Global.loaded;
|
delete window.BDFDB_Global.loaded;
|
||||||
BDFDB.TimeUtils.interval((interval, count) => {
|
BDFDB.TimeUtils.interval((interval, count) => {
|
||||||
if (count > 60 || window.BDFDB_Global.loaded) BDFDB.TimeUtils.clear(interval);
|
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);
|
}, 1000);
|
||||||
}
|
}
|
||||||
BDFDB.DOMUtils.removeLocalStyle(plugin.name);
|
BDFDB.DOMUtils.removeLocalStyle(plugin.name);
|
||||||
|
@ -461,7 +461,7 @@ module.exports = (_ => {
|
||||||
plugin: plugin,
|
plugin: plugin,
|
||||||
title: plugin.name,
|
title: plugin.name,
|
||||||
controls: [
|
controls: [
|
||||||
plugin.changelog && BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.Clickable, {
|
plugin.changeLog && BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.Clickable, {
|
||||||
className: BDFDB.disCN.settingspanelheaderbutton,
|
className: BDFDB.disCN.settingspanelheaderbutton,
|
||||||
children: BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.TooltipContainer, {
|
children: BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.TooltipContainer, {
|
||||||
text: BDFDB.LanguageUtils.LanguageStrings.CHANGE_LOG,
|
text: BDFDB.LanguageUtils.LanguageStrings.CHANGE_LOG,
|
||||||
|
@ -514,9 +514,12 @@ module.exports = (_ => {
|
||||||
|
|
||||||
|
|
||||||
const loadLibrary = tryAgain => {
|
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);
|
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 = {};
|
||||||
BDFDB.ObserverUtils.connect = function (plugin, eleOrSelec, observer, config = {childList: true}) {
|
BDFDB.ObserverUtils.connect = function (plugin, eleOrSelec, observer, config = {childList: true}) {
|
||||||
|
@ -7434,9 +7437,7 @@ module.exports = (_ => {
|
||||||
BDFDB.LibraryComponents[component] = "div";
|
BDFDB.LibraryComponents[component] = "div";
|
||||||
}
|
}
|
||||||
|
|
||||||
require("request").get("https://mwittrien.github.io/BetterDiscordAddons/Library/_res/BDFDB.raw.css", (error, response, body) => {
|
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];}));
|
||||||
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];}));
|
|
||||||
});
|
|
||||||
|
|
||||||
window.BDFDB_Global.loaded = true;
|
window.BDFDB_Global.loaded = true;
|
||||||
delete window.BDFDB_Global.loading;
|
delete window.BDFDB_Global.loading;
|
||||||
|
@ -7445,8 +7446,12 @@ module.exports = (_ => {
|
||||||
|
|
||||||
while (PluginStores.delayedLoad.length) PluginStores.delayedLoad.shift().load();
|
while (PluginStores.delayedLoad.length) PluginStores.delayedLoad.shift().load();
|
||||||
while (PluginStores.delayedStart.length) PluginStores.delayedStart.shift().start();
|
while (PluginStores.delayedStart.length) PluginStores.delayedStart.shift().start();
|
||||||
while (pluginQueue.length) BDFDB.BDUtils.reloadPlugin(pluginQueue.shift());
|
while (pluginQueue.length) {
|
||||||
}, "Could not initiate library!", config.name))
|
let pluginName = pluginQueue.shift();
|
||||||
|
if (pluginName) BDFDB.TimeUtils.timeout(_ => BDFDB.BDUtils.reloadPlugin(pluginName));
|
||||||
|
}
|
||||||
|
}, "Could not initiate library!", config.name));
|
||||||
|
});
|
||||||
};
|
};
|
||||||
loadLibrary(true);
|
loadLibrary(true);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue