diff --git a/Plugins/EditUsers/EditUsers.plugin.js b/Plugins/EditUsers/EditUsers.plugin.js index e10763c8da..e33a4f11f6 100644 --- a/Plugins/EditUsers/EditUsers.plugin.js +++ b/Plugins/EditUsers/EditUsers.plugin.js @@ -3,7 +3,7 @@ class EditUsers { getName () {return "EditUsers";} - getVersion () {return "3.2.9";} + getVersion () {return "3.3.0";} getAuthor () {return "DevilBro";} @@ -11,7 +11,7 @@ class EditUsers { initConstructor () { this.changelog = { - "fixed":[["Typing Users","The plugin now properly changes the names in the typing users list"]] + "fixed":[["Changes","Fixed for the new server classes"]] }; this.labels = {}; @@ -265,7 +265,7 @@ class EditUsers { if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) { let data = BDFDB.loadAllData(this, "users"); BDFDB.removeAllData(this, "users"); - BDFDB.WebModules.forceAllUpdates(this); + try {BDFDB.WebModules.forceAllUpdates(this);} catch (err) {} BDFDB.saveAllData(data, this, "users"); BDFDB.removeEles(".autocompleteEditUsers", ".autocompleteEditUsersRow"); @@ -309,14 +309,14 @@ class EditUsers { let userContextSubMenu = BDFDB.htmlToElement(this.userContextSubMenuMarkup); let useritem = userContextSubMenu.querySelector(".usersettings-item"); useritem.addEventListener("click", () => { - instance._reactInternalFiber.return.memoizedProps.closeContextMenu(); + BDFDB.closeContextMenu(menu); this.showUserSettings(instance.props.user); }); if (BDFDB.loadData(instance.props.user.id, this, "users")) { let resetitem = userContextSubMenu.querySelector(".resetsettings-item"); BDFDB.removeClass(resetitem, BDFDB.disCN.contextmenuitemdisabled); resetitem.addEventListener("click", () => { - instance._reactInternalFiber.return.memoizedProps.closeContextMenu(); + BDFDB.closeContextMenu(menu); BDFDB.removeData(instance.props.user.id, this, "users"); BDFDB.WebModules.forceAllUpdates(this); }); @@ -969,7 +969,7 @@ class EditUsers { else if (BDFDB.getParentEle(BDFDB.dotCN.textareawrapchat, wrapper)) key = "changeInChatTextarea"; else if (BDFDB.getParentEle(BDFDB.dotCN.voiceuser, wrapper)) key = "changeInVoiceChat"; else if (BDFDB.getParentEle(BDFDB.dotCN.members, wrapper)) key = "changeInMemberList"; - else if (BDFDB.getParentEle(BDFDB.dotCN.dms, wrapper)) key = "changeInRecentDms"; + else if (BDFDB.getParentEle(BDFDB.dotCN.dmguild, wrapper)) key = "changeInRecentDms"; else if (BDFDB.getParentEle(BDFDB.dotCN.dmchannels, wrapper)) key = "changeInDmsList"; else if (BDFDB.getParentEle(BDFDB.dotCN.channelheaderheaderbar, wrapper)) key = "changeInDmHeader"; else if (BDFDB.getParentEle(BDFDB.dotCN.callavatarwrapper, wrapper) || BDFDB.getParentEle(BDFDB.dotCN.callincoming, wrapper) || BDFDB.getParentEle(BDFDB.dotCN.callcurrentcontainer, wrapper) || BDFDB.getParentEle(BDFDB.dotCN.pictureinpicture, wrapper)) key = "changeInDmCalls"; diff --git a/Plugins/PinDMs/PinDMs.plugin.js b/Plugins/PinDMs/PinDMs.plugin.js index 6bde36c26b..848aa2ff53 100644 --- a/Plugins/PinDMs/PinDMs.plugin.js +++ b/Plugins/PinDMs/PinDMs.plugin.js @@ -3,7 +3,7 @@ class PinDMs { getName () {return "PinDMs";} - getVersion () {return "1.3.7";} + getVersion () {return "1.3.8";} getAuthor () {return "DevilBro";} @@ -11,8 +11,7 @@ class PinDMs { initConstructor () { this.changelog = { - "added":[["Pin Icon","Added the option to disable the 'Pin' icon for pinned DMs in the server list"]], - "fixed":[["Pin Icon","Repositioned the pin icon in a way that it doesn't cover the audio/video icon"]] + "fixed":[["Changes","Fixed for the new server classes"]] }; this.patchModules = { @@ -73,36 +72,36 @@ class PinDMs { `; - this.recentDMMarkup = - `
+ this.recentDMMarkup = + `
-
- +
+
-
0
+
0
`; this.css = ` ${BDFDB.dotCN.dmchannel}.pindms-dragpreview, - ${BDFDB.dotCN.guild}.pindms-dragpreview { + ${BDFDB.dotCN.dmguild}.pindms-dragpreview { pointer-events: none !important; position: absolute !important; opacity: 0.5 !important; z-index: 10000 !important; } - ${BDFDB.dotCN.guild}.pindms-dragpreview:before, - ${BDFDB.dotCN.guild}.pindms-dragpreview:after, - ${BDFDB.dotCN.guild}.pindms-dragpreview ${BDFDB.dotCN.badge} { + ${BDFDB.dotCN.dmguild}.pindms-dragpreview:before, + ${BDFDB.dotCN.dmguild}.pindms-dragpreview:after, + ${BDFDB.dotCN.dmguild}.pindms-dragpreview ${BDFDB.dotCN.dmguildbadge} { display: none !important; } - ${BDFDB.dotCN.guild}.pindms-dragpreview ${BDFDB.dotCN.avataricon} { + ${BDFDB.dotCN.dmguild}.pindms-dragpreview ${BDFDB.dotCN.dmguildavatar} { background-color: transparent !important; overflow: hidden !important; }`; this.pinIconCSS = ` - ${BDFDB.dotCN.guild}.pinned:before { + ${BDFDB.dotCN.dmguild}.pinned:before { background-position: 50%; background-repeat: no-repeat; background-size: 16px; @@ -112,16 +111,16 @@ class PinDMs { overflow: hidden; pointer-events: none; position: absolute; - width: 24px; left: -6px; top: -6px; + width: 24px; z-index: 1; background-image: url('data:image/svg+xml; utf8, '); } - ${BDFDB.dotCNS.themelight + BDFDB.dotCN.guild}.pinned:before { + ${BDFDB.dotCNS.themelight + BDFDB.dotCN.dmguild}.pinned:before { background-color: #202225; } - ${BDFDB.dotCNS.themedark + BDFDB.dotCN.guild}.pinned:before { + ${BDFDB.dotCNS.themedark + BDFDB.dotCN.dmguild}.pinned:before { background-color: #202225; }` @@ -224,7 +223,7 @@ class PinDMs { this.unhideNativeDM(info.id); if (info.div) info.div.removeEventListener("contextmenu", info.div.PinDMsContextMenuListener); } - BDFDB.removeEles(BDFDB.dotCNS.dms + BDFDB.dotCN.guild + ".pinned", ".pindms-dragpreview"); + BDFDB.removeEles(BDFDB.dotCN.dmguild + ".pinned", ".pindms-dragpreview"); BDFDB.unloadMessage(this); } @@ -311,7 +310,7 @@ class PinDMs { BDFDB.removeEles(pinguilditem); unpinguilditem.addEventListener("click", () => { BDFDB.closeContextMenu(target); - BDFDB.removeEles(document.querySelector(`${BDFDB.dotCNS.dms + BDFDB.dotCN.guild}.pinned[channelid="${id}"]`)); + BDFDB.removeEles(document.querySelector(`${BDFDB.dotCN.dmguild}.pinned[channelid="${id}"]`)); this.unhideNativeDM(id); BDFDB.removeData(id, this, "pinnedRecents"); this.updatePinnedPositions("pinnedRecents"); @@ -322,8 +321,7 @@ class PinDMs { } processGuilds (instance, wrapper) { - let dms = wrapper.querySelector(BDFDB.dotCN.dms); - if (dms) for (let id of this.sortAndUpdate("pinnedRecents")) this.addPinnedRecent(id); + for (let id of this.sortAndUpdate("pinnedRecents")) this.addPinnedRecent(id); } processPrivateChannel (instance, wrapper) { @@ -525,14 +523,14 @@ class PinDMs { } addPinnedRecent (id) { - let dms = document.querySelector(BDFDB.dotCN.dms); - if (dms && !dms.querySelector(`${BDFDB.dotCN.guild}.pinned[channelid="${id}"]`)) { + let anker = document.querySelector(`${BDFDB.dotCNS.guilds + BDFDB.dotCN.friendsonline}`); + if (anker && !document.querySelector(`${BDFDB.dotCN.dmguild}.pinned[channelid="${id}"]`)) { let info = this.ChannelUtils.getChannel(id); if (info) { let dmdiv = BDFDB.htmlToElement(this.recentDMMarkup); let user = info.type == 1 ? this.UserUtils.getUser(info.recipients[0]) : null; dmdiv.setAttribute("channelid", id); - dms.insertBefore(dmdiv, dms.firstElementChild); + anker.parentElement.insertBefore(dmdiv, anker.nextSibling); let avatar = dmdiv.querySelector(BDFDB.dotCN.avatarinner); let dmname = info.name; if (!dmname && info.recipients.length > 0) { @@ -568,8 +566,6 @@ class PinDMs { if (Math.sqrt((x - e2.pageX)**2) > 20 || Math.sqrt((y - e2.pageY)**2) > 20) { document.removeEventListener("mousemove", mousemove); document.removeEventListener("mouseup", mouseup); - let dmswrap = document.querySelector(`${BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.dms}`); - if (!dmswrap) return; let hovele = null; let placeholder = BDFDB.htmlToElement(`
`); let dragpreview = this.createDragPreview(dmdiv, e); @@ -577,8 +573,8 @@ class PinDMs { BDFDB.removeEles(placeholder); BDFDB.toggleEles(dmdiv, false); this.updateDragPreview(dragpreview, e3); - hovele = BDFDB.getParentEle(BDFDB.dotCNS.dms + BDFDB.dotCN.guild + ".pinned", e3.target); - if (hovele) dmswrap.insertBefore(placeholder, hovele.nextSibling); + hovele = BDFDB.getParentEle(BDFDB.dotCN.dmguild + ".pinned", e3.target); + if (hovele) hovele.parentElement.insertBefore(placeholder, hovele.nextSibling); }; let releasing = e3 => { document.removeEventListener("mousemove", dragging); @@ -586,7 +582,7 @@ class PinDMs { BDFDB.removeEles(placeholder, dragpreview); BDFDB.toggleEles(dmdiv, true); if (hovele) { - dmswrap.insertBefore(dmdiv, hovele.nextSibling); + hovele.parentElement.insertBefore(dmdiv, hovele.nextSibling); this.updatePinnedPositions("pinnedRecents"); } }; @@ -631,23 +627,23 @@ class PinDMs { updatePinnedPositions (type) { let newPinned = {}, oldPinned = BDFDB.loadAllData(this, type); - let pins = Array.from(document.querySelectorAll(type == "pinnedRecents" ? `${BDFDB.dotCNS.dms + BDFDB.dotCN.guild}.pinned` : `${BDFDB.dotCNS.dmchannels + BDFDB.dotCN.dmchannel}.pinned`)).map(div => {return div.getAttribute("channelid");}).reverse(); + let pins = Array.from(document.querySelectorAll(type == "pinnedRecents" ? `${BDFDB.dotCN.dmguild}.pinned` : `${BDFDB.dotCNS.dmchannels + BDFDB.dotCN.dmchannel}.pinned`)).map(div => {return div.getAttribute("channelid");}).reverse(); for (let i in pins) if (pins[i]) newPinned[pins[i]] = parseInt(i); for (let id in oldPinned) if (newPinned[id] == undefined) newPinned[id] = Object.keys(newPinned).length; BDFDB.saveAllData(newPinned, this, type); } updatePinnedRecent (id, unmouted = false) { - let pinneddmdiv = document.querySelector(`${BDFDB.dotCNS.dms + BDFDB.dotCN.guild}.pinned[channelid="${id}"]`); + let pinneddmdiv = document.querySelector(`${BDFDB.dotCN.dmguild}.pinned[channelid="${id}"]`); if (Node.prototype.isPrototypeOf(pinneddmdiv)) { let dmdiv = BDFDB.getDmDiv(id); let count = this.UnreadUtils.getUnreadCount(id); - let badge = pinneddmdiv.querySelector(BDFDB.dotCN.badge); + let badge = pinneddmdiv.querySelector(BDFDB.dotCN.dmguildbadge); BDFDB.toggleEles(badge, count > 0); BDFDB.toggleClass(pinneddmdiv, "has-new-messages", count > 0); badge.innerText = count; - BDFDB.toggleClass(pinneddmdiv, BDFDB.disCN.guildaudio, !unmouted && Node.prototype.isPrototypeOf(dmdiv) && BDFDB.containsClass(dmdiv, BDFDB.disCN.guildaudio)); - BDFDB.toggleClass(pinneddmdiv, BDFDB.disCN.guildvideo, !unmouted && Node.prototype.isPrototypeOf(dmdiv) && BDFDB.containsClass(dmdiv, BDFDB.disCN.guildvideo)); + BDFDB.toggleClass(pinneddmdiv, BDFDB.disCN.dmguildaudio, !unmouted && Node.prototype.isPrototypeOf(dmdiv) && BDFDB.containsClass(dmdiv, BDFDB.disCN.dmguildaudio)); + BDFDB.toggleClass(pinneddmdiv, BDFDB.disCN.dmguildvideo, !unmouted && Node.prototype.isPrototypeOf(dmdiv) && BDFDB.containsClass(dmdiv, BDFDB.disCN.dmguildvideo)); } } @@ -670,7 +666,7 @@ class PinDMs { addHoverBehaviour (div) { /* based on stuff from Zerebos */ let divinner = div.querySelector(BDFDB.dotCN.guildinner); - let divicon = div.querySelector(BDFDB.dotCN.guildicon); + let divicon = div.querySelector(BDFDB.dotCN.dmguildavatarinner); let backgroundColor = new this.Animations.Value(0); backgroundColor .interpolate({ diff --git a/Plugins/ReadAllNotificationsButton/ReadAllNotificationsButton.plugin.js b/Plugins/ReadAllNotificationsButton/ReadAllNotificationsButton.plugin.js index 87f73f8200..95da150146 100644 --- a/Plugins/ReadAllNotificationsButton/ReadAllNotificationsButton.plugin.js +++ b/Plugins/ReadAllNotificationsButton/ReadAllNotificationsButton.plugin.js @@ -3,7 +3,7 @@ class ReadAllNotificationsButton { getName () {return "ReadAllNotificationsButton";} - getVersion () {return "1.4.2";} + getVersion () {return "1.4.3";} getAuthor () {return "DevilBro";} @@ -11,12 +11,13 @@ class ReadAllNotificationsButton { initConstructor () { this.changelog = { - "improved":[["Clear Mentions","Added an option to add the 'Clear Mentions' button in the recent mentions popout"]] + "fixed":[["Changes","Fixed for the new server classes"]] }; this.patchModules = { "Guilds":"componentDidMount", - "RecentMentions":"componentDidMount" + "RecentMentions":"componentDidMount", + "DirectMessage":"componentDidMount" }; this.RANcontextMenuMarkup = @@ -168,6 +169,12 @@ class ReadAllNotificationsButton { } } + processDirectMessage (instance, wrapper, methodnames) { + let ranbutton = document.querySelector(".RANbutton-frame"); + let guildseparator = wrapper.parentElement.parentElement.querySelector(BDFDB.dotCN.guildseparator); + if (ranbutton && guildseparator) guildseparator.parentElement.insertBefore(ranbutton, guildseparator); + } + processRecentMentions (instance, wrapper) { BDFDB.removeEles(".RAMbutton"); if (instance.props && instance.props.popoutName == "RECENT_MENTIONS_POPOUT" && BDFDB.getData("addClearButton", this, "settings")) { @@ -188,7 +195,9 @@ class ReadAllNotificationsButton { instance.loadMore(); setTimeout(() => {this.clearMentions(instance, wrapper);},3000); } - }setLabelsByLanguage () { + } + + setLabelsByLanguage () { switch (BDFDB.getDiscordLanguage().id) { case "hr": //croatian return {