lib
This commit is contained in:
parent
084520b93c
commit
d0094bfa50
|
@ -141,12 +141,12 @@ module.exports = (_ => {
|
||||||
PluginStores.updateTimeout.push(plugin.name);
|
PluginStores.updateTimeout.push(plugin.name);
|
||||||
let url = ["ImageZoom", "ImageGallery", "ReverseImageSearch", "ShowImageDetails"].includes(plugin.name) ? "https://mwittrien.github.io/BetterDiscordAddons/Plugins/ImageUtilities/ImageUtilities.plugin.js" : ["BetterFriendCount"].includes(plugin.name) ? "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BetterFriendList/BetterFriendList.plugin.js" : (plugin.rawUrl ||`https://mwittrien.github.io/BetterDiscordAddons/Plugins/${plugin.name}/${plugin.name}.plugin.js`);
|
let url = ["ImageZoom", "ImageGallery", "ReverseImageSearch", "ShowImageDetails"].includes(plugin.name) ? "https://mwittrien.github.io/BetterDiscordAddons/Plugins/ImageUtilities/ImageUtilities.plugin.js" : ["BetterFriendCount"].includes(plugin.name) ? "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BetterFriendList/BetterFriendList.plugin.js" : (plugin.rawUrl ||`https://mwittrien.github.io/BetterDiscordAddons/Plugins/${plugin.name}/${plugin.name}.plugin.js`);
|
||||||
|
|
||||||
if (!window.PluginUpdates || typeof window.PluginUpdates !== "object") window.PluginUpdates = {plugins:{}};
|
if (!BDFDB.ObjectUtils.is(window.PluginUpdates) || !BDFDB.ObjectUtils.is(window.PluginUpdates.plugins)) window.PluginUpdates = {plugins: {}};
|
||||||
window.PluginUpdates.plugins[url] = {name: plugin.name, raw: url, version: plugin.version};
|
window.PluginUpdates.plugins[url] = {name: plugin.name, raw: url, version: plugin.version};
|
||||||
|
|
||||||
BDFDB.PluginUtils.checkUpdate(plugin.name, url);
|
BDFDB.PluginUtils.checkUpdate(plugin.name, url);
|
||||||
|
|
||||||
if (typeof window.PluginUpdates.interval === "undefined") window.PluginUpdates.interval = BDFDB.TimeUtils.interval(_ => {
|
if (window.PluginUpdates.interval === undefined) window.PluginUpdates.interval = BDFDB.TimeUtils.interval(_ => {
|
||||||
BDFDB.PluginUtils.checkAllUpdates();
|
BDFDB.PluginUtils.checkAllUpdates();
|
||||||
}, 1000*60*60*2);
|
}, 1000*60*60*2);
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ module.exports = (_ => {
|
||||||
|
|
||||||
BDFDB.ArrayUtils.remove(PluginStores.started, plugin.name, true);
|
BDFDB.ArrayUtils.remove(PluginStores.started, plugin.name, true);
|
||||||
delete Cache.data[plugin.name]
|
delete Cache.data[plugin.name]
|
||||||
delete window.PluginUpdates.plugins[url];
|
if (BDFDB.ObjectUtils.is(window.PluginUpdates) && BDFDB.ObjectUtils.is(window.PluginUpdates.plugins)) delete window.PluginUpdates.plugins[url];
|
||||||
};
|
};
|
||||||
BDFDB.PluginUtils.translate = function (plugin) {
|
BDFDB.PluginUtils.translate = function (plugin) {
|
||||||
plugin.labels = {};
|
plugin.labels = {};
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
let url = ["ImageZoom", "ImageGallery", "ReverseImageSearch", "ShowImageDetails"].includes(plugin.name) ? "https://mwittrien.github.io/BetterDiscordAddons/Plugins/ImageUtilities/ImageUtilities.plugin.js" : ["BetterFriendCount"].includes(plugin.name) ? "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BetterFriendList/BetterFriendList.plugin.js" : (typeof plugin.getRawUrl == "function" && typeof plugin.getRawUrl() == "string" ? plugin.getRawUrl() : `https://mwittrien.github.io/BetterDiscordAddons/Plugins/${plugin.name}/${plugin.name}.plugin.js`);
|
let url = ["ImageZoom", "ImageGallery", "ReverseImageSearch", "ShowImageDetails"].includes(plugin.name) ? "https://mwittrien.github.io/BetterDiscordAddons/Plugins/ImageUtilities/ImageUtilities.plugin.js" : ["BetterFriendCount"].includes(plugin.name) ? "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BetterFriendList/BetterFriendList.plugin.js" : (typeof plugin.getRawUrl == "function" && typeof plugin.getRawUrl() == "string" ? plugin.getRawUrl() : `https://mwittrien.github.io/BetterDiscordAddons/Plugins/${plugin.name}/${plugin.name}.plugin.js`);
|
||||||
BDFDB.PluginUtils.checkUpdate(plugin.name, url);
|
BDFDB.PluginUtils.checkUpdate(plugin.name, url);
|
||||||
|
|
||||||
if (!window.PluginUpdates || typeof window.PluginUpdates !== "object") window.PluginUpdates = {plugins: {} };
|
if (!BDFDB.ObjectUtils.is(window.PluginUpdates) || !BDFDB.ObjectUtils.is(window.PluginUpdates.plugins)) window.PluginUpdates = {plugins: {}};
|
||||||
window.PluginUpdates.plugins[url] = {name: plugin.name, raw: url, version: plugin.version};
|
window.PluginUpdates.plugins[url] = {name: plugin.name, raw: url, version: plugin.version};
|
||||||
if (typeof window.PluginUpdates.interval === "undefined") window.PluginUpdates.interval = BDFDB.TimeUtils.interval(_ => {BDFDB.PluginUtils.checkAllUpdates();}, 1000*60*60*2);
|
if (typeof window.PluginUpdates.interval === "undefined") window.PluginUpdates.interval = BDFDB.TimeUtils.interval(_ => {BDFDB.PluginUtils.checkAllUpdates();}, 1000*60*60*2);
|
||||||
BDFDB.TimeUtils.timeout(_ => {delete plugin.updateChecked;}, 30000);
|
BDFDB.TimeUtils.timeout(_ => {delete plugin.updateChecked;}, 30000);
|
||||||
|
@ -114,8 +114,8 @@
|
||||||
if (closeButton) closeButton.click();
|
if (closeButton) closeButton.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
delete BDFDB.DataUtils.cached[plugin.name]
|
delete BDFDB.DataUtils.cached[plugin.name];
|
||||||
delete window.PluginUpdates.plugins[url];
|
if (BDFDB.ObjectUtils.is(window.PluginUpdates) && BDFDB.ObjectUtils.is(window.PluginUpdates.plugins)) delete window.PluginUpdates.plugins[url];
|
||||||
|
|
||||||
delete plugin.started;
|
delete plugin.started;
|
||||||
BDFDB.TimeUtils.timeout(_ => {delete plugin.stopping;});
|
BDFDB.TimeUtils.timeout(_ => {delete plugin.stopping;});
|
||||||
|
|
Loading…
Reference in New Issue