stuff
This commit is contained in:
parent
dc86596b32
commit
2ff69da9ee
|
@ -2,7 +2,7 @@
|
|||
* @name ImageUtilities
|
||||
* @author DevilBro
|
||||
* @authorId 278543574059057154
|
||||
* @version 5.3.8
|
||||
* @version 5.3.9
|
||||
* @description Adds several Utilities for Images/Videos (Gallery, Download, Reverse Search, Zoom, Copy, etc.)
|
||||
* @invite Jx3TjNS
|
||||
* @donate https://www.paypal.me/MircoWittrien
|
||||
|
@ -1211,7 +1211,7 @@ module.exports = (_ => {
|
|||
|
||||
processLazyImage (e) {
|
||||
if (e.node) {
|
||||
if (!e.instance.props.animated && !e.instance.props.children) for (let ele of [e.node.src && e.node, ...e.node.querySelectorAll("[src]")].filter(n => n)) ele.src = this.removeFormatInUrl(ele.src);
|
||||
if (!e.instance.props.src.split("?")[0].endsWith(".gif") && !e.instance.props.animated && !e.instance.props.children) for (let ele of [e.node.src && e.node, ...e.node.querySelectorAll("[src]")].filter(n => n)) ele.src = this.removeFormatInUrl(ele.src);
|
||||
if (e.instance.props.resized) {
|
||||
for (let selector of ["embedfull", "embedinlinemedia", "embedgridcontainer", "imagemosaicattachmentscontainer", "imagemosaiconebyonegridsingle"]) {
|
||||
let parent = BDFDB.DOMUtils.getParent(BDFDB.dotCN[selector], e.node);
|
||||
|
@ -1361,7 +1361,7 @@ module.exports = (_ => {
|
|||
e.instance.props.resized = true;
|
||||
}
|
||||
}
|
||||
if (this.settings.rescaleSettings.messages != "NONE" && [e.instance.props.className, e.instance.props.containerClassName].every(n => [BDFDB.disCN.embedvideoimagecomponent, BDFDB.disCN.embedthumbnail].every(m => (n || "").indexOf(m) == -1)) && BDFDB.ReactUtils.findOwner(reactInstance, {name: "LazyImageZoomable", up: true}) && (e.instance.props.mediaLayoutType != "MOSAIC" || (BDFDB.ReactUtils.findValue(reactInstance, "mediaAttachments", {up: true}) || []).length < 2)) {
|
||||
if (this.settings.rescaleSettings.messages != "NONE" && [e.instance.props.className, e.instance.props.containerClassName].every(n => [BDFDB.disCN.embedvideoimagecomponent, BDFDB.disCN.embedthumbnail].every(m => (n || "").indexOf(m) == -1)) && BDFDB.ReactUtils.findOwner(reactInstance, {name: "LazyImageZoomable", up: true}) && (e.instance.props.mediaLayoutType != "MOSAIC" || (BDFDB.ReactUtils.findValue(reactInstance, "message", {up: true}) || {attachments: []}).attachments.filter(n => n.content_type.startsWith("image")).length < 2)) {
|
||||
let aRects = BDFDB.DOMUtils.getRects(document.querySelector(BDFDB.dotCN.appmount));
|
||||
let mRects = BDFDB.DOMUtils.getRects(document.querySelector(BDFDB.dotCNC.messageaccessory + BDFDB.dotCN.messagecontents));
|
||||
let mwRects = BDFDB.DOMUtils.getRects(document.querySelector(BDFDB.dotCN.messagewrapper));
|
||||
|
@ -1391,7 +1391,7 @@ module.exports = (_ => {
|
|||
|
||||
processLazyImageZoomable (e) {
|
||||
if (!e.instance.props.original || e.instance.props.src.indexOf("https://media.discordapp.net/attachments") != 0) return;
|
||||
if (this.settings.detailsSettings.tooltip || this.settings.detailsSettings.footnote && e.instance.props.mediaLayoutType == "MOSAIC" && (BDFDB.ReactUtils.findValue(BDFDB.ObjectUtils.get(e, `instance.${BDFDB.ReactUtils.instanceKey}`), "mediaAttachments", {up: true}) || []).length > 1) {
|
||||
if (this.settings.detailsSettings.tooltip || this.settings.detailsSettings.footnote && e.instance.props.mediaLayoutType == "MOSAIC" && (BDFDB.ReactUtils.findValue(BDFDB.ObjectUtils.get(e, `instance.${BDFDB.ReactUtils.instanceKey}`), "message", {up: true}) || {attachments: []}).attachments.filter(n => n.content_type.startsWith("image")).length > 1) {
|
||||
const attachment = BDFDB.ReactUtils.findValue(e.instance, "attachment", {up: true});
|
||||
if (attachment) {
|
||||
const onMouseEnter = e.returnvalue.props.onMouseEnter;
|
||||
|
@ -1408,7 +1408,7 @@ module.exports = (_ => {
|
|||
}, "Error in onMouseEnter of LazyImageZoomable!");
|
||||
}
|
||||
}
|
||||
if (this.settings.detailsSettings.footnote && [e.instance.props.className, e.instance.props.containerClassName].every(n => [BDFDB.disCN.embedmedia, BDFDB.disCN.embedthumbnail].every(m => (n || "").indexOf(m) == -1)) && (e.instance.props.mediaLayoutType != "MOSAIC" || (BDFDB.ReactUtils.findValue(BDFDB.ObjectUtils.get(e, `instance.${BDFDB.ReactUtils.instanceKey}`), "mediaAttachments", {up: true}) || []).length < 2)) {
|
||||
if (this.settings.detailsSettings.footnote && [e.instance.props.className, e.instance.props.containerClassName].every(n => [BDFDB.disCN.embedmedia, BDFDB.disCN.embedthumbnail].every(m => (n || "").indexOf(m) == -1)) && (e.instance.props.mediaLayoutType != "MOSAIC" || (BDFDB.ReactUtils.findValue(BDFDB.ObjectUtils.get(e, `instance.${BDFDB.ReactUtils.instanceKey}`), "message", {up: true}) || {attachments: []}).attachments.filter(n => n.content_type.startsWith("image")).length < 2)) {
|
||||
e.returnvalue = BDFDB.ReactUtils.createElement("div", {
|
||||
children: [
|
||||
e.returnvalue,
|
||||
|
@ -1700,7 +1700,7 @@ module.exports = (_ => {
|
|||
}
|
||||
|
||||
removeFormatInUrl (url) {
|
||||
return (url || "").split(/[&?]format=/)[0];
|
||||
return (url || "").replace(/[\&\?]format\=[A-z]+/g, "");
|
||||
}
|
||||
|
||||
addListener (eventType, type, callback) {
|
||||
|
|
|
@ -571,6 +571,7 @@ module.exports = (_ => {
|
|||
className: BDFDB.disCNS.channelheadericonwrapper + BDFDB.disCN.channelheadericonclickable,
|
||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
|
||||
className: BDFDB.disCNS.channelheadericon,
|
||||
nativeClass: true,
|
||||
iconSVG: pinIcon
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue