diff --git a/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js b/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js index 9da5e950ce..4f989aeac4 100644 --- a/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js +++ b/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js @@ -125,7 +125,7 @@ class BadgesEverywhere { getSettingsPanel () { if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return; - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var badges = BDFDB.DataUtils.get(this, "badges"); var indicators = BDFDB.DataUtils.get(this, "indicators"); var settingsitems = [], inneritems = []; @@ -213,19 +213,19 @@ class BadgesEverywhere { // begin of own functions processMemberListItem (instance, wrapper, returnvalue) { - if (instance.props && BDFDB.DataUtils.get(this, "settings")) this.addBadges(instance.props.user, wrapper.querySelector(BDFDB.dotCN.namecontainernamewrapper), "list", "showInMemberList"); + if (instance.props && BDFDB.DataUtils.get(this, "settings", "showInMemberList")) this.addBadges(instance.props.user, wrapper.querySelector(BDFDB.dotCN.namecontainernamewrapper), "list"); } processMessageUsername (instance, wrapper, returnvalue) { let message = BDFDB.ReactUtils.getValue(instance, "props.message"); if (message) { let username = wrapper.querySelector(BDFDB.dotCN.messageusername); - if (username && BDFDB.DataUtils.get(this, "settings")) this.addBadges(message.author, wrapper, "chat", "showInChat"); + if (username && BDFDB.DataUtils.get(this, "settings", "showInChat")) this.addBadges(message.author, wrapper, "chat"); } } processUserPopout (instance, wrapper, returnvalue) { - if (instance.props && BDFDB.DataUtils.get(this, "settings")) this.addBadges(instance.props.user, wrapper.querySelector(BDFDB.dotCN.userpopoutheadertext), "popout", "showInPopout"); + if (instance.props && BDFDB.DataUtils.get(this, "settings", "showInPopout")) this.addBadges(instance.props.user, wrapper.querySelector(BDFDB.dotCN.userpopoutheadertext), "popout"); } processStandardSidebarView (instance, wrapper, returnvalue) { @@ -258,8 +258,10 @@ class BadgesEverywhere { } else if (!this.loadedusers[info.id]) { this.requestedusers[info.id].push([wrapper,type]); - }); - else this.addToWrapper(info, wrapper, type); + } + else { + this.addToWrapper(info, wrapper, type); + } } addToWrapper (info, wrapper, type) { diff --git a/Plugins/BetterSearchPage/BetterSearchPage.plugin.js b/Plugins/BetterSearchPage/BetterSearchPage.plugin.js index 61513bc8da..d86f9fbdc8 100644 --- a/Plugins/BetterSearchPage/BetterSearchPage.plugin.js +++ b/Plugins/BetterSearchPage/BetterSearchPage.plugin.js @@ -69,7 +69,7 @@ class BetterSearchPage { getSettingsPanel () { if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return; - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var settingshtml = `
${this.name}
`; for (let key in settings) { settingshtml += `

${this.defaults.settings[key].description}

`; diff --git a/Plugins/ChatAliases/ChatAliases.plugin.js b/Plugins/ChatAliases/ChatAliases.plugin.js index cfe8cf3f69..05b50c1d62 100644 --- a/Plugins/ChatAliases/ChatAliases.plugin.js +++ b/Plugins/ChatAliases/ChatAliases.plugin.js @@ -95,7 +95,7 @@ class ChatAliases { getSettingsPanel () { if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return; - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var amounts = BDFDB.DataUtils.get(this, "amounts"); var settingshtml = `
${this.name}
`; for (let key in settings) { @@ -290,17 +290,17 @@ class ChatAliases { onNativeContextMenu (instance, menu, returnvalue) { if (instance.props && instance.props.value && instance.props.value.trim() && !menu.querySelector(`${this.name}-contextMenuItem`)) { - if ((instance.props.type == "NATIVE_TEXT" || instance.props.type == "CHANNEL_TEXT_AREA") && BDFDB.DataUtils.get(this, "settings")) this.appendItem(menu, returnvalue, instance.props.value.trim(), "addContextMenu"); + if ((instance.props.type == "NATIVE_TEXT" || instance.props.type == "CHANNEL_TEXT_AREA") && BDFDB.DataUtils.get(this, "settings", "addContextMenu")) this.appendItem(menu, returnvalue, instance.props.value.trim()); } } onMessageContextMenu (instance, menu, returnvalue) { if (instance.props && instance.props.message && instance.props.channel && instance.props.target && !menu.querySelector(`${this.name}-contextMenuItem`)) { let text = document.getSelection().toString().trim(); - if (text && BDFDB.DataUtils.get(this, "settings")) this.appendItem(menu, returnvalue, text, "addContextMenu"); + if (text && BDFDB.DataUtils.get(this, "settings", "addContextMenu")) this.appendItem(menu, returnvalue, text); } } - + appendItem (menu, returnvalue, text) { let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]}); const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, { @@ -331,7 +331,7 @@ class ChatAliases { if (instance.props && instance.props.channel && instance.props.type) { var textarea = wrapper.querySelector("textarea"); if (!textarea) return; - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); BDFDB.ListenerUtils.add(this, textarea, "input", () => { if (this.format) { this.format = false; diff --git a/Plugins/ChatFilter/ChatFilter.plugin.js b/Plugins/ChatFilter/ChatFilter.plugin.js index eee423e1b2..8361e2d304 100644 --- a/Plugins/ChatFilter/ChatFilter.plugin.js +++ b/Plugins/ChatFilter/ChatFilter.plugin.js @@ -107,7 +107,7 @@ class ChatFilter { getSettingsPanel () { if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return; var replaces = BDFDB.DataUtils.get(this, "replaces"); - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var settingshtml = `
${this.name}
`; for (let key in settings) { if (!this.defaults.settings[key].inner) settingshtml += `

${this.defaults.settings[key].description}

`; @@ -282,14 +282,14 @@ class ChatFilter { onNativeContextMenu (instance, menu, returnvalue) { if (instance.props && instance.props.value && instance.props.value.trim() && !menu.querySelector(`${this.name}-contextMenuItem`)) { - if ((instance.props.type == "NATIVE_TEXT" || instance.props.type == "CHANNEL_TEXT_AREA") && BDFDB.DataUtils.get(this, "settings")) this.appendItem(menu, returnvalue, instance.props.value.trim(), "addContextMenu"); + if ((instance.props.type == "NATIVE_TEXT" || instance.props.type == "CHANNEL_TEXT_AREA") && BDFDB.DataUtils.get(this, "settings", "addContextMenu")) this.appendItem(menu, returnvalue, instance.props.value.trim()); } } onMessageContextMenu (instance, menu, returnvalue) { if (instance.props && instance.props.message && instance.props.channel && instance.props.target && !menu.querySelector(`${this.name}-contextMenuItem`)) { let text = document.getSelection().toString().trim(); - if (text && BDFDB.DataUtils.get(this, "settings")) this.appendItem(menu, returnvalue, text, "addContextMenu"); + if (text && BDFDB.DataUtils.get(this, "settings", "addContextMenu")) this.appendItem(menu, returnvalue, text); } } @@ -344,7 +344,7 @@ class ChatFilter { } }); - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var replaces = BDFDB.DataUtils.get(this, "replaces"); var blocked = false; for (let bWord in this.words.blocked) { diff --git a/Plugins/CompleteTimestamps/CompleteTimestamps.plugin.js b/Plugins/CompleteTimestamps/CompleteTimestamps.plugin.js index d1e5a44a9f..c6241d4f0b 100644 --- a/Plugins/CompleteTimestamps/CompleteTimestamps.plugin.js +++ b/Plugins/CompleteTimestamps/CompleteTimestamps.plugin.js @@ -187,14 +187,14 @@ class CompleteTimestamps { } processMessageGroup (instance, wrapper, returnvalue) { - if (BDFDB.DataUtils.get(this, "settings")) for (let stamp of wrapper.querySelectorAll("time[datetime]")) this.changeTimestamp(stamp, "showInChat"); + if (BDFDB.DataUtils.get(this, "settings", "showInChat")) for (let stamp of wrapper.querySelectorAll("time[datetime]")) this.changeTimestamp(stamp); } processEmbed (instance, wrapper, returnvalue) { let embed = BDFDB.ReactUtils.getValue(instance, "props.embed"); let footer = wrapper.querySelector(BDFDB.dotCN.embedfootertext); if (footer && embed && embed.timestamp && BDFDB.DataUtils.get(this, "settings", "showInEmbed")) { - footer.lastChild.textContent = this.getTimestamp(this.languages[BDFDB.DataUtils.get(this, "choices")].id, embed.timestamp._i, "creationDateLang"); + footer.lastChild.textContent = this.getTimestamp(this.languages[BDFDB.DataUtils.get(this, "choices", "creationDateLang")].id, embed.timestamp._i); } } diff --git a/Plugins/EditChannels/EditChannels.plugin.js b/Plugins/EditChannels/EditChannels.plugin.js index 9054357bf4..b05950dbdb 100644 --- a/Plugins/EditChannels/EditChannels.plugin.js +++ b/Plugins/EditChannels/EditChannels.plugin.js @@ -55,7 +55,7 @@ class EditChannels { getSettingsPanel () { if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return; - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var settingsitems = [], inneritems = []; for (let key in settings) (!this.defaults.settings[key].inner ? settingsitems : inneritems).push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSwitch, { diff --git a/Plugins/EditServers/EditServers.plugin.js b/Plugins/EditServers/EditServers.plugin.js index bd7d85c030..6959f79a40 100644 --- a/Plugins/EditServers/EditServers.plugin.js +++ b/Plugins/EditServers/EditServers.plugin.js @@ -38,7 +38,7 @@ class EditServers { getSettingsPanel () { if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return; - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var settingsitems = [], inneritems = []; for (let key in settings) (!this.defaults.settings[key].inner ? settingsitems : inneritems).push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSwitch, { diff --git a/Plugins/EditUsers/EditUsers.plugin.js b/Plugins/EditUsers/EditUsers.plugin.js index 3993b6ab59..1860f063e6 100644 --- a/Plugins/EditUsers/EditUsers.plugin.js +++ b/Plugins/EditUsers/EditUsers.plugin.js @@ -101,7 +101,7 @@ class EditUsers { getSettingsPanel () { if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return; - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var settingsitems = [], inneritems = []; for (let key in settings) (!this.defaults.settings[key].inner ? settingsitems : inneritems).push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSwitch, { diff --git a/Plugins/EmojiStatistics/EmojiStatistics.plugin.js b/Plugins/EmojiStatistics/EmojiStatistics.plugin.js index ee7d1d3984..53dddda9dd 100644 --- a/Plugins/EmojiStatistics/EmojiStatistics.plugin.js +++ b/Plugins/EmojiStatistics/EmojiStatistics.plugin.js @@ -138,7 +138,7 @@ class EmojiStatistics { getSettingsPanel () { if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return; - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var amounts = BDFDB.DataUtils.get(this, "amounts"); var settingshtml = `
${this.name}
`; for (let key in settings) { diff --git a/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js b/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js index 574294941b..be6d506c59 100644 --- a/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js +++ b/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js @@ -342,7 +342,7 @@ class GoogleTranslateOption { textarea.selectionEnd = text.length; document.execCommand("insertText", false, ""); this.translateText(text, "message", (translation, input, output) => { - translation = !translation ? text : (BDFDB.DataUtils.get(this, "settings") ? text + "\n\n" + translation : translation, "sendOriginalMessage"); + translation = !translation ? text : (BDFDB.DataUtils.get(this, "settings", "sendOriginalMessage") ? text + "\n\n" + translation : translation); textarea.focus(); document.execCommand("insertText", false, translation + " "); BDFDB.triggerSend(textarea); @@ -605,7 +605,7 @@ class GoogleTranslateOption { container.appendChild(translatepopout); let buttonrects = BDFDB.getRects(button); translatepopout.style.setProperty("left", buttonrects.left + buttonrects.width + "px"); - translatepopout.style.setProperty("top", buttonrects.top - buttonrects.height/2 + "px") + translatepopout.style.setProperty("top", buttonrects.top - buttonrects.height/2 + "px"); BDFDB.ListenerUtils.addToChildren(translatepopout, "click", BDFDB.dotCN.selectcontrol, e => { let type = BDFDB.getParentEle(BDFDB.dotCN.select, e.currentTarget).getAttribute("type"); diff --git a/Plugins/MessageUtilities/MessageUtilities.plugin.js b/Plugins/MessageUtilities/MessageUtilities.plugin.js index d977952299..dbe5bd05eb 100644 --- a/Plugins/MessageUtilities/MessageUtilities.plugin.js +++ b/Plugins/MessageUtilities/MessageUtilities.plugin.js @@ -313,7 +313,7 @@ class MessageUtilities { let channel = BDFDB.LibraryModules.ChannelStore.getChannel(message.channel_id); if ((channel && BDFDB.UserUtils.can("MANAGE_MESSAGES")) || message.author.id == BDFDB.UserUtils.me.id && message.type != 1 && message.type != 2 && message.type != 3) { BDFDB.LibraryModules.MessageUtils.deleteMessage(message.channel_id, message.id, message.state != "SENT"); - if (BDFDB.DataUtils.get(this, "toasts")) BDFDB.NotificationUtils.toast("Message has been deleted.", {type:"success"}, action); + if (BDFDB.DataUtils.get(this, "toasts", action)) BDFDB.NotificationUtils.toast("Message has been deleted.", {type:"success"}); } } } @@ -321,7 +321,7 @@ class MessageUtilities { doEdit ({messagediv, pos, message}, action) { if (message.author.id == BDFDB.UserUtils.me.id && !messagediv.querySelector("textarea")) { BDFDB.LibraryModules.MessageUtils.startEditMessage(message.channel_id, message.id, message.content); - if (BDFDB.DataUtils.get(this, "toasts")) BDFDB.NotificationUtils.toast("Started editing.", {type:"success"}, action); + if (BDFDB.DataUtils.get(this, "toasts", action)) BDFDB.NotificationUtils.toast("Started editing.", {type:"success"}); } } @@ -329,7 +329,7 @@ class MessageUtilities { let reactButton = messagediv.querySelector(BDFDB.dotCN.emojipickerbutton); if (reactButton) { reactButton.click(); - if (BDFDB.DataUtils.get(this, "toasts")) BDFDB.NotificationUtils.toast("Reaction popout has been opened.", {type:"success"}, action); + if (BDFDB.DataUtils.get(this, "toasts", action)) BDFDB.NotificationUtils.toast("Reaction popout has been opened.", {type:"success"}); } } @@ -339,11 +339,11 @@ class MessageUtilities { if (channel && (channel.type == 1 || channel.type == 3 || BDFDB.UserUtils.can("MANAGE_MESSAGES")) && message.type == 0) { if (message.pinned) { BDFDB.LibraryModules.MessagePinUtils.unpinMessage(channel, message.id); - if (BDFDB.DataUtils.get(this, "toasts")) BDFDB.NotificationUtils.toast("Message has been unpinned.", {type:"error"}, action); + if (BDFDB.DataUtils.get(this, "toasts", action)) BDFDB.NotificationUtils.toast("Message has been unpinned.", {type:"error"}); } else { BDFDB.LibraryModules.MessagePinUtils.pinMessage(channel, message.id); - if (BDFDB.DataUtils.get(this, "toasts")) BDFDB.NotificationUtils.toast("Message has been pinned.", {type:"success"}, action); + if (BDFDB.DataUtils.get(this, "toasts", action)) BDFDB.NotificationUtils.toast("Message has been pinned.", {type:"success"}); } } } @@ -352,7 +352,7 @@ class MessageUtilities { doCopyRaw ({messagediv, pos, message}, action) { if (message.content) { BDFDB.LibraryRequires.electron.clipboard.write({text:message.content}); - if (BDFDB.DataUtils.get(this, "toasts")) BDFDB.NotificationUtils.toast("Raw message content has been copied.", {type:"success"}, action); + if (BDFDB.DataUtils.get(this, "toasts", action)) BDFDB.NotificationUtils.toast("Raw message content has been copied.", {type:"success"}); } } @@ -360,7 +360,7 @@ class MessageUtilities { let channel = BDFDB.LibraryModules.ChannelStore.getChannel(message.channel_id); if (channel) { BDFDB.LibraryRequires.electron.clipboard.write({text:`https://discordapp.com/channels/${channel.guild_id}/${channel.id}/${message.id}`}); - if (BDFDB.DataUtils.get(this, "toasts")) BDFDB.NotificationUtils.toast("Messagelink has been copied.", {type:"success"}, action); + if (BDFDB.DataUtils.get(this, "toasts", action)) BDFDB.NotificationUtils.toast("Messagelink has been copied.", {type:"success"}); } } diff --git a/Plugins/OldTitleBar/OldTitleBar.plugin.js b/Plugins/OldTitleBar/OldTitleBar.plugin.js index c214ae2b0f..c5b49d6a07 100644 --- a/Plugins/OldTitleBar/OldTitleBar.plugin.js +++ b/Plugins/OldTitleBar/OldTitleBar.plugin.js @@ -97,7 +97,7 @@ class OldTitleBar { getSettingsPanel () { if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return; - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var settingshtml = `
${this.name}
`; for (let key in settings) { settingshtml += `

${this.defaults.settings[key].description}

`; @@ -158,7 +158,7 @@ class OldTitleBar { this.window = BDFDB.LibraryRequires.electron.remote.getCurrentWindow(); - this.patchMainScreen(BDFDB.DataUtils.get(this, "settings"), "displayNative"); + this.patchMainScreen(BDFDB.DataUtils.get(this, "settings", "displayNative")); BDFDB.addClass([document.body,document.querySelector(BDFDB.dotCN.titlebar)], "hidden-by-OTB"); @@ -208,7 +208,7 @@ class OldTitleBar { addTitleBar () { BDFDB.removeEles(".headerbarOTB"); - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); if (BDFDB.DataUtils.get(this, "settings", "addOldBar")) { var headerbar = BDFDB.htmlToElement(``); this.createButtons(headerbar); diff --git a/Plugins/OwnerTag/OwnerTag.plugin.js b/Plugins/OwnerTag/OwnerTag.plugin.js index af47ea387e..3ceea4c099 100644 --- a/Plugins/OwnerTag/OwnerTag.plugin.js +++ b/Plugins/OwnerTag/OwnerTag.plugin.js @@ -45,7 +45,7 @@ class OwnerTag { getSettingsPanel () { if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return; - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var inputs = BDFDB.DataUtils.get(this, "inputs"); var settingshtml = `
${this.name}
`; for (let key in inputs) { @@ -128,15 +128,15 @@ class OwnerTag { } processMemberListItem (instance, wrapper, returnvalue) { - if (instance.props && BDFDB.DataUtils.get(this, "settings")) this.addOwnerTag(instance.props.user, null, wrapper.querySelector(BDFDB.dotCN.namecontainernamewrapper), "list", BDFDB.disCN.bottagmember, null, "addInMemberList"); + if (instance.props && BDFDB.DataUtils.get(this, "settings", "addInMemberList")) this.addOwnerTag(instance.props.user, null, wrapper.querySelector(BDFDB.dotCN.namecontainernamewrapper), "list", BDFDB.disCN.bottagmember, null); } processUserPopout (instance, wrapper, returnvalue) { - if (instance.props && BDFDB.DataUtils.get(this, "settings")) this.addOwnerTag(instance.props.user, null, wrapper.querySelector(BDFDB.dotCN.nametag), "popout", BDFDB.disCN.bottagnametag, wrapper, "addInUserPopout"); + if (instance.props && BDFDB.DataUtils.get(this, "settings", "addInUserPopout")) this.addOwnerTag(instance.props.user, null, wrapper.querySelector(BDFDB.dotCN.nametag), "popout", BDFDB.disCN.bottagnametag, wrapper); } processUserProfile (instance, wrapper, returnvalue) { - if (instance.props && BDFDB.DataUtils.get(this, "settings")) this.addOwnerTag(instance.props.user, null, wrapper.querySelector(BDFDB.dotCN.nametag), "profile", BDFDB.disCNS.bottagnametag + BDFDB.disCN.userprofilebottag, wrapper, "addInUserProfil"); + if (instance.props && BDFDB.DataUtils.get(this, "settings", "addInUserProfil")) this.addOwnerTag(instance.props.user, null, wrapper.querySelector(BDFDB.dotCN.nametag), "profile", BDFDB.disCNS.bottagnametag + BDFDB.disCN.userprofilebottag, wrapper); } processMessageUsername (instance, wrapper, returnvalue, methodnames) { @@ -191,7 +191,7 @@ class OwnerTag { } addHideCSS () { - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); if (settings.hideNativeCrown || settings.useCrown) BDFDB.appendLocalStyle(this.name + "HideCrown", `${BDFDB.dotCNS.member + BDFDB.dotCN.memberownericon}:not(.owner-tag-crown) {display: none;}`); else BDFDB.removeLocalStyle(this.name + "HideCrown"); } diff --git a/Plugins/PinDMs/PinDMs.plugin.js b/Plugins/PinDMs/PinDMs.plugin.js index 1e74b7ae3d..ee6cf4ca47 100644 --- a/Plugins/PinDMs/PinDMs.plugin.js +++ b/Plugins/PinDMs/PinDMs.plugin.js @@ -110,7 +110,7 @@ class PinDMs { getSettingsPanel () { if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return; - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var settingshtml = `
${this.name}
`; for (let key in settings) { settingshtml += `

${this.defaults.settings[key].description}

`; diff --git a/Plugins/PluginRepo/PluginRepo.plugin.js b/Plugins/PluginRepo/PluginRepo.plugin.js index 3068b72faf..5563889e0d 100644 --- a/Plugins/PluginRepo/PluginRepo.plugin.js +++ b/Plugins/PluginRepo/PluginRepo.plugin.js @@ -586,7 +586,7 @@ class PluginRepo { loadPlugins () { BDFDB.removeEles("iframe.discordSandbox",".pluginrepo-loadingicon"); - var settings = BDFDB.DataUtils.load(this, "settings"); + let settings = BDFDB.DataUtils.load(this, "settings"); var getPluginInfo, createFrame, runInFrame; var frame, framerunning = false, framequeue = [], outdated = 0, newentries = 0, i = 0; var tags = ["getName", "getVersion", "getAuthor", "getDescription"]; diff --git a/Plugins/ReadAllNotificationsButton/ReadAllNotificationsButton.plugin.js b/Plugins/ReadAllNotificationsButton/ReadAllNotificationsButton.plugin.js index cee57b164e..2a3afd3338 100644 --- a/Plugins/ReadAllNotificationsButton/ReadAllNotificationsButton.plugin.js +++ b/Plugins/ReadAllNotificationsButton/ReadAllNotificationsButton.plugin.js @@ -58,7 +58,7 @@ class ReadAllNotificationsButton { getSettingsPanel () { if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return; - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var settingsitems = [], inneritems = []; for (let key in settings) (!this.defaults.settings[key].inner ? settingsitems : inneritems).push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSwitch, { diff --git a/Plugins/RemoveNicknames/RemoveNicknames.plugin.js b/Plugins/RemoveNicknames/RemoveNicknames.plugin.js index 43e2fb2100..3587ef25ca 100644 --- a/Plugins/RemoveNicknames/RemoveNicknames.plugin.js +++ b/Plugins/RemoveNicknames/RemoveNicknames.plugin.js @@ -42,7 +42,7 @@ class RemoveNicknames { getSettingsPanel () { if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return; - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var settingshtml = `
${this.name}
`; for (let key in settings) { if (!this.defaults.settings[key].inner) settingshtml += `

${this.defaults.settings[key].description}

`; diff --git a/Plugins/ReverseImageSearch/ReverseImageSearch.plugin.js b/Plugins/ReverseImageSearch/ReverseImageSearch.plugin.js index 55cc6f4ea3..b01a07d3c2 100644 --- a/Plugins/ReverseImageSearch/ReverseImageSearch.plugin.js +++ b/Plugins/ReverseImageSearch/ReverseImageSearch.plugin.js @@ -107,14 +107,14 @@ class ReverseImageSearch { onGuildContextMenu (instance, menu, returnvalue) { if (instance.props && instance.props.guild && instance.props.target) { let guildicon = BDFDB.containsClass(instance.props.target, BDFDB.disCN.avataricon) ? instance.props.target : instance.props.target.querySelector(BDFDB.dotCN.guildicon); - if (guildicon && BDFDB.DataUtils.get(this, "settings")) this.appendItem(menu, returnvalue, guildicon.tagName == "IMG" ? guildicon.getAttribute("src") : guildicon.style.getPropertyValue("background-image"), "addGuildIconEntry"); + if (guildicon && BDFDB.DataUtils.get(this, "settings", "addGuildIconEntry")) this.appendItem(menu, returnvalue, guildicon.tagName == "IMG" ? guildicon.getAttribute("src") : guildicon.style.getPropertyValue("background-image")); } } onUserContextMenu (instance, menu, returnvalue) { if (instance.props && instance.props.user && instance.props.target) { let avatar = BDFDB.containsClass(instance.props.target, BDFDB.disCN.avataricon) ? instance.props.target : instance.props.target.querySelector(BDFDB.dotCN.avatar); - if (avatar && BDFDB.DataUtils.get(this, "settings")) this.appendItem(menu, returnvalue, avatar.tagName == "IMG" ? avatar.getAttribute("src") : avatar.style.getPropertyValue("background-image"), "addUserAvatarEntry"); + if (avatar && BDFDB.DataUtils.get(this, "settings", "addUserAvatarEntry")) this.appendItem(menu, returnvalue, avatar.tagName == "IMG" ? avatar.getAttribute("src") : avatar.style.getPropertyValue("background-image")); } } @@ -181,7 +181,7 @@ class ReverseImageSearch { } setLabelsByLanguage () { - switch (BDFDB.getDiscordLanguage().id) { + switch (BDFDB.LanguageUtils.getLanguage().id) { case "hr": //croatian return { submenu_disabled_text: "Svi su onemogućeni" diff --git a/Plugins/ServerFolders/ServerFolders.plugin.js b/Plugins/ServerFolders/ServerFolders.plugin.js index 2a358e0e08..ce67b92d0e 100644 --- a/Plugins/ServerFolders/ServerFolders.plugin.js +++ b/Plugins/ServerFolders/ServerFolders.plugin.js @@ -841,7 +841,7 @@ class ServerFolders { addSeparator (folderid) { if (!this.foldercontentguilds) return; - if (!this.foldercontent.querySelector(`.folderseparatorouter[folderid="${folderid}"]`) && BDFDB.DataUtils.get(this, "settings")) this.foldercontentguilds.insertBefore(BDFDB.htmlToElement(`
`), this.foldercontentguilds.querySelectorAll(`[folderid="${folderid}"]`)[0], "addSeparators"); + if (!this.foldercontent.querySelector(`.folderseparatorouter[folderid="${folderid}"]`) && BDFDB.DataUtils.get(this, "settings", "addSeparators")) this.foldercontentguilds.insertBefore(BDFDB.htmlToElement(`
`), this.foldercontentguilds.querySelectorAll(`[folderid="${folderid}"]`)[0]); if (BDFDB.containsClass(this.foldercontentguilds.firstElementChild, "folderseparatorouter")) BDFDB.removeEles(this.foldercontentguilds.firstElementChild); } diff --git a/Plugins/ServerHider/ServerHider.plugin.js b/Plugins/ServerHider/ServerHider.plugin.js index 633ccf5678..5208d48e9c 100644 --- a/Plugins/ServerHider/ServerHider.plugin.js +++ b/Plugins/ServerHider/ServerHider.plugin.js @@ -246,7 +246,7 @@ class ServerHider { } unreadServer (id) { - if (BDFDB.DataUtils.get(this, "settings") && !this.isInFolder(id)) BDFDB.GuildUtils.markAsRead(id, "clearNotifications"); + if (BDFDB.DataUtils.get(this, "settings", "clearNotifications") && !this.isInFolder(id)) BDFDB.GuildUtils.markAsRead(id); } isInFolder (id) { @@ -257,7 +257,7 @@ class ServerHider { } setLabelsByLanguage () { - switch (BDFDB.getDiscordLanguage().id) { + switch (BDFDB.LanguageUtils.getLanguage().id) { case "hr": //croatian return { modal_header_text: "Upravljanje popisom poslužitelja", diff --git a/Plugins/ShowHiddenChannels/ShowHiddenChannels.plugin.js b/Plugins/ShowHiddenChannels/ShowHiddenChannels.plugin.js index ae82a18754..685e0ebb38 100644 --- a/Plugins/ShowHiddenChannels/ShowHiddenChannels.plugin.js +++ b/Plugins/ShowHiddenChannels/ShowHiddenChannels.plugin.js @@ -105,7 +105,7 @@ class ShowHiddenChannels { getSettingsPanel () { if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return; - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var amounts = BDFDB.DataUtils.get(this, "amounts"); var settingshtml = `
${this.name}
`; for (let key in settings) { @@ -223,7 +223,7 @@ class ShowHiddenChannels { } } - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var count = 0; for (let type in BDFDB.DiscordConstants.ChannelTypes) { if (this.settingsMap[type] && !settings[this.settingsMap[type]]) hiddenChannels[BDFDB.DiscordConstants.ChannelTypes[type]] = []; @@ -309,7 +309,7 @@ class ShowHiddenChannels { showAccessRoles (guild, channel, e, allowed) { if ((e.type != "mouseenter" && e.type != "mouseover") || !guild || !channel) return; - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var myMember = BDFDB.LibraryModules.MemberStore.getMember(guild.id, BDFDB.UserUtils.me.id); var allowedRoles = [], allowedUsers = [], overwrittenRoles = [], deniedRoles = [], deniedUsers = []; var everyoneDenied = false; diff --git a/Plugins/SpellCheck/SpellCheck.plugin.js b/Plugins/SpellCheck/SpellCheck.plugin.js index 1e798ef294..db67baa02b 100644 --- a/Plugins/SpellCheck/SpellCheck.plugin.js +++ b/Plugins/SpellCheck/SpellCheck.plugin.js @@ -56,7 +56,7 @@ class SpellCheck { getSettingsPanel () { if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return; - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var choices = BDFDB.DataUtils.get(this, "choices"); var amounts = BDFDB.DataUtils.get(this, "amounts"); var settingshtml = `
${this.name}
`; diff --git a/Plugins/ThemeRepo/ThemeRepo.plugin.js b/Plugins/ThemeRepo/ThemeRepo.plugin.js index fc377976e5..c780fd6700 100644 --- a/Plugins/ThemeRepo/ThemeRepo.plugin.js +++ b/Plugins/ThemeRepo/ThemeRepo.plugin.js @@ -881,7 +881,7 @@ class ThemeRepo { loadThemes () { BDFDB.removeEles(".themerepo-loadingicon"); - var settings = BDFDB.DataUtils.load(this, "settings"); + let settings = BDFDB.DataUtils.load(this, "settings"); var getThemeInfo, outdated = 0, newentries = 0, i = 0, NFLDreplace = null; var tags = ["name","description","author","version"]; var newentriesdata = BDFDB.DataUtils.load(this, "newentriesdata"), ownlist = BDFDB.DataUtils.load(this, "ownlist", "ownlist") || []; diff --git a/Plugins/TimedLightDarkMode/TimedLightDarkMode.plugin.js b/Plugins/TimedLightDarkMode/TimedLightDarkMode.plugin.js index f2d15816dc..be074b9586 100644 --- a/Plugins/TimedLightDarkMode/TimedLightDarkMode.plugin.js +++ b/Plugins/TimedLightDarkMode/TimedLightDarkMode.plugin.js @@ -81,7 +81,7 @@ class TimedLightDarkMode { processRadioGroup (instance, wrapper, returnvalue) { if (instance.props && Array.isArray(instance.props.options) && instance.props.options[0] && instance.props.options[0].value == "light" && instance.props.options[1] && instance.props.options[1].value == "dark" && wrapper.parentElement.firstElementChild.innerText && wrapper.parentElement.firstElementChild.innerText.toUpperCase() == BDFDB.LanguageUtils.LanguageStrings.THEME.toUpperCase()) { - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var values = BDFDB.DataUtils.get(this, "values"); var settingsbox = BDFDB.htmlToElement(`
${BDFDB.LanguageUtils.LanguageStrings.THEME} Timer
00:00
03:00
06:00
09:00
12:00
15:00
18:00
21:00
24:00
`); wrapper.parentElement.appendChild(settingsbox); diff --git a/Plugins/UserNotes/UserNotes.plugin.js b/Plugins/UserNotes/UserNotes.plugin.js index d1cb9d09e6..96bb61ce6f 100644 --- a/Plugins/UserNotes/UserNotes.plugin.js +++ b/Plugins/UserNotes/UserNotes.plugin.js @@ -65,7 +65,7 @@ class UserNotes { getSettingsPanel () { if (!global.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return; - var settings = BDFDB.DataUtils.get(this, "settings"); + let settings = BDFDB.DataUtils.get(this, "settings"); var settingshtml = `
${this.name}
`; settingshtml += `

Remove all User Notes.

`; settingshtml += `
`;