stuff
This commit is contained in:
parent
d3fa3b69b7
commit
7fb71dcbf4
|
@ -54,6 +54,7 @@
|
||||||
"GuildChannelKeys": {"props": ["GUILD_SELECTABLE_CHANNELS_KEY", "GUILD_VOCAL_CHANNELS_KEY"]},
|
"GuildChannelKeys": {"props": ["GUILD_SELECTABLE_CHANNELS_KEY", "GUILD_VOCAL_CHANNELS_KEY"]},
|
||||||
"GuildChannelStore": {"props": ["getChannels", "getDefaultChannel"]},
|
"GuildChannelStore": {"props": ["getChannels", "getDefaultChannel"]},
|
||||||
"GuildEmojiStore": {"props": ["getGuildEmoji", "getDisambiguatedEmojiContext"]},
|
"GuildEmojiStore": {"props": ["getGuildEmoji", "getDisambiguatedEmojiContext"]},
|
||||||
|
"GuildEventStore": {"props": ["getGuildScheduledEventsForGuild", "getGuildScheduledEvent"]},
|
||||||
"GuildNotificationsUtils": {"props": ["updateChannelOverrideSettings", "updateGuildNotificationSettings"]},
|
"GuildNotificationsUtils": {"props": ["updateChannelOverrideSettings", "updateGuildNotificationSettings"]},
|
||||||
"GuildSettingsUtils": {"props": ["open", "updateGuild"]},
|
"GuildSettingsUtils": {"props": ["open", "updateGuild"]},
|
||||||
"GuildStore": {"props": ["getGuild", "getGuilds"]},
|
"GuildStore": {"props": ["getGuild", "getGuilds"]},
|
||||||
|
@ -136,6 +137,7 @@
|
||||||
"ThreadStore": {"props": ["isActive", "getThreadsForGuild"]},
|
"ThreadStore": {"props": ["isActive", "getThreadsForGuild"]},
|
||||||
"UnreadGuildUtils": {"props": ["hasUnread", "getTotalMentionCount"]},
|
"UnreadGuildUtils": {"props": ["hasUnread", "getTotalMentionCount"]},
|
||||||
"UnreadChannelUtils": {"props": ["getUnreadCount", "getOldestUnreadMessageId"]},
|
"UnreadChannelUtils": {"props": ["getUnreadCount", "getOldestUnreadMessageId"]},
|
||||||
|
"UnreadStateTypes": {"props": ["ReadStateTypes"], "value": "ReadStateTypes"},
|
||||||
"UploadUtils": {"props": ["upload", "instantBatchUpload"]},
|
"UploadUtils": {"props": ["upload", "instantBatchUpload"]},
|
||||||
"URLParser": {"props": ["parse", "resolveObject"]},
|
"URLParser": {"props": ["parse", "resolveObject"]},
|
||||||
"UserBioParser": {"props": ["parseBioReact"]},
|
"UserBioParser": {"props": ["parseBioReact"]},
|
||||||
|
@ -1288,6 +1290,7 @@
|
||||||
"HoverCard": {"props": ["card", "active"]},
|
"HoverCard": {"props": ["card", "active"]},
|
||||||
"HoverCardRemoveButton": {"props": ["button", "filled", "default"]},
|
"HoverCardRemoveButton": {"props": ["button", "filled", "default"]},
|
||||||
"IconDirection": {"props": ["directionDown", "directionUp"]},
|
"IconDirection": {"props": ["directionDown", "directionUp"]},
|
||||||
|
"ImageAssets": {"props": ["pngImage", "stickerAsset"]},
|
||||||
"ImageModal": {"props": ["image", "modal"], "length": 4, "smaller": true},
|
"ImageModal": {"props": ["image", "modal"], "length": 4, "smaller": true},
|
||||||
"ImageWrapper": {"props": ["clickable", "imageWrapperBackground"]},
|
"ImageWrapper": {"props": ["clickable", "imageWrapperBackground"]},
|
||||||
"Input": {"props": ["inputMini", "inputDefault"]},
|
"Input": {"props": ["inputMini", "inputDefault"]},
|
||||||
|
@ -2311,10 +2314,12 @@
|
||||||
"imagealttext": ["MessageElements", "altText"],
|
"imagealttext": ["MessageElements", "altText"],
|
||||||
"imageclickable": ["ImageWrapper", "clickable"],
|
"imageclickable": ["ImageWrapper", "clickable"],
|
||||||
"imageerror": ["ImageWrapper", "imageError"],
|
"imageerror": ["ImageWrapper", "imageError"],
|
||||||
|
"imageoriginallink": ["ImageWrapper", "originalLink"],
|
||||||
"imageplaceholder": ["ImageWrapper", "imagePlaceholder"],
|
"imageplaceholder": ["ImageWrapper", "imagePlaceholder"],
|
||||||
"imageplaceholderoverlay": ["ImageWrapper", "imagePlaceholderOverlay"],
|
"imageplaceholderoverlay": ["ImageWrapper", "imagePlaceholderOverlay"],
|
||||||
"imagemodal": ["ImageModal", "modal"],
|
"imagemodal": ["ImageModal", "modal"],
|
||||||
"imagemodalimage": ["ImageModal", "image"],
|
"imagemodalimage": ["ImageModal", "image"],
|
||||||
|
"imagesticker": ["ImageAssets", "stickerAsset"],
|
||||||
"imagewrapper": ["ImageWrapper", "imageWrapper"],
|
"imagewrapper": ["ImageWrapper", "imageWrapper"],
|
||||||
"imagewrapperbackground": ["ImageWrapper", "imageWrapperBackground"],
|
"imagewrapperbackground": ["ImageWrapper", "imageWrapperBackground"],
|
||||||
"imagewrapperinner": ["ImageWrapper", "imageWrapperInner"],
|
"imagewrapperinner": ["ImageWrapper", "imageWrapperInner"],
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* @name ImageUtilities
|
* @name ImageUtilities
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 4.6.3
|
* @version 4.6.4
|
||||||
* @description Adds several Utilities for Images/Videos (Gallery, Download, Reverse Search, Zoom, Copy, etc.)
|
* @description Adds several Utilities for Images/Videos (Gallery, Download, Reverse Search, Zoom, Copy, etc.)
|
||||||
* @invite Jx3TjNS
|
* @invite Jx3TjNS
|
||||||
* @donate https://www.paypal.me/MircoWittrien
|
* @donate https://www.paypal.me/MircoWittrien
|
||||||
|
@ -17,18 +17,14 @@ module.exports = (_ => {
|
||||||
"info": {
|
"info": {
|
||||||
"name": "ImageUtilities",
|
"name": "ImageUtilities",
|
||||||
"author": "DevilBro",
|
"author": "DevilBro",
|
||||||
"version": "4.6.3",
|
"version": "4.6.4",
|
||||||
"description": "Adds several Utilities for Images/Videos (Gallery, Download, Reverse Search, Zoom, Copy, etc.)"
|
"description": "Adds several Utilities for Images/Videos (Gallery, Download, Reverse Search, Zoom, Copy, etc.)"
|
||||||
},
|
},
|
||||||
"changeLog": {
|
"changeLog": {
|
||||||
"fixed": {
|
"fixed": {
|
||||||
"Open Image": "No longer stops Images from opening when being clicked, when Details Tooltip is enabled",
|
"GIFS": "View Image works for GIFs again",
|
||||||
"Details Tooltip": "Works again"
|
"GIFVS": "Works for GIFVs now",
|
||||||
},
|
"Stickers": "Works for Stickers now"
|
||||||
"improved": {
|
|
||||||
"Alt Text": "Larger Image Alt Texts of Images will now be displayed in a new container below the Image Details",
|
|
||||||
"Server Specific Avatars/Banners": "Can also now be target by the context menu",
|
|
||||||
"Banners": "You can now view user banners in the full resolution (keep in mind that server specific user banners are always saved in a low resolution, because discord doesn't want to waste server space for each banner, can't be bypassed since no high resolution for them exists"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -588,20 +584,23 @@ module.exports = (_ => {
|
||||||
onMessageContextMenu (e) {
|
onMessageContextMenu (e) {
|
||||||
if (e.instance.props.message && e.instance.props.channel && e.instance.props.target) {
|
if (e.instance.props.message && e.instance.props.channel && e.instance.props.target) {
|
||||||
if (e.instance.props.attachment) this.injectItem(e, [e.instance.props.attachment.url]);
|
if (e.instance.props.attachment) this.injectItem(e, [e.instance.props.attachment.url]);
|
||||||
else if (e.instance.props.target.tagName == "A" && e.instance.props.message.embeds && e.instance.props.message.embeds[0] && (e.instance.props.message.embeds[0].type == "image" || e.instance.props.message.embeds[0].type == "video")) this.injectItem(e, [e.instance.props.target.href]);
|
|
||||||
else if (e.instance.props.target.tagName == "IMG" && e.instance.props.target.complete && e.instance.props.target.naturalHeight) {
|
|
||||||
if (BDFDB.DOMUtils.containsClass(e.instance.props.target.parentElement, BDFDB.disCN.imagewrapper)) this.injectItem(e, [{file: e.instance.props.target.src, original: this.getTargetLink(e.instance.props.target)}]);
|
|
||||||
else if (BDFDB.DOMUtils.containsClass(e.instance.props.target, BDFDB.disCN.embedauthoricon) && this.settings.places.userAvatars) this.injectItem(e, [e.instance.props.target.src]);
|
|
||||||
else if (BDFDB.DOMUtils.containsClass(e.instance.props.target, BDFDB.disCN.emojiold, "emote", false) && this.settings.places.emojis) this.injectItem(e, [{file: e.instance.props.target.src, alternativeName: e.instance.props.target.getAttribute("data-name")}]);
|
|
||||||
}
|
|
||||||
else if (e.instance.props.target.tagName == "VIDEO") {
|
|
||||||
if (BDFDB.DOMUtils.containsClass(e.instance.props.target, BDFDB.disCN.embedvideo) || BDFDB.DOMUtils.getParent(BDFDB.dotCN.attachmentvideo, e.instance.props.target)) this.injectItem(e, [{file: e.instance.props.target.src, original: this.getTargetLink(e.instance.props.target)}]);
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
const reaction = BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagereaction, e.instance.props.target);
|
const target = e.instance.props.target.tagName == "A" && BDFDB.DOMUtils.containsClass(e.instance.props.target, BDFDB.disCN.imageoriginallink) && e.instance.props.target.parentElement.querySelector("img, video") || e.instance.props.target;
|
||||||
if (reaction && this.settings.places.emojis) {
|
if (target.tagName == "A" && e.instance.props.message.embeds && e.instance.props.message.embeds[0] && (e.instance.props.message.embeds[0].type == "image" || e.instance.props.message.embeds[0].type == "video" || e.instance.props.message.embeds[0].type == "gifv")) this.injectItem(e, [target.href]);
|
||||||
const emoji = reaction.querySelector(BDFDB.dotCN.emojiold);
|
else if (target.tagName == "IMG" && target.complete && target.naturalHeight) {
|
||||||
if (emoji) this.injectItem(e, [{file: emoji.src, alternativeName: emoji.getAttribute("data-name")}]);
|
if (BDFDB.DOMUtils.containsClass(target.parentElement, BDFDB.disCN.imagewrapper) || BDFDB.DOMUtils.containsClass(target, BDFDB.disCN.imagesticker)) this.injectItem(e, [{file: target.src, original: this.getTargetLink(target)}]);
|
||||||
|
else if (BDFDB.DOMUtils.containsClass(target, BDFDB.disCN.embedauthoricon) && this.settings.places.userAvatars) this.injectItem(e, [target.src]);
|
||||||
|
else if (BDFDB.DOMUtils.containsClass(target, BDFDB.disCN.emojiold, "emote", false) && this.settings.places.emojis) this.injectItem(e, [{file: target.src, alternativeName: target.getAttribute("data-name")}]);
|
||||||
|
}
|
||||||
|
else if (target.tagName == "VIDEO") {
|
||||||
|
if (BDFDB.DOMUtils.containsClass(target, BDFDB.disCN.embedvideo) || BDFDB.DOMUtils.getParent(BDFDB.dotCN.attachmentvideo, target)) this.injectItem(e, [{file: target.src, original: this.getTargetLink(target)}]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const reaction = BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagereaction, target);
|
||||||
|
if (reaction && this.settings.places.emojis) {
|
||||||
|
const emoji = reaction.querySelector(BDFDB.dotCN.emojiold);
|
||||||
|
if (emoji) this.injectItem(e, [{file: emoji.src, alternativeName: emoji.getAttribute("data-name")}]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -642,9 +641,9 @@ module.exports = (_ => {
|
||||||
filterUrls (...urls) {
|
filterUrls (...urls) {
|
||||||
let addedUrls = [];
|
let addedUrls = [];
|
||||||
return urls.filter(n => this.isValid(n && n.file || n)).map(n => {
|
return urls.filter(n => this.isValid(n && n.file || n)).map(n => {
|
||||||
let srcUrl = (n.file || n).replace(/^url\(|\)$|"|'/g, "").replace(/\?size\=\d+$/, "?size=4096").replace(/[\?\&](height|width)=\d+/g, "").split("%3A")[0];
|
let srcUrl = (n.file || n).replace(/^url\(|\)$|"|'/g, "").replace(/\?size\=\d+$/, "?size=4096").replace(/\?size\=\d+&/, "?size=4096&").replace(/[\?\&](height|width)=\d+/g, "").split("%3A")[0];
|
||||||
if (srcUrl.startsWith("https://cdn.discordapp.com/") && !srcUrl.endsWith("?size=4096")) srcUrl += "?size=4096";
|
if (srcUrl.startsWith("https://cdn.discordapp.com/") && !srcUrl.endsWith("?size=4096") && !srcUrl.indexOf("?size=4096&") == -1) srcUrl += "?size=4096";
|
||||||
let originalUrl = (n.original || n.file || n).replace(/^url\(|\)$|"|'/g, "").replace(/\?size\=\d+$/, "?size=4096").replace(/[\?\&](height|width)=\d+/g, "").split("%3A")[0];
|
let originalUrl = (n.original || n.file || n).replace(/^url\(|\)$|"|'/g, "").replace(/\?size\=\d+$/, "?size=4096").replace(/\?size\=\d+&/, "?size=4096&").replace(/[\?\&](height|width)=\d+/g, "").split("%3A")[0];
|
||||||
let fileUrl = srcUrl;
|
let fileUrl = srcUrl;
|
||||||
if (fileUrl.indexOf("https://images-ext-1.discordapp.net/external/") > -1 || fileUrl.indexOf("https://images-ext-2.discordapp.net/external/") > -1) {
|
if (fileUrl.indexOf("https://images-ext-1.discordapp.net/external/") > -1 || fileUrl.indexOf("https://images-ext-2.discordapp.net/external/") > -1) {
|
||||||
if (fileUrl.split("/https/").length > 1) fileUrl = "https://" + fileUrl.split("/https/").pop();
|
if (fileUrl.split("/https/").length > 1) fileUrl = "https://" + fileUrl.split("/https/").pop();
|
||||||
|
|
Loading…
Reference in New Issue