diff --git a/Library/0BDFDB.plugin.js b/Library/0BDFDB.plugin.js index 9137612806..bcc7840d04 100644 --- a/Library/0BDFDB.plugin.js +++ b/Library/0BDFDB.plugin.js @@ -2,7 +2,7 @@ * @name BDFDB * @author DevilBro * @authorId 278543574059057154 - * @version 1.5.0 + * @version 1.5.1 * @description Required Library for DevilBro's Plugins * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -22,15 +22,10 @@ module.exports = (_ => { "info": { "name": "BDFDB", "author": "DevilBro", - "version": "1.5.0", + "version": "1.5.1", "description": "Required Library for DevilBro's Plugins" }, - "rawUrl": `https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js`, - "changeLog": { - "improved": { - "Select Component": "Switched the old Dropdown Select Component with Discord's New Version" - } - } + "rawUrl": `https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js` }; const DiscordObjects = {}; @@ -1555,26 +1550,20 @@ module.exports = (_ => { else BDFDB.DOMUtils.addClass(tooltip, BDFDB.disCN.tooltipprimary); if (config.list || BDFDB.ObjectUtils.is(config.guild)) BDFDB.DOMUtils.addClass(tooltip, BDFDB.disCN.tooltiplistitem); - - let mouseMove = e => { - let parent = e.target.parentElement.querySelector(":hover"); - if (parent && anker != parent && !anker.contains(parent)) itemLayer.removeTooltip(); + + const removeTooltip = _ => { + document.removeEventListener("mousemove", mouseMove); + document.removeEventListener("mouseleave", mouseLeave); + BDFDB.DOMUtils.remove(itemLayer); + BDFDB.ArrayUtils.remove(Tooltips, id); + observer.disconnect(); + if (zIndexed) BDFDB.DOMUtils.removeClass(itemLayerContainer, BDFDB.disCN.itemlayercontainerzindexdisabled); + if (typeof config.onHide == "function") config.onHide(itemLayer, anker); }; - let mouseLeave = e => itemLayer.removeTooltip(); - if (!config.perssist) { - document.addEventListener("mousemove", mouseMove); - document.addEventListener("mouseleave", mouseLeave); - } - - let observer = new MutationObserver(changes => changes.forEach(change => { - let nodes = Array.from(change.removedNodes); - if (nodes.indexOf(itemLayer) > -1 || nodes.indexOf(anker) > -1 || nodes.some(n => n.contains(anker))) itemLayer.removeTooltip(); - })); - observer.observe(document.body, {subtree: true, childList: true}); - - (tooltip.setText = itemLayer.setText = newText => { + const setText = newText => { if (BDFDB.ObjectUtils.is(config.guild)) { - let voiceChannels = LibraryModules.GuildChannelStore.getChannels(config.guild.id)[BDFDB.DiscordConstants.ChannelTypes.GUILD_VOICE].map(c => c.channel.id); + let channels = LibraryModules.GuildChannelStore.getChannels(config.guild.id); + let voiceChannels = (channels[BDFDB.DiscordConstants.ChannelTypes.GUILD_VOICE] || channels.VOCAL || []).map(c => c.channel.id); let streamOwnerIds = LibraryModules.StreamUtils.getAllApplicationStreams().filter(app => app.guildId === config.guild.id).map(app => app.ownerId) || []; let streamOwners = streamOwnerIds.map(ownerId => LibraryModules.UserStore.getUser(ownerId)).filter(n => n); let connectedUsers = BDFDB.ObjectUtils.toArray(LibraryModules.VoiceUtils.getVoiceStates(config.guild.id)).map(state => voiceChannels.includes(state.channelId) && state.channelId != config.guild.afkChannelId && !streamOwnerIds.includes(state.userId) && LibraryModules.UserStore.getUser(state.userId)).filter(n => n); @@ -1648,18 +1637,9 @@ module.exports = (_ => { else if (config.html) tooltipContent.innerHTML = newText; else tooltipContent.innerText = newText; } - })(text); - (tooltip.removeTooltip = itemLayer.removeTooltip = _ => { - document.removeEventListener("mousemove", mouseMove); - document.removeEventListener("mouseleave", mouseLeave); - BDFDB.DOMUtils.remove(itemLayer); - BDFDB.ArrayUtils.remove(Tooltips, id); - observer.disconnect(); - if (zIndexed) BDFDB.DOMUtils.removeClass(itemLayerContainer, BDFDB.disCN.itemlayercontainerzindexdisabled); - if (typeof config.onHide == "function") config.onHide(itemLayer, anker); - }); - (tooltip.update = itemLayer.update = newText => { - if (newText) tooltip.setText(newText); + }; + const update = newText => { + if (newText) setText(newText); let left, top; const tRects = BDFDB.DOMUtils.getRects(anker); const iRects = BDFDB.DOMUtils.getRects(itemLayer); @@ -1718,7 +1698,29 @@ module.exports = (_ => { } } } - })(); + }; + + const mouseMove = e => { + let parent = e.target.parentElement.querySelector(":hover"); + if (parent && anker != parent && !anker.contains(parent)) removeTooltip(); + }; + const mouseLeave = e => removeTooltip(); + if (!config.perssist) { + document.addEventListener("mousemove", mouseMove); + document.addEventListener("mouseleave", mouseLeave); + } + + const observer = new MutationObserver(changes => changes.forEach(change => { + let nodes = Array.from(change.removedNodes); + if (nodes.indexOf(itemLayer) > -1 || nodes.indexOf(anker) > -1 || nodes.some(n => n.contains(anker))) removeTooltip(); + })); + observer.observe(document.body, {subtree: true, childList: true}); + + tooltip.removeTooltip = itemLayer.removeTooltip = removeTooltip; + tooltip.setText = itemLayer.setText = setText; + tooltip.update = itemLayer.update = update; + setText(text); + update(); if (config.delay) { BDFDB.DOMUtils.toggle(itemLayer); diff --git a/Plugins/EditUsers/EditUsers.plugin.js b/Plugins/EditUsers/EditUsers.plugin.js index f5fb3daf55..15a5bea242 100644 --- a/Plugins/EditUsers/EditUsers.plugin.js +++ b/Plugins/EditUsers/EditUsers.plugin.js @@ -2,7 +2,7 @@ * @name EditUsers * @author DevilBro * @authorId 278543574059057154 - * @version 4.1.6 + * @version 4.1.7 * @description Allows you to locally edit Users * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien diff --git a/Plugins/PluginRepo/PluginRepo.plugin.js b/Plugins/PluginRepo/PluginRepo.plugin.js index f9a1069ec3..d14c2e2b29 100644 --- a/Plugins/PluginRepo/PluginRepo.plugin.js +++ b/Plugins/PluginRepo/PluginRepo.plugin.js @@ -2,7 +2,7 @@ * @name PluginRepo * @author DevilBro * @authorId 278543574059057154 - * @version 2.1.5 + * @version 2.1.6 * @description Allow you to look at all plugins from the plugin repo and download them on the fly * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien diff --git a/Plugins/ShowHiddenChannels/ShowHiddenChannels.plugin.js b/Plugins/ShowHiddenChannels/ShowHiddenChannels.plugin.js index 2b9ca6c6b4..a897cd0285 100644 --- a/Plugins/ShowHiddenChannels/ShowHiddenChannels.plugin.js +++ b/Plugins/ShowHiddenChannels/ShowHiddenChannels.plugin.js @@ -2,7 +2,7 @@ * @name ShowHiddenChannels * @author DevilBro * @authorId 278543574059057154 - * @version 2.9.3 + * @version 2.9.4 * @description Displays all hidden Channels, which can't be accessed due to Role Restrictions, this won't allow you to read them (impossible) * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,13 +17,8 @@ module.exports = (_ => { "info": { "name": "ShowHiddenChannels", "author": "DevilBro", - "version": "2.9.3", + "version": "2.9.4", "description": "Displays all hidden Channels, which can't be accessed due to Role Restrictions, this won't allow you to read them (impossible)" - }, - "changeLog": { - "added": { - "Hide connected voice users": "You can now disable the option to show users who are in a hidden voice channel" - } } }; @@ -76,6 +71,11 @@ module.exports = (_ => { GUILD_ANNOUNCEMENT: "showAnnouncement", GUILD_STORE: "showStore" }; + + const channelsAliases = { + GUILD_TEXT: "SELECTABLE", + GUILD_VOICE: "VOCAL" + }; const typeNameMap = { GUILD_TEXT: "TEXT_CHANNEL", @@ -387,7 +387,7 @@ module.exports = (_ => { hiddenCategory = new BDFDB.DiscordObjects.Channel({ guild_id: e.instance.props.guild.id, id: hiddenId, - "name": "hidden", + name: "hidden", type: BDFDB.DiscordConstants.ChannelTypes.GUILD_CATEGORY }); e.instance.props.categories[hiddenId] = []; @@ -403,7 +403,7 @@ module.exports = (_ => { else hiddenCategory = null; for (let type in hiddenChannels) { - let channelType = type == BDFDB.DiscordConstants.ChannelTypes.GUILD && e.instance.props.channels.SELECTABLE ? "SELECTABLE" : type; + let channelType = channelsAliases[BDFDB.DiscordConstants.ChannelTypes[type]] || type; if (!BDFDB.ArrayUtils.is(e.instance.props.channels[channelType])) e.instance.props.channels[channelType] = []; for (let channel of hiddenChannels[type]) { let hiddenChannel = new BDFDB.DiscordObjects.Channel(Object.assign({}, channel, { diff --git a/Plugins/WriteUpperCase/WriteUpperCase.plugin.js b/Plugins/WriteUpperCase/WriteUpperCase.plugin.js index bff1175a2e..f658287a81 100644 --- a/Plugins/WriteUpperCase/WriteUpperCase.plugin.js +++ b/Plugins/WriteUpperCase/WriteUpperCase.plugin.js @@ -2,7 +2,7 @@ * @name WriteUpperCase * @author DevilBro * @authorId 278543574059057154 - * @version 1.2.9 + * @version 1.3.0 * @description Changes the first Letter of each Sentence in Message Inputs to Uppercase * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien