Update ImageUtilities.plugin.js
This commit is contained in:
parent
80938778bb
commit
161faca91c
|
@ -2,7 +2,7 @@
|
||||||
* @name ImageUtilities
|
* @name ImageUtilities
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 5.0.9
|
* @version 5.1.0
|
||||||
* @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
|
||||||
|
@ -1152,10 +1152,10 @@ module.exports = (_ => {
|
||||||
}
|
}
|
||||||
|
|
||||||
processModalCarousel (e) {
|
processModalCarousel (e) {
|
||||||
if (this.settings.viewerSettings.galleryMode) {
|
if (!this.settings.viewerSettings.galleryMode || !BDFDB.ReactUtils.findParent(e.returnvalue, {name: "ImageModal"})) return;
|
||||||
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "ImageModal"});
|
e.returnvalue.props.className = "";
|
||||||
if (index > -1) return children[index];
|
e.returnvalue.props.children[0] = null;
|
||||||
}
|
e.returnvalue.props.children[2] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
processLazyImage (e) {
|
processLazyImage (e) {
|
||||||
|
@ -1182,7 +1182,7 @@ module.exports = (_ => {
|
||||||
viewedImage = null;
|
viewedImage = null;
|
||||||
this.cleanupListeners("Gallery");
|
this.cleanupListeners("Gallery");
|
||||||
}
|
}
|
||||||
if (e.methodname == "componentDidMount" && BDFDB.DOMUtils.getParent(BDFDB.dotCN.imagemodal, e.node)) {
|
if (e.methodname == "componentDidMount" && BDFDB.DOMUtils.getParent(BDFDB.dotCNC.imagemodal + BDFDB.dotCN.modalcarouselmodal, e.node)) {
|
||||||
BDFDB.TimeUtils.clear(viewedImageTimeout);
|
BDFDB.TimeUtils.clear(viewedImageTimeout);
|
||||||
let modal = BDFDB.DOMUtils.getParent(BDFDB.dotCN.modal, e.node);
|
let modal = BDFDB.DOMUtils.getParent(BDFDB.dotCN.modal, e.node);
|
||||||
if (modal) {
|
if (modal) {
|
||||||
|
@ -1615,21 +1615,22 @@ module.exports = (_ => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
let isVideo = this.isValid(viewedImage.proxy_url, "video");
|
let isVideo = this.isValid(viewedImage.proxy_url, "video");
|
||||||
|
let thisViewedImage = viewedImage;
|
||||||
switchedImageProps = {
|
switchedImageProps = {
|
||||||
animated: !!isVideo,
|
animated: !!isVideo,
|
||||||
original: viewedImage.proxy_url,
|
original: thisViewedImage.proxy_url,
|
||||||
placeholder: isVideo && (viewedImage.thumbnail && viewedImage.thumbnail.proxy_url || viewedImage.proxy_url),
|
placeholder: isVideo && (thisViewedImage.thumbnail && thisViewedImage.thumbnail.proxy_url || thisViewedImage.proxy_url),
|
||||||
src: viewedImage.proxy_url,
|
src: thisViewedImage.proxy_url,
|
||||||
width: viewedImage.width,
|
width: thisViewedImage.width,
|
||||||
height: viewedImage.height,
|
height: thisViewedImage.height,
|
||||||
children: !isVideo ? null : (videoData => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Video, {
|
children: !isVideo ? null : (videoData => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Video, {
|
||||||
ignoreMaxSize: true,
|
ignoreMaxSize: true,
|
||||||
poster: viewedImage.proxy_url.replace("https://cdn.discordapp.com", "https://media.discordapp.net").split("?size=")[0] + "?format=jpeg",
|
poster: thisViewedImage.proxy_url.replace("https://cdn.discordapp.com", "https://media.discordapp.net").split("?size=")[0] + "?format=jpeg",
|
||||||
src: viewedImage.proxy_url,
|
src: thisViewedImage.proxy_url,
|
||||||
width: videoData.size.width,
|
width: videoData.size.width,
|
||||||
height: videoData.size.height,
|
height: videoData.size.height,
|
||||||
naturalWidth: viewedImage.width,
|
naturalWidth: thisViewedImage.width,
|
||||||
naturalHeight: viewedImage.height,
|
naturalHeight: thisViewedImage.height,
|
||||||
play: true,
|
play: true,
|
||||||
playOnHover: !!BDFDB.LibraryStores.AccessibilityStore.useReducedMotion
|
playOnHover: !!BDFDB.LibraryStores.AccessibilityStore.useReducedMotion
|
||||||
}))
|
}))
|
||||||
|
|
Loading…
Reference in New Issue