This commit is contained in:
Mirco Wittrien 2020-01-14 00:06:07 +01:00
parent be649471ed
commit 7b6e0f3815
52 changed files with 212 additions and 224 deletions

View File

@ -7083,7 +7083,7 @@
LibraryComponents.ContextMenus = {};
LibraryComponents.ContextMenus._Exports = {};
LibraryComponents.ContextMenus._NormalMenus = ["DeveloperContextMenu", "GuildRoleContextMenu", "MessageContextMenu", "NativeContextMenu", "ScreenshareContextMenu", "UserSettingsCogContextMenu"];
LibraryComponents.ContextMenus._NormalMenus = ["DeveloperContextMenu", "GuildRoleContextMenu", "MessageContextMenu", "NativeContextMenu", "ScreenshareContextMenu", "SlateContextMenu", "UserSettingsCogContextMenu"];
LibraryComponents.ContextMenus._FluxMenus = ["ApplicationContextMenu", "GroupDMContextMenu"];
LibraryComponents.ContextMenus._NonRenderMenus = ["ChannelContextMenu", "GuildContextMenu", "UserContextMenu"];
@ -7109,6 +7109,8 @@
LibraryComponents.ContextMenus.ScreenshareContextMenu = BDFDB.ModuleUtils.findByName("ScreenshareContextMenu");
LibraryComponents.ContextMenus.SlateContextMenu = BDFDB.ModuleUtils.findByName("SlateContextMenu");
LibraryComponents.ContextMenus.UserContextMenu = BDFDB.ModuleUtils.findByString("Error - no such ctx menu type", BDFDB.DiscordConstants.ContextMenuTypes.USER_CHANNEL_MEMBERS);
LibraryComponents.ContextMenus._Exports.UserContextMenu = (BDFDB.ModuleUtils.findByString("Error - no such ctx menu type", BDFDB.DiscordConstants.ContextMenuTypes.USER_CHANNEL_MEMBERS, false) || {}).exports;

File diff suppressed because one or more lines are too long

View File

@ -182,11 +182,11 @@ class BadgesEverywhere {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -41,11 +41,11 @@ class BetterFriendCount {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);
@ -117,7 +117,7 @@ class BetterFriendCount {
processFriendRow () {
BDFDB.TimeUtils.clear(this.rerenderTimeout);
this.rerenderTimeout = BDFDB.TimeUtils.timeout(() => {
this.rerenderTimeout = BDFDB.TimeUtils.timeout(_ => {
delete this.rerenderTimeout;
BDFDB.ModuleUtils.forceAllUpdates(this, "TabBar");
}, 1000);

View File

@ -35,11 +35,11 @@ class BetterNsfwTag {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -98,11 +98,11 @@ class BetterSearchPage {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);
@ -157,26 +157,26 @@ class BetterSearchPage {
className: ["BSP-pagination-button", "BSP-pagination-first", currentpage == 1 ? BDFDB.disCN.searchresultspaginationdisabled : null].filter(n => n).join(" "),
text: "First",
"aria-label": "First",
onClick: () => {if (currentpage != 1) doJump(1);}
onClick: _ => {if (currentpage != 1) doJump(1);}
}) : null,
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
className: [BDFDB.disCN.searchresultspaginationprevious, currentpage == 1 ? BDFDB.disCN.searchresultspaginationdisabled : null].filter(n => n).join(" "),
text: BDFDB.LanguageUtils.LanguageStrings.PAGINATION_PREVIOUS,
"aria-label": BDFDB.LanguageUtils.LanguageStrings.PAGINATION_PREVIOUS,
onClick: () => {if (currentpage != 1) doJump(currentpage - 1);}
onClick: _ => {if (currentpage != 1) doJump(currentpage - 1);}
}),
BDFDB.LanguageUtils.LanguageStringsFormat("PAGINATOR_OF_PAGES", currentpage, maxpage),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
className: [BDFDB.disCN.searchresultspaginationnext, currentpage == maxpage ? BDFDB.disCN.searchresultspaginationdisabled : null].filter(n => n).join(" "),
text: BDFDB.LanguageUtils.LanguageStrings.PAGINATION_NEXT,
"aria-label": BDFDB.LanguageUtils.LanguageStrings.PAGINATION_NEXT,
onClick: () => {if (currentpage != maxpage) doJump(currentpage + 1);}
onClick: _ => {if (currentpage != maxpage) doJump(currentpage + 1);}
}),
settings.addFirstLast ? BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
className: ["BSP-pagination-button", "BSP-pagination-last", currentpage == maxpage ? BDFDB.disCN.searchresultspaginationdisabled : null].filter(n => n).join(" "),
text: "Last",
"aria-label": "Last",
onClick: () => {if (currentpage != maxpage) doJump(maxpage);}
onClick: _ => {if (currentpage != maxpage) doJump(maxpage);}
}) : null,
settings.addJumpTo ? BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextInput, {
id: "BSP-pagination-jumpinput",

View File

@ -93,11 +93,11 @@ class CharCounter {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -202,11 +202,11 @@ class ChatAliases {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -168,11 +168,11 @@ class ChatFilter {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);
@ -205,7 +205,7 @@ class ChatFilter {
// begin of own functions
updateContainer (settingspanel, ele) {
var wordvalue = null, replacevalue = null, action = ele.getAttribute("action"), rtype = ele.getAttribute("rtype"), update = () => {
var wordvalue = null, replacevalue = null, action = ele.getAttribute("action"), rtype = ele.getAttribute("rtype"), update = _ => {
BDFDB.DataUtils.save(this.words, this, "words");
var containerhtml = ``;
@ -240,7 +240,7 @@ class ChatFilter {
}
}
else if (action == "removeall") {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to remove all added Words from your list?", () => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to remove all added Words from your list?", _ => {
this.words[rtype] = {};
update();
});
@ -454,7 +454,7 @@ class ChatFilter {
addClickListener (message, addListener) {
message.removeEventListener("click", message.clickChatFilterListener);
if (addListener) {
message.clickChatFilterListener = () => {
message.clickChatFilterListener = _ => {
if (BDFDB.DOMUtils.containsClass(message, "revealed")) {
BDFDB.DOMUtils.removeClass(message, "revealed");
message.innerHTML = message.ChatFilterNewHTML;
@ -478,7 +478,7 @@ class ChatFilter {
BDFDB.appendModal(chatfilterAddModal);
wordvalueinput.addEventListener("input", () => {
wordvalueinput.addEventListener("input", _ => {
if (!wordvalueinput.value.trim()) {
addbutton.disabled = true;
BDFDB.DOMUtils.addClass(wordvalueinput, "invalid");
@ -493,7 +493,7 @@ class ChatFilter {
}
});
BDFDB.ListenerUtils.addToChildren(chatfilterAddModal, "click", BDFDB.dotCNC.backdrop + BDFDB.dotCNC.modalclose + ".btn-add", () => {
BDFDB.ListenerUtils.addToChildren(chatfilterAddModal, "click", BDFDB.dotCNC.backdrop + BDFDB.dotCNC.modalclose + ".btn-add", _ => {
BDFDB.DOMUtils.remove(".chatfilter-disabled-tooltip");
});

View File

@ -168,11 +168,11 @@ class CompleteTimestamps {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -29,11 +29,11 @@ class CopyRawMessage {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -187,11 +187,11 @@ class CreationDate {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -72,11 +72,11 @@ class DisplayServersAsChannels {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -92,7 +92,7 @@ class EditChannels {
color: BDFDB.LibraryComponents.Button.Colors.RED,
label: "Reset all Channels",
onClick: _ => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to reset all channels?", () => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to reset all channels?", _ => {
BDFDB.DataUtils.remove(this, "channels");
this.forceUpdateAll();
});
@ -117,11 +117,11 @@ class EditChannels {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -73,7 +73,7 @@ class EditServers {
color: BDFDB.LibraryComponents.Button.Colors.RED,
label: "Reset all Servers",
onClick: _ => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to reset all Servers?", () => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to reset all Servers?", _ => {
BDFDB.DataUtils.remove(this, "servers");
BDFDB.ModuleUtils.forceAllUpdates(this);;
});
@ -98,11 +98,11 @@ class EditServers {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);
@ -585,7 +585,7 @@ class EditServers {
delete instance.props.errorMessage;
instance.forceUpdate();
}
else instance.checkTimeout = BDFDB.TimeUtils.timeout(() => {
else instance.checkTimeout = BDFDB.TimeUtils.timeout(_ => {
BDFDB.LibraryRequires.request(url.trim(), (error, response, result) => {
if (response && response.headers["content-type"] && response.headers["content-type"].indexOf("image") != -1) {
instance.props.success = true;

View File

@ -123,7 +123,7 @@ class EditUsers {
color: BDFDB.LibraryComponents.Button.Colors.RED,
label: "Reset all Users",
onClick: _ => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to reset all users?", () => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to reset all users?", _ => {
BDFDB.DataUtils.remove(this, "users");
this.forceUpdateAll();
});
@ -148,11 +148,11 @@ class EditUsers {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);
@ -163,7 +163,7 @@ class EditUsers {
if (this.started) return;
BDFDB.PluginUtils.init(this);
var observer = new MutationObserver(() => {this.changeAppTitle();});
var observer = new MutationObserver(_ => {this.changeAppTitle();});
BDFDB.ObserverUtils.connect(this, document.head.querySelector("title"), {name:"appTitleObserver",instance:observer}, {childList:true});
this.forceUpdateAll();
@ -418,13 +418,13 @@ class EditUsers {
}
else if (!e.ctrlKey && e.which != 16 && textarea.selectionStart == textarea.selectionEnd && textarea.selectionEnd == textarea.value.length) {
BDFDB.TimeUtils.clear(textarea.EditUsersAutocompleteTimeout);
textarea.EditUsersAutocompleteTimeout = BDFDB.TimeUtils.timeout(() => {this.addAutoCompleteMenu(textarea, channel);},100);
textarea.EditUsersAutocompleteTimeout = BDFDB.TimeUtils.timeout(_ => {this.addAutoCompleteMenu(textarea, channel);},100);
}
if (!e.ctrlKey && e.which != 38 && e.which != 40 && !(e.which == 39 && textarea.selectionStart == textarea.selectionEnd && textarea.selectionEnd == textarea.value.length)) BDFDB.DOMUtils.remove(".autocompleteEditUsers", ".autocompleteEditUsersRow");
});
BDFDB.ListenerUtils.add(this, textarea, "click", e => {
if (textarea.selectionStart == textarea.selectionEnd && textarea.selectionEnd == textarea.value.length) BDFDB.TimeUtils.timeout(() => {this.addAutoCompleteMenu(textarea, channel);});
if (textarea.selectionStart == textarea.selectionEnd && textarea.selectionEnd == textarea.value.length) BDFDB.TimeUtils.timeout(_ => {this.addAutoCompleteMenu(textarea, channel);});
});
}
}
@ -700,7 +700,7 @@ class EditUsers {
instance.props.inputClassName = null;
instance.forceUpdate();
}
else instance.checkTimeout = BDFDB.TimeUtils.timeout(() => {
else instance.checkTimeout = BDFDB.TimeUtils.timeout(_ => {
BDFDB.LibraryRequires.request(url.trim(), (error, response, result) => {
if (response && response.headers["content-type"] && response.headers["content-type"].indexOf("image") != -1) {
if (input) BDFDB.DOMUtils.remove(input.tooltip);
@ -869,7 +869,7 @@ class EditUsers {
wrapper = BDFDB.DOMUtils.containsClass(wrapper, BDFDB.disCN.guildicon) ? wrapper.parentElement.parentElement.parentElement : wrapper;
wrapper.removeEventListener("mouseenter", wrapper.tooltipListenerEditUsers);
if (data.name) {
wrapper.tooltipListenerEditUsers = () => {
wrapper.tooltipListenerEditUsers = _ => {
BDFDB.TooltipUtils.create(wrapper, data.name, {type, selector:"EditUsers-tooltip", hide:true});
};
wrapper.addEventListener("mouseenter", wrapper.tooltipListenerEditUsers);
@ -912,11 +912,11 @@ class EditUsers {
else colorDefault();
if (data.name || data.color1 || data.color2) {
dmchannel.mouseenterListenerEditUsers = () => {
dmchannel.mouseenterListenerEditUsers = _ => {
username.EditUsersHovered = true;
colorHover();
};
dmchannel.mouseleaveListenerEditUsers = () => {
dmchannel.mouseleaveListenerEditUsers = _ => {
delete username.EditUsersHovered;
colorDefault();
};
@ -972,11 +972,11 @@ class EditUsers {
if (mention.EditUsersHovered) colorHover();
else colorDefault();
mention.mouseoverListenerEditUsers = () => {
mention.mouseoverListenerEditUsers = _ => {
mention.EditUsersHovered = true;
colorHover();
};
mention.mouseoutListenerEditUsers = () => {
mention.mouseoutListenerEditUsers = _ => {
delete mention.EditUsersHovered;
colorDefault();
};
@ -1016,11 +1016,11 @@ class EditUsers {
if (username.EditUsersHovered) colorHover();
else colorDefault();
if (data.name || data.color1) {
username.mouseoverListenerEditUsers = () => {
username.mouseoverListenerEditUsers = _ => {
username.EditUsersHovered = true;
colorHover();
};
username.mouseoutListenerEditUsers = () => {
username.mouseoutListenerEditUsers = _ => {
delete username.EditUsersHovered;
colorDefault();
};
@ -1151,7 +1151,7 @@ class EditUsers {
let isgradient = data.color1 && BDFDB.ObjectUtils.is(data.color1);
let username = isgradient ? `<div class="${BDFDB.disCN.marginleft8}" changed-by-editusers="true" style="flex: 1 1 auto;"><span style="pointer-events: none; -webkit-background-clip: text !important; color: transparent !important; background-image: ${BDFDB.ColorUtils.createGradient(data.color1)} !important;">${BDFDB.StringUtils.htmlEscape(data.name || data.member.nick || data.user.username)}</span></div>` : `<div class="${BDFDB.disCN.marginleft8}" changed-by-editusers="true" style="flex: 1 1 auto;${data.color1 ? (' color: ' + BDFDB.ColorUtils.convert(data.color1, 'RGB') + ' !important;') : ''}">${BDFDB.StringUtils.htmlEscape(data.name || data.member.nick || data.user.username)}</div>`;
let autocompleterow = BDFDB.DOMUtils.create(`<div class="${BDFDB.disCNS.autocompleterowvertical + BDFDB.disCN.autocompleterow} autocompleteEditUsersRow"><div userid="${data.user.id}" class="${BDFDB.disCNS.autocompleteselector + BDFDB.disCN.autocompleteselectable} autocompleteEditUsersSelector"><div class="${BDFDB.disCNS.flex + BDFDB.disCNS.horizontal + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.autocompletecontent}" style="flex: 1 1 auto;"><div class="${BDFDB.disCN.avatarwrapper}" role="img" aria-label="${data.user.username}, ${BDFDB.LanguageUtils.LanguageStrings["STATUS_" + status.toUpperCase()]}" aria-hidden="false" style="width: 24px; height: 24px;"><svg width="30" height="24" viewBox="0 0 30 24" class="${BDFDB.disCN.avatarmask}" aria-hidden="true"><foreignObject x="0" y="0" width="24" height="24" mask="url(#svg-mask-avatar-status-round-24)"><img src="${data.url || BDFDB.UserUtils.getAvatar(data.user.id)}" alt=" " class="${BDFDB.disCN.avatar}" aria-hidden="true"></foreignObject><rect width="8" height="8" x="16" y="16" fill="${BDFDB.UserUtils.getStatusColor(status)}" mask="url(#svg-mask-status-${status})" class="${BDFDB.disCN.avatarpointerevents}"></rect></svg></div>${username}<div class="${BDFDB.disCNS.flex + BDFDB.disCNS.horizontal + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignbaseline + BDFDB.disCNS.nowrap + BDFDB.disCN.autocompletedescription}" style="flex: 0 1 auto;"><div class="${BDFDB.disCN.autocompletedescriptionusername}">${BDFDB.StringUtils.htmlEscape(data.user.username)}</div><div class="${BDFDB.disCN.autocompletedescriptiondiscriminator}">#${data.user.discriminator}</div></div></div></div></div>`);
autocompleterow.querySelector(BDFDB.dotCN.autocompleteselectable).addEventListener("click", () => {this.swapWordWithMention(textarea);});
autocompleterow.querySelector(BDFDB.dotCN.autocompleteselectable).addEventListener("click", _ => {this.swapWordWithMention(textarea);});
autocompletemenu.appendChild(autocompleterow);
}
if (!autocompletemenu.querySelector(BDFDB.dotCN.autocompleteselected)) {

View File

@ -90,11 +90,11 @@ class EmojiStatistics {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -29,11 +29,11 @@ class ForceImagePreviews {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);
@ -76,7 +76,7 @@ class ForceImagePreviews {
if (response && response.headers["content-type"] && response.headers["content-type"].indexOf("image") > -1) {
let imagethrowaway = document.createElement("img");
imagethrowaway.src = link;
imagethrowaway.onload = () => {
imagethrowaway.onload = _ => {
if (!this.isEmbedded(embeds, link)) {
embeds.push({
image: {

View File

@ -290,7 +290,7 @@ class FriendNotifications {
else BDFDB.NotificationUtils.toast("Please enter a valid UserID of a user that has been loaded in your client.", {type:"error"});
}
});
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".btn-timelog", () => {this.showTimeLog();});
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".btn-timelog", _ => {this.showTimeLog();});
return settingspanel;
}
@ -309,11 +309,11 @@ class FriendNotifications {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);
@ -492,7 +492,7 @@ class FriendNotifications {
for (let id in users) this.userStatusStore[id] = this.getStatusWithMobileAndActivity(id, users[id]).statusname;
let toasttime = (amounts.toastTime > amounts.checkInterval ? amounts.checkInterval : amounts.toastTime) * 1000;
let desktoptime = (amounts.desktopTime > amounts.checkInterval ? amounts.checkInterval : amounts.desktopTime) * 1000;
this.checkInterval = BDFDB.TimeUtils.interval(() => {
this.checkInterval = BDFDB.TimeUtils.interval(_ => {
for (let id in users) if (!users[id].disabled) {
let user = BDFDB.LibraryModules.UserStore.getUser(id);
let status = this.getStatusWithMobileAndActivity(id, users[id]);
@ -505,7 +505,7 @@ class FriendNotifications {
let avatar = EUdata.removeIcon ? "" : (EUdata.url ? EUdata.url : BDFDB.UserUtils.getAvatar(user.id));
this.timeLog.push({string:toaststring, avatar, time: new Date()});
if (!(settings.muteOnDND && BDFDB.UserUtils.getStatus() == "dnd")) {
let openChannel = () => {
let openChannel = _ => {
if (settings.openOnClick) {
let DMid = BDFDB.LibraryModules.ChannelStore.getDMFromUserId(user.id)
if (DMid) BDFDB.LibraryModules.SelectChannelUtils.selectPrivateChannel(DMid);

View File

@ -88,11 +88,11 @@ class GoogleSearchReplace {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -113,11 +113,11 @@ class GoogleTranslateOption {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -53,11 +53,11 @@ class ImageGallery {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -68,11 +68,11 @@ class ImageZoom {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -189,11 +189,11 @@ class JoinedAtDate {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -190,11 +190,11 @@ class LastMessageDate {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -156,11 +156,11 @@ class MessageUtilities {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);
@ -263,7 +263,7 @@ class MessageUtilities {
if (!this.hasDoubleClickOverwrite(bindings, bindings[priorityaction])) {
this.defaults.bindings[priorityaction].func.apply(this, [{messagediv, pos, message}, priorityaction]);
}
else this.clickTimeout = BDFDB.TimeUtils.timeout(() => {
else this.clickTimeout = BDFDB.TimeUtils.timeout(_ => {
this.defaults.bindings[priorityaction].func.apply(this, [{messagediv, pos, message}, priorityaction]);
}, 500);
}

View File

@ -23,25 +23,11 @@ class MoveablePopups {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
this.libLoadTimeout = setTimeout(() => {
libraryScript.remove();
require("request")("https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js", (error, response, body) => {
if (body) {
libraryScript = document.createElement("script");
libraryScript.setAttribute("id", "BDFDBLibraryScript");
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("date", performance.now());
libraryScript.innerText = body;
document.head.appendChild(libraryScript);
}
this.initialize();
});
}, 15000);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);
@ -120,7 +106,7 @@ class MoveablePopups {
BDFDB.DOMUtils.removeLocalStyle("disableTextSelection");
document.removeEventListener("mouseup", mouseup);
document.removeEventListener("mousemove", mousemove);
BDFDB.TimeUtils.timeout(() => {this.dragging = false},1);
BDFDB.TimeUtils.timeout(_ => {this.dragging = false},1);
};
var mousemove = e2 => {
left = left - (oldX - e2.pageX);

View File

@ -128,8 +128,8 @@ class NotificationSounds {
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".btn-addsong", e => {this.saveAudio(settingspanel);});
BDFDB.ListenerUtils.add(this, settingspanel, "keyup", ".songInput", e => {if (e.which == 13) this.saveAudio(settingspanel);});
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".reset-button", () => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to delete all added songs?", () => {
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".reset-button", _ => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to delete all added songs?", _ => {
BDFDB.DataUtils.remove(this, "choices");
BDFDB.DataUtils.remove(this, "audios");
this.loadAudios();
@ -188,11 +188,11 @@ class NotificationSounds {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);
@ -223,7 +223,7 @@ class NotificationSounds {
BDFDB.ModuleUtils.patch(this, BDFDB.LibraryModules.SoundUtils, "playSound", {instead: e => {
let type = e.methodArguments[0];
if (this.choices[type]) BDFDB.TimeUtils.timeout(() => {
if (this.choices[type]) BDFDB.TimeUtils.timeout(_ => {
if (type == "message1") {
if (this.firedEvents["dm"]) this.firedEvents["dm"] = false;
else if (this.firedEvents["mentioned"]) this.firedEvents["mentioned"] = false;
@ -238,17 +238,17 @@ class NotificationSounds {
let audio = new Audio();
audio.src = this.choices[type].src;
audio.volume = this.choices[type].volume/100;
e.returnValue.play = () => {
e.returnValue.play = _ => {
if (!audio.paused || this.dontPlayAudio(type)) return;
audio.loop = false;
audio.play();
};
e.returnValue.loop = () => {
e.returnValue.loop = _ => {
if (!audio.paused || this.dontPlayAudio(type)) return;
audio.loop = true;
audio.play();
};
e.returnValue.stop = () => {audio.pause();}
e.returnValue.stop = _ => {audio.pause();}
}});
this.loadAudios();
@ -310,7 +310,7 @@ class NotificationSounds {
if (e2.target.parentElement != selectMenu) {
document.removeEventListener("mousedown", removeMenu);
selectMenu.remove();
BDFDB.TimeUtils.timeout(() => {BDFDB.DOMUtils.removeClass(selectWrap, BDFDB.disCN.selectisopen);},100);
BDFDB.TimeUtils.timeout(_ => {BDFDB.DOMUtils.removeClass(selectWrap, BDFDB.disCN.selectisopen);},100);
}
};
document.addEventListener("mousedown", removeMenu);
@ -365,7 +365,7 @@ class NotificationSounds {
var sMaxX = sMinX + BDFDB.DOMUtils.getRects(track).width;
var bubble = BDFDB.DOMUtils.create(`<span class="${BDFDB.disCN.sliderbubble}">${Math.floor(this.choices[type].volume)}%</span>`);
grabber.appendChild(bubble);
var mouseup = () => {
var mouseup = _ => {
document.removeEventListener("mouseup", mouseup);
document.removeEventListener("mousemove", mousemove);
BDFDB.DOMUtils.remove(bubble);
@ -426,7 +426,7 @@ class NotificationSounds {
});
}
successSavedAudio = () => {
successSavedAudio = _ => {
BDFDB.NotificationUtils.toast(`Song ${song} was added to category ${category}.`, {type:"success"});
if (!this.audios[category]) this.audios[category] = {};
this.audios[category][song] = url;
@ -480,19 +480,19 @@ class NotificationSounds {
fireEvent (type) {
this.firedEvents[type] = true;
BDFDB.TimeUtils.timeout(() => {this.firedEvents[type] = false;},3000);
BDFDB.TimeUtils.timeout(_ => {this.firedEvents[type] = false;},3000);
}
processIncomingCalls (instance, wrapper, returnvalue) {
let audio = new Audio();
let play = () => {
let play = _ => {
if (!audio.paused || this.dontPlayAudio("call_ringing")) return;
audio.loop = true;
audio.src = this.choices["call_ringing"].src;
audio.volume = this.choices["call_ringing"].volume/100;
audio.play();
};
let stop = () => {audio.pause();}
let stop = _ => {audio.pause();}
BDFDB.ModuleUtils.patch(this, instance, "startRinging", {instead: play});
BDFDB.ModuleUtils.patch(this, instance, "stopRinging", {instead: stop});
BDFDB.ModuleUtils.patch(this, instance._reactInternalFiber.type.prototype, "startRinging", {instead: play});

View File

@ -105,7 +105,7 @@ class OldTitleBar {
if (notifybar) notifybar.querySelector(BDFDB.dotCN.noticedismiss).click();
if (this.patched) {
notifybar = BDFDB.NotificationUtils.notice("Changed nativebar settings, relaunch to see changes:", {type:"danger",btn:"Relaunch",id:"OldTitleBarNotifyBar"});
notifybar.querySelector(BDFDB.dotCN.noticebutton).addEventListener("click", () => {
notifybar.querySelector(BDFDB.dotCN.noticebutton).addEventListener("click", _ => {
BDFDB.LibraryRequires.electron.remote.app.relaunch();
BDFDB.LibraryRequires.electron.remote.app.quit();
});
@ -132,11 +132,11 @@ class OldTitleBar {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -101,11 +101,11 @@ class OwnerTag {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -32,7 +32,7 @@ class PersonalPins {
color: BDFDB.LibraryComponents.Button.Colors.RED,
label: "Delete all Notes",
onClick: _ => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to delete all pinned notes?", () => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to delete all pinned notes?", _ => {
BDFDB.DataUtils.remove(this, "notes");
});
},
@ -56,11 +56,11 @@ class PersonalPins {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -127,7 +127,7 @@ class PinDMs {
color: BDFDB.LibraryComponents.Button.Colors.RED,
label: "Unpin all pinned DMs",
onClick: _ => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to unpin all pinned DMs?", () => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to unpin all pinned DMs?", _ => {
BDFDB.DataUtils.remove(this, "dmCategories");
BDFDB.DataUtils.remove(this, "pinnedRecents");
});
@ -152,11 +152,11 @@ class PinDMs {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -266,11 +266,11 @@ class PluginRepo {
BDFDB.initElements(settingspanel, this);
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".btn-addplugin", () => {this.addPluginToOwnList(settingspanel);});
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".btn-addplugin", _ => {this.addPluginToOwnList(settingspanel);});
BDFDB.ListenerUtils.add(this, settingspanel, "click", "#input-pluginurl", e => {if (e.which == 13) this.addPluginToOwnList(settingspanel);});
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".remove-plugin", e => {this.removePluginFromOwnList(e);});
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".remove-all", () => {this.removeAllFromOwnList(settingspanel);});
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".refresh-button", () => {
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".remove-all", _ => {this.removeAllFromOwnList(settingspanel);});
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".refresh-button", _ => {
this.loading = {is:false, timeout:null, amount:0};
this.loadPlugins();
});
@ -292,11 +292,11 @@ class PluginRepo {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);
@ -309,7 +309,7 @@ class PluginRepo {
this.loadPlugins();
this.updateInterval = BDFDB.TimeUtils.interval(() => {this.checkForNewPlugins();},1000*60*30);
this.updateInterval = BDFDB.TimeUtils.interval(_ => {this.checkForNewPlugins();},1000*60*30);
BDFDB.ModuleUtils.forceAllUpdates(this);
}
@ -357,10 +357,10 @@ class PluginRepo {
var folderbutton = document.querySelector(BDFDB.dotCN._repofolderbutton);
if (folderbutton) {
var repoButton = BDFDB.DOMUtils.create(`<button class="${BDFDB.disCN._repofolderbutton} bd-pluginrepobutton">PluginRepo</button>`);
repoButton.addEventListener("click", () => {
repoButton.addEventListener("click", _ => {
this.openPluginRepoModal();
});
repoButton.addEventListener("mouseenter", () => {
repoButton.addEventListener("mouseenter", _ => {
BDFDB.TooltipUtils.create(repoButton, "Open Plugin Repo", {type:"top",selector:"pluginrepo-button-tooltip"});
});
folderbutton.parentElement.insertBefore(repoButton, folderbutton.nextSibling);
@ -395,7 +395,7 @@ class PluginRepo {
}
removeAllFromOwnList (settingspanel) {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to remove all added Plugins from your own list?", () => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to remove all added Plugins from your own list?", _ => {
BDFDB.DataUtils.save([], this, "ownlist", "ownlist");
BDFDB.DOMUtils.remove(settingspanel.querySelector(BDFDB.dotCN.hovercard));
});
@ -428,13 +428,13 @@ class PluginRepo {
orderinput.setAttribute('option', options.forcedOrder);
}
BDFDB.ListenerUtils.addToChildren(pluginRepoModal, "keyup", BDFDB.dotCN.searchbarinput, () => {
BDFDB.ListenerUtils.addToChildren(pluginRepoModal, "keyup", BDFDB.dotCN.searchbarinput, _ => {
BDFDB.TimeUtils.clear(pluginRepoModal.searchTimeout);
pluginRepoModal.searchTimeout = BDFDB.TimeUtils.timeout(() => {this.sortEntries(pluginRepoModal);},1000);
pluginRepoModal.searchTimeout = BDFDB.TimeUtils.timeout(_ => {this.sortEntries(pluginRepoModal);},1000);
});
BDFDB.ListenerUtils.addToChildren(pluginRepoModal, "click", BDFDB.dotCN.searchbarclear, () => {
BDFDB.ListenerUtils.addToChildren(pluginRepoModal, "click", BDFDB.dotCN.searchbarclear, _ => {
BDFDB.TimeUtils.clear(pluginRepoModal.searchTimeout);
pluginRepoModal.searchTimeout = BDFDB.TimeUtils.timeout(() => {this.sortEntries(pluginRepoModal);},1000);
pluginRepoModal.searchTimeout = BDFDB.TimeUtils.timeout(_ => {this.sortEntries(pluginRepoModal);},1000);
});
BDFDB.ListenerUtils.addToChildren(pluginRepoModal, "change", ".hide-checkbox", e => {
pluginRepoModal.updateHidden = true;
@ -444,10 +444,10 @@ class PluginRepo {
BDFDB.DataUtils.save(e.currentTarget.checked, this, "RNMstart", "RNMstart");
});
BDFDB.ListenerUtils.addToChildren(pluginRepoModal, "click", ".sort-filter", e => {
BDFDB.createSortPopout(e.currentTarget, this.sortPopoutMarkup, () => {this.sortEntries(pluginRepoModal);});
BDFDB.createSortPopout(e.currentTarget, this.sortPopoutMarkup, _ => {this.sortEntries(pluginRepoModal);});
});
BDFDB.ListenerUtils.addToChildren(pluginRepoModal, "click", ".order-filter", e => {
BDFDB.createSortPopout(e.currentTarget, this.orderPopoutMarkup, () => {this.sortEntries(pluginRepoModal);});
BDFDB.createSortPopout(e.currentTarget, this.orderPopoutMarkup, _ => {this.sortEntries(pluginRepoModal);});
});
BDFDB.ListenerUtils.addToChildren(pluginRepoModal, "click", BDFDB.dotCN.tabbaritem + "[tab=plugins]", e => {
if (!BDFDB.DOMUtils.containsClass(e.currentTarget, BDFDB.disCN.settingsitemselected) && pluginRepoModal.updateHidden) {
@ -536,7 +536,7 @@ class PluginRepo {
entry.querySelector(".btn-download").addEventListener("click", e => {
setEntryState(0);
this.downloadPlugin(data);
if (pluginRepoModal.querySelector("#input-rnmstart").checked) BDFDB.TimeUtils.timeout(() => {this.startPlugin(data);},3000);
if (pluginRepoModal.querySelector("#input-rnmstart").checked) BDFDB.TimeUtils.timeout(_ => {this.startPlugin(data);},3000);
});
container.appendChild(entry);
@ -604,10 +604,10 @@ class PluginRepo {
this.loadedPlugins = {};
this.grabbedPlugins = result.split("\n").filter(n => n);
this.foundPlugins = this.grabbedPlugins.concat(ownlist);
this.loading = {is:true, timeout:BDFDB.TimeUtils.timeout(() => {
this.loading = {is:true, timeout:BDFDB.TimeUtils.timeout(_ => {
BDFDB.TimeUtils.clear(this.loading.timeout);
if (this.started) {
if (this.loading.is && this.loading.amount < 4) BDFDB.TimeUtils.timeout(() => {this.loadPlugins();},10000);
if (this.loading.is && this.loading.amount < 4) BDFDB.TimeUtils.timeout(_ => {this.loadPlugins();},10000);
this.loading = {is: false, timeout:null, amount:this.loading.amount};
}
},1200000), amount:this.loading.amount+1};
@ -618,20 +618,20 @@ class PluginRepo {
}
var loadingicon = BDFDB.DOMUtils.create(this.pluginRepoIconMarkup);
BDFDB.DOMUtils.addClass(loadingicon, "pluginrepo-loadingicon");
loadingicon.addEventListener("mouseenter", () => {
loadingicon.addEventListener("mouseenter", _ => {
BDFDB.TooltipUtils.create(loadingicon, this.getLoadingTooltipText(), {type:"left", delay:500, style:"max-width:unset;", selector:"pluginrepo-loading-tooltip"});
});
loadingiconwrapper.appendChild(loadingicon);
createFrame().then(() => {
getPluginInfo(() => {
createFrame().then(_ => {
getPluginInfo(_ => {
if (!this.started) {
BDFDB.TimeUtils.clear(this.loading.timeout);
BDFDB.DOMUtils.remove(frame);
if (frame && frame.messageReceived) window.removeEventListener("message", frame.messageReceived);
return;
}
var finishCounter = 0, finishInterval = BDFDB.TimeUtils.interval(() => {
var finishCounter = 0, finishInterval = BDFDB.TimeUtils.interval(_ => {
if ((framequeue.length == 0 && !framerunning) || finishCounter > 300 || !this.loading.is) {
BDFDB.TimeUtils.clear(finishInterval);
BDFDB.DOMUtils.remove(frame, loadingicon, ".pluginrepo-loadingicon");
@ -751,11 +751,11 @@ class PluginRepo {
});
}
createFrame = () => {
createFrame = _ => {
var markup = this.frameMarkup;
return new Promise(function(callback) {
frame = BDFDB.DOMUtils.create(markup);
frame.startTimeout = BDFDB.TimeUtils.timeout(() => {
frame.startTimeout = BDFDB.TimeUtils.timeout(_ => {
callback();
},600000);
frame.messageReceived = e => {
@ -777,7 +777,7 @@ class PluginRepo {
});
}
runInFrame = () => {
runInFrame = _ => {
if (framerunning) return;
let framedata = framequeue.shift();
if (!framedata) return;

View File

@ -92,11 +92,11 @@ class ReadAllNotificationsButton {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -77,11 +77,11 @@ class RemoveNicknames {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -94,11 +94,11 @@ class RepoControls {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);
@ -283,7 +283,7 @@ class RepoControls {
look: BDFDB.LibraryComponents.Button.Looks.BLANK,
size: BDFDB.LibraryComponents.Button.Sizes.NONE,
onClick: _ => {
let deleteFile = () => {
let deleteFile = _ => {
BDFDB.LibraryRequires.fs.unlink(e.instance.props.RCdata.path, (error) => {
if (error) BDFDB.NotificationUtils.toast(`Unable to delete ${e.instance.props.RCdata.type} "${e.returnvalue.props["data-name"]}".`, {type:"danger"});
else BDFDB.NotificationUtils.toast(`Successfully deleted ${e.instance.props.RCdata.type} "${e.returnvalue.props["data-name"]}".`, {type:"success"});
@ -320,7 +320,7 @@ class RepoControls {
toggleAll (type, instance, enable) {
let listnode = BDFDB.ReactUtils.findDOMNode(BDFDB.ReactUtils.findOwner(instance, {name: "V2C_List"}));
if (listnode) BDFDB.ModalUtils.confirm(this, `Are you sure you want to ${enable ? "enable" : "disable"} all ${type[0].toUpperCase() + type.slice(1)}s?`, () => {
if (listnode) BDFDB.ModalUtils.confirm(this, `Are you sure you want to ${enable ? "enable" : "disable"} all ${type[0].toUpperCase() + type.slice(1)}s?`, _ => {
for (let header of listnode.querySelectorAll(BDFDB.dotCN._repoheader)) {
if (header.querySelector(BDFDB.dotCN._reponame).textContent.toLowerCase().indexOf(this.name.toLowerCase()) != 0) {
let switchwrap = header.querySelector(BDFDB.dotCN._repocheckboxwrap);

View File

@ -30,11 +30,11 @@ class RevealAllSpoilersOption {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -93,11 +93,11 @@ class ReverseImageSearch {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -48,11 +48,11 @@ class SendLargeMessages {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -395,7 +395,7 @@ class ServerFolders {
color: BDFDB.LibraryComponents.Button.Colors.RED,
label: "Reset all Folders",
onClick: _ => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to reset all folders?", () => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to reset all folders?", _ => {
BDFDB.DataUtils.remove(this, "folders");
});
},
@ -407,7 +407,7 @@ class ServerFolders {
color: BDFDB.LibraryComponents.Button.Colors.RED,
label: "Remove all custom Icons",
onClick: _ => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to remove all custom icons?", () => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to remove all custom icons?", _ => {
BDFDB.DataUtils.remove(this, "customicons");
});
},
@ -431,11 +431,11 @@ class ServerFolders {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);
@ -596,7 +596,7 @@ class ServerFolders {
if (this.folderStates[e.instance.props.folderId] && !BDFDB.equals(state, this.folderStates[e.instance.props.folderId])) {
if (data.autoRead && (state.unread || state.badge > 0)) {
BDFDB.TimeUtils.clear(this.folderReads[e.instance.props.folderId]);
this.folderReads[e.instance.props.folderId] = BDFDB.TimeUtils.timeout(() => {
this.folderReads[e.instance.props.folderId] = BDFDB.TimeUtils.timeout(_ => {
BDFDB.GuildUtils.markAsRead(e.instance.props.guildIds);
}, 10000);
}
@ -646,7 +646,7 @@ class ServerFolders {
}
this.guildStates[e.instance.props.guild.id] = state;
}
if (e.node) BDFDB.ListenerUtils.add(this, e.node, "click", () => {BDFDB.TimeUtils.timeout(() => {
if (e.node) BDFDB.ListenerUtils.add(this, e.node, "click", _ => {BDFDB.TimeUtils.timeout(_ => {
let folder = BDFDB.GuildUtils.getFolder(e.instance.props.guild.id);
let settings = BDFDB.DataUtils.get(this, "settings");
if (settings.closeAllFolders) for (let openFolderId of BDFDB.LibraryModules.FolderUtils.getExpandedFolders()) if (!folder || openFolderId != folder.folderId || !settings.forceOpenFolder) BDFDB.LibraryModules.GuildUtils.toggleGuildFolderExpand(openFolderId);

View File

@ -32,7 +32,7 @@ class ServerHider {
color: BDFDB.LibraryComponents.Button.Colors.RED,
label: "Unhide all Servers/Folders",
onClick: _ => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to unhide all servers and folders?", () => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to unhide all servers and folders?", _ => {
BDFDB.DataUtils.save([], this, "hidden");
BDFDB.ModuleUtils.forceAllUpdates(this);
});
@ -57,11 +57,11 @@ class ServerHider {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -98,11 +98,11 @@ class ShowHiddenChannels {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -95,11 +95,11 @@ class ShowImageDetails {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -104,11 +104,11 @@ class SpellCheck {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);
@ -150,7 +150,7 @@ class SpellCheck {
if (SCindex > -1) {
if (BDFDB.ReactUtils.findValue(e.instance._reactInternalFiber, "spellcheckEnabled") == true) {
BDFDB.TimeUtils.clear(this.disableSpellcheckTimeout);
this.disableSpellcheckTimeout = BDFDB.TimeUtils.timeout(() => {
this.disableSpellcheckTimeout = BDFDB.TimeUtils.timeout(_ => {
BDFDB.LibraryModules.SpellCheckUtils.toggleSpellcheck();
delete this.disableSpellcheckTimeout;
}, 1000);
@ -215,7 +215,7 @@ class SpellCheck {
var textarea = wrapper.querySelector("textarea");
if (!textarea) return;
var updateSpellcheck = () => {
var updateSpellcheck = _ => {
var style = Object.assign({},getComputedStyle(textarea));
for (let i in style) if (i.indexOf("webkit") == -1 && isNaN(parseInt(i))) spellcheck.style[i] = style[i];
spellcheck.style.setProperty("color", "transparent", "important");
@ -242,7 +242,7 @@ class SpellCheck {
updateSpellcheck();
BDFDB.ListenerUtils.add(this, textarea, "keyup", e => {
BDFDB.TimeUtils.clear(textarea.spellchecktimeout);
if (textarea.value) textarea.spellchecktimeout = BDFDB.TimeUtils.timeout(() => {updateSpellcheck();},100);
if (textarea.value) textarea.spellchecktimeout = BDFDB.TimeUtils.timeout(_ => {updateSpellcheck();},100);
else updateSpellcheck();
});
BDFDB.ListenerUtils.add(this, textarea, "scroll", e => {
@ -317,7 +317,7 @@ class SpellCheck {
this.dictionary = BDFDB.DataUtils.load(this, "owndics", lang) || [];
this.killLanguageToast();
this.languageToast = BDFDB.NotificationUtils.toast("Grabbing dictionary (" + this.languages[lang].name + "). Please wait", {timeout:0});
this.languageToast.interval = BDFDB.TimeUtils.interval(() => {
this.languageToast.interval = BDFDB.TimeUtils.interval(_ => {
this.languageToast.textContent = this.languageToast.textContent.indexOf(".....") > -1 ? "Grabbing dictionary (" + this.languages[lang].name + "). Please wait" : this.languageToast.textContent + ".";
},500);
this.languageToast.lang = lang

View File

@ -56,11 +56,11 @@ class SteamProfileLink {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -332,11 +332,11 @@ class ThemeRepo {
BDFDB.initElements(settingspanel, this);
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".btn-addtheme", () => {this.addThemeToOwnList(settingspanel);});
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".btn-addtheme", _ => {this.addThemeToOwnList(settingspanel);});
BDFDB.ListenerUtils.add(this, settingspanel, "click", "#input-themeurl", e => {if (e.which == 13) this.addThemeToOwnList(settingspanel);});
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".remove-theme", e => {this.removeThemeFromOwnList(e);});
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".remove-all", () => {this.removeAllFromOwnList(settingspanel);});
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".refresh-button", () => {
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".remove-all", _ => {this.removeAllFromOwnList(settingspanel);});
BDFDB.ListenerUtils.add(this, settingspanel, "click", ".refresh-button", _ => {
this.loading = {is:false, timeout:null, amount:0};
this.loadThemes();
});
@ -358,11 +358,11 @@ class ThemeRepo {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);
@ -375,7 +375,7 @@ class ThemeRepo {
this.loadThemes();
this.updateInterval = BDFDB.TimeUtils.interval(() => {this.checkForNewThemes();},1000*60*30);
this.updateInterval = BDFDB.TimeUtils.interval(_ => {this.checkForNewThemes();},1000*60*30);
BDFDB.ModuleUtils.forceAllUpdates(this);
}
@ -417,10 +417,10 @@ class ThemeRepo {
var folderbutton = document.querySelector(BDFDB.dotCN._repofolderbutton);
if (folderbutton) {
var repoButton = BDFDB.DOMUtils.create(`<button class="${BDFDB.disCN._repofolderbutton} bd-themerepobutton">ThemeRepo</button>`);
repoButton.addEventListener("click", () => {
repoButton.addEventListener("click", _ => {
this.openThemeRepoModal();
});
repoButton.addEventListener("mouseenter", () => {
repoButton.addEventListener("mouseenter", _ => {
BDFDB.TooltipUtils.create(repoButton, "Open Theme Repo", {type:"top",selector:"themerepo-button-tooltip"});
});
folderbutton.parentElement.insertBefore(repoButton, folderbutton.nextSibling);
@ -455,7 +455,7 @@ class ThemeRepo {
}
removeAllFromOwnList (settingspanel) {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to remove all added Themes from your own list?", () => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to remove all added Themes from your own list?", _ => {
BDFDB.DataUtils.save([], this, "ownlist", "ownlist");
BDFDB.DOMUtils.remove(settingspanel.querySelector(BDFDB.dotCN.hovercard));
});
@ -596,7 +596,7 @@ class ThemeRepo {
this.createThemeFile(data.name + ".theme.css", css);
}
});
BDFDB.ListenerUtils.addToChildren(themeRepoModal, "click", BDFDB.dotCNC.modalclose + BDFDB.dotCN.backdrop, () => {
BDFDB.ListenerUtils.addToChildren(themeRepoModal, "click", BDFDB.dotCNC.modalclose + BDFDB.dotCN.backdrop, _ => {
frame.remove();
document.removeEventListener("keyup", keyPressed);
window.removeEventListener("message", messageReceived);
@ -613,16 +613,16 @@ class ThemeRepo {
if (!document.querySelector(BDFDB.dotCN.colorpicker)) {
themeRepoModal.childNodes[0].style.setProperty("opacity", "0.85");
themeRepoModal.childNodes[1].style.setProperty("opacity", "1");
BDFDB.TimeUtils.timeout(() => {for (let child of themeRepoModal.childNodes) child.style.removeProperty("transition");}, 500);
BDFDB.TimeUtils.timeout(_ => {for (let child of themeRepoModal.childNodes) child.style.removeProperty("transition");}, 500);
}
});
BDFDB.ListenerUtils.addToChildren(themeRepoModal, "keyup", BDFDB.dotCN.searchbarinput, () => {
BDFDB.ListenerUtils.addToChildren(themeRepoModal, "keyup", BDFDB.dotCN.searchbarinput, _ => {
BDFDB.TimeUtils.clear(themeRepoModal.searchTimeout);
themeRepoModal.searchTimeout = BDFDB.TimeUtils.timeout(() => {this.sortEntries(themeRepoModal);},1000);
themeRepoModal.searchTimeout = BDFDB.TimeUtils.timeout(_ => {this.sortEntries(themeRepoModal);},1000);
});
BDFDB.ListenerUtils.addToChildren(themeRepoModal, "click", BDFDB.dotCN.searchbarclear, () => {
BDFDB.ListenerUtils.addToChildren(themeRepoModal, "click", BDFDB.dotCN.searchbarclear, _ => {
BDFDB.TimeUtils.clear(themeRepoModal.searchTimeout);
themeRepoModal.searchTimeout = BDFDB.TimeUtils.timeout(() => {this.sortEntries(themeRepoModal);},1000);
themeRepoModal.searchTimeout = BDFDB.TimeUtils.timeout(_ => {this.sortEntries(themeRepoModal);},1000);
});
BDFDB.ListenerUtils.addToChildren(themeRepoModal, "change", ".hide-checkbox", e => {
themeRepoModal.updateHidden = true;
@ -632,10 +632,10 @@ class ThemeRepo {
BDFDB.DataUtils.save(e.currentTarget.checked, this, "RNMstart", "RNMstart");
});
BDFDB.ListenerUtils.addToChildren(themeRepoModal, "click", ".sort-filter", e => {
BDFDB.createSortPopout(e.currentTarget, this.sortPopoutMarkup, () => {this.sortEntries(themeRepoModal);});
BDFDB.createSortPopout(e.currentTarget, this.sortPopoutMarkup, _ => {this.sortEntries(themeRepoModal);});
});
BDFDB.ListenerUtils.addToChildren(themeRepoModal, "click", ".order-filter", e => {
BDFDB.createSortPopout(e.currentTarget, this.orderPopoutMarkup, () => {this.sortEntries(themeRepoModal);});
BDFDB.createSortPopout(e.currentTarget, this.orderPopoutMarkup, _ => {this.sortEntries(themeRepoModal);});
});
BDFDB.ListenerUtils.addToChildren(themeRepoModal, "click", BDFDB.dotCN.tabbaritem + "[tab=themes]", e => {
if (!BDFDB.DOMUtils.containsClass(e.currentTarget, BDFDB.disCN.settingsitemselected)) {
@ -747,9 +747,9 @@ class ThemeRepo {
container.appendChild(varcontainer);
}
}
let inputs = container.querySelectorAll(".varinput"), updateTimeout, updatePreview = () => {
let inputs = container.querySelectorAll(".varinput"), updateTimeout, updatePreview = _ => {
BDFDB.TimeUtils.clear(updateTimeout);
updateTimeout = BDFDB.TimeUtils.timeout(() => {
updateTimeout = BDFDB.TimeUtils.timeout(_ => {
let css = data.fullcss;
for (let input of inputs) {
let oldvalue = input.getAttribute("placeholder");
@ -817,7 +817,7 @@ class ThemeRepo {
entry.querySelector(".btn-download").addEventListener("click", e => {
setEntryState(0);
this.downloadTheme(data);
if (themeRepoModal.querySelector("#input-rnmstart").checked) BDFDB.TimeUtils.timeout(() => {this.applyTheme(data);},3000);
if (themeRepoModal.querySelector("#input-rnmstart").checked) BDFDB.TimeUtils.timeout(_ => {this.applyTheme(data);},3000);
});
entry.querySelector(".previewCheckbox").addEventListener("click", e => {
themeRepoModal.querySelector(".generator-select " + BDFDB.dotCN.select).setAttribute('value', "-----");
@ -902,10 +902,10 @@ class ThemeRepo {
}
this.foundThemes = this.grabbedThemes.concat(ownlist);
this.loading = {is:true, timeout:BDFDB.TimeUtils.timeout(() => {
this.loading = {is:true, timeout:BDFDB.TimeUtils.timeout(_ => {
BDFDB.TimeUtils.clear(this.loading.timeout);
if (this.started) {
if (this.loading.is && this.loading.amount < 4) BDFDB.TimeUtils.timeout(() => {this.loadThemes();},10000);
if (this.loading.is && this.loading.amount < 4) BDFDB.TimeUtils.timeout(_ => {this.loadThemes();},10000);
this.loading = {is: false, timeout:null, amount:this.loading.amount};
}
},1200000), amount:this.loading.amount+1};
@ -916,12 +916,12 @@ class ThemeRepo {
}
var loadingicon = BDFDB.DOMUtils.create(this.themeRepoIconMarkup);
BDFDB.DOMUtils.addClass(loadingicon, "themerepo-loadingicon");
loadingicon.addEventListener("mouseenter", () => {
loadingicon.addEventListener("mouseenter", _ => {
BDFDB.TooltipUtils.create(loadingicon, this.getLoadingTooltipText(), {type:"left", delay:500, style:"max-width:unset;", selector:"themerepo-loading-tooltip"});
});
loadingiconwrapper.appendChild(loadingicon);
getThemeInfo(() => {
getThemeInfo(_ => {
if (!this.started) {
BDFDB.TimeUtils.clear(this.loading.timeout);
return;

View File

@ -46,7 +46,7 @@ window.onmessage = function (e) {
break;
case "Eval":
window.evalResult = null;
if (e.data.jsstring) window.eval(`(() => {${e.data.jsstring}})()`);
if (e.data.jsstring) window.eval(`(_ => {${e.data.jsstring}})()`);
window.parent.postMessage({origin:"DiscordPreview",reason:"EvalResult",result:window.evalResult},"*");
break;
case "NewTheme":
@ -77,7 +77,7 @@ window.onmessage = function (e) {
}
};
window.require = function () {
return () => {};
return _ => {};
};
window.getString = function (obj) {
var string = "";

View File

@ -35,11 +35,11 @@ class ThemeSettings {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);
@ -95,7 +95,7 @@ class ThemeSettings {
}
let closebutton = BDFDB.DOMUtils.create(`<div style="float: right; cursor: pointer;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" style="width: 18px; height: 18px;"><g class="background" fill="none" fill-rule="evenodd"><path d="M0 0h12v12H0"></path><path class="fill" fill="#dcddde" d="M9.5 3.205L8.795 2.5 6 5.295 3.205 2.5l-.705.705L5.295 6 2.5 8.795l.705.705L6 6.705 8.795 9.5l.705-.705L6.705 6"></path></g></svg></div>`);
wrapper.appendChild(closebutton);
closebutton.addEventListener("click", () => {
closebutton.addEventListener("click", _ => {
BDFDB.DOMUtils.removeClass(wrapper, BDFDB.disCN._reposettingsopen);
BDFDB.DOMUtils.addClass(wrapper, BDFDB.disCN._reposettingsclosed);
while (wrapper.childElementCount) wrapper.firstChild.remove();

View File

@ -47,11 +47,11 @@ class TimedLightDarkMode {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);
@ -110,7 +110,7 @@ class TimedLightDarkMode {
let inverted = values.timer1 > values.timer2;
let timer1LOW = this.getTime(values.timer1), timer2LOW = this.getTime(values.timer2);
let timer1HIGH = this.getHighTime(timer2LOW), timer2HIGH = this.getHighTime(timer1LOW);
let check = () => {
let check = _ => {
let currenttime = new Date();
let currenthours = currenttime.getHours();
let currentminutes = currenttime.getMinutes();
@ -139,7 +139,7 @@ class TimedLightDarkMode {
let bubble = BDFDB.DOMUtils.create(`<span class="${BDFDB.disCN.sliderbubble}">${(currenthours > 9 ? currenthours : ("0" + currenthours)) + ":" + (currentminutes > 9 ? currentminutes : ("0" + currentminutes))}</span>`);
grabber.appendChild(bubble);
grabber.style.setProperty("left", `${this.getPercent(currenttime)}%`);
let mouseleave = () => {
let mouseleave = _ => {
BDFDB.DOMUtils.remove(bubble);
grabber.removeEventListener("mouseleave", mouseleave);
};
@ -163,7 +163,7 @@ class TimedLightDarkMode {
let sMaxX = sMinX + BDFDB.DOMUtils.getRects(track).width;
let bubble = BDFDB.DOMUtils.create(`<span class="${BDFDB.disCN.sliderbubble}">${this.getTime(value, true)}</span>`);
grabber.appendChild(bubble);
let mouseup = () => {
let mouseup = _ => {
document.removeEventListener("mouseup", mouseup);
document.removeEventListener("mousemove", mousemove);
BDFDB.DOMUtils.remove(bubble);

View File

@ -104,11 +104,11 @@ class TopRoleEverywhere {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -32,7 +32,7 @@ class UserNotes {
color: BDFDB.LibraryComponents.Button.Colors.RED,
label: "Delete all Usernotes",
onClick: _ => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to remove all usernotes?", () => {
BDFDB.ModalUtils.confirm(this, "Are you sure you want to remove all usernotes?", _ => {
BDFDB.DataUtils.remove(this, "notes");
});
},
@ -56,11 +56,11 @@ class UserNotes {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);

View File

@ -35,11 +35,11 @@ class WriteUpperCase {
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js");
libraryScript.setAttribute("date", performance.now());
libraryScript.addEventListener("load", () => {this.initialize();});
libraryScript.addEventListener("load", _ => {this.initialize();});
document.head.appendChild(libraryScript);
}
else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();
this.startTimeout = setTimeout(() => {
this.startTimeout = setTimeout(_ => {
try {return this.initialize();}
catch (err) {console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not initiate plugin! " + err);}
}, 30000);