Update ImageUtilities.plugin.js
This commit is contained in:
parent
46863b7672
commit
2751d73b26
|
@ -2,7 +2,7 @@
|
||||||
* @name ImageUtilities
|
* @name ImageUtilities
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 4.5.3
|
* @version 4.5.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,7 +17,7 @@ module.exports = (_ => {
|
||||||
"info": {
|
"info": {
|
||||||
"name": "ImageUtilities",
|
"name": "ImageUtilities",
|
||||||
"author": "DevilBro",
|
"author": "DevilBro",
|
||||||
"version": "4.5.3",
|
"version": "4.5.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.)"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -619,11 +619,6 @@ module.exports = (_ => {
|
||||||
let type = isVideo ? BDFDB.LanguageUtils.LanguageStrings.VIDEO : BDFDB.LanguageUtils.LanguageStrings.IMAGE;
|
let type = isVideo ? BDFDB.LanguageUtils.LanguageStrings.VIDEO : BDFDB.LanguageUtils.LanguageStrings.IMAGE;
|
||||||
return BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
|
return BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
|
||||||
children: [
|
children: [
|
||||||
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
|
||||||
label: BDFDB.LanguageUtils.LanguageStrings.OPEN_LINK,
|
|
||||||
id: BDFDB.ContextMenuUtils.createItemId(this.name, "open-link"),
|
|
||||||
action: _ => BDFDB.DiscordUtils.openLink(urlData.original)
|
|
||||||
}),
|
|
||||||
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
||||||
label: BDFDB.LanguageUtils.LanguageStrings.COPY_LINK,
|
label: BDFDB.LanguageUtils.LanguageStrings.COPY_LINK,
|
||||||
id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-link"),
|
id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-link"),
|
||||||
|
@ -640,6 +635,16 @@ module.exports = (_ => {
|
||||||
BDFDB.NotificationUtils.toast(BDFDB.LanguageUtils.LanguageStrings.LINK_COPIED, {type: "success"});
|
BDFDB.NotificationUtils.toast(BDFDB.LanguageUtils.LanguageStrings.LINK_COPIED, {type: "success"});
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
||||||
|
label: BDFDB.LanguageUtils.LanguageStrings.OPEN_LINK,
|
||||||
|
id: BDFDB.ContextMenuUtils.createItemId(this.name, "open-link"),
|
||||||
|
action: _ => BDFDB.DiscordUtils.openLink(urlData.original)
|
||||||
|
}),
|
||||||
|
!this.isValid(urlData.file, "copyable") ? null : BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
||||||
|
label: this.labels.context_copy.replace("{{var0}}", type),
|
||||||
|
id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-file"),
|
||||||
|
action: _ => this.copyFile(urlData.file)
|
||||||
|
}),
|
||||||
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
||||||
label: this.labels.context_view.replace("{{var0}}", type),
|
label: this.labels.context_view.replace("{{var0}}", type),
|
||||||
id: BDFDB.ContextMenuUtils.createItemId(this.name, "view-file"),
|
id: BDFDB.ContextMenuUtils.createItemId(this.name, "view-file"),
|
||||||
|
@ -676,11 +681,6 @@ module.exports = (_ => {
|
||||||
img.src = urlData.file;
|
img.src = urlData.file;
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
!this.isValid(urlData.file, "copyable") ? null : BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
|
||||||
label: this.labels.context_copy.replace("{{var0}}", type),
|
|
||||||
id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-file"),
|
|
||||||
action: _ => this.copyFile(urlData.file)
|
|
||||||
}),
|
|
||||||
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
||||||
label: this.labels.context_saveas.replace("{{var0}}", type),
|
label: this.labels.context_saveas.replace("{{var0}}", type),
|
||||||
id: BDFDB.ContextMenuUtils.createItemId(this.name, "download-file-as"),
|
id: BDFDB.ContextMenuUtils.createItemId(this.name, "download-file-as"),
|
||||||
|
@ -1013,7 +1013,7 @@ module.exports = (_ => {
|
||||||
processUserBanner (e) {
|
processUserBanner (e) {
|
||||||
let banner = e.instance.props.user && this.settings.places.userAvatars && BDFDB.UserUtils.getBanner(e.instance.props.user.id);
|
let banner = e.instance.props.user && this.settings.places.userAvatars && BDFDB.UserUtils.getBanner(e.instance.props.user.id);
|
||||||
if (banner) e.returnvalue.props.onContextMenu = event => {
|
if (banner) e.returnvalue.props.onContextMenu = event => {
|
||||||
let validUrls = this.filterUrls((e.instance.props.user.getBannerURL(4096) || banner).replace(/\.webp|\.gif/, ".png"), BDFDB.LibraryModules.IconUtils.isAnimatedIconHash(e.instance.props.user.banner) && e.instance.props.user.getBannerURL(4096, true));
|
let validUrls = this.filterUrls(banner, BDFDB.LibraryModules.IconUtils.isAnimatedIconHash(e.instance.props.user.banner) && BDFDB.UserUtils.getBanner(e.instance.props.user.id, true));
|
||||||
if (validUrls.length) BDFDB.ContextMenuUtils.open(this, event, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
|
if (validUrls.length) BDFDB.ContextMenuUtils.open(this, event, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
|
||||||
children: validUrls.length == 1 ? this.createSubMenus({}, validUrls) : BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
children: validUrls.length == 1 ? this.createSubMenus({}, validUrls) : BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
||||||
label: BDFDB.LanguageUtils.LanguageStrings.IMAGE + " " + BDFDB.LanguageUtils.LanguageStrings.ACTIONS,
|
label: BDFDB.LanguageUtils.LanguageStrings.IMAGE + " " + BDFDB.LanguageUtils.LanguageStrings.ACTIONS,
|
||||||
|
|
Loading…
Reference in New Issue