From b610d6171bbafed907d49206eb30f28c0096a133 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien <23700969+mwittrien@users.noreply.github.com> Date: Fri, 8 Jul 2022 17:29:11 +0200 Subject: [PATCH] stuff --- Plugins/EditChannels/EditChannels.plugin.js | 11 ------- .../ImageUtilities/ImageUtilities.plugin.js | 30 +++++++++++++++++-- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/Plugins/EditChannels/EditChannels.plugin.js b/Plugins/EditChannels/EditChannels.plugin.js index 37c0db2bd0..22edb59de9 100644 --- a/Plugins/EditChannels/EditChannels.plugin.js +++ b/Plugins/EditChannels/EditChannels.plugin.js @@ -519,17 +519,6 @@ module.exports = (_ => { wrapper.props.name = [wrapper.props.name]; if (wrapper.props.avatar) wrapper.props.avatar.props.src = this.getGroupIcon(instance.props.channel.id); } - - processPrivateChannel (e) { - if (e.instance.props.channel && e.instance.props.channel.isGroupDM() && this.settings.places.channelList) { - if (changedChannels[e.instance.props.channel.id] && changedChannels[e.instance.props.channel.id].name) { - e.returnvalue.props.name = BDFDB.ReactUtils.createElement("span", {children: this.getGroupName(e.instance.props.channel.id)}); - } - this.changeChannelColor(e.returnvalue.props.name, e.instance.props.channel.id, {modify: BDFDB.ObjectUtils.extract(Object.assign({}, e.instance.props, e.instance.state), "hovered", "selected", "hasUnreadMessages", "muted")}); - e.returnvalue.props.name = [e.returnvalue.props.name]; - e.returnvalue.props.avatar.props.src = this.getGroupIcon(e.instance.props.channel.id); - } - } processQuickSwitchChannelResult (e) { if (e.instance.props.channel && this.settings.places.quickSwitcher) { diff --git a/Plugins/ImageUtilities/ImageUtilities.plugin.js b/Plugins/ImageUtilities/ImageUtilities.plugin.js index 07261620f1..083d03b37f 100644 --- a/Plugins/ImageUtilities/ImageUtilities.plugin.js +++ b/Plugins/ImageUtilities/ImageUtilities.plugin.js @@ -2,7 +2,7 @@ * @name ImageUtilities * @author DevilBro * @authorId 278543574059057154 - * @version 4.7.6 + * @version 4.7.7 * @description Adds several Utilities for Images/Videos (Gallery, Download, Reverse Search, Zoom, Copy, etc.) * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,7 +17,7 @@ module.exports = (_ => { "info": { "name": "ImageUtilities", "author": "DevilBro", - "version": "4.7.6", + "version": "4.7.7", "description": "Adds several Utilities for Images/Videos (Gallery, Download, Reverse Search, Zoom, Copy, etc.)" } }; @@ -303,6 +303,10 @@ module.exports = (_ => { align-items: center; min-width: 500px; } + ${BDFDB.dotCNS.imagemodal + BDFDB.notCN._imageutilitiessibling} > ${BDFDB.dotCN.imagewrapper} img { + object-fit: contain; + width: unset; + } ${BDFDB.dotCN._imageutilitiessibling} { display: flex; align-items: center; @@ -687,9 +691,28 @@ module.exports = (_ => { } onGroupDMContextMenu (e) { - if (e.instance.props.channel && e.instance.props.channel.isGroupDM() && this.settings.places.groupIcons) this.injectItem(e, [(BDFDB.DMUtils.getIcon(e.instance.props.channel.id) || "").replace(/\.webp|\.gif/, ".png")]); + if (e.instance.props.channel && e.instance.props.channel.isGroupDM() && this.settings.places.groupIcons) this.injectItem(e, ); } + onChannelContextMenu (e) { + if (e.instance.props.channel && e.instance.props.channel.isGroupDM() && this.settings.places.groupIcons && e.subType == "useChannelLeaveItem") { + let validUrls = this.filterUrls((BDFDB.DMUtils.getIcon(e.instance.props.channel.id) || "").replace(/\.webp|\.gif/, ".png")); + if (!validUrls.length) return; + + if (e.returnvalue.length) e.returnvalue.unshift(BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuSeparator, {})); + e.returnvalue.unshift(BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { + label: this.isValid(validUrls[0].file, "video") ? BDFDB.LanguageUtils.LanguageStrings.VIDEO : BDFDB.LanguageUtils.LanguageStrings.IMAGE + " " + BDFDB.LanguageUtils.LanguageStrings.ACTIONS, + id: BDFDB.ContextMenuUtils.createItemId(this.name, "main-subitem"), + children: this.createSubMenus({ + instance: e.instance, + urls: validUrls, + prefix: BDFDB.LanguageUtils.LanguageStrings.USER_SETTINGS_AVATAR + }) + })); + } + } + + onNativeContextMenu (e) { if (e.type == "NativeImageContextMenu" && (e.instance.props.href || e.instance.props.src)) this.injectItem(e, [e.instance.props.href || e.instance.props.src]); } @@ -1052,6 +1075,7 @@ module.exports = (_ => { } if (this.settings.viewerSettings.galleryMode && viewedImage) { + console.log(viewedImage); if (!cachedImages || cachedImages.channelId != viewedImage.channelId || cachedImages.amount && this.getImageIndex(cachedImages.all, viewedImage) == -1) { BDFDB.TimeUtils.clear(viewedImageTimeout); let channel = BDFDB.LibraryModules.ChannelStore.getChannel(viewedImage.channelId);