This commit is contained in:
Mirco Wittrien 2021-01-06 12:38:36 +01:00
parent 3d1e6df8be
commit a4d5686fa6
53 changed files with 749 additions and 749 deletions

View File

@ -59,11 +59,11 @@ module.exports = (_ => {
};
const Plugin = function(config) {
return class Plugin {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
load() {
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load () {
this.loaded = true;
if (window.BDFDB_Global.loading) {
if (!PluginStores.delayedLoad.includes(this)) PluginStores.delayedLoad.push(this);
@ -77,7 +77,7 @@ module.exports = (_ => {
}, "Failed to load plugin!", config.info.name)();
}
}
start() {
start () {
if (!this.loaded) this.load();
if (window.BDFDB_Global.loading) {
if (!PluginStores.delayedStart.includes(this)) PluginStores.delayedStart.push(this);
@ -92,7 +92,7 @@ module.exports = (_ => {
delete this.stopping;
}
}
stop() {
stop () {
if (this.stopping) return;
this.stopping = true;
BDFDB.TimeUtils.timeout(_ => {delete this.stopping;});
@ -8009,18 +8009,18 @@ module.exports = (_ => {
loadLibrary(true);
return class BDFDB_Frame {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
libraryInstance = this;
Object.assign(this, config.info, BDFDB.ObjectUtils.exclude(config, "info"));
if (!BDFDB.BDUtils.isPluginEnabled(config.info.name)) BDFDB.BDUtils.enablePlugin(config.info.name);
}
start() {}
stop() {
start () {}
stop () {
if (!BDFDB.BDUtils.isPluginEnabled(config.info.name)) BDFDB.BDUtils.enablePlugin(config.info.name);
}

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
}
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -70,7 +70,7 @@ module.exports = (_ => {
const miniTypes = ["list", "chat"];
return class BadgesEverywhere extends Plugin {
onLoad() {
onLoad () {
this.patchedModules = {
after: {
MemberListItem: "render",
@ -291,7 +291,7 @@ module.exports = (_ => {
for (let flag in this.defaults.badges) if (!this.defaults.badges[flag].icon || isNaN(parseInt(flag))) delete this.defaults.badges[flag];
}
onStart() {
onStart () {
badgeClasses = BDFDB.DiscordClassModules.UserBadges || {};
requestedUsers = {}, loadedUsers = {};
@ -331,7 +331,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
BDFDB.TimeUtils.clear(requestQueue.timeout);
this.forceUpdateAll();
@ -371,14 +371,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
badges = BDFDB.DataUtils.get(this, "badges");
indicators = BDFDB.DataUtils.get(this, "indicators");
@ -417,7 +417,7 @@ module.exports = (_ => {
else requestedUsers[user.id].push(instance);
}
runQueue() {
runQueue () {
if (!requestQueue.id) {
let id = requestQueue.queue.shift();
if (id) {

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -79,7 +79,7 @@ module.exports = (_ => {
};
return class BetterFriendList extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
addTotalAmount: {value: true, description: "Add total amount for all/requested/blocked"},
@ -125,7 +125,7 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
sortKey = null;
sortReversed = false;
searchQuery = "";
@ -133,7 +133,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -151,14 +151,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
BDFDB.PatchUtils.forceAllUpdates(this);
@ -343,7 +343,7 @@ module.exports = (_ => {
});
}
rerenderList() {
rerenderList () {
let selectedButton = document.querySelector(BDFDB.dotCNS.peoplestabbar + BDFDB.dotCN.settingsitemselected);
if (selectedButton) selectedButton.click();
}

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -64,7 +64,7 @@ module.exports = (_ => {
}
} : (([Plugin, BDFDB]) => {
return class BetterNsfwTag extends Plugin {
onLoad() {
onLoad () {
this.patchedModules = {
after: {
ChannelItem: "default"
@ -72,11 +72,11 @@ module.exports = (_ => {
};
}
onStart() {
onStart () {
BDFDB.PatchUtils.forceAllUpdates(this);
}
onStop() {
onStop () {
BDFDB.PatchUtils.forceAllUpdates(this);
}

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -66,7 +66,7 @@ module.exports = (_ => {
var settings = {};
return class BetterSearchPage extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
addFirstLast: {value: true, description: "Add a first and last page button"},
@ -83,11 +83,11 @@ module.exports = (_ => {
}
onStart() {
onStart () {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -112,7 +112,7 @@ module.exports = (_ => {
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
BDFDB.PatchUtils.forceAllUpdates(this);

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -78,7 +78,7 @@ module.exports = (_ => {
};
return class CharCounter extends Plugin {
onLoad() {
onLoad () {
this.patchedModules = {
after: {
ChannelTextAreaContainer: "render",
@ -135,11 +135,11 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
BDFDB.PatchUtils.forceAllUpdates(this);
}
onStop() {
onStop () {
BDFDB.PatchUtils.forceAllUpdates(this);
}

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -66,7 +66,7 @@ module.exports = (_ => {
var settings = {}, amounts = {}, configs = {}, aliases = {}, commandAliases = {}, commandSentinel;
return class ChatAliases extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
configs: {
case: {value: false, description: "Handle the wordvalue case sensitive"},
@ -103,7 +103,7 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
aliases = BDFDB.DataUtils.load(this, "words");
commandSentinel = BDFDB.LibraryModules.AutocompleteSentinels && BDFDB.LibraryModules.AutocompleteSentinels.COMMAND_SENTINEL || "/";
commandAliases = BDFDB.ObjectUtils.filter(aliases, key => key.startsWith(commandSentinel), true);
@ -211,7 +211,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
if (BDFDB.LibraryModules.AutocompleteOptions && BDFDB.LibraryModules.AutocompleteOptions.AUTOCOMPLETE_OPTIONS) {
delete BDFDB.LibraryModules.AutocompleteOptions.AUTOCOMPLETE_OPTIONS.ALIASES;
}
@ -370,14 +370,14 @@ module.exports = (_ => {
});
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
amounts = BDFDB.DataUtils.get(this, "amounts");
configs = BDFDB.DataUtils.get(this, "configs");

View File

@ -20,12 +20,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -44,9 +44,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -62,7 +62,7 @@ module.exports = (_ => {
var settings = {}, replaces = {}, configs = {};
return class ChatFilter extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
configs: {
empty: {value: false, description: "Allow the replacevalue to be empty (ignoring the default)"},
@ -95,14 +95,14 @@ module.exports = (_ => {
}
onStart() {
onStart () {
words = BDFDB.DataUtils.load(this, "words");
for (let rType in this.defaults.replaces) if (!BDFDB.ObjectUtils.is(words[rType])) words[rType] = {};
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -232,14 +232,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
replaces = BDFDB.DataUtils.get(this, "replaces");
configs = BDFDB.DataUtils.get(this, "configs");

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -67,7 +67,7 @@ module.exports = (_ => {
var settings = {}, choices = {}, formats = {}, amounts = {};
return class CompleteTimestamps extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
showInChat: {value: true, description: "Replace chat timestamp with complete timestamp"},
@ -104,7 +104,7 @@ module.exports = (_ => {
};
}
onStart() {
onStart () {
languages = BDFDB.ObjectUtils.deepAssign({
own: {
"name": "Own",
@ -124,7 +124,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
BDFDB.DOMUtils.removeLocalStyle(this.name + "CompactCorrection");
@ -256,7 +256,7 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
currentMode = null;
@ -264,7 +264,7 @@ module.exports = (_ => {
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
choices = BDFDB.DataUtils.get(this, "choices");
formats = BDFDB.DataUtils.get(this, "formats");

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -66,7 +66,7 @@ module.exports = (_ => {
var settings = {};
return class CopyRawMessage extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
copyOnlySelected: {value: true, description: "Only copy selected text of a message"}
@ -74,11 +74,11 @@ module.exports = (_ => {
};
}
onStart() {
onStart () {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -96,14 +96,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
}

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -67,7 +67,7 @@ module.exports = (_ => {
var settings = {}, choices = {}, formats = {}, amounts = {};
return class CreationDate extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
addInUserPopout: {value: true, description: "Add in User Popouts"},
@ -99,7 +99,7 @@ module.exports = (_ => {
}
onStart() {
onStart () {
languages = BDFDB.ObjectUtils.deepAssign({
own: {
"name": "Own",
@ -110,7 +110,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -240,14 +240,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
choices = BDFDB.DataUtils.get(this, "choices");
formats = BDFDB.DataUtils.get(this, "formats");
@ -339,7 +339,7 @@ module.exports = (_ => {
return charArray.join("");
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -67,7 +67,7 @@ module.exports = (_ => {
var settings = {}, formats = {}, format = null;
const PreviewMessageComponent = class PreviewMessage extends BdApi.React.Component {
render() {
render () {
let spoofChannel = new BDFDB.DiscordObjects.Channel({
id: "126223823845647771",
guild_id: "850725684241078788",
@ -102,7 +102,7 @@ module.exports = (_ => {
};
return class CustomQuoter extends Plugin {
onLoad() {
onLoad () {
_this = this;
this.defaults = {
@ -115,11 +115,11 @@ module.exports = (_ => {
};
}
onStart() {
onStart () {
this.forceUpdateAll();
}
onStop() {}
onStop () {}
getSettingsPanel (collapseStates = {}) {
let settingsPanel;
@ -259,14 +259,14 @@ module.exports = (_ => {
});
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
formats = Object.assign({"Standard": "$quote $mention"}, BDFDB.DataUtils.load(this, "formats"));
}
@ -438,7 +438,7 @@ module.exports = (_ => {
return charArray.join("");
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -67,7 +67,7 @@ module.exports = (_ => {
var settings = {}, amounts = {};
return class DisplayLargeMessages extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
onDemand: {value: false, description: "Inject the content of 'message.txt' on demand and not automatically"},
@ -111,7 +111,7 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
encodedMessages = {};
requestedMessages = [];
pendingRequests = [];
@ -132,7 +132,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -168,7 +168,7 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
encodedMessages = {};
@ -178,7 +178,7 @@ module.exports = (_ => {
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
amounts = BDFDB.DataUtils.get(this, "amounts");
@ -326,7 +326,7 @@ module.exports = (_ => {
}
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -66,7 +66,7 @@ module.exports = (_ => {
var settings = {}, amounts = {};
return class DisplayServersAsChannels extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
showGuildIcon: {value: true, description: "Show a icon for servers"},
@ -92,7 +92,7 @@ module.exports = (_ => {
};
}
onStart() {
onStart () {
BDFDB.DOMUtils.addClass(document.body, BDFDB.disCN._displayserversaschannelsstyled);
BDFDB.PatchUtils.patch(this, BDFDB.LibraryComponents.GuildComponents.Guild.prototype, "render", {after: e => {
@ -103,7 +103,7 @@ module.exports = (_ => {
this.addCSS();
}
onStop() {
onStop () {
BDFDB.DOMUtils.removeClassFromDOM(BDFDB.disCN._displayserversaschannelsstyled);
BDFDB.DOMUtils.removeLocalStyle("DSACStyle" + this.name);
@ -138,7 +138,7 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
@ -146,7 +146,7 @@ module.exports = (_ => {
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
amounts = BDFDB.DataUtils.get(this, "amounts");
@ -348,7 +348,7 @@ module.exports = (_ => {
}
}
addCSS() {
addCSS () {
BDFDB.DOMUtils.appendLocalStyle("DSACStyle" + this.name, `
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCN.guildswrapper},
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildsscroller},

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -66,7 +66,7 @@ module.exports = (_ => {
var changedChannels = {}, settings = {};
return class EditChannels extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
changeChannelIcon: {value: true, inner: false, description: "Change color of Channel Icon"},
@ -115,7 +115,7 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
let observer = new MutationObserver(_ => {this.changeAppTitle();});
BDFDB.ObserverUtils.connect(this, document.head.querySelector("title"), {name: "appTitleObserver",instance: observer}, {childList: true});
@ -140,7 +140,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -180,7 +180,7 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
@ -456,7 +456,7 @@ module.exports = (_ => {
}
}
changeAppTitle() {
changeAppTitle () {
let channel = BDFDB.LibraryModules.ChannelStore.getChannel(BDFDB.LibraryModules.LastChannelStore.getChannelId());
let title = document.head.querySelector("title");
if (title && BDFDB.ChannelUtils.isTextChannel(channel)) BDFDB.DOMUtils.setText(title, "@" + this.getChannelData(channel.id, settings.changeAppTitle).name);
@ -594,7 +594,7 @@ module.exports = (_ => {
});
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -66,7 +66,7 @@ module.exports = (_ => {
var changedGuilds = {}, settings = {};
return class EditServers extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
addOriginalTooltip: {value: true, inner: false, description: "Hovering over a changed Server Header shows the original Name as Tooltip"},
@ -105,7 +105,7 @@ module.exports = (_ => {
this.patchPriority = 7;
}
onStart() {
onStart () {
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.IconUtils, "getGuildBannerURL", {instead: e => {
let guild = BDFDB.LibraryModules.GuildStore.getGuild(e.methodArguments[0].id);
if (guild) {
@ -130,7 +130,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -170,14 +170,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
changedGuilds = BDFDB.DataUtils.load(this, "servers");
settings = BDFDB.DataUtils.get(this, "settings");
@ -693,7 +693,7 @@ module.exports = (_ => {
guild.banner = data.removeBanner ? null : (data.banner || guild.EditServersCachedBanner);
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -66,7 +66,7 @@ module.exports = (_ => {
var changedUsers = {}, settings = {};
return class EditUsers extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
changeInContextMenu: {value: true, inner: true, description: "User ContextMenu"},
@ -189,7 +189,7 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
let observer = new MutationObserver(_ => {this.changeAppTitle();});
BDFDB.ObserverUtils.connect(this, document.head.querySelector("title"), {name: "appTitleObserver", instance: observer}, {childList: true});
@ -232,7 +232,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -272,14 +272,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
changedUsers = BDFDB.DataUtils.load(this, "users");
settings = BDFDB.DataUtils.get(this, "settings");
@ -1024,7 +1024,7 @@ module.exports = (_ => {
}
}
changeAppTitle() {
changeAppTitle () {
let channel = BDFDB.LibraryModules.ChannelStore.getChannel(BDFDB.LibraryModules.LastChannelStore.getChannelId());
let title = document.head.querySelector("title");
if (title && channel && channel.type == BDFDB.DiscordConstants.ChannelTypes.DM) {
@ -1445,7 +1445,7 @@ module.exports = (_ => {
}, 1000);
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -20,12 +20,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -44,9 +44,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -61,7 +61,7 @@ module.exports = (_ => {
var emojiReplicaList;
return class EmojiStatistics extends Plugin {
onLoad() {
onLoad () {
this.patchedModules = {
after: {
EmojiPicker: "type"
@ -92,11 +92,11 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
BDFDB.PatchUtils.forceAllUpdates(this);
}
onStop() {
onStop () {
BDFDB.PatchUtils.forceAllUpdates(this);
}
@ -121,7 +121,7 @@ module.exports = (_ => {
}));
}
loadEmojiList() {
loadEmojiList () {
emojiReplicaList = {};
let guilds = BDFDB.LibraryModules.GuildStore.getGuilds();
for (let id in guilds) for (let emoji of BDFDB.LibraryModules.GuildEmojiStore.getGuildEmoji(id)) {
@ -129,7 +129,7 @@ module.exports = (_ => {
}
}
showEmojiInformationModal() {
showEmojiInformationModal () {
BDFDB.ModalUtils.open(this, {
size: "LARGE",
header: this.labels.modal_header,
@ -180,7 +180,7 @@ module.exports = (_ => {
});
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -20,12 +20,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -44,9 +44,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -61,7 +61,7 @@ module.exports = (_ => {
var loadedEmbeds, requestedEmbeds;
return class ForceImagePreviews extends Plugin {
onLoad() {
onLoad () {
loadedEmbeds = {};
requestedEmbeds = [];
@ -72,12 +72,12 @@ module.exports = (_ => {
};
}
onStart() {
onStart () {
BDFDB.PatchUtils.forceAllUpdates(this);
BDFDB.MessageUtils.rerenderAll();
}
onStop() {
onStop () {
BDFDB.PatchUtils.forceAllUpdates(this);
BDFDB.MessageUtils.rerenderAll();
}

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -87,10 +87,10 @@ module.exports = (_ => {
};
const FriendOnlineCounterComponent = class FriendOnlineCounter extends BdApi.React.Component {
componentDidMount() {
componentDidMount () {
friendCounter = this;
}
render() {
render () {
return BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.guildouter,
children: BDFDB.ReactUtils.createElement("div", {
@ -105,10 +105,10 @@ module.exports = (_ => {
};
const TimeLogComponent = class TimeLog extends BdApi.React.Component {
componentDidMount() {
componentDidMount () {
timeLogList = this;
}
render() {
render () {
return this.props.entries.length ? BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.PaginatedList, {
items: this.props.entries,
amount: 100,
@ -148,7 +148,7 @@ module.exports = (_ => {
};
return class FriendNotifications extends Plugin {
onLoad() {
onLoad () {
_this = this;
userStatusStore = {};
@ -219,7 +219,7 @@ module.exports = (_ => {
}
}
onStart() {
onStart () {
// REMOVE 1.1.2021
let convert = type => {
let data = BDFDB.DataUtils.load(this, type);
@ -239,7 +239,7 @@ module.exports = (_ => {
BDFDB.PatchUtils.forceAllUpdates(this);
}
onStop() {
onStop () {
BDFDB.TimeUtils.clear(checkInterval);
BDFDB.PatchUtils.forceAllUpdates(this);
@ -590,7 +590,7 @@ module.exports = (_ => {
});
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
@ -633,7 +633,7 @@ module.exports = (_ => {
}));
}
createDefaultConfig() {
createDefaultConfig () {
return Object.assign({
disabled: settings.disableForNew
}, BDFDB.ObjectUtils.map(this.defaults.notificationstrings, data => notificationTypes[data.init ? "TOAST" : "DISABLED"].value));
@ -654,7 +654,7 @@ module.exports = (_ => {
return status;
}
startInterval() {
startInterval () {
BDFDB.TimeUtils.clear(checkInterval);
settings = BDFDB.DataUtils.get(this, "settings");
@ -731,7 +731,7 @@ module.exports = (_ => {
}, amounts.checkInterval * 1000);
}
showTimeLog() {
showTimeLog () {
let searchTimeout;
BDFDB.ModalUtils.open(this, {
size: "MEDIUM",

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -67,7 +67,7 @@ module.exports = (_ => {
var settings = {}, engines = {}, enabledEngines = {};
return class GoogleSearchReplace extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
useChromium: {value: false, description: "Use an inbuilt browser window instead of opening your default browser"},
@ -93,11 +93,11 @@ module.exports = (_ => {
};
}
onStart() {
onStart () {
this.forceUpdateAll();
}
onStop() {}
onStop () {}
getSettingsPanel (collapseStates = {}) {
let settingsPanel, settingsItems = [];
@ -123,14 +123,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
engines = BDFDB.DataUtils.get(this, "engines");
enabledEngines = BDFDB.ObjectUtils.filter(engines, n => n);
@ -190,7 +190,7 @@ module.exports = (_ => {
}
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -20,12 +20,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -44,9 +44,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -84,7 +84,7 @@ module.exports = (_ => {
var settings = {}, choices = {}, exceptions = {}, engines = {}, favorites = {};
return class GoogleTranslateOption extends Plugin {
onLoad() {
onLoad () {
languages = {};
translating = false;
isTranslating = false;
@ -141,11 +141,11 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
this.forceUpdateAll();
}
onStop() {
onStop () {
translating = false;
this.forceUpdateAll();
@ -185,14 +185,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
choices = BDFDB.DataUtils.get(this, "choices");
exceptions = BDFDB.DataUtils.get(this, "exceptions");
@ -574,7 +574,7 @@ module.exports = (_ => {
return selects;
}
setLanguages() {
setLanguages () {
let engine = translationEngines[engines.translator] || {};
let languageIds = engine.languages || [];
languages = BDFDB.ObjectUtils.deepAssign(
@ -959,7 +959,7 @@ module.exports = (_ => {
else return language.name + (language.ownlang && language.name != language.ownlang ? ` / ${language.ownlang}` : "");
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -20,12 +20,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -44,9 +44,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -59,7 +59,7 @@ module.exports = (_ => {
}
} : (([Plugin, BDFDB]) => {
return class HideMutedCategories extends Plugin {
onLoad() {
onLoad () {
this.patchedModules = {
before: {
Channels: "render"
@ -72,11 +72,11 @@ module.exports = (_ => {
this.patchPriority = 10;
}
onStart() {
onStart () {
BDFDB.PatchUtils.forceAllUpdates(this);
}
onStop() {
onStop () {
BDFDB.PatchUtils.forceAllUpdates(this);
}

View File

@ -30,12 +30,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -54,9 +54,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -73,18 +73,18 @@ module.exports = (_ => {
var settings = {}, amounts = {}, zoomSettings = {}, engines = {}, enabledEngines = {}, ownLocations = {}, downloadsFolder;
const ImageDetails = class ImageDetails extends BdApi.React.Component {
componentDidMount() {
componentDidMount () {
this.props.attachment = BDFDB.ReactUtils.findValue(BDFDB.ObjectUtils.get(this, `${BDFDB.ReactUtils.instanceKey}.return`), "attachment", {up: true});
BDFDB.ReactUtils.forceUpdate(this);
}
componentDidUpdate() {
componentDidUpdate () {
if ((!this.props.attachment || !this.props.attachment.size) && !this.props.loaded) {
this.props.loaded = true;
this.props.attachment = BDFDB.ReactUtils.findValue(BDFDB.ObjectUtils.get(this, `${BDFDB.ReactUtils.instanceKey}.return`), "attachment", {up: true});
BDFDB.ReactUtils.forceUpdate(this);
}
}
render() {
render () {
return !this.props.attachment ? null : BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
className: BDFDB.disCN._imageutilitiesimagedetails,
children: [
@ -115,7 +115,7 @@ module.exports = (_ => {
};
return class ImageUtilities extends Plugin {
onLoad() {
onLoad () {
firedEvents = [];
clickedImage = null;
@ -246,7 +246,7 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
// REMOVE 16.12.2020
let oL = BDFDB.DataUtils.load(this, "ownLocations"), c = false;
for (let i in oL) if (!BDFDB.ObjectUtils.is(oL[i])) {
@ -267,7 +267,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.cleanupListeners("Gallery");
this.cleanupListeners("Zoom");
@ -451,14 +451,14 @@ module.exports = (_ => {
});
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
amounts = BDFDB.DataUtils.get(this, "amounts");
zoomSettings = BDFDB.DataUtils.get(this, "zoomSettings");
@ -994,7 +994,7 @@ module.exports = (_ => {
});
}
getDownloadLocation() {
getDownloadLocation () {
if (downloadsFolder && BDFDB.LibraryRequires.fs.existsSync(downloadsFolder)) return downloadsFolder;
let homePath = BDFDB.LibraryRequires.process.env.USERPROFILE || BDFDB.LibraryRequires.process.env.HOMEPATH || BDFDB.LibraryRequires.process.env.HOME;
let downloadPath = homePath && BDFDB.LibraryRequires.path.join(homePath, "Downloads");
@ -1111,7 +1111,7 @@ module.exports = (_ => {
}
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -67,7 +67,7 @@ module.exports = (_ => {
var settings = {}, choices = {}, formats = {}, amounts = {};
return class JoinedAtDate extends Plugin {
onLoad() {
onLoad () {
loadedUsers = {};
requestedUsers = {};
@ -101,7 +101,7 @@ module.exports = (_ => {
};
}
onStart() {
onStart () {
languages = BDFDB.ObjectUtils.deepAssign({
own: {
name: "Own",
@ -112,7 +112,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -242,14 +242,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
choices = BDFDB.DataUtils.get(this, "choices");
formats = BDFDB.DataUtils.get(this, "formats");
@ -356,7 +356,7 @@ module.exports = (_ => {
return charArray.join("");
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -67,7 +67,7 @@ module.exports = (_ => {
var settings = {}, choices = {}, formats = {}, amounts = {};
return class LastMessageDate extends Plugin {
onLoad() {
onLoad () {
loadedUsers = {};
requestedUsers = {};
@ -101,7 +101,7 @@ module.exports = (_ => {
};
}
onStart() {
onStart () {
languages = BDFDB.ObjectUtils.deepAssign({
own: {
name: "Own",
@ -122,7 +122,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -252,14 +252,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
choices = BDFDB.DataUtils.get(this, "choices");
formats = BDFDB.DataUtils.get(this, "formats");
@ -380,7 +380,7 @@ module.exports = (_ => {
return charArray.join("");
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -29,12 +29,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -53,9 +53,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -72,7 +72,7 @@ module.exports = (_ => {
var settings = {}, bindings = {}, enabledBindings = {}, toasts = {};
return class MessageUtilities extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
"addHints": {value: true, description: "Add keycombo hints to contextmenus: "},
@ -107,7 +107,7 @@ module.exports = (_ => {
}
}
onStart() {
onStart () {
BDFDB.ListenerUtils.add(this, document, "click", BDFDB.dotCNC.message + BDFDB.dotCN.searchresultsgroupcozy, e => {
if (!BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagetoolbarbutton, e.target)) this.onClick(e, 0, "onSglClick");
});
@ -121,7 +121,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -214,14 +214,14 @@ module.exports = (_ => {
});
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
bindings = BDFDB.DataUtils.get(this, "bindings");
enabledBindings = BDFDB.ObjectUtils.filter(bindings, action => settings[action], true);

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -129,24 +129,24 @@ module.exports = (_ => {
this._src = audios[choices[type].category][choices[type].sound] || types[type].src;
this._volume = choices[type].volume;
}
loop() {
loop () {
this._ensureAudio().then(audio => {
audio.loop = true;
audio.play();
});
}
play() {
play () {
this._ensureAudio().then(audio => {
audio.loop = false;
audio.play();
});
}
pause() {
pause () {
this._audio.then(audio => {
audio.pause();
});
}
stop() {
stop () {
this._destroyAudio();
}
setTime (time) {
@ -159,7 +159,7 @@ module.exports = (_ => {
audio.loop = loop;
});
}
_destroyAudio() {
_destroyAudio () {
if (this._audio) {
this._audio.then(audio => {
audio.pause();
@ -168,7 +168,7 @@ module.exports = (_ => {
this._audio = null;
}
}
_ensureAudio() {
_ensureAudio () {
return this._audio = this._audio || new Promise((callback, errorCallback) => {
let audio = new Audio;
audio.src = this._src && this._src.startsWith("data") ? this._src.replace(/ /g, "") : this._src;
@ -189,7 +189,7 @@ module.exports = (_ => {
};
return class NotificationSounds extends Plugin {
onLoad() {
onLoad () {
audios = {};
choices = {};
firedEvents = {};
@ -209,7 +209,7 @@ module.exports = (_ => {
this.patchPriority = 10;
}
onStart() {
onStart () {
if (BDFDB.LibraryModules.PlatformUtils.embedded) {
let change = _ => {
if (window.navigator.mediaDevices && window.navigator.mediaDevices.enumerateDevices) {
@ -321,7 +321,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
for (let type in createdAudios) if (createdAudios[type]) createdAudios[type].stop();
}
@ -631,7 +631,7 @@ module.exports = (_ => {
});
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
for (let type in createdAudios) if (createdAudios[type]) createdAudios[type].stop();
@ -640,7 +640,7 @@ module.exports = (_ => {
}
}
forceUpdateAll() {
forceUpdateAll () {
repatchIncoming = true;
createdAudios["call_calling"] = BDFDB.LibraryModules.SoundUtils.createSound("call_calling");
volumes = BDFDB.DataUtils.get(this, "volumes");
@ -667,12 +667,12 @@ module.exports = (_ => {
}
}
loadAudios() {
loadAudios () {
audios = Object.assign({}, BDFDB.DataUtils.load(this, "audios"), defaultAudios);
BDFDB.DataUtils.save(BDFDB.ObjectUtils.exclude(audios, Object.keys(defaultAudios)), this, "audios");
}
loadChoices() {
loadChoices () {
let loadedChoices = BDFDB.DataUtils.load(this, "choices");
for (let type in types) {
let choice = loadedChoices[type] || {}, soundFound = false;

View File

@ -20,12 +20,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -44,9 +44,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -62,7 +62,7 @@ module.exports = (_ => {
var settings = {};
return class OldTitleBar extends Plugin {
onLoad() {
onLoad () {
patched = false;
electronWindow = BDFDB.LibraryRequires.electron.remote.getCurrentWindow();
@ -135,7 +135,7 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
BDFDB.ListenerUtils.add(this, window, "resize", e => {
BDFDB.PatchUtils.forceAllUpdates(this, ["HeaderBarContainer", "StandardSidebarView"]);
});
@ -147,7 +147,7 @@ module.exports = (_ => {
this.patchMainScreen(settings.displayNative);
}
onStop() {
onStop () {
this.forceUpdateAll();
BDFDB.DOMUtils.removeClassFromDOM(BDFDB.disCN._oldtitlebarenabled);
@ -188,7 +188,7 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
@ -196,7 +196,7 @@ module.exports = (_ => {
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
BDFDB.PatchUtils.forceAllUpdates(this);

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -73,7 +73,7 @@ module.exports = (_ => {
var settings = {}, inputs = {};
return class OwnerTag extends Plugin {
onLoad() {
onLoad () {
this.patchedModules = {
after: {
MemberListItem: "render",
@ -125,11 +125,11 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -187,14 +187,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
inputs = BDFDB.DataUtils.get(this, "inputs");
@ -339,7 +339,7 @@ module.exports = (_ => {
return userTypes.NONE;
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -76,7 +76,7 @@ module.exports = (_ => {
var choices = {};
return class PersonalPins extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
choices: {
defaultFilter: {value: filterKeys[0], options: filterKeys, type: "filter", description: "Default choice tab"},
@ -92,11 +92,11 @@ module.exports = (_ => {
};
}
onStart() {
onStart () {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -129,14 +129,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
choices = BDFDB.DataUtils.get(this, "choices");
BDFDB.PatchUtils.forceAllUpdates(this);
@ -581,7 +581,7 @@ module.exports = (_ => {
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -69,7 +69,7 @@ module.exports = (_ => {
var settings = {}, preCategories = {}, preCollapseStates = {};
return class PinDMs extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
sortInRecentOrder: {value: false, inner: true, description: "Channel List"},
@ -164,11 +164,11 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
let unreadDMsInstance = BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.app), {name: "UnreadDMs", unlimited: true});
@ -228,14 +228,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
preCategories = BDFDB.DataUtils.get(this, "preCategories");
preCollapseStates = BDFDB.DataUtils.load(this, "preCollapseStates");
@ -1001,7 +1001,7 @@ module.exports = (_ => {
dragPreview.style.setProperty("top", event.clientY - (rects.height/2) + "px", "important");
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -119,7 +119,7 @@ module.exports = (_ => {
const pluginRepoIcon = `<svg width="34" height="31" viewBox="0 0 400 382"><path d="M0.000 183.023 L 0.000 366.046 46.377 366.046 L 92.754 366.046 92.754 312.629 L 92.754 259.213 127.223 259.213 C 174.433 259.213,187.432 257.146,210.766 245.926 C 311.105 197.681,301.344 41.358,195.859 7.193 C 173.603 -0.015,173.838 0.000,80.846 0.000 L 0.000 0.000 0.000 183.023 M157.615 88.195 C 193.007 97.413,198.827 152.678,166.407 171.674 C 158.993 176.019,155.494 176.398,122.807 176.398 L 92.754 176.398 92.754 131.677 L 92.754 86.957 122.807 86.957 C 146.807 86.957,153.819 87.206,157.615 88.195" stroke="none" fill="COLOR_1" fill-rule="evenodd"></path><path d="M226.647 3.824 C 258.085 21.580,282.721 54.248,291.095 89.281 C 292.183 93.834,293.041 95.659,294.560 96.655 C 310.880 107.348,312.400 140.701,297.286 156.464 C 293.685 160.221,293.134 161.348,291.162 169.006 C 282.026 204.468,259.916 235.185,230.701 253.002 C 229.548 253.705,235.510 262.261,270.237 309.731 L 311.131 365.631 355.565 365.846 L 400.000 366.060 400.000 348.309 L 400.000 330.557 364.338 285.630 L 328.676 240.703 333.494 238.892 C 373.356 223.907,395.248 189.691,399.313 136.020 C 404.504 67.495,372.510 19.710,311.375 4.675 C 294.592 0.548,287.694 -0.000,252.482 0.000 L 219.876 0.000 226.647 3.824 M202.899 265.964 C 183.869 272.635,168.536 274.960,139.752 275.540 L 116.770 276.003 116.770 321.024 L 116.770 366.046 163.975 366.046 L 211.180 366.046 211.180 314.700 C 211.180 286.460,210.901 263.386,210.559 263.425 C 210.217 263.464,206.770 264.607,202.899 265.964" stroke="none" fill="COLOR_2" fill-rule="evenodd"></path></svg>`;
const RepoListComponent = class PluginList extends BdApi.React.Component {
componentDidMount() {
componentDidMount () {
list = this;
BDFDB.TimeUtils.timeout(_ => {
forcedSort = null;
@ -127,7 +127,7 @@ module.exports = (_ => {
showOnlyOutdated = false;
}, 5000);
}
filterPlugins() {
filterPlugins () {
let plugins = Object.keys(loadedPlugins).map(url => {
let plugin = loadedPlugins[url];
let instPlugin = BDFDB.BDUtils.getPlugin(plugin.getName);
@ -157,7 +157,7 @@ module.exports = (_ => {
if (this.props.orderKey == "DESC") plugins.reverse();
return plugins;
}
render() {
render () {
let automaticLoading = BDFDB.BDUtils.getSettings(BDFDB.BDUtils.settingsIds.automaticLoading);
if (!this.props.tab) this.props.tab = "Plugins";
this.props.entries = (!loading.is && !BDFDB.ObjectUtils.isEmpty(loadedPlugins) ? this.filterPlugins() : []).map(plugin => BDFDB.ReactUtils.createElement(RepoCardComponent, {
@ -234,7 +234,7 @@ module.exports = (_ => {
};
const RepoCardComponent = class PluginCard extends BdApi.React.Component {
render() {
render () {
let buttonConfig = buttonData[(Object.entries(pluginStates).find(n => n[1] == this.props.plugin.state) || [])[0]];
return buttonConfig && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.AddonCard, {
icon: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
@ -385,10 +385,10 @@ module.exports = (_ => {
};
const RepoListHeaderComponent = class PluginListHeader extends BdApi.React.Component {
componentDidMount() {
componentDidMount () {
header = this;
}
render() {
render () {
if (!this.props.tab) this.props.tab = "Plugins";
return BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN._repolistheader,
@ -482,7 +482,7 @@ module.exports = (_ => {
};
return class PluginRepo extends Plugin {
onLoad() {
onLoad () {
_this = this;
loading = {is: false, timeout: null, amount: 0};
@ -517,7 +517,7 @@ module.exports = (_ => {
}
onStart() {
onStart () {
this.forceUpdateAll();
this.loadPlugins();
@ -525,7 +525,7 @@ module.exports = (_ => {
updateInterval = BDFDB.TimeUtils.interval(_ => {this.checkForNewPlugins();}, 1000*60*30);
}
onStop() {
onStop () {
BDFDB.TimeUtils.clear(updateInterval);
BDFDB.TimeUtils.clear(loading.timeout);
@ -623,14 +623,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
modalSettings = BDFDB.DataUtils.get(this, "modalSettings");
favorites = BDFDB.DataUtils.load(this, "favorites");
@ -698,7 +698,7 @@ module.exports = (_ => {
}
}
loadPlugins() {
loadPlugins () {
BDFDB.DOMUtils.remove(".pluginrepo-loadingicon");
let settings = BDFDB.DataUtils.load(this, "settings");
let getPluginInfo, extractConfigInfo, createSandbox, runInSandbox;
@ -977,7 +977,7 @@ module.exports = (_ => {
}
}
getLoadingTooltipText() {
getLoadingTooltipText () {
return `Loading PluginRepo - [${Object.keys(loadedPlugins).length}/${Object.keys(grabbedPlugins).length}]`;
}
@ -1008,7 +1008,7 @@ module.exports = (_ => {
return string;
}
checkForNewPlugins() {
checkForNewPlugins () {
BDFDB.LibraryRequires.request("https://mwittrien.github.io/BetterDiscordAddons/Plugins/PluginRepo/_res/PluginList.txt", (error, response, result) => {
if (response && !BDFDB.equals(result.replace(/\t|\r/g, "").split("\n").filter(n => n), grabbedPlugins)) {
loading = {is: false, timeout: null, amount: 0};

View File

@ -20,12 +20,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -44,9 +44,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -59,11 +59,11 @@ module.exports = (_ => {
}
} : (([Plugin, BDFDB]) => {
return class QuickMention extends Plugin {
onLoad() {}
onLoad () {}
onStart() {}
onStart () {}
onStop() {}
onStop () {}
onMessageOptionToolbar (e) {
if (!e.instance.props.expanded && e.instance.props.message.author.id != BDFDB.UserUtils.me.id && (BDFDB.UserUtils.can("SEND_MESSAGES") || e.instance.props.channel.type == BDFDB.DiscordConstants.ChannelTypes.DM || e.instance.props.channel.type == BDFDB.DiscordConstants.ChannelTypes.GROUP_DM)) e.returnvalue.props.children.unshift(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {

View File

@ -20,12 +20,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -44,9 +44,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -62,7 +62,7 @@ module.exports = (_ => {
var settings = {};
return class ReadAllNotificationsButton extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
addClearButton: {value: true, inner: false, description: "Add a 'Clear Mentions' button to the recent mentions popout"},
@ -109,14 +109,14 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
let loadedBlacklist = BDFDB.DataUtils.load(this, "blacklist");
this.saveBlacklist(!BDFDB.ArrayUtils.is(loadedBlacklist) ? [] : loadedBlacklist);
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -181,14 +181,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
BDFDB.PatchUtils.forceAllUpdates(this);
@ -342,7 +342,7 @@ module.exports = (_ => {
BDFDB.DataUtils.save(savedBlacklist, this, "blacklist");
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -66,7 +66,7 @@ module.exports = (_ => {
var settings = {};
return class RemoveBlockedMessages extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
disableNotifications: {value: true, inner: true, description: "Messages Notifications"},
@ -109,7 +109,7 @@ module.exports = (_ => {
this.patchPriority = 8;
}
onStart() {
onStart () {
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.UnreadChannelUtils, "hasUnread", {after: e => {
if (e.returnValue && settings.disableNotifications) {
let count = BDFDB.LibraryModules.UnreadChannelUtils.getUnreadCount(e.methodArguments[0]);
@ -170,7 +170,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -191,14 +191,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
BDFDB.PatchUtils.forceAllUpdates(this);

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -66,7 +66,7 @@ module.exports = (_ => {
var settings = {};
return class RemoveNicknames extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
replaceOwn: {value: false, inner: false, description: "Replace your own name: "},
@ -102,11 +102,11 @@ module.exports = (_ => {
};
}
onStart() {
onStart () {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -135,7 +135,7 @@ module.exports = (_ => {
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
BDFDB.PatchUtils.forceAllUpdates(this);

View File

@ -20,12 +20,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -44,9 +44,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -59,11 +59,11 @@ module.exports = (_ => {
}
} : (([Plugin, BDFDB]) => {
return class RevealAllSpoilersOption extends Plugin {
onLoad() {}
onLoad () {}
onStart() {}
onStart () {}
onStop() {}
onStop () {}
onMessageContextMenu (e) {
if (e.instance.props.message && e.instance.props.target) {

View File

@ -20,12 +20,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -44,9 +44,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -61,7 +61,7 @@ module.exports = (_ => {
const messageDelay = 1000; //changing at own risk, might result in bans or mutes
return class SendLargeMessages extends Plugin {
onLoad() {
onLoad () {
this.patchedModules = {
before: {
ChannelTextAreaForm: "render",
@ -73,11 +73,11 @@ module.exports = (_ => {
};
}
onStart() {
onStart () {
BDFDB.PatchUtils.forceAllUpdates(this);
}
onStop() {
onStop () {
BDFDB.PatchUtils.forceAllUpdates(this);
}
@ -168,7 +168,7 @@ module.exports = (_ => {
return messages;
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -64,7 +64,7 @@ module.exports = (_ => {
}
} : (([Plugin, BDFDB]) => {
return class ServerCounter extends Plugin {
onLoad() {
onLoad () {
this.patchedModules = {
after: {
Guilds: "render"
@ -72,11 +72,11 @@ module.exports = (_ => {
};
}
onStart() {
onStart () {
BDFDB.PatchUtils.forceAllUpdates(this);
}
onStop() {
onStop () {
BDFDB.PatchUtils.forceAllUpdates(this);
}

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -71,14 +71,14 @@ module.exports = (_ => {
super(props);
this.state = {fetchedOwner: false, delayed: false, repositioned: false};
}
componentDidUpdate() {
componentDidUpdate () {
if (amounts.tooltipDelay && this.state.delayed && !this.state.repositioned) {
this.state.repositioned = true;
let tooltip = BDFDB.DOMUtils.getParent(BDFDB.dotCN.tooltip, BDFDB.ObjectUtils.get(this, `${BDFDB.ReactUtils.instanceKey}.return.return.stateNode.containerInfo`));
if (tooltip) tooltip.update();
}
}
render() {
render () {
if (amounts.tooltipDelay && !this.state.delayed) {
BDFDB.TimeUtils.timeout(_ => {
this.state.delayed = true;
@ -144,7 +144,7 @@ module.exports = (_ => {
};
const GuildDetailsRowComponent = class GuildDetailsRow extends BdApi.React.Component {
render() {
render () {
return (this.props.prefix.length + this.props.string.length) > Math.round(34 * (amounts.tooltipWidth/300)) ? [
BDFDB.ReactUtils.createElement("div", {
children: `${this.props.prefix}:`
@ -159,7 +159,7 @@ module.exports = (_ => {
};
return class ServerDetails extends Plugin {
onLoad() {
onLoad () {
_this = this;
this.defaults = {
@ -224,7 +224,7 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
BDFDB.PatchUtils.patch(this, BDFDB.LibraryComponents.GuildComponents.Guild.prototype, "render", {after: e => {
this.processGuild({instance: e.thisObject, returnvalue: e.returnValue, methodname: "render"});
}});
@ -239,7 +239,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
BDFDB.DOMUtils.removeLocalStyle(this.name + "TooltipWidth");
@ -420,14 +420,14 @@ module.exports = (_ => {
});
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
colors = BDFDB.DataUtils.get(this, "colors");
choices = BDFDB.DataUtils.get(this, "choices");
@ -526,7 +526,7 @@ module.exports = (_ => {
return charArray.join("");
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -20,12 +20,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -44,9 +44,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -81,10 +81,10 @@ module.exports = (_ => {
var folderGuildContent = null;
const folderGuildContentComponent = class FolderGuildsContent extends BdApi.React.Component {
componentDidMount() {
componentDidMount () {
folderGuildContent = this;
}
render() {
render () {
let closing = this.props.closing;
delete this.props.closing;
let folders = Array.from(BDFDB.LibraryModules.FolderUtils.getExpandedFolders()).map(folderId => BDFDB.LibraryModules.FolderStore.getGuildFolderById(folderId)).filter(folder => folder && folder.guildIds);
@ -196,7 +196,7 @@ module.exports = (_ => {
};
const folderIconPickerComponent = class FolderIconPicker extends BdApi.React.Component {
render() {
render () {
let folderIcons = _this.loadAllIcons();
for (let id in folderIcons) if (!folderIcons[id].customID) {
folderIcons[id].openicon = _this.createBase64SVG(folderIcons[id].openicon);
@ -247,13 +247,13 @@ module.exports = (_ => {
var redCross = `'data:image/svg+xml; base64, PHN2ZyB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSI0MDAiIGhlaWdodD0iNDAwIj48cGF0aCBkPSJNNDAuNDAwIDE3LjE3OCBDIDM5Ljg1MCAxNy4zNjYsMzguNzkzIDE3LjUzOCwzOC4wNTAgMTcuNTYwIEMgMzMuMzUxIDE3LjY5OSwyMy4zOTcgMjQuNzg4LDIxLjM4MSAyOS40MzIgQyAyMS4wODcgMzAuMTA5LDIwLjU2NiAzMC44OTYsMjAuMjIzIDMxLjE4MSBDIDE5Ljg4MCAzMS40NjUsMTkuNjAwIDMxLjg2NiwxOS42MDAgMzIuMDcxIEMgMTkuNjAwIDMyLjI3NiwxOS4yMzYgMzMuMjQyLDE4Ljc5MiAzNC4yMTggQyAxNi4zNDUgMzkuNTg5LDE2LjM0NSA0OS42MTEsMTguNzkyIDU0Ljk4MiBDIDE5LjIzNiA1NS45NTgsMTkuNjAwIDU2LjkxOCwxOS42MDAgNTcuMTE2IEMgMTkuNjAwIDU3LjMxNCwxOS45NjAgNTcuODAyLDIwLjQwMCA1OC4yMDAgQyAyMC44NDAgNTguNTk4LDIxLjIwMCA1OS4xMzEsMjEuMjAwIDU5LjM4NSBDIDIxLjIwMCA2MC4zOTEsMjUuNjgwIDY0Ljk0Miw5MS41MDUgMTMwLjgwMCBDIDEyOC45OTUgMTY4LjMxMCwxNTkuODQ5IDE5OS4zMjYsMTYwLjA2OCAxOTkuNzI0IEMgMTYwLjQwOSAyMDAuMzQ0LDE1MC45NTAgMjA5Ljk2NCw5My45ODkgMjY2LjkyNCBDIDE4Ljc5OCAzNDIuMTEzLDE5LjYwMCAzNDEuMjkyLDE5LjYwMCAzNDMuMTI2IEMgMTkuNjAwIDM0My4yODMsMTkuMjUwIDM0NC4wNjUsMTguODIyIDM0NC44NjQgQyAxNS40MjkgMzUxLjE5NSwxNS45NTggMzYyLjkxOCwxOS45MzIgMzY5LjQ0MCBDIDIyLjA5NCAzNzIuOTkwLDI3LjQ3NCAzNzguODAwLDI4LjU5OCAzNzguODAwIEMgMjguODYxIDM3OC44MDAsMjkuNDAyIDM3OS4xNjAsMjkuODAwIDM3OS42MDAgQyAzMC4xOTggMzgwLjA0MCwzMC43MDMgMzgwLjQwMCwzMC45MjIgMzgwLjQwMCBDIDMxLjE0MSAzODAuNDAwLDMyLjIzOCAzODAuODMxLDMzLjM2MCAzODEuMzU4IEMgMzQuNDgyIDM4MS44ODYsMzYuNDgwIDM4Mi41MzMsMzcuODAwIDM4Mi43OTcgQyA0My43ODYgMzgzLjk5NCw0NC4zMjMgMzg0LjAyNyw0Ny4yOTkgMzgzLjM4NiBDIDQ4Ljg5NSAzODMuMDQyLDUxLjAxMCAzODIuNjE5LDUyLjAwMCAzODIuNDQ2IEMgNTIuOTkwIDM4Mi4yNzQsNTQuNTE3IDM4MS43NDMsNTUuMzk0IDM4MS4yNjYgQyA1Ni4yNzEgMzgwLjc5MCw1Ny4xODggMzgwLjQwMCw1Ny40MzIgMzgwLjQwMCBDIDU3LjY3NiAzODAuNDAwLDU4LjIwMiAzODAuMDQwLDU4LjYwMCAzNzkuNjAwIEMgNTguOTk4IDM3OS4xNjAsNTkuNTk4IDM3OC44MDAsNTkuOTMyIDM3OC44MDAgQyA2MC4yNjcgMzc4LjgwMCw5MS43MjUgMzQ3LjYxNSwxMjkuODM5IDMwOS41MDAgQyAxNjkuMDU3IDI3MC4yODEsMTk5LjQ5NiAyNDAuMTQ1LDE5OS45NjQgMjQwLjA3MyBDIDIwMC42MDIgMjM5Ljk3NSwyMTYuMDAxIDI1NS4xOTMsMjY3LjQ5NSAzMDYuODE0IEMgMzI3LjA0NiAzNjYuNTExLDMzOS41MzEgMzc4LjgwMCwzNDAuNjI3IDM3OC44MDAgQyAzNDAuNzk4IDM3OC44MDAsMzQxLjI2NSAzNzkuMDk3LDM0MS42NjcgMzc5LjQ2MSBDIDM0NS43MjggMzgzLjEzNiwzNjEuMDEzIDM4NC40MDksMzY1LjY4NSAzODEuNDYxIEMgMzY2LjE4OCAzODEuMTQzLDM2Ny4wMjQgMzgwLjc1NywzNjcuNTQxIDM4MC42MDIgQyAzNzAuNTgzIDM3OS42OTEsMzc2LjYyMyAzNzQuMjAwLDM3OS4zODIgMzY5LjgzNiBDIDM4NS4xMDUgMzYwLjc4NSwzODQuMDM5IDM0Ni40MDksMzc3LjAzOSAzMzguMjI4IEMgMzc2LjA4NCAzMzcuMTEzLDM0NC44NDYgMzA1Ljc0MywzMDcuNjIxIDI2OC41MTcgQyAyNTUuMzI5IDIxNi4yMjQsMjM5Ljk2OSAyMDAuNjQ3LDI0MC4wNzAgMjAwLjAwOSBDIDI0MC4xNDMgMTk5LjU0NSwyNzAuMDYyIDE2OS4yODgsMzA4LjIxNiAxMzEuMDkxIEMgMzQ1LjYyNSA5My42NDEsMzc2LjcyMyA2Mi4zNzAsMzc3LjMyNCA2MS42MDAgQyAzODQuMjg2IDUyLjY3OCwzODUuMDM2IDQwLjYyMSwzNzkuMjc3IDMwLjE3MSBDIDM3Ni4xMzYgMjQuNDY5LDM2Ny45MDYgMTguNTM3LDM2MS42NjggMTcuNDc3IEMgMzU0LjY1NiAxNi4yODYsMzQ1LjA5NSAxNy42NjUsMzQxLjg4MyAyMC4zMzEgQyAzNDEuNTY3IDIwLjU5NCwzNDAuNTQ5IDIxLjMxOCwzMzkuNjIyIDIxLjk0MSBDIDMzOC42OTUgMjIuNTYzLDMwNy4wMzEgNTMuOTcyLDI2OS4yNTkgOTEuNzM3IEMgMjMxLjQ4NiAxMjkuNTAxLDIwMC4zMzAgMTYwLjQwMCwyMDAuMDIyIDE2MC40MDAgQyAxOTkuNzE0IDE2MC40MDAsMTY4LjkzOCAxMjkuODY5LDEzMS42MzEgOTIuNTU0IEMgNTYuMjI1IDE3LjEzMSw2MC4yODggMjEuMDQ3LDU1LjIwMCAxOC44ODcgQyA1MS41OTEgMTcuMzU0LDQyLjgzNiAxNi4zNDMsNDAuNDAwIDE3LjE3OHoiIGZpbGw9InJnYigyNDAsIDcxLCA3MSkiPjwvcGF0aD48L3N2Zz4='`;
const folderIconCustomPreviewComponent = class FolderIconCustomPreview extends BdApi.React.Component {
componentDidMount() {
componentDidMount () {
this._previewInterval = BDFDB.TimeUtils.interval(_ => {
this.props.tick = !this.props.tick;
BDFDB.ReactUtils.forceUpdate(this);
}, 2000);
}
componentWillUnmount() {
componentWillUnmount () {
BDFDB.TimeUtils.clear(this._previewInterval);
}
checkImage(base64OrUrl, callback) {
@ -294,7 +294,7 @@ module.exports = (_ => {
img.src = base64;
}
}
render() {
render () {
return [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: _this.labels.modal_customopen,
@ -377,7 +377,7 @@ module.exports = (_ => {
};
return class ServerFolders extends Plugin {
onLoad() {
onLoad () {
_this = this;
folderStates = {};
@ -470,7 +470,7 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
let forceClosing = false;
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.GuildUtils, "toggleGuildFolderExpand", {after: e => {
if (settings.closeOtherFolders && !forceClosing) {
@ -483,13 +483,13 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
BDFDB.DOMUtils.removeClassFromDOM(BDFDB.disCN._serverfoldersfoldercontentisopen);
}
onSwitch() {
onSwitch () {
if (typeof BDFDB === "object" && settings.forceOpenFolder) {
let folder = BDFDB.GuildUtils.getFolder(BDFDB.LibraryModules.LastGuildStore.getGuildId());
if (folder && !BDFDB.LibraryModules.FolderUtils.isFolderExpanded(folder.folderId)) BDFDB.LibraryModules.GuildUtils.toggleGuildFolderExpand(folder.folderId);
@ -532,7 +532,7 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
folderStates = {};
@ -540,7 +540,7 @@ module.exports = (_ => {
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
folderConfigs = BDFDB.DataUtils.load(this, "folders");
customIcons = BDFDB.DataUtils.load(this, "customicons");
@ -944,7 +944,7 @@ module.exports = (_ => {
}
}
loadAllIcons() {
loadAllIcons () {
let icons = {};
folderIcons.forEach((array, i) => {
icons[i] = {
@ -1160,7 +1160,7 @@ module.exports = (_ => {
dragpreview.style.setProperty("top", event.clientY - 25 + "px", "important");
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -64,7 +64,7 @@ module.exports = (_ => {
}
} : (([Plugin, BDFDB]) => {
return class ServerHider extends Plugin {
onLoad() {
onLoad () {
this.patchedModules = {
after: {
Guilds: "render"
@ -72,7 +72,7 @@ module.exports = (_ => {
};
}
onStart() {
onStart () {
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.FolderStore, "getGuildFolderById", {after: e => {
let hiddenGuildIds = BDFDB.DataUtils.load(this, "hidden", "servers") || [];
if (e.returnValue && hiddenGuildIds.length) {
@ -86,7 +86,7 @@ module.exports = (_ => {
BDFDB.PatchUtils.forceAllUpdates(this);
}
onStop() {
onStop () {
BDFDB.PatchUtils.forceAllUpdates(this);
}
@ -205,7 +205,7 @@ module.exports = (_ => {
}
}
showHideModal() {
showHideModal () {
let hiddenGuildIds = BDFDB.DataUtils.load(this, "hidden", "servers") || [];
let hiddenFolderIds = BDFDB.DataUtils.load(this, "hidden", "folders") || [];
let guilds = BDFDB.LibraryModules.FolderStore.guildFolders.map(n => n.guildIds).flat(10).map(guildId => BDFDB.LibraryModules.GuildStore.getGuild(guildId)).filter(n => n);
@ -309,7 +309,7 @@ module.exports = (_ => {
BDFDB.PatchUtils.forceAllUpdates(this);
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -91,7 +91,7 @@ module.exports = (_ => {
};
const userRowComponent = class UserRow extends BdApi.React.Component {
componentDidMount() {
componentDidMount () {
if (this.props.user.fetchable) {
this.props.user.fetchable = false;
BDFDB.LibraryModules.UserFetchUtils.getUser(this.props.user.id).then(fetchedUser => {
@ -100,7 +100,7 @@ module.exports = (_ => {
});
}
}
render() {
render () {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ListRow, {
prefix: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.AvatarComponents.default, {
className: BDFDB.disCN.listavatar,
@ -124,7 +124,7 @@ module.exports = (_ => {
};
const roleRowComponent = class RoleRow extends BdApi.React.Component {
render() {
render () {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ListRow, {
prefix: BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCNS.avataricon + BDFDB.disCNS.listavatar + BDFDB.disCNS.avatariconsizemedium + BDFDB.disCN.avatariconinactive,
@ -151,7 +151,7 @@ module.exports = (_ => {
};
return class ShowHiddenChannels extends Plugin {
onLoad() {
onLoad () {
overrideTypes = Object.keys(BDFDB.DiscordConstants.PermissionOverrideType);
this.defaults = {
@ -184,7 +184,7 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
let loadedBlacklist = BDFDB.DataUtils.load(this, "blacklist");
this.saveBlacklist(!BDFDB.ArrayUtils.is(loadedBlacklist) ? [] : loadedBlacklist);
@ -229,7 +229,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -283,14 +283,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
hiddenChannelCache = {};
@ -579,7 +579,7 @@ module.exports = (_ => {
});
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -19,12 +19,12 @@ module.exports = (_ => {
}
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -43,9 +43,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -61,7 +61,7 @@ module.exports = (_ => {
var settings = {}, choices = {}, amounts = {};
return class SpellCheck extends Plugin {
onLoad() {
onLoad () {
languages = {};
dictionaries = {};
langDictionaries = {};
@ -95,7 +95,7 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
BDFDB.LibraryRequires.request("https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/SpellCheck/dic", (error, response, body) => {
let dictionaryLanguageIds = Array.from(BDFDB.DOMUtils.create(body).querySelectorAll(`[href*="/mwittrien/BetterDiscordAddons/blob/master/Plugins/SpellCheck/dic/"]`)).map(n => n.innerText.split(".")[0]).filter(n => n);
languages = BDFDB.ObjectUtils.filter(BDFDB.LanguageUtils.languages, langId => dictionaryLanguageIds.includes(langId), true);
@ -114,7 +114,7 @@ module.exports = (_ => {
});
}
onStop() {
onStop () {
this.forceUpdateAll();
BDFDB.DOMUtils.remove(BDFDB.dotCN._spellcheckoverlay);
@ -182,14 +182,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
choices = BDFDB.DataUtils.get(this, "choices");
amounts = BDFDB.DataUtils.get(this, "amounts");
@ -456,7 +456,7 @@ module.exports = (_ => {
else return language.name + (language.ownlang && language.name != language.ownlang ? ` / ${language.ownlang}` : "");
}
setLabelsByLanguage() {
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {
case "bg": // Bulgarian
return {

View File

@ -20,12 +20,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -44,9 +44,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -71,7 +71,7 @@ module.exports = (_ => {
];
const SpotifyControlsComponent = class SpotifyControls extends BdApi.React.Component {
componentDidMount() {
componentDidMount () {
controls = this;
}
request(socket, device, type, data) {
@ -110,7 +110,7 @@ module.exports = (_ => {
});
});
}
render() {
render () {
let socketDevice = BDFDB.LibraryModules.SpotifyTrackUtils.getActiveSocketAndDevice();
if (!socketDevice) return null;
if (this.props.song) {
@ -321,7 +321,7 @@ module.exports = (_ => {
}
};
const SpotifyControlsButtonComponent = class SpotifyControlsButton extends BdApi.React.Component {
render() {
render () {
if (!this.props.playerSize || !buttonConfigs[this.props.type] || !buttonConfigs[this.props.type][this.props.playerSize]) return null;
let button = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Button, BDFDB.ObjectUtils.exclude(Object.assign({}, this.props, {
className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.accountinfobutton, this.props.disabled ? BDFDB.disCN.accountinfobuttondisabled : BDFDB.disCN.accountinfobuttonenabled, this.props.active && BDFDB.disCN._spotifycontrolsbuttonactive),
@ -343,7 +343,7 @@ module.exports = (_ => {
}
};
const SpotifyControlsTimelineComponent = class SpotifyControlsTimeline extends BdApi.React.Component {
componentDidMount() {
componentDidMount () {
BDFDB.TimeUtils.clear(updateInterval);
updateInterval = BDFDB.TimeUtils.interval(_ => {
if (!this.updater || typeof this.updater.isMounted != "function" || !this.updater.isMounted(this)) BDFDB.TimeUtils.clear(updateInterval);
@ -360,7 +360,7 @@ module.exports = (_ => {
let hours = Math.floor((time / (1000 * 60 * 60)) % 24);
return `${hours > 0 ? hours + ":" : ""}${hours > 0 && minutes < 10 ? "0" + minutes : minutes}:${seconds < 10 ? "0" + seconds : seconds}`
}
render() {
render () {
let maxTime = this.props.song.timestamps.end - this.props.song.timestamps.start;
let currentTime = (!playbackState.is_playing && stopTime ? stopTime : new Date()) - this.props.song.timestamps.start;
currentTime = currentTime > maxTime ? maxTime : currentTime;
@ -407,7 +407,7 @@ module.exports = (_ => {
};
return class SpotifyControls extends Plugin {
onLoad() {
onLoad () {
_this = this;
this.defaults = {
@ -600,7 +600,7 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.SpotifyTrackUtils, "getActivity", {after: e => {
if (e.methodArguments[0] !== false) {
if (e.returnValue && e.returnValue.name == "Spotify") this.updatePlayer(e.returnValue);
@ -634,7 +634,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
if (typeof insertPatchCancel == "function") insertPatchCancel();
@ -700,14 +700,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
buttonConfigs = BDFDB.DataUtils.get(this, "buttonConfigs");

View File

@ -20,12 +20,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -44,9 +44,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -65,7 +65,7 @@ module.exports = (_ => {
};
return class SteamProfileLink extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
useChromium: {value: false, description: "Use inbuilt browser instead of default if fails to open Steam"}
@ -73,7 +73,7 @@ module.exports = (_ => {
};
}
onStart() {
onStart () {
for (let key in urls) BDFDB.ListenerUtils.add(this, document, "click", urls[key].map(url => url.indexOf("http") == 0 ? `a[href^="${url}"]` : `a[href*="${url}"][href*="${key}"]`).join(", "), e => {
this.openIn(e, key, e.currentTarget.href);
});
@ -81,7 +81,7 @@ module.exports = (_ => {
this.forceUpdateAll();
}
onStop() {}
onStop () {}
getSettingsPanel (collapseStates = {}) {
let settingsPanel, settingsItems = [];
@ -99,14 +99,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
}

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -119,7 +119,7 @@ module.exports = (_ => {
const themeRepoIcon = `<svg width="36" height="31" viewBox="20 0 400 332"><path d="M0.000 39.479 L 0.000 78.957 43.575 78.957 L 87.151 78.957 87.151 204.097 L 87.151 329.236 129.609 329.236 L 172.067 329.236 172.067 204.097 L 172.067 78.957 215.642 78.957 L 259.218 78.957 259.218 39.479 L 259.218 0.000 129.609 0.000 L 0.000 0.000 0.000 39.479" stroke="none" fill="COLOR_1" fill-rule="evenodd"></path><path d="M274.115 38.624 L 274.115 77.248 280.261 77.734 C 309.962 80.083,325.986 106.575,313.378 132.486 C 305.279 149.131,295.114 152.700,255.800 152.700 L 230.168 152.700 230.168 123.277 L 230.168 93.855 208.566 93.855 L 186.965 93.855 186.965 211.546 L 186.965 329.236 208.566 329.236 L 230.168 329.236 230.168 277.068 L 230.168 224.899 237.268 225.113 L 244.368 225.326 282.215 277.095 L 320.062 328.864 360.031 329.057 L 400.000 329.249 400.000 313.283 L 400.000 297.317 367.924 256.908 L 335.848 216.499 340.182 214.869 C 376.035 201.391,395.726 170.616,399.382 122.342 C 405.008 48.071,360.214 0.000,285.379 0.000 L 274.115 0.000 274.115 38.624" stroke="none" fill="COLOR_2" fill-rule="evenodd"></path></svg>`;
const RepoListComponent = class ThemeList extends BdApi.React.Component {
componentDidMount() {
componentDidMount () {
list = this;
BDFDB.TimeUtils.timeout(_ => {
forcedSort = null;
@ -127,13 +127,13 @@ module.exports = (_ => {
showOnlyOutdated = false;
}, 5000);
}
componentWillUnmount() {
componentWillUnmount () {
if (preview) {
BDFDB.WindowUtils.close(preview);
preview = null;
}
}
filterThemes() {
filterThemes () {
let themes = Object.keys(loadedThemes).map(url => {
let theme = loadedThemes[url];
let instTheme = BDFDB.BDUtils.getTheme(theme.name);
@ -165,7 +165,7 @@ module.exports = (_ => {
if (this.props.orderKey == "DESC") themes.reverse();
return themes;
}
openPreview() {
openPreview () {
preview = BDFDB.WindowUtils.open(this, "https://mwittrien.github.io/BetterDiscordAddons/Plugins/_res/DiscordPreview.html", {
alwaysOnTop: settings.keepOnTop,
showOnReady: true,
@ -224,7 +224,7 @@ module.exports = (_ => {
}
});
}
render() {
render () {
let automaticLoading = BDFDB.BDUtils.getSettings(BDFDB.BDUtils.settingsIds.automaticLoading);
if (!this.props.tab) this.props.tab = "Themes";
this.props.entries = (!loading.is && !BDFDB.ObjectUtils.isEmpty(loadedThemes) ? this.filterThemes() : []).map(theme => BDFDB.ReactUtils.createElement(RepoCardComponent, {
@ -503,7 +503,7 @@ module.exports = (_ => {
};
const RepoCardComponent = class ThemeCard extends BdApi.React.Component {
render() {
render () {
let buttonConfig = buttonData[(Object.entries(themeStates).find(n => n[1] == this.props.theme.state) || [])[0]];
return buttonConfig && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.AddonCard, {
icon: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
@ -677,10 +677,10 @@ module.exports = (_ => {
};
const RepoListHeaderComponent = class ThemeListHeader extends BdApi.React.Component {
componentDidMount() {
componentDidMount () {
header = this;
}
render() {
render () {
if (!this.props.tab) this.props.tab = "Themes";
return BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN._repolistheader,
@ -773,7 +773,7 @@ module.exports = (_ => {
}
};
return class ThemeRepo extends Plugin {
onLoad() {
onLoad () {
_this = this;
loading = {is: false, timeout: null, amount: 0};
@ -809,7 +809,7 @@ module.exports = (_ => {
};
}
onStart() {
onStart () {
this.forceUpdateAll();
this.loadThemes();
@ -817,7 +817,7 @@ module.exports = (_ => {
updateInterval = BDFDB.TimeUtils.interval(_ => {this.checkForNewThemes();}, 1000*60*30);
}
onStop() {
onStop () {
BDFDB.TimeUtils.clear(updateInterval);
BDFDB.TimeUtils.clear(loading.timeout);
@ -916,14 +916,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
modalSettings = BDFDB.DataUtils.get(this, "modalSettings");
favorites = BDFDB.DataUtils.load(this, "favorites");
@ -1017,7 +1017,7 @@ module.exports = (_ => {
return fullCSS;
}
loadThemes() {
loadThemes () {
BDFDB.DOMUtils.remove(".themerepo-loadingicon");
let getThemeInfo, outdated = 0, newEntries = 0, i = 0;
let tags = ["name", "description", "author", "version"];
@ -1192,11 +1192,11 @@ module.exports = (_ => {
}
}
getLoadingTooltipText() {
getLoadingTooltipText () {
return `Loading ThemeRepo - [${Object.keys(loadedThemes).length}/${Object.keys(grabbedThemes).length}]`;
}
checkForNewThemes() {
checkForNewThemes () {
BDFDB.LibraryRequires.request("https://mwittrien.github.io/BetterDiscordAddons/Plugins/ThemeRepo/_res/ThemeList.txt", (error, response, result) => {
if (response && !BDFDB.equals(result.replace(/\t|\r/g, "").split("\n").filter(n => n), grabbedThemes)) {
loading = {is: false, timeout: null, amount: 0};

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -68,11 +68,11 @@ module.exports = (_ => {
var dir;
return class ThemeSettings extends Plugin {
onLoad() {
onLoad () {
dir = BDFDB.BDUtils.getThemesFolder();
}
onStart() {
onStart () {
let cardObserver = (new MutationObserver(changes => {changes.forEach(change => {if (change.addedNodes) {change.addedNodes.forEach(node => {
if (BDFDB.DOMUtils.containsClass(node, BDFDB.disCN._repocard)) this.appendSettingsButton(node);
if (node.nodeType != Node.TEXT_NODE) for (let child of node.querySelectorAll(BDFDB.dotCN._repocard)) this.appendSettingsButton(child);
@ -84,7 +84,7 @@ module.exports = (_ => {
for (let child of document.querySelectorAll(BDFDB.dotCN._repocard)) this.appendSettingsButton(child);
}
onStop() {
onStop () {
BDFDB.DOMUtils.remove(".theme-settings-button");
}

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -67,7 +67,7 @@ module.exports = (_ => {
var settings = {}, values = {};
return class TimedLightDarkMode extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
running: {value: true}
@ -85,7 +85,7 @@ module.exports = (_ => {
};
}
onStart() {
onStart () {
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.SettingsUtils, "updateLocalSettings", {after: e => {
if (BDFDB.ObjectUtils.is(e.methodArguments[0]) && e.methodArguments[0].theme) {
BDFDB.TimeUtils.clear(changeTimeout);
@ -101,7 +101,7 @@ module.exports = (_ => {
BDFDB.PatchUtils.forceAllUpdates(this);
}
onStop() {
onStop () {
BDFDB.TimeUtils.clear(checkInterval);
BDFDB.DOMUtils.remove(BDFDB.dotCN._timedlightdarkmodetimersettings);
@ -145,7 +145,7 @@ module.exports = (_ => {
}
}
startInterval() {
startInterval () {
BDFDB.TimeUtils.clear(checkInterval);
settings = BDFDB.DataUtils.get(this, "settings");
values = BDFDB.DataUtils.get(this, "values");

View File

@ -25,12 +25,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -49,9 +49,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -66,7 +66,7 @@ module.exports = (_ => {
var settings = {};
return class TopRoleEverywhere extends Plugin {
onLoad() {
onLoad () {
this.defaults = {
settings: {
showInChat: {value: true, inner: true, description: "Chat Window"},
@ -123,11 +123,11 @@ module.exports = (_ => {
`;
}
onStart() {
onStart () {
this.forceUpdateAll();
}
onStop() {
onStop () {
this.forceUpdateAll();
}
@ -156,14 +156,14 @@ module.exports = (_ => {
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, settingsItems);
}
onSettingsClosed() {
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
forceUpdateAll() {
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
BDFDB.PatchUtils.forceAllUpdates(this);

View File

@ -20,12 +20,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -44,9 +44,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -59,7 +59,7 @@ module.exports = (_ => {
}
} : (([Plugin, BDFDB]) => {
return class UserNotes extends Plugin {
onLoad() {
onLoad () {
this.css = `
.${this.name}-modal textarea {
height: 50vh;
@ -67,9 +67,9 @@ module.exports = (_ => {
`;
}
onStart() {}
onStart () {}
onStop() {}
onStop () {}
getSettingsPanel (collapseStates = {}) {
let settingsPanel, settingsItems = [];

View File

@ -20,12 +20,12 @@ module.exports = (_ => {
};
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.author;}
getVersion() {return config.info.version;}
getDescription() {return config.info.description;}
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return config.info.description;}
load() {
load () {
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
@ -44,9 +44,9 @@ module.exports = (_ => {
}
if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name);
}
start() {this.load();}
stop() {}
getSettingsPanel() {
start () {this.load();}
stop () {}
getSettingsPanel () {
let template = document.createElement("template");
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The library plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
template.content.firstElementChild.querySelector("a").addEventListener("click", _ => {
@ -59,7 +59,7 @@ module.exports = (_ => {
}
} : (([Plugin, BDFDB]) => {
return class WriteUpperCase extends Plugin {
onLoad() {
onLoad () {
this.patchedModules = {
before: {
ChannelEditorContainer: "render"
@ -67,11 +67,11 @@ module.exports = (_ => {
};
}
onStart() {
onStart () {
BDFDB.PatchUtils.forceAllUpdates(this);
}
onStop() {
onStop () {
BDFDB.PatchUtils.forceAllUpdates(this);
}