This commit is contained in:
poslop
2024-04-30 15:32:45 -05:00
parent a21e33aeb6
commit 7d153f28e0
23 changed files with 1781 additions and 1490 deletions

View File

@@ -2,7 +2,7 @@
* @name ImageUtilities
* @author DevilBro
* @authorId 278543574059057154
* @version 5.1.9
* @version 5.4.0
* @description Adds several Utilities for Images/Videos (Gallery, Download, Reverse Search, Zoom, Copy, etc.)
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@@ -25,9 +25,14 @@ module.exports = (_ => {
getDescription () {return `The Library Plugin needed for ${this.name} is missing. Open the Plugin Settings to download it. \n\n${this.description}`;}
downloadLibrary () {
require("request").get("https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js", (e, r, b) => {
if (!e && b && r.statusCode == 200) require("fs").writeFile(require("path").join(BdApi.Plugins.folder, "0BDFDB.plugin.js"), b, _ => BdApi.showToast("Finished downloading BDFDB Library", {type: "success"}));
else BdApi.alert("Error", "Could not download BDFDB Library Plugin. Try again later or download it manually from GitHub: https://mwittrien.github.io/downloader/?library");
BdApi.Net.fetch("https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js").then(r => {
if (!r || r.status != 200) throw new Error();
else return r.text();
}).then(b => {
if (!b) throw new Error();
else return require("fs").writeFile(require("path").join(BdApi.Plugins.folder, "0BDFDB.plugin.js"), b, _ => BdApi.showToast("Finished downloading BDFDB Library", {type: "success"}));
}).catch(error => {
BdApi.alert("Error", "Could not download BDFDB Library Plugin. Try again later or download it manually from GitHub: https://mwittrien.github.io/downloader/?library");
});
}
@@ -65,8 +70,6 @@ module.exports = (_ => {
var cachedImages;
var eventTypes = {};
const imgUrlReplaceString = "DEVILBRO_BD_REVERSEIMAGESEARCH_REPLACE_IMAGEURL";
const rescaleOptions = {
NONE: "No Resize",
ORIGINAL: "Resize to Original Size",
@@ -205,7 +208,7 @@ module.exports = (_ => {
},
viewerSettings: {
zoomMode: {value: true, description: "Enables Zoom Mode to zoom into Images while holding down your Mouse"},
galleryMode: {value: true, description: "Enables Gallery Mode to quick-switch between Images"},
galleryMode: {value: true, description: "Enables Gallery Mode to quick-switch between Images"},
details: {value: true, description: "Adds Image Details (Name, Size, Amount)"},
copyImage: {value: true, description: "Adds a 'Copy Image' Option"},
saveImage: {value: true, description: "Adds a 'Save Image as' Option"},
@@ -214,39 +217,41 @@ module.exports = (_ => {
galleryFilter: {},
zoomSettings: {
pixelMode: {value: false, label: "Uses Pixel Lens instead of a Blur Lens"},
clickMode: {value: false, label: "Click Image to zoom instead of holding the Mouse Button"},
lensSize: {value: 200, digits: 0, minValue: 50, maxValue: 5000, unit: "px", label: "context_lenssize"},
zoomLevel: {value: 2, digits: 1, minValue: 1, maxValue: 20, unit: "x", label: "ACCESSIBILITY_ZOOM_LEVEL_LABEL"},
zoomLevel: {value: 2, digits: 1, minValue: 1, maxValue: 20, unit: "x", label: "ACCESSIBILITY_ZOOM_LEVEL_LABEL"},
zoomSpeed: {value: 0.1, digits: 2, minValue: 0.01, maxValue: 1, unit: "", label: "context_zoomspeed"}
},
rescaleSettings: {
messages: {value: "NONE", description: "Messages"},
imageViewer: {value: "NONE", description: "Image Viewer"}
imageViewer: {value: "NONE", description: "Image Viewer"}
},
detailsSettings: {
footnote: {value: true, description: "in the Image Description"},
tooltip: {value: false, description: "as a Hover Tooltip"},
tooltipDelay: {value: 0, min: 0, description: "Image Tooltip Delay (in ms)"}
tooltipDelay: {value: 0, min: 0, description: "Image Tooltip Delay (in ms)"}
},
places: {
userAvatars: {value: true, description: "User Avatars"},
groupIcons: {value: true, description: "Group Icons"},
guildIcons: {value: true, description: "Server Icons"},
userAvatars: {value: true, description: "User Avatars"},
groupIcons: {value: true, description: "Group Icons"},
guildIcons: {value: true, description: "Server Icons"},
streamPreviews: {value: true, description: "Stream Previews"},
emojis: {value: true, description: "Custom Emojis/Emotes"}
},
engines: {
_all: {value: true, name: BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_ALL, url: null},
Baidu: {value: true, name: "Baidu", url: "http://image.baidu.com/pcdutu?queryImageUrl=" + imgUrlReplaceString},
Bing: {value: true, name: "Bing", url: "https://www.bing.com/images/search?q=imgurl:" + imgUrlReplaceString + "&view=detailv2&iss=sbi&FORM=IRSBIQ"},
Google: {value: true, name: "Google", url: "https://www.google.com/searchbyimage?sbisrc=1&image_url=" + imgUrlReplaceString},
GoogleLens: {value: true, name: "Google Lens", url: "https://lens.google.com/uploadbyurl?url=" + imgUrlReplaceString},
ImgOps: {value: true, name: "ImgOps", raw: true, url: "https://imgops.com/specialized+reverse/" + imgUrlReplaceString},
IQDB: {value: true, name: "IQDB", url: "https://iqdb.org/?url=" + imgUrlReplaceString},
Reddit: {value: true, name: "Reddit", url: "http://karmadecay.com/search?q=" + imgUrlReplaceString},
SauceNAO: {value: true, name: "SauceNAO", url: "https://saucenao.com/search.php?db=999&url=" + imgUrlReplaceString},
Sogou: {value: true, name: "Sogou", url: "http://pic.sogou.com/ris?flag=1&drag=0&query=" + imgUrlReplaceString + "&flag=1"},
TinEye: {value: true, name: "TinEye", url: "https://tineye.com/search?url=" + imgUrlReplaceString},
WhatAnime: {value: true, name: "WhatAnime", url: "https://trace.moe/?url=" + imgUrlReplaceString},
Yandex: {value: true, name: "Yandex", url: "https://yandex.com/images/search?url=" + imgUrlReplaceString + "&rpt=imageview"}
Baidu: {value: true, name: "Baidu", url: "http://image.baidu.com/pcdutu?queryImageUrl="},
Bing: {value: true, name: "Bing", url: "https://www.bing.com/images/search?view=detailv2&iss=sbi&FORM=IRSBIQ&q=imgurl:"},
Google: {value: true, name: "Google", url: "https://www.google.com/searchbyimage?sbisrc=cr_1&image_url="},
GoogleLens: {value: true, name: "Google Lens", url: "https://lens.google.com/uploadbyurl?url="},
ImgOps: {value: true, name: "ImgOps", raw: true, url: "https://imgops.com/specialized+reverse/"},
IQDB: {value: true, name: "IQDB", url: "https://iqdb.org/?url="},
Reddit: {value: true, name: "Reddit", url: "http://karmadecay.com/search?q="},
SauceNAO: {value: true, name: "SauceNAO", url: "https://saucenao.com/search.php?db=999&url="},
Sogou: {value: true, name: "Sogou", url: "http://pic.sogou.com/ris?flag=1&drag=0&flag=1&query="},
TinEye: {value: true, name: "TinEye", url: "https://tineye.com/search?url="},
WhatAnime: {value: true, name: "WhatAnime", url: "https://trace.moe/?url="},
Yandex: {value: true, name: "Yandex", url: "https://yandex.com/images/search?rpt=imageview&url="}
}
};
@@ -280,10 +285,14 @@ module.exports = (_ => {
};
this.css = `
${BDFDB.dotCN._imageutilitiesimagedetailsadded} {
max-height: unset !important;
}
${BDFDB.dotCNS._imageutilitiesimagedetailsadded + BDFDB.dotCN.imagewrapper} {
border-radius: 8px !important;
height: calc(100% - 1rem - 16px) !important;
max-height: unset !important;
margin-left: unset !important;
}
${BDFDB.dotCNS._imageutilitiesimagedetailsadded + BDFDB.dotCN.imagealttextcontainer} {
bottom: calc(1rem + 16px) !important;
@@ -695,16 +704,22 @@ module.exports = (_ => {
if (!this.settings.places.guildIcons || !e.instance.props.guild) return;
if (BDFDB.DOMUtils.getParent(BDFDB.dotCNC.guildheader + BDFDB.dotCN.guildchannels, e.instance.props.target) && (!e.instance.props.target.className && e.instance.props.target.parentElement.firstElementChild == e.instance.props.target) || (e.instance.props.target.className && e.instance.props.target.className.indexOf(BDFDB.disCN.guildheaderbanneranimatedhoverlayer) > -1)) {
let banner = BDFDB.GuildUtils.getBanner(e.instance.props.guild.id);
if (banner) this.injectItem(e, [banner.replace(/\.webp|\.gif/, ".png"), e.instance.props.guild.banner && BDFDB.LibraryModules.IconUtils.isAnimatedIconHash(e.instance.props.guild.banner) && banner.replace(/\.webp|\.png/, ".gif")], BDFDB.LanguageUtils.LibraryStrings.guildbanner);
if (banner) this.injectItem(e, [banner.replace(/\.webp|\.gif/, ".png"), e.instance.props.guild.banner && BDFDB.LibraryModules.IconUtils.isAnimatedIconHash(e.instance.props.guild.banner) && banner.replace(/\.webp|\.png/, ".gif")], {prefix: BDFDB.LanguageUtils.LibraryStrings.guildbanner, id: "banner"});
}
else if (!BDFDB.DOMUtils.getParent(BDFDB.dotCN.channels, e.instance.props.target)) this.injectItem(e, [(e.instance.props.guild.getIconURL(4096) || "").replace(/\.webp|\.gif/, ".png"), e.instance.props.guild.icon && BDFDB.LibraryModules.IconUtils.isAnimatedIconHash(e.instance.props.guild.icon) && e.instance.props.guild.getIconURL(4096, true)], BDFDB.LanguageUtils.LibraryStrings.guildicon);
else if (!BDFDB.DOMUtils.getParent(BDFDB.dotCN.channels, e.instance.props.target)) this.injectItem(e, [(e.instance.props.guild.getIconURL(4096) || "").replace(/\.webp|\.gif/, ".png"), e.instance.props.guild.icon && BDFDB.LibraryModules.IconUtils.isAnimatedIconHash(e.instance.props.guild.icon) && e.instance.props.guild.getIconURL(4096, true)], {prefix: BDFDB.LanguageUtils.LibraryStrings.guildicon, id: "icon"});
}
onUserContextMenu (e) {
if (!this.settings.places.userAvatars || !e.instance.props.user) return;
const guildId = BDFDB.LibraryStores.SelectedGuildStore.getGuildId();
const member = BDFDB.LibraryStores.GuildMemberStore.getMember(guildId, e.instance.props.user.id);
this.injectItem(e, [(e.instance.props.user.getAvatarURL(null, 4096) || "").replace(/\.webp|\.gif/, ".png"), BDFDB.LibraryModules.IconUtils.isAnimatedIconHash(e.instance.props.user.avatar) && e.instance.props.user.getAvatarURL(null, 4096, true), (e.instance.props.user.getAvatarURL(guildId, 4096) || "").replace(/\.webp|\.gif/, ".png"), member && member.avatar && BDFDB.LibraryModules.IconUtils.isAnimatedIconHash(member.avatar) && e.instance.props.user.getAvatarURL(guildId, 4096, true)]);
if (this.settings.places.userAvatars && e.instance.props.user) {
const guildId = BDFDB.LibraryStores.SelectedGuildStore.getGuildId();
const member = BDFDB.LibraryStores.GuildMemberStore.getMember(guildId, e.instance.props.user.id);
this.injectItem(e, [(e.instance.props.user.getAvatarURL(null, 4096) || "").replace(/\.webp|\.gif/, ".png"), BDFDB.LibraryModules.IconUtils.isAnimatedIconHash(e.instance.props.user.avatar) && e.instance.props.user.getAvatarURL(null, 4096, true), (e.instance.props.user.getAvatarURL(guildId, 4096) || "").replace(/\.webp|\.gif/, ".png"), member && member.avatar && BDFDB.LibraryModules.IconUtils.isAnimatedIconHash(member.avatar) && e.instance.props.user.getAvatarURL(guildId, 4096, true)]);
}
if (this.settings.places.streamPreviews && e.instance.props.user) {
let stream = BDFDB.LibraryStores.ApplicationStreamingStore.getAnyStreamForUser(e.instance.props.user.id);
let previewUrl = stream && BDFDB.LibraryStores.ApplicationStreamPreviewStore.getPreviewURL(stream.guildId, stream.channelId, stream.ownerId);
if (previewUrl) this.injectItem(e, [previewUrl], {id: "stream", label: this.labels.context_streamactions});
}
}
onGroupDMContextMenu (e) {
@@ -720,20 +735,20 @@ module.exports = (_ => {
onMessageContextMenu (e) {
if (!e.instance.props.message || !e.instance.props.channel || !e.instance.props.target) return;
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") || (BDFDB.DOMUtils.getParent(BDFDB.dotCN.messageattachment, e.instance.props.target) || e.instance.props.target).querySelector("img, video") || e.instance.props.target;
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], null, true);
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], {isNative: true});
else if (target.tagName == "IMG" && target.complete && target.naturalHeight) {
if (BDFDB.DOMUtils.getParent(BDFDB.dotCN.imagewrapper, target) || BDFDB.DOMUtils.containsClass(target, BDFDB.disCN.imagesticker)) this.injectItem(e, [{file: target.src, original: this.getTargetLink(e.instance.props.target) || this.getTargetLink(target)}], null, true);
else if (BDFDB.DOMUtils.containsClass(target, BDFDB.disCN.embedauthoricon) && this.settings.places.userAvatars) this.injectItem(e, [target.src], null, true);
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")}], null, true);
if (BDFDB.DOMUtils.getParent(BDFDB.dotCN.imagewrapper, target) || BDFDB.DOMUtils.containsClass(target, BDFDB.disCN.imagesticker)) this.injectItem(e, [{file: target.src, original: this.getTargetLink(e.instance.props.target) || this.getTargetLink(target)}], {isNative: true});
else if (BDFDB.DOMUtils.containsClass(target, BDFDB.disCN.embedauthoricon) && this.settings.places.userAvatars) this.injectItem(e, [target.src], {isNative: true});
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")}], {isNative: true});
}
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(e.instance.props.target) || this.getTargetLink(target)}], null, true);
if (BDFDB.DOMUtils.containsClass(target, BDFDB.disCN.embedvideo) || BDFDB.DOMUtils.getParent(BDFDB.dotCN.attachmentvideo, target)) this.injectItem(e, [{file: target.src, original: this.getTargetLink(e.instance.props.target) || this.getTargetLink(target)}], {isNative: true});
}
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")}], null, true);
if (emoji) this.injectItem(e, [{file: emoji.src, alternativeName: emoji.getAttribute("data-name")}], {isNative: true});
}
}
}
@@ -745,14 +760,13 @@ module.exports = (_ => {
return href || src;
}
injectItem (e, urls, prefix, isNative = false) {
injectItem (e, urls, config = {}) {
let validUrls = this.filterUrls(...urls);
if (!validUrls.length) return;
let [nativeParent, nativeIndex] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "copy-native-link", group: true});
if (nativeIndex > -1) {
if (validUrls.length == 1) isNative = true;
if (validUrls.length == 1) config.isNative = true;
nativeParent.splice(nativeIndex, 1);
nativeIndex -= 1;
}
for (let id of ["open-native-link", "copy-image", "save-image"]) {
let [removeParent, removeIndex] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: id, group: true});
@@ -762,15 +776,15 @@ module.exports = (_ => {
let subMenu = this.createSubMenus({
instance: e.instance,
urls: validUrls,
prefix: prefix,
prefix: config.prefix,
target: e.instance.props.target
});
let [children, index] = isNative && nativeIndex > -1 ? [nativeParent, nativeIndex] : BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "devmode-copy-id", group: true});
children.splice(index > -1 ? index : children.length, 0, isNative ? subMenu : BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
let [children, index] = config.isNative && nativeIndex > -1 ? [nativeParent, nativeIndex] : BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "devmode-copy-id", group: true});
children.splice(index > -1 ? index : children.length, 0, config.isNative && nativeIndex > -1 ? subMenu : BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
children: BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.isValid(validUrls[0].file, "video") ? this.labels.context_videoactions : this.labels.context_imageactions,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "main-subitem"),
label: config.label || (this.isValid(validUrls[0].file, "video") ? this.labels.context_videoactions : this.labels.context_imageactions),
id: BDFDB.ContextMenuUtils.createItemId(this.name, config.id, "main-subitem"),
children: subMenu
})
}));
@@ -794,8 +808,14 @@ module.exports = (_ => {
isValid (url, type) {
if (!url) return false;
const file = url && (BDFDB.LibraryModules.URLParser.parse(url).pathname || "").split("%3A")[0].toLowerCase();
return file && (!type && (url.indexOf("discord.com/streams/guild:") > -1 || url.indexOf("discordapp.com/streams/guild:") > -1 || url.indexOf("discordapp.net/streams/guild:") > -1 || url.startsWith("https://images-ext-1.discordapp.net/") || url.startsWith("https://images-ext-2.discordapp.net/") || Object.keys(fileTypes).some(t => file.endsWith(`/${t}`) || file.endsWith(`.${t}`))) || type && Object.keys(fileTypes).filter(t => fileTypes[t][type]).some(t => file.endsWith(`/${t}`) || file.endsWith(`.${t}`)));
if (url && url.indexOf("data:") == 0 && url.indexOf("base64") > -1) {
const fileType = (url.split("/")[1] || "").split(";")[0];
return !type && fileTypes[fileType] || type && type != "searchable" && fileTypes[fileType] && fileTypes[fileType][type];
}
else {
const file = url && (BDFDB.LibraryModules.URLParser.parse(url).pathname || "").split("%3A")[0].toLowerCase();
return file && (!type && (url.indexOf("discord.com/streams/guild:") > -1 || url.indexOf("discordapp.com/streams/guild:") > -1 || url.indexOf("discordapp.net/streams/guild:") > -1 || url.startsWith("https://images-ext-1.discordapp.net/") || url.startsWith("https://images-ext-2.discordapp.net/") || Object.keys(fileTypes).some(t => file.endsWith(`/${t}`) || file.endsWith(`.${t}`))) || ((type == "copyable" || type == "searchable") && (url.indexOf("discord.com/streams/guild:") > -1 || url.indexOf("discordapp.com/streams/guild:") > -1 || url.indexOf("discordapp.net/streams/guild:") > -1)) || type && Object.keys(fileTypes).filter(t => fileTypes[t][type]).some(t => file.endsWith(`/${t}`) || file.endsWith(`.${t}`)));
}
}
getPosterUrl (url) {
@@ -822,11 +842,12 @@ module.exports = (_ => {
return BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
children: [
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
urlData.original && urlData.original.indexOf("data:") != 0 && BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: BDFDB.LanguageUtils.LanguageStrings.COPY_LINK,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-link"),
action: _ => {
let url = urlData.original.split("?width")[0].split("?height")[0].split("?size")[0];
let url = this.removeSizeInUrl(urlData.original);
url = this.removeFormatInUrl(url);
url = url.indexOf("discordapp.com/avatars/") > 0 || url.indexOf("discordapp.com/icons/") > 0 ? `${url}?size=4096` : url;
BDFDB.LibraryModules.WindowUtils.copy(url);
BDFDB.NotificationUtils.toast(BDFDB.LanguageUtils.LanguageStrings.LINK_COPIED, {type: "success"});
@@ -836,13 +857,14 @@ module.exports = (_ => {
label: BDFDB.LanguageUtils.LanguageStrings.COPY_MEDIA_LINK,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-media-link"),
action: _ => {
let url = urlData.file.split("?width")[0].split("?height")[0].split("?size")[0];
let url = this.removeSizeInUrl(urlData.file);
url = this.removeFormatInUrl(url);
url = url.indexOf("discordapp.com/avatars/") > 0 || url.indexOf("discordapp.com/icons/") > 0 ? `${url}?size=4096` : url;
BDFDB.LibraryModules.WindowUtils.copy(url);
BDFDB.NotificationUtils.toast(BDFDB.LanguageUtils.LanguageStrings.LINK_COPIED, {type: "success"});
}
}),
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
urlData.original && urlData.original.indexOf("data:") != 0 && 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)
@@ -850,7 +872,7 @@ module.exports = (_ => {
!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({url: urlData.src, fallbackUrl: urlData.file || urlData.original})
action: _ => this.copyFile({url: urlData.original, fallbackUrl: urlData.src})
}),
!document.querySelector(BDFDB.dotCN.imagemodal) && BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.context_view.replace("{{var0}}", type),
@@ -867,7 +889,7 @@ module.exports = (_ => {
"aria-label": BDFDB.LanguageUtils.LanguageStrings.IMAGE,
children: isVideo ? BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ImageVideoModal, {
src: imageThrowaway.src,
poster: this.getPosterUrl(imageThrowaway.src),
poster: _this.getPosterUrl(imageThrowaway.src),
width: this.videoWidth,
naturalWidth: this.videoWidth,
height: this.videoHeight,
@@ -890,12 +912,12 @@ module.exports = (_ => {
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.context_saveas.replace("{{var0}}", type),
id: BDFDB.ContextMenuUtils.createItemId(this.name, "download-file-as"),
action: _ => this.downloadFile({url: urlData.src, fallbackUrl: urlData.file || urlData.original}, null, urlData.alternativeName),
action: _ => this.downloadFile({url: urlData.original, fallbackUrl: urlData.src}, null, urlData.alternativeName),
children: locations.length && BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
children: locations.map((name, i) => BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
id: BDFDB.ContextMenuUtils.createItemId(this.name, "download", name, i),
label: name,
action: _ => this.downloadFile({url: urlData.src, fallbackUrl: urlData.file || urlData.original}, ownLocations[name].location, urlData.alternativeName)
action: _ => this.downloadFile({url: urlData.original, fallbackUrl: urlData.src}, ownLocations[name].location, urlData.alternativeName)
}))
})
}),
@@ -905,7 +927,7 @@ module.exports = (_ => {
persisting: true,
action: event => {
if (!event.shiftKey) BDFDB.ContextMenuUtils.close(instance);
BDFDB.DiscordUtils.openLink(this.defaults.engines[engineKeys[0]].url.replace(imgUrlReplaceString, encodeURIComponent(urlData.original)), {
BDFDB.DiscordUtils.openLink(this.defaults.engines[engineKeys[0]].url + encodeURIComponent(urlData.original), {
minimized: event.shiftKey
});
}
@@ -922,7 +944,7 @@ module.exports = (_ => {
color: key == "_all" ? BDFDB.DiscordConstants.MenuItemColors.DANGER : BDFDB.DiscordConstants.MenuItemColors.DEFAULT,
persisting: true,
action: event => {
const open = (url, k) => BDFDB.DiscordUtils.openLink(this.defaults.engines[k].url.replace(imgUrlReplaceString, this.defaults.engines[k].raw ? url : encodeURIComponent(url)), {minimized: event.shiftKey});
const open = (url, k) => BDFDB.DiscordUtils.openLink(this.defaults.engines[k].url + (this.defaults.engines[k].raw ? url : encodeURIComponent(url)), {minimized: event.shiftKey});
if (!event.shiftKey) BDFDB.ContextMenuUtils.close(instance);
if (key == "_all") {
for (let key2 in enginesWithoutAll) open(urlData.original, key2);
@@ -1020,7 +1042,7 @@ module.exports = (_ => {
children: this.labels.context_saveas.replace("{{var0}}", type),
onClick: event => {
BDFDB.ListenerUtils.stopEvent(event);
this.downloadFile({url: url});
this.downloadFile({url: e.instance.props.original, fallbackUrl: url});
},
onContextMenu: event => {
let locations = Object.keys(ownLocations).filter(n => ownLocations[n].enabled);
@@ -1028,7 +1050,7 @@ module.exports = (_ => {
children: locations.map((name, i) => BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
id: BDFDB.ContextMenuUtils.createItemId(this.name, "download", name, i),
label: name,
action: _ => this.downloadFile({url: url}, ownLocations[name].location)
action: _ => this.downloadFile({url: e.instance.props.original, fallbackUrl: url}, ownLocations[name].location)
}))
}));
}
@@ -1045,7 +1067,7 @@ module.exports = (_ => {
children: this.labels.context_copy.replace("{{var0}}", type),
onClick: event => {
BDFDB.ListenerUtils.stopEvent(event);
this.copyFile({url: url});
this.copyFile({url: e.instance.props.original, fallbackUrl: url});
}
})
],
@@ -1088,7 +1110,7 @@ module.exports = (_ => {
className: BDFDB.disCN._imageutilitiesdetailswrapper,
children: [
e.instance.props.alt && {label: "Alt", text: e.instance.props.alt},
{label: "Source", text: url.split("?width")[0].split("?height")[0].split("?size")[0]},
{label: "Source", text: this.removeSizeInUrl(this.removeFormatInUrl(url))},
{label: "Size", text: `${e.instance.props.width}x${e.instance.props.height}px`},
cachedImages && cachedImages.amount && cachedImages.amount > 1 && {label: filterForVideos ? "Video" : "Image", text: `${cachedImages.index + 1 || 1} of ${cachedImages.amount}`}
].filter(n => n).map(data => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextElement, {
@@ -1189,6 +1211,7 @@ module.exports = (_ => {
processLazyImage (e) {
if (e.node) {
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);
@@ -1201,9 +1224,9 @@ module.exports = (_ => {
ele.style.setProperty("height", e.instance.props.height + "px");
ele.style.setProperty("max-height", e.instance.props.height + "px");
}
for (let ele of [e.node.src && e.node, ...e.node.querySelectorAll("[src]")].filter(n => n)) ele.src = ele.src.split("?width")[0].split("?height")[0].split("?size")[0];
if (e.instance.state.readyState != BDFDB.LibraryComponents.ImageComponents.ImageReadyStates.READY) {
e.instance.state.readyState = BDFDB.LibraryComponents.ImageComponents.ImageReadyStates.READY;
for (let ele of [e.node.src && e.node, ...e.node.querySelectorAll("[src]")].filter(n => n)) ele.src = this.removeSizeInUrl(ele.src);
if (e.instance.state.readyState != BDFDB.DiscordConstants.ImageReadyStates.READY) {
e.instance.state.readyState = BDFDB.DiscordConstants.ImageReadyStates.READY;
BDFDB.ReactUtils.forceUpdate(e.instance);
}
}
@@ -1229,7 +1252,8 @@ module.exports = (_ => {
if (this.isValid(e.instance.props.src, "gif")) e.node.style.setProperty("pointer-events", "none");
if (this.settings.viewerSettings.zoomMode && typeof e.instance.props.children != "function" && !BDFDB.DOMUtils.containsClass(e.node.parentElement, BDFDB.disCN._imageutilitiessibling)) {
e.node.style.setProperty("cursor", "zoom-in");
e.node.addEventListener("mousedown", event => {
e.node.addEventListener(this.settings.zoomSettings.clickMode ? "click" : "mousedown", event => {
BDFDB.ListenerUtils.stopEvent(event);
if (event.which != 1 || e.node.querySelector("video")) return;
let vanishObserver;
@@ -1238,7 +1262,7 @@ module.exports = (_ => {
let imgRects = BDFDB.DOMUtils.getRects(e.node.firstElementChild);
let lens = BDFDB.DOMUtils.create(`<div class="${BDFDB.disCN._imageutilitieslense}" style="border-radius: 50% !important; pointer-events: none !important; z-index: 10000 !important; width: ${this.settings.zoomSettings.lensSize}px !important; height: ${this.settings.zoomSettings.lensSize}px !important; position: fixed !important;"><div style="position: absolute !important; top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important;"><${e.node.firstElementChild.tagName} src="${!this.isValid(e.instance.props.src, "video") ? e.instance.props.src : this.getPosterUrl(e.instance.props.src)}" style="width: ${imgRects.width * zoomLevel}px; height: ${imgRects.height * zoomLevel}px; position: fixed !important;${this.settings.zoomSettings.pixelMode ? " image-rendering: pixelated !important;" : ""}"${e.node.firstElementChild.tagName == "VIDEO" ? " loop autoplay" : ""}></${e.node.firstElementChild.tagName}></div></div>`);
let pane = lens.firstElementChild.firstElementChild;
let backdrop = BDFDB.DOMUtils.create(`<div class="${BDFDB.disCN._imageutilitieslensebackdrop}" style="background: rgba(0, 0, 0, 0.3) !important; position: absolute !important; top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important; pointer-events: none !important; z-index: 8000 !important;"></div>`);
let backdrop = BDFDB.DOMUtils.create(`<div class="${BDFDB.disCN._imageutilitieslensebackdrop}" style="background: rgba(0, 0, 0, 0.3) !important; position: absolute !important; top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important; pointer-events: all !important; z-index: 8000 !important;"></div>`);
let appMount = document.querySelector(BDFDB.dotCN.appmount);
appMount.appendChild(lens);
appMount.appendChild(backdrop);
@@ -1265,15 +1289,12 @@ module.exports = (_ => {
};
lens.update();
for (let ele of [e.node, document.querySelector(BDFDB.dotCN.imagemodal)]) if (ele) ele.style.setProperty("pointer-events", "none", "important");
let dragging = event2 => {
event = event2;
lens.update();
};
let releasing = event2 => {
BDFDB.ListenerUtils.stopEvent(event2);
for (let ele of [e.node, document.querySelector(BDFDB.dotCN.imagemodal)]) if (ele) ele.style.removeProperty("pointer-events");
this.cleanupListeners("Zoom");
document.removeEventListener("mousemove", dragging);
document.removeEventListener("mouseup", releasing);
@@ -1340,7 +1361,7 @@ module.exports = (_ => {
e.instance.props.resized = true;
}
}
if (this.settings.rescaleSettings.messages != "NONE" && (!e.instance.props.className || e.instance.props.className.indexOf(BDFDB.disCN.embedthumbnail) == -1) && (!e.instance.props.containerClassName || e.instance.props.containerClassName.indexOf(BDFDB.disCN.embedthumbnail) == -1 && e.instance.props.containerClassName.indexOf(BDFDB.disCN.embedvideoimagecomponent) == -1) && BDFDB.ReactUtils.findOwner(reactInstance, {name: "LazyImageZoomable", up: true}) && (e.instance.props.mediaLayoutType != "MOSAIC" || (BDFDB.ReactUtils.findValue(reactInstance, "attachments", {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));
@@ -1370,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}`), "attachments", {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;
@@ -1387,7 +1408,7 @@ module.exports = (_ => {
}, "Error in onMouseEnter of LazyImageZoomable!");
}
}
if (this.settings.detailsSettings.footnote && (e.instance.props.className || "").indexOf(BDFDB.disCN.embedmedia) == -1 && (e.instance.props.className || "").indexOf(BDFDB.disCN.embedthumbnail) == -1 && (e.instance.props.mediaLayoutType != "MOSAIC" || (BDFDB.ReactUtils.findValue(BDFDB.ObjectUtils.get(e, `instance.${BDFDB.ReactUtils.instanceKey}`), "attachments", {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,
@@ -1398,7 +1419,7 @@ module.exports = (_ => {
width: 0,
filename: "unknown.png"
}
})
}, true)
]
});
}
@@ -1478,20 +1499,16 @@ module.exports = (_ => {
requestFile (urls, onLoad, onError, config = {}) {
if (!urls || typeof onLoad != "function") return typeof onError == "function" && onError();
let url = urls.url.startsWith("/assets") ? (window.location.origin + urls.url) : urls.url;
let url = (urls.url && urls.url.startsWith("/assets") ? (window.location.origin + urls.url) : urls.url || "");
let isResized = !config.orignalSizeChecked && (url.indexOf("?width=") > -1 || url.indexOf("?height=") > -1 || url.indexOf("?size=") > -1);
if (!config.fallbackToRequest) BDFDB.DiscordUtils.requestFileData(isResized ? url.split("?width")[0].split("?height")[0].split("?size")[0] : url, {timeout: 3000}, (error, buffer) => {
if (error || !buffer) {
if (isResized) this.requestFile(urls, onLoad, onError, {orignalSizeChecked: true});
else if (urls.fallbackUrl && urls.url != urls.fallbackUrl) this.requestFile({url: urls.fallbackUrl, oldUrl: urls.url}, onLoad, onError);
else this.requestFile({url: urls.oldUrl || urls.url, fallbackUrl: urls.oldUrl ? urls.url : undefined}, onLoad, onError, {fallbackToRequest: true});
}
else onLoad(url, buffer);
});
else BDFDB.LibraryRequires.request(isResized ? url.split("?width")[0].split("?height")[0].split("?size")[0] : url, {agentOptions: {rejectUnauthorized: false}, headers: {"Content-Type": "application/json"}}, (error, response, buffer) => {
url = isResized ? this.removeSizeInUrl(url) : url;
let isFormatted = (url.indexOf("?format=") > -1);
url = isFormatted ? this.removeFormatInUrl(url) : url;
url = url.indexOf("discordapp.com/avatars/") > 0 || url.indexOf("discordapp.com/icons/") > 0 ? `${url}?size=4096` : url;
BDFDB.LibraryRequires.request(url, {toBuffer: true}, (error, response, buffer) => {
if (error || response.statusCode != 200 || response.headers["content-type"].indexOf("text/html") > -1) {
if (isResized) this.requestFile(urls, onLoad, onError, {orignalSizeChecked: true, fallbackToRequest: true});
else if (urls.fallbackUrl && urls.url != urls.fallbackUrl) this.requestFile({url: urls.fallbackUrl}, onLoad, onError, {fallbackToRequest: true});
if (isResized) this.requestFile(urls, onLoad, onError, {orignalSizeChecked: true});
else if (urls.fallbackUrl && urls.url != urls.fallbackUrl) this.requestFile({url: urls.fallbackUrl}, onLoad, onError);
else if (typeof onError == "function") onError();
}
else onLoad(url, buffer);
@@ -1504,7 +1521,7 @@ module.exports = (_ => {
if (!extension) BDFDB.NotificationUtils.toast(this.labels.toast_save_failed.replace("{{var0}}", BDFDB.LanguageUtils.LanguageStrings.IMAGE).replace("{{var1}}", path || "PC"), {type: "danger"});
else {
let type = fileTypes[extension].video ? BDFDB.LanguageUtils.LanguageStrings.VIDEO : BDFDB.LanguageUtils.LanguageStrings.IMAGE;
if (path) BDFDB.LibraryRequires.fs.writeFile(this.getFileName(path, (alternativeName || url.split("/").pop().split(".").slice(0, -1).join(".") || "unknown").slice(0, 35), extension, 0), Buffer.from(buffer), error => {
if (path) BDFDB.LibraryRequires.fs.writeFile(this.getFileName(path, (alternativeName || url.split("/").pop().split(".").slice(0, -1).join(".") || "unknown").slice(0, 35), extension, 0), new Uint8Array(buffer), error => {
if (error) BDFDB.NotificationUtils.toast(this.labels.toast_save_failed.replace("{{var0}}", type).replace("{{var1}}", path), {type: "danger"});
else BDFDB.NotificationUtils.toast(this.labels.toast_save_success.replace("{{var0}}", type).replace("{{var1}}", path), {type: "success"});
});
@@ -1523,7 +1540,7 @@ module.exports = (_ => {
}
copyFile (urls) {
this.requestFile(urls, (url, buffer) => {
this.requestFile(urls, url => {
let type = this.isValid(url, "video") ? BDFDB.LanguageUtils.LanguageStrings.VIDEO : BDFDB.LanguageUtils.LanguageStrings.IMAGE;
BDFDB.LibraryModules.WindowUtils.copyImage(url);
BDFDB.NotificationUtils.toast(this.labels.toast_copy_success.replace("{{var0}}", type), {type: "success"});
@@ -1678,6 +1695,14 @@ module.exports = (_ => {
return filtered;
}
removeSizeInUrl (url) {
return (url || "").split(/[&?]width=/)[0].split(/[&?]height=/)[0].split(/[&?]size=/)[0].split(/[&?]width=/)[0].split(/[&?]height=/)[0].split(/[&?]size=/)[0];
}
removeFormatInUrl (url) {
return (url || "").replace(/format\=[A-z]+(\&){0,1}/g, "");
}
addListener (eventType, type, callback) {
if (!type || !eventType || typeof callback != "function") return;
if (!eventTypes[type]) eventTypes[type] = [];
@@ -1701,13 +1726,14 @@ module.exports = (_ => {
case "bg": // Bulgarian
return {
context_copy: "Копирайте {{var0}}",
context_imageactions: "Действия с изображения",
context_imageactions: "Действия с изображения",
context_lenssize: "Размер на обектива",
context_zoomspeed: "Скорост на мащабиране",
context_saveas: "Запазете {{var0}} като ...",
context_searchwith: "Търсете {{var0}} с ...",
context_videoactions: "Видео действия",
context_streamactions: "Действия за визуализация на потока",
context_videoactions: "Видео действия",
context_view: "Преглед {{var0}}",
context_zoomspeed: "Скорост на мащабиране",
submenu_disabled: "Всички инвалиди",
toast_copy_failed: "{{var0}} не можа да бъде копиран в клипборда",
toast_copy_success: "{{var0}} беше копиран в клипборда",
@@ -1717,13 +1743,14 @@ module.exports = (_ => {
case "cs": // Czech
return {
context_copy: "Zkopírovat {{var0}}",
context_imageactions: "Akce s obrázky",
context_imageactions: "Akce s obrázky",
context_lenssize: "Velikost lupy",
context_zoomspeed: "Rychlost zoomu",
context_saveas: "Uložit {{var0}} jako...",
context_searchwith: "Hledat {{var0}} pomocí...",
context_videoactions: "Video akce",
context_streamactions: "Akce náhledu streamu",
context_videoactions: "Video akce",
context_view: "Zobrazit {{var0}}",
context_zoomspeed: "Rychlost zoomu",
submenu_disabled: "Vše zakázáno",
toast_copy_failed: "{{var0}} nemohl být zkopírován do schránky",
toast_copy_success: "{{var0}} byl zkopírován do schránky",
@@ -1733,13 +1760,14 @@ module.exports = (_ => {
case "da": // Danish
return {
context_copy: "Kopiér {{var0}}",
context_imageactions: "Billedhandlinger",
context_imageactions: "Billedhandlinger",
context_lenssize: "Objektivstørrelse",
context_zoomspeed: "Zoomhastighed",
context_saveas: "Gem {{var0}} som ...",
context_searchwith: "Søg i {{var0}} med ...",
context_videoactions: "Videohandlinger",
context_streamactions: "Stream forhåndsvisningshandlinger",
context_videoactions: "Videohandlinger",
context_view: "Se {{var0}}",
context_zoomspeed: "Zoomhastighed",
submenu_disabled: "Alle handicappede",
toast_copy_failed: "{{var0}} kunne ikke kopieres til udklipsholderen",
toast_copy_success: "{{var0}} blev kopieret til udklipsholderen",
@@ -1749,13 +1777,14 @@ module.exports = (_ => {
case "de": // German
return {
context_copy: "{{var0}} kopieren",
context_imageactions: "Bildaktionen",
context_imageactions: "Bildaktionen",
context_lenssize: "Linsengröße",
context_zoomspeed: "Zoomgeschwindigkeit",
context_saveas: "{{var0}} speichern als ...",
context_searchwith: "{{var0}} suchen mit ...",
context_videoactions: "Videoaktionen",
context_streamactions: "Stream-Vorschau-Aktionen",
context_videoactions: "Videoaktionen",
context_view: "{{var0}} ansehen",
context_zoomspeed: "Zoomgeschwindigkeit",
submenu_disabled: "Alle deaktiviert",
toast_copy_failed: "{{var0}} konnte nicht in die Zwischenablage kopiert werden",
toast_copy_success: "{{var0}} wurde in die Zwischenablage kopiert",
@@ -1765,13 +1794,14 @@ module.exports = (_ => {
case "el": // Greek
return {
context_copy: "Αντιγραφή {{var0}}",
context_imageactions: "Ενέργειες εικόνας",
context_imageactions: "Ενέργειες εικόνας",
context_lenssize: "Μέγεθος φακού",
context_zoomspeed: "Ταχύτητα ζουμ",
context_saveas: "Αποθήκευση {{var0}} ως ...",
context_searchwith: "Αναζήτηση {{var0}} με ...",
context_videoactions: "Ενέργειες βίντεο",
context_streamactions: "Ενέργειες προεπισκόπησης ροής",
context_videoactions: "Ενέργειες βίντεο",
context_view: "Προβολή {{var0}}",
context_zoomspeed: "Ταχύτητα ζουμ",
submenu_disabled: "Όλα τα άτομα με ειδικές ανάγκες",
toast_copy_failed: "Δεν ήταν δυνατή η αντιγραφή του {{var0}} στο πρόχειρο",
toast_copy_success: "Το {{var0}} αντιγράφηκε στο πρόχειρο",
@@ -1781,13 +1811,14 @@ module.exports = (_ => {
case "es": // Spanish
return {
context_copy: "Copiar {{var0}}",
context_imageactions: "Acciones de imagen",
context_imageactions: "Acciones de imagen",
context_lenssize: "Tamaño de la lente",
context_zoomspeed: "Velocidad de zoom",
context_saveas: "Guardar {{var0}} como ...",
context_searchwith: "Buscar {{var0}} con ...",
context_videoactions: "Acciones de vídeo",
context_streamactions: "Acciones de vista previa de transmisión",
context_videoactions: "Acciones de vídeo",
context_view: "Ver {{var0}}",
context_zoomspeed: "Velocidad de zoom",
submenu_disabled: "Todos discapacitados",
toast_copy_failed: "{{var0}} no se pudo copiar al portapapeles",
toast_copy_success: "{{var0}} se copió en el portapapeles",
@@ -1797,13 +1828,14 @@ module.exports = (_ => {
case "fi": // Finnish
return {
context_copy: "Kopioi {{var0}}",
context_imageactions: "Kuvatoiminnot",
context_imageactions: "Kuvatoiminnot",
context_lenssize: "Linssin koko",
context_zoomspeed: "Zoomausnopeus",
context_saveas: "Tallenna {{var0}} nimellä ...",
context_searchwith: "Tee haku {{var0}} ...",
context_videoactions: "Videotoiminnot",
context_streamactions: "Streamin esikatselutoiminnot",
context_videoactions: "Videotoiminnot",
context_view: "Näytä {{var0}}",
context_zoomspeed: "Zoomausnopeus",
submenu_disabled: "Kaikki vammaiset",
toast_copy_failed: "Kohdetta {{var0}} ei voitu kopioida leikepöydälle",
toast_copy_success: "{{var0}} kopioitiin leikepöydälle",
@@ -1813,13 +1845,14 @@ module.exports = (_ => {
case "fr": // French
return {
context_copy: "Copier {{var0}}",
context_imageactions: "Actions sur les images",
context_imageactions: "Actions sur les images",
context_lenssize: "Taille de l'objectif",
context_zoomspeed: "Vitesse de zoom",
context_saveas: "Enregistrer {{var0}} sous ...",
context_searchwith: "Rechercher {{var0}} avec ...",
context_videoactions: "Actions vidéo",
context_streamactions: "Actions d'aperçu de flux",
context_videoactions: "Actions vidéo",
context_view: "Afficher {{var0}}",
context_zoomspeed: "Vitesse de zoom",
submenu_disabled: "Tout désactivé",
toast_copy_failed: "{{var0}} n'a pas pu être copié dans le presse-papiers",
toast_copy_success: "{{var0}} a été copié dans le presse-papiers",
@@ -1829,13 +1862,14 @@ module.exports = (_ => {
case "hi": // Hindi
return {
context_copy: "कॉपी {{var0}}",
context_imageactions: "छवि क्रियाएँ",
context_imageactions: "छवि क्रियाएँ",
context_lenssize: "लेंस का आकार",
context_zoomspeed: "ज़ूम गति",
context_saveas: "{{var0}} को इस रूप में सेव करें...",
context_searchwith: "इसके साथ {{var0}} खोजें ...",
context_videoactions: "वीडियो क्रिया",
context_streamactions: "स्ट्रीम पूर्वावलोकन क्रियाएं",
context_videoactions: "वीडियो क्रिया",
context_view: "देखें {{var0}}",
context_zoomspeed: "ज़ूम गति",
submenu_disabled: "सभी अक्षम",
toast_copy_failed: "{{var0}} को क्लिपबोर्ड पर कॉपी नहीं किया जा सका",
toast_copy_success: "{{var0}} को क्लिपबोर्ड पर कॉपी किया गया था",
@@ -1845,13 +1879,14 @@ module.exports = (_ => {
case "hr": // Croatian
return {
context_copy: "Kopiraj {{var0}}",
context_imageactions: "Radnje slike",
context_imageactions: "Radnje slike",
context_lenssize: "Veličina leće",
context_zoomspeed: "Brzina zumiranja",
context_saveas: "Spremi {{var0}} kao ...",
context_searchwith: "Traži {{var0}} sa ...",
context_videoactions: "Video radnje",
context_streamactions: "Radnje pregleda streama",
context_videoactions: "Video radnje",
context_view: "Pogledajte {{var0}}",
context_zoomspeed: "Brzina zumiranja",
submenu_disabled: "Svi invalidi",
toast_copy_failed: "{{var0}} nije moguće kopirati u međuspremnik",
toast_copy_success: "{{var0}} je kopirano u međuspremnik",
@@ -1861,13 +1896,14 @@ module.exports = (_ => {
case "hu": // Hungarian
return {
context_copy: "{{var0}} másolása",
context_imageactions: "Képműveletek",
context_imageactions: "Képműveletek",
context_lenssize: "Lencse mérete",
context_zoomspeed: "Zoom sebesség",
context_saveas: "{{var0}} mentése másként ...",
context_searchwith: "Keresés a következőben: {{var0}} a következővel:",
context_videoactions: "Videóműveletek",
context_streamactions: "Stream előnézeti műveletek",
context_videoactions: "Videóműveletek",
context_view: "Megtekintés: {{var0}}",
context_zoomspeed: "Zoom sebesség",
submenu_disabled: "Minden fogyatékkal él",
toast_copy_failed: "A {{var0}} fájl nem másolható a vágólapra",
toast_copy_success: "A {{var0}} elemet a vágólapra másolta",
@@ -1877,13 +1913,14 @@ module.exports = (_ => {
case "it": // Italian
return {
context_copy: "Copia {{var0}}",
context_imageactions: "Azioni immagine",
context_imageactions: "Azioni immagine",
context_lenssize: "Dimensione della lente",
context_zoomspeed: "Velocità dello zoom",
context_saveas: "Salva {{var0}} come ...",
context_searchwith: "Cerca {{var0}} con ...",
context_videoactions: "Azioni video",
context_streamactions: "Azioni di anteprima del flusso",
context_videoactions: "Azioni video",
context_view: "Visualizza {{var0}}",
context_zoomspeed: "Velocità dello zoom",
submenu_disabled: "Tutti disabilitati",
toast_copy_failed: "{{var0}} non può essere copiato negli appunti",
toast_copy_success: "{{var0}} è stato copiato negli appunti",
@@ -1893,13 +1930,14 @@ module.exports = (_ => {
case "ja": // Japanese
return {
context_copy: "{{var0}} をコピーします",
context_imageactions: "画像アクション",
context_imageactions: "画像アクション",
context_lenssize: "レンズサイズ",
context_zoomspeed: "ズーム速度",
context_saveas: "{{var0}} を...として保存します",
context_searchwith: "{{var0}} を...で検索",
context_videoactions: "ビデオ アクション",
context_streamactions: "ストリーム プレビュー アクション",
context_videoactions: "ビデオ アクション",
context_view: "{{var0}} を表示",
context_zoomspeed: "ズーム速度",
submenu_disabled: "すべて無効",
toast_copy_failed: "{{var0}} をクリップボードにコピーできませんでした",
toast_copy_success: "{{var0}} がクリップボードにコピーされました",
@@ -1909,13 +1947,14 @@ module.exports = (_ => {
case "ko": // Korean
return {
context_copy: "{{var0}} 복사",
context_imageactions: "이미지 작업",
context_imageactions: "이미지 작업",
context_lenssize: "렌즈 크기",
context_zoomspeed: "줌 속도",
context_saveas: "{{var0}} 을 다른 이름으로 저장 ...",
context_searchwith: "{{var0}} 검색 ...",
context_videoactions: "비디오 작업",
context_streamactions: "스트림 미리보기 작업",
context_videoactions: "비디오 작업",
context_view: "{{var0}} 보기",
context_zoomspeed: "줌 속도",
submenu_disabled: "모두 비활성화 됨",
toast_copy_failed: "{{var0}} 을 클립 보드에 복사 할 수 없습니다.",
toast_copy_success: "{{var0}} 이 클립 보드에 복사되었습니다.",
@@ -1925,13 +1964,14 @@ module.exports = (_ => {
case "lt": // Lithuanian
return {
context_copy: "Kopijuoti {{var0}}",
context_imageactions: "Vaizdo veiksmai",
context_imageactions: "Vaizdo veiksmai",
context_lenssize: "Objektyvo dydis",
context_zoomspeed: "Priartinimo greitis",
context_saveas: "Išsaugoti '{{var0}}' kaip ...",
context_searchwith: "Ieškoti {{var0}} naudojant ...",
context_videoactions: "Vaizdo įrašų veiksmai",
context_streamactions: "Srauto peržiūros veiksmai",
context_videoactions: "Vaizdo įrašų veiksmai",
context_view: "Žiūrėti {{var0}}",
context_zoomspeed: "Priartinimo greitis",
submenu_disabled: "Visi neįgalūs",
toast_copy_failed: "{{var0}} nepavyko nukopijuoti į mainų sritį",
toast_copy_success: "{{var0}} buvo nukopijuota į mainų sritį",
@@ -1941,13 +1981,14 @@ module.exports = (_ => {
case "nl": // Dutch
return {
context_copy: "Kopieer {{var0}}",
context_imageactions: "Afbeeldingsacties",
context_imageactions: "Afbeeldingsacties",
context_lenssize: "Lens Maat",
context_zoomspeed: "Zoom snelheid",
context_saveas: "Bewaar {{var0}} als ...",
context_searchwith: "Zoek {{var0}} met ...",
context_videoactions: "Video-acties",
context_streamactions: "Stream Preview-acties",
context_videoactions: "Video-acties",
context_view: "Bekijk {{var0}}",
context_zoomspeed: "Zoom snelheid",
submenu_disabled: "Allemaal uitgeschakeld",
toast_copy_failed: "{{var0}} kan niet naar het klembord worden gekopieerd",
toast_copy_success: "{{var0}} is naar het klembord gekopieerd",
@@ -1957,13 +1998,14 @@ module.exports = (_ => {
case "no": // Norwegian
return {
context_copy: "Kopier {{var0}}",
context_imageactions: "Bildehandlinger",
context_imageactions: "Bildehandlinger",
context_lenssize: "Linsestørrelse",
context_zoomspeed: "Zoomhastighet",
context_saveas: "Lagre {{var0}} som ...",
context_searchwith: "Søk på {{var0}} med ...",
context_videoactions: "Videohandlinger",
context_streamactions: "Strøm forhåndsvisningshandlinger",
context_videoactions: "Videohandlinger",
context_view: "Vis {{var0}}",
context_zoomspeed: "Zoomhastighet",
submenu_disabled: "Alle funksjonshemmede",
toast_copy_failed: "{{var0}} kunne ikke kopieres til utklippstavlen",
toast_copy_success: "{{var0}} ble kopiert til utklippstavlen",
@@ -1973,13 +2015,14 @@ module.exports = (_ => {
case "pl": // Polish
return {
context_copy: "Kopiuj {{var0}}",
context_imageactions: "Działania związane z obrazem",
context_imageactions: "Działania związane z obrazem",
context_lenssize: "Rozmiar soczewki",
context_zoomspeed: "Szybkość zoomu",
context_saveas: "Zapisz {{var0}} jako ...",
context_searchwith: "Wyszukaj {{var0}} za pomocą ...",
context_videoactions: "Akcje wideo",
context_streamactions: "Akcje podglądu strumienia",
context_videoactions: "Akcje wideo",
context_view: "Wyświetl {{var0}}",
context_zoomspeed: "Szybkość zoomu",
submenu_disabled: "Wszystkie wyłączone",
toast_copy_failed: "Nie można skopiować {{var0}} do schowka",
toast_copy_success: "{{var0}} został skopiowany do schowka",
@@ -1989,13 +2032,14 @@ module.exports = (_ => {
case "pt-BR": // Portuguese (Brazil)
return {
context_copy: "Copiar {{var0}}",
context_imageactions: "Ações de imagem",
context_imageactions: "Ações de imagem",
context_lenssize: "Tamanho da lente",
context_zoomspeed: "Velocidade do zoom",
context_saveas: "Salvar {{var0}} como ...",
context_searchwith: "Pesquisar {{var0}} com ...",
context_videoactions: "Ações de vídeo",
context_streamactions: "Ações de visualização de fluxo",
context_videoactions: "Ações de vídeo",
context_view: "Visualizar {{var0}}",
context_zoomspeed: "Velocidade do zoom",
submenu_disabled: "Todos desativados",
toast_copy_failed: "{{var0}} não pôde ser copiado para a área de transferência",
toast_copy_success: "{{var0}} foi copiado para a área de transferência",
@@ -2005,13 +2049,14 @@ module.exports = (_ => {
case "ro": // Romanian
return {
context_copy: "Copiați {{var0}}",
context_imageactions: "Acțiuni de imagine",
context_imageactions: "Acțiuni de imagine",
context_lenssize: "Dimensiunea obiectivului",
context_zoomspeed: "Viteza de zoom",
context_saveas: "Salvați {{var0}} ca ...",
context_searchwith: "Căutați {{var0}} cu ...",
context_videoactions: "Acțiuni video",
context_streamactions: "Acțiuni de previzualizare în flux",
context_videoactions: "Acțiuni video",
context_view: "Vizualizați {{var0}}",
context_zoomspeed: "Viteza de zoom",
submenu_disabled: "Toate sunt dezactivate",
toast_copy_failed: "{{var0}} nu a putut fi copiat în clipboard",
toast_copy_success: "{{var0}} a fost copiat în clipboard",
@@ -2021,13 +2066,14 @@ module.exports = (_ => {
case "ru": // Russian
return {
context_copy: "Скопируйте {{var0}}",
context_imageactions: "Действия с изображением",
context_imageactions: "Действия с изображением",
context_lenssize: "Размер линзы",
context_zoomspeed: "Скорость масштабирования",
context_saveas: "Сохранить {{var0}} как ...",
context_searchwith: "Искать {{var0}} с помощью ...",
context_videoactions: "Действия с видео",
context_streamactions: "Действия предварительного просмотра трансляции",
context_videoactions: "Действия с видео",
context_view: "Посмотреть {{var0}}",
context_zoomspeed: "Скорость масштабирования",
submenu_disabled: "Все отключены",
toast_copy_failed: "{{var0}} не удалось скопировать в буфер обмена",
toast_copy_success: "{{var0}} скопирован в буфер обмена",
@@ -2037,13 +2083,14 @@ module.exports = (_ => {
case "sv": // Swedish
return {
context_copy: "Kopiera {{var0}}",
context_imageactions: "Bildåtgärder",
context_imageactions: "Bildåtgärder",
context_lenssize: "Linsstorlek",
context_zoomspeed: "Zoomhastighet",
context_saveas: "Spara {{var0}} som ...",
context_searchwith: "Sök {{var0}} med ...",
context_videoactions: "Videoåtgärder",
context_streamactions: "Streama förhandsgranskningsåtgärder",
context_videoactions: "Videoåtgärder",
context_view: "Visa {{var0}}",
context_zoomspeed: "Zoomhastighet",
submenu_disabled: "Alla funktionshindrade",
toast_copy_failed: "{{var0}} kunde inte kopieras till Urklipp",
toast_copy_success: "{{var0}} kopierades till Urklipp",
@@ -2053,13 +2100,14 @@ module.exports = (_ => {
case "th": // Thai
return {
context_copy: "คัดลอก{{var0}}",
context_imageactions: "การทำงานของรูปภาพ",
context_imageactions: "การทำงานของรูปภาพ",
context_lenssize: "ขนาดเลนส์",
context_zoomspeed: "ความเร็วในการซูม",
context_saveas: "บันทึก{{var0}}เป็น ...",
context_searchwith: "ค้นหา{{var0}} ้วย ...",
context_videoactions: "การกระทำของวิดีโอ",
context_streamactions: "การดำเนินการแสดงตัวอย่างสตรีม",
context_videoactions: "การกระทำของวิดีโอ",
context_view: "ดู{{var0}}",
context_zoomspeed: "ความเร็วในการซูม",
submenu_disabled: "ปิดใช้งานทั้งหมด",
toast_copy_failed: "ไม่สามารถคัดลอก{{var0}}ไปยังคลิปบอร์ดได้",
toast_copy_success: "คัดลอก{{var0}}ไปยังคลิปบอร์ดแล้ว",
@@ -2069,13 +2117,14 @@ module.exports = (_ => {
case "tr": // Turkish
return {
context_copy: "{{var0}} kopyala",
context_imageactions: "Görüntü Eylemleri",
context_imageactions: "Görüntü Eylemleri",
context_lenssize: "Lens Boyutu",
context_zoomspeed: "yakınlaştırma hızı",
context_saveas: "{{var0}} farklı kaydet ...",
context_searchwith: "{{var0}} şununla ara ...",
context_videoactions: "Video Eylemleri",
context_streamactions: "Akış Önizleme İşlemleri",
context_videoactions: "Video Eylemleri",
context_view: "{{var0}} görüntüle",
context_zoomspeed: "yakınlaştırma hızı",
submenu_disabled: "Hepsi devre dışı",
toast_copy_failed: "{{var0}} panoya kopyalanamadı",
toast_copy_success: "{{var0}} panoya kopyalandı",
@@ -2085,13 +2134,14 @@ module.exports = (_ => {
case "uk": // Ukrainian
return {
context_copy: "Копіювати {{var0}}",
context_imageactions: "Дії із зображеннями",
context_imageactions: "Дії із зображеннями",
context_lenssize: "Розмір лінзи",
context_zoomspeed: "Швидкість масштабування",
context_saveas: "Збережіть {{var0}} як ...",
context_searchwith: "Шукати {{var0}} за допомогою ...",
context_videoactions: "Відео дії",
context_streamactions: "Дії попереднього перегляду потоку",
context_videoactions: "Відео дії",
context_view: "Переглянути {{var0}}",
context_zoomspeed: "Швидкість масштабування",
submenu_disabled: "Всі інваліди",
toast_copy_failed: "Не вдалося скопіювати {{var0}} у буфер обміну",
toast_copy_success: "{{var0}} скопійовано в буфер обміну",
@@ -2101,13 +2151,14 @@ module.exports = (_ => {
case "vi": // Vietnamese
return {
context_copy: "Sao chép {{var0}}",
context_imageactions: "Hành động hình ảnh",
context_imageactions: "Hành động hình ảnh",
context_lenssize: "Kích thước ống kính",
context_zoomspeed: "tốc độ thu phóng",
context_saveas: "Lưu {{var0}} dưới dạng ...",
context_searchwith: "Tìm kiếm {{var0}} bằng ...",
context_videoactions: "Hành động video",
context_streamactions: "Tác vụ xem trước luồng",
context_videoactions: "Hành động video",
context_view: "Xem {{var0}}",
context_zoomspeed: "tốc độ thu phóng",
submenu_disabled: "Tất cả đã bị vô hiệu hóa",
toast_copy_failed: "Không thể sao chép {{var0}} vào khay nhớ tạm",
toast_copy_success: "{{var0}} đã được sao chép vào khay nhớ tạm",
@@ -2117,13 +2168,14 @@ module.exports = (_ => {
case "zh-CN": // Chinese (China)
return {
context_copy: "复制 {{var0}}",
context_imageactions: "图像动作",
context_imageactions: "图像动作",
context_lenssize: "缩放尺寸",
context_zoomspeed: "变焦速度",
context_saveas: "将 {{var0}} 另存到...",
context_searchwith: "搜索 {{var0}} 使用...",
context_videoactions: "视频动作",
context_streamactions: "流预览操作",
context_videoactions: "视频动作",
context_view: "查看 {{var0}}",
context_zoomspeed: "变焦速度",
submenu_disabled: "全部禁用",
toast_copy_failed: "{{var0}} 无法复制到剪贴板",
toast_copy_success: "{{var0}} 已复制到剪贴板",
@@ -2133,13 +2185,14 @@ module.exports = (_ => {
case "zh-TW": // Chinese (Taiwan)
return {
context_copy: "複製 {{var0}}",
context_imageactions: "圖像動作",
context_imageactions: "圖像動作",
context_lenssize: "縮放尺寸",
context_zoomspeed: "变焦速度",
context_saveas: "將 {{var0}} 另存到...",
context_searchwith: "搜尋 {{var0}} 使用...",
context_videoactions: "視頻動作",
context_streamactions: "流預覽操作",
context_videoactions: "視頻動作",
context_view: "預覽 {{var0}}",
context_zoomspeed: "变焦速度",
submenu_disabled: "全部關閉",
toast_copy_failed: "{{var0}} 無法複製到剪貼簿",
toast_copy_success: "{{var0}} 已複製到剪貼簿",
@@ -2149,13 +2202,14 @@ module.exports = (_ => {
default: // English
return {
context_copy: "Copy {{var0}}",
context_imageactions: "Image Actions",
context_lenssize: "Lens Size",
context_zoomspeed: "Zoom speed",
context_imageactions: "Image Actions",
context_lenssize: "Lens size",
context_saveas: "Save {{var0}} as ...",
context_searchwith: "Search {{var0}} with ...",
context_videoactions: "Video Actions",
context_streamactions: "Stream Preview Actions",
context_videoactions: "Video Actions",
context_view: "View {{var0}}",
context_zoomspeed: "Zoom speed",
submenu_disabled: "All disabled",
toast_copy_failed: "{{var0}} could not be copied to the Clipboard",
toast_copy_success: "{{var0}} was copied to the Clipboard",