Update ImageUtilities.plugin.js

This commit is contained in:
Mirco Wittrien 2020-08-31 21:41:39 +02:00
parent 9916bd30eb
commit 1722f60cdd
1 changed files with 62 additions and 28 deletions

View File

@ -50,7 +50,7 @@ var ImageUtilities = (_ => {
return class ImageUtilities { return class ImageUtilities {
getName () {return "ImageUtilities";} getName () {return "ImageUtilities";}
getVersion () {return "4.1.0";} getVersion () {return "4.1.1";}
getAuthor () {return "DevilBro";} getAuthor () {return "DevilBro";}
@ -58,9 +58,7 @@ var ImageUtilities = (_ => {
constructor () { constructor () {
this.changelog = { this.changelog = {
"progress":[["Welcome","This is the successor of ImageZoom, ImageGallery, ReverseImageSearch and ShowImageDetails. All of these plugins are now combined in one with even more useful features. Check out the plugin settings to configure the plugin the way you want it to work."]], "added":[["Save Image as...","Added new option to open a save as prompt, where you can choose the filename and path"]]
"improved":[["Animated Icons/Avatars","Right clicking a server/user with an animated icon will now give the option to either choose the .png or .gif"]],
"fixed":[["Image Formats","Fixed some issues with some image formats, like copy option not showing for gifs since gifs can't be copied in the clipboard"]]
}; };
this.patchedModules = { this.patchedModules = {
@ -429,6 +427,21 @@ var ImageUtilities = (_ => {
}); });
} }
}), }),
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.context_saveimageas_text,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "download-image-as"),
action: _ => {
BDFDB.LibraryRequires.request(url, {encoding: null}, (error, response, body) => {
let fileName = `${url.split("/").pop().split(".").slice(0, -1).join(".")}.${response.headers["content-type"].split("/").pop().split("+")[0]}`;
let hrefURL = window.URL.createObjectURL(new Blob([body]));
let tempLink = document.createElement("a");
tempLink.href = hrefURL;
tempLink.download = fileName;
tempLink.click();
window.URL.revokeObjectURL(hrefURL);
});
}
}),
!this.isCopyable(url) ? null : BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { !this.isCopyable(url) ? null : BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.context_copyimage_text, label: this.labels.context_copyimage_text,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-image"), id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-image"),
@ -892,7 +905,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "Slika je spremljena u '{{path}}'", toast_saveimage_success: "Slika je spremljena u '{{path}}'",
toast_saveimage_failed: "Spremanje slike na '{{path}}' nije uspjelo", toast_saveimage_failed: "Spremanje slike na '{{path}}' nije uspjelo",
context_viewimage_text: "Pogledati sliku", context_viewimage_text: "Pogledati sliku",
context_saveimage_text: "Preuzmite sliku", context_saveimage_text: "Spremiti sliku",
context_saveimageas_text: "Spremi sliku kao ...",
context_copyimage_text: "Kopiraj sliku", context_copyimage_text: "Kopiraj sliku",
context_copyimagelink_text: "Kopirajte vezu slike", context_copyimagelink_text: "Kopirajte vezu slike",
context_reverseimagesearch_text: "Traži sliku ...", context_reverseimagesearch_text: "Traži sliku ...",
@ -907,7 +921,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "Billedet er gemt i '{{path}}'", toast_saveimage_success: "Billedet er gemt i '{{path}}'",
toast_saveimage_failed: "Kunne ikke gemme billedet i '{{path}}'", toast_saveimage_failed: "Kunne ikke gemme billedet i '{{path}}'",
context_viewimage_text: "Se billede", context_viewimage_text: "Se billede",
context_saveimage_text: "Download billede", context_saveimage_text: "Gem billede",
context_saveimageas_text: "Gem billede som ...",
context_copyimage_text: "Kopier billede", context_copyimage_text: "Kopier billede",
context_copyimagelink_text: "Kopier billedlink", context_copyimagelink_text: "Kopier billedlink",
context_reverseimagesearch_text: "Søg billede med ...", context_reverseimagesearch_text: "Søg billede med ...",
@ -918,13 +933,14 @@ var ImageUtilities = (_ => {
return { return {
toast_copyimage_success: "Bild in Zwischenablage kopiert", toast_copyimage_success: "Bild in Zwischenablage kopiert",
toast_copyimage_failed: "Bild konnte nicht in die Zwischenablage kopiert werden", toast_copyimage_failed: "Bild konnte nicht in die Zwischenablage kopiert werden",
toast_copyimagelink_success: "Bildlink in Zwischenablage kopiert", toast_copyimagelink_success: "Bildadresse in Zwischenablage kopiert",
toast_saveimage_success: "Bild wurde in '{{path}}' gespeichert", toast_saveimage_success: "Bild wurde in '{{path}}' gespeichert",
toast_saveimage_failed: "Bild konnte nicht in '{{path}}' gespeichert werden", toast_saveimage_failed: "Bild konnte nicht in '{{path}}' gespeichert werden",
context_viewimage_text: "Bild ansehen", context_viewimage_text: "Bild ansehen",
context_saveimage_text: "Bild herunterladen", context_saveimage_text: "Bild speichern",
context_saveimageas_text: "Bild speichern unter ...",
context_copyimage_text: "Bild kopieren", context_copyimage_text: "Bild kopieren",
context_copyimagelink_text: "Bildlink kopieren", context_copyimagelink_text: "Bildadresse kopieren",
context_reverseimagesearch_text: "Bild suchen mit ...", context_reverseimagesearch_text: "Bild suchen mit ...",
context_lensesize_text: "Linsengröße", context_lensesize_text: "Linsengröße",
submenu_disabled_text: "Alle deaktiviert" submenu_disabled_text: "Alle deaktiviert"
@ -937,7 +953,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "Imagen guardada en '{{path}}'", toast_saveimage_success: "Imagen guardada en '{{path}}'",
toast_saveimage_failed: "No se pudo guardar la imagen en '{{path}}'", toast_saveimage_failed: "No se pudo guardar la imagen en '{{path}}'",
context_viewimage_text: "Ver imagen", context_viewimage_text: "Ver imagen",
context_saveimage_text: "Descargar imagen", context_saveimage_text: "Guardar imagen",
context_saveimageas_text: "Guardar imagen como ...",
context_copyimage_text: "Copiar imagen", context_copyimage_text: "Copiar imagen",
context_copyimagelink_text: "Copiar enlace de imagen", context_copyimagelink_text: "Copiar enlace de imagen",
context_reverseimagesearch_text: "Buscar imagen con ...", context_reverseimagesearch_text: "Buscar imagen con ...",
@ -952,7 +969,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "Image enregistrée dans '{{path}}'", toast_saveimage_success: "Image enregistrée dans '{{path}}'",
toast_saveimage_failed: "Échec de l'enregistrement de l'image dans '{{path}}'", toast_saveimage_failed: "Échec de l'enregistrement de l'image dans '{{path}}'",
context_viewimage_text: "Voir l'image", context_viewimage_text: "Voir l'image",
context_saveimage_text: "Télécharger l'image", context_saveimage_text: "Enregistrer l'image",
context_saveimageas_text: "Enregistrer l'image sous ...",
context_copyimage_text: "Copier l'image", context_copyimage_text: "Copier l'image",
context_copyimagelink_text: "Copier le lien de l'image", context_copyimagelink_text: "Copier le lien de l'image",
context_reverseimagesearch_text: "Rechercher une image avec ...", context_reverseimagesearch_text: "Rechercher une image avec ...",
@ -967,7 +985,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "Immagine salvata in '{{path}}'", toast_saveimage_success: "Immagine salvata in '{{path}}'",
toast_saveimage_failed: "Impossibile salvare l'immagine in '{{path}}'", toast_saveimage_failed: "Impossibile salvare l'immagine in '{{path}}'",
context_viewimage_text: "Guarda l'immagine", context_viewimage_text: "Guarda l'immagine",
context_saveimage_text: "Scarica immagine", context_saveimage_text: "Salva immagine",
context_saveimageas_text: "Salva l'immagine come ...",
context_copyimage_text: "Copia l'immagine", context_copyimage_text: "Copia l'immagine",
context_copyimagelink_text: "Copia link immagine", context_copyimagelink_text: "Copia link immagine",
context_reverseimagesearch_text: "Cerca immagine con ...", context_reverseimagesearch_text: "Cerca immagine con ...",
@ -982,7 +1001,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "Afbeelding opgeslagen in '{{path}}'", toast_saveimage_success: "Afbeelding opgeslagen in '{{path}}'",
toast_saveimage_failed: "Kan afbeelding niet opslaan in '{{path}}'", toast_saveimage_failed: "Kan afbeelding niet opslaan in '{{path}}'",
context_viewimage_text: "Bekijk afbeelding", context_viewimage_text: "Bekijk afbeelding",
context_saveimage_text: "Download afbeelding", context_saveimage_text: "Sla afbeelding op",
context_saveimageas_text: "Sla afbeelding op als ...",
context_copyimage_text: "Kopieer afbeelding", context_copyimage_text: "Kopieer afbeelding",
context_copyimagelink_text: "Kopieer afbeeldingslink", context_copyimagelink_text: "Kopieer afbeeldingslink",
context_reverseimagesearch_text: "Afbeelding zoeken met ...", context_reverseimagesearch_text: "Afbeelding zoeken met ...",
@ -997,7 +1017,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "Bilde lagret i '{{path}}'", toast_saveimage_success: "Bilde lagret i '{{path}}'",
toast_saveimage_failed: "Kunne ikke lagre bildet i '{{path}}'", toast_saveimage_failed: "Kunne ikke lagre bildet i '{{path}}'",
context_viewimage_text: "Vis bilde", context_viewimage_text: "Vis bilde",
context_saveimage_text: "Last ned bilde", context_saveimage_text: "Lagre bildet",
context_saveimageas_text: "Lagre bildet som ...",
context_copyimage_text: "Kopier bilde", context_copyimage_text: "Kopier bilde",
context_copyimagelink_text: "Kopier bildelink", context_copyimagelink_text: "Kopier bildelink",
context_reverseimagesearch_text: "Søk på bilde med ...", context_reverseimagesearch_text: "Søk på bilde med ...",
@ -1012,7 +1033,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "Obraz zapisany w '{{path}}'", toast_saveimage_success: "Obraz zapisany w '{{path}}'",
toast_saveimage_failed: "Nie udało się zapisać obrazu w '{{path}}'", toast_saveimage_failed: "Nie udało się zapisać obrazu w '{{path}}'",
context_viewimage_text: "Zobacz obraz", context_viewimage_text: "Zobacz obraz",
context_saveimage_text: "Pobierz obraz", context_saveimage_text: "Zapisać obraz",
context_saveimageas_text: "Zapisz obraz jako ...",
context_copyimage_text: "Skopiuj obraz", context_copyimage_text: "Skopiuj obraz",
context_copyimagelink_text: "Kopiuj łącze do obrazu", context_copyimagelink_text: "Kopiuj łącze do obrazu",
context_reverseimagesearch_text: "Wyszukaj obraz za pomocą ...", context_reverseimagesearch_text: "Wyszukaj obraz za pomocą ...",
@ -1027,7 +1049,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "Imagem salva em '{{path}}'", toast_saveimage_success: "Imagem salva em '{{path}}'",
toast_saveimage_failed: "Falha ao salvar imagem em '{{path}}'", toast_saveimage_failed: "Falha ao salvar imagem em '{{path}}'",
context_viewimage_text: "Ver imagem", context_viewimage_text: "Ver imagem",
context_saveimage_text: "Baixar imagem", context_saveimage_text: "Salvar imagem",
context_saveimageas_text: "Salvar imagem como ...",
context_copyimage_text: "Copiar imagem", context_copyimage_text: "Copiar imagem",
context_copyimagelink_text: "Copiar link da imagem", context_copyimagelink_text: "Copiar link da imagem",
context_reverseimagesearch_text: "Pesquisar imagem com ...", context_reverseimagesearch_text: "Pesquisar imagem com ...",
@ -1042,7 +1065,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "Kuva tallennettu '{{path}}'", toast_saveimage_success: "Kuva tallennettu '{{path}}'",
toast_saveimage_failed: "Kuvan tallentaminen epäonnistui '{{path}}'", toast_saveimage_failed: "Kuvan tallentaminen epäonnistui '{{path}}'",
context_viewimage_text: "Näytä kuva", context_viewimage_text: "Näytä kuva",
context_saveimage_text: "Lataa kuva", context_saveimage_text: "Tallenna kuva",
context_saveimageas_text: "Tallenna kuva nimellä ...",
context_copyimage_text: "Kopioi kuva", context_copyimage_text: "Kopioi kuva",
context_copyimagelink_text: "Kopioi kuvan linkki", context_copyimagelink_text: "Kopioi kuvan linkki",
context_reverseimagesearch_text: "Hae kuvaa ...", context_reverseimagesearch_text: "Hae kuvaa ...",
@ -1057,7 +1081,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "Bild sparad i '{{path}}'", toast_saveimage_success: "Bild sparad i '{{path}}'",
toast_saveimage_failed: "Det gick inte att spara bilden i '{{path}}'", toast_saveimage_failed: "Det gick inte att spara bilden i '{{path}}'",
context_viewimage_text: "Se bild", context_viewimage_text: "Se bild",
context_saveimage_text: "Ladda ner bild", context_saveimage_text: "Spara bild",
context_saveimageas_text: "Spara bild som ...",
context_copyimage_text: "Kopiera bild", context_copyimage_text: "Kopiera bild",
context_copyimagelink_text: "Kopiera bildlänk", context_copyimagelink_text: "Kopiera bildlänk",
context_reverseimagesearch_text: "Sök bild med ...", context_reverseimagesearch_text: "Sök bild med ...",
@ -1072,7 +1097,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "Resim '{{path}}' konumuna kaydedildi", toast_saveimage_success: "Resim '{{path}}' konumuna kaydedildi",
toast_saveimage_failed: "'{{path}}' konumuna resim kaydedilemedi", toast_saveimage_failed: "'{{path}}' konumuna resim kaydedilemedi",
context_viewimage_text: "Resmi görüntüle", context_viewimage_text: "Resmi görüntüle",
context_saveimage_text: "Resmi İndir", context_saveimage_text: "Resmi kaydet",
context_saveimageas_text: "Resmi farklı kaydet ...",
context_copyimage_text: "Resmi kopyala", context_copyimage_text: "Resmi kopyala",
context_copyimagelink_text: "Görüntü Bağlantısını kopyala", context_copyimagelink_text: "Görüntü Bağlantısını kopyala",
context_reverseimagesearch_text: "Görüntüyü şununla ara ...", context_reverseimagesearch_text: "Görüntüyü şununla ara ...",
@ -1087,7 +1113,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "Obrázek uložený v '{{path}}'", toast_saveimage_success: "Obrázek uložený v '{{path}}'",
toast_saveimage_failed: "Nepodařilo se uložit obrázek do '{{path}}'", toast_saveimage_failed: "Nepodařilo se uložit obrázek do '{{path}}'",
context_viewimage_text: "Zobrazit obrázek", context_viewimage_text: "Zobrazit obrázek",
context_saveimage_text: "Stáhnout obrázek", context_saveimage_text: "Uložit obrázek",
context_saveimageas_text: "Uložit obrázek jako ...",
context_copyimage_text: "Kopírovat obrázek", context_copyimage_text: "Kopírovat obrázek",
context_copyimagelink_text: "Kopírovat odkaz na obrázek", context_copyimagelink_text: "Kopírovat odkaz na obrázek",
context_reverseimagesearch_text: "Vyhledat obrázek pomocí ...", context_reverseimagesearch_text: "Vyhledat obrázek pomocí ...",
@ -1102,7 +1129,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "Изображението е запазено в '{{path}}'", toast_saveimage_success: "Изображението е запазено в '{{path}}'",
toast_saveimage_failed: "Неуспешно запазване на изображението в '{{path}}'", toast_saveimage_failed: "Неуспешно запазване на изображението в '{{path}}'",
context_viewimage_text: "Вижте изображението", context_viewimage_text: "Вижте изображението",
context_saveimage_text: "Изтегляне на изображението", context_saveimage_text: "Запазването на изображението",
context_saveimageas_text: "Запази изображението като ...",
context_copyimage_text: "Копирай изображение", context_copyimage_text: "Копирай изображение",
context_copyimagelink_text: "Копиране на изображението", context_copyimagelink_text: "Копиране на изображението",
context_reverseimagesearch_text: "Търсене на изображение с ...", context_reverseimagesearch_text: "Търсене на изображение с ...",
@ -1117,7 +1145,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "Изображение сохранено в '{{path}}'", toast_saveimage_success: "Изображение сохранено в '{{path}}'",
toast_saveimage_failed: "Не удалось сохранить изображение в '{{path}}'", toast_saveimage_failed: "Не удалось сохранить изображение в '{{path}}'",
context_viewimage_text: "Просмотр изображения", context_viewimage_text: "Просмотр изображения",
context_saveimage_text: "Скачать изображение", context_saveimage_text: "Сохранить изображение",
context_saveimageas_text: "Сохранить изображение как ...",
context_copyimage_text: "Копировать изображение", context_copyimage_text: "Копировать изображение",
context_copyimagelink_text: "Копировать ссылку на изображение", context_copyimagelink_text: "Копировать ссылку на изображение",
context_reverseimagesearch_text: "Поиск изображения с ...", context_reverseimagesearch_text: "Поиск изображения с ...",
@ -1132,7 +1161,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "Зображення збережено на '{{path}}'", toast_saveimage_success: "Зображення збережено на '{{path}}'",
toast_saveimage_failed: "Не вдалося зберегти зображення на '{{path}}'", toast_saveimage_failed: "Не вдалося зберегти зображення на '{{path}}'",
context_viewimage_text: "Переглянути зображення", context_viewimage_text: "Переглянути зображення",
context_saveimage_text: "Завантажити зображення", context_saveimage_text: "Зберегти зображення",
context_saveimageas_text: "Зберегти зображення як ...",
context_copyimage_text: "Скопіювати зображення", context_copyimage_text: "Скопіювати зображення",
context_copyimagelink_text: "Скопіюйте посилання на зображення", context_copyimagelink_text: "Скопіюйте посилання на зображення",
context_reverseimagesearch_text: "Шукати зображення за допомогою ...", context_reverseimagesearch_text: "Шукати зображення за допомогою ...",
@ -1147,7 +1177,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "画像は'{{path}}'に保存されました", toast_saveimage_success: "画像は'{{path}}'に保存されました",
toast_saveimage_failed: "画像を'{{path}}'に保存できませんでした", toast_saveimage_failed: "画像を'{{path}}'に保存できませんでした",
context_viewimage_text: "画像を見る", context_viewimage_text: "画像を見る",
context_saveimage_text: "画像をダウンロード", context_saveimage_text: "画像を保存",
context_saveimageas_text: "画像を保存します ...",
context_copyimage_text: "画像をコピー", context_copyimage_text: "画像をコピー",
context_copyimagelink_text: "画像リンクをコピー", context_copyimagelink_text: "画像リンクをコピー",
context_reverseimagesearch_text: "で画像を検索 ...", context_reverseimagesearch_text: "で画像を検索 ...",
@ -1162,11 +1193,12 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "圖片保存在'{{path}}'中", toast_saveimage_success: "圖片保存在'{{path}}'中",
toast_saveimage_failed: "無法將圖像保存到'{{path}}'中", toast_saveimage_failed: "無法將圖像保存到'{{path}}'中",
context_viewimage_text: "看圖片", context_viewimage_text: "看圖片",
context_saveimage_text: "下載圖片", context_saveimage_text: "保存圖片",
context_saveimageas_text: "將圖像另存為...",
context_copyimage_text: "複製圖片", context_copyimage_text: "複製圖片",
context_copyimagelink_text: "複製圖像鏈接", context_copyimagelink_text: "複製圖像鏈接",
context_lensesize_text: "鏡片尺寸", context_lensesize_text: "鏡片尺寸",
context_reverseimagesearch_text: "搜尋圖片 ...", context_reverseimagesearch_text: "搜尋圖片...",
submenu_disabled_text: "全部停用" submenu_disabled_text: "全部停用"
}; };
case "ko": //korean case "ko": //korean
@ -1177,7 +1209,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "'{{path}}'에 저장된 이미지", toast_saveimage_success: "'{{path}}'에 저장된 이미지",
toast_saveimage_failed: "'{{path}}'에 이미지를 저장하지 못했습니다", toast_saveimage_failed: "'{{path}}'에 이미지를 저장하지 못했습니다",
context_viewimage_text: "이미지보기", context_viewimage_text: "이미지보기",
context_saveimage_text: "이미지 다운로드", context_saveimage_text: "이미지를 저장",
context_saveimageas_text: "다른 이름으로 이미지 저장 ...",
context_copyimage_text: "복사 이미지", context_copyimage_text: "복사 이미지",
context_copyimagelink_text: "이미지 링크 복사", context_copyimagelink_text: "이미지 링크 복사",
context_reverseimagesearch_text: "로 이미지 검색 ...", context_reverseimagesearch_text: "로 이미지 검색 ...",
@ -1192,7 +1225,8 @@ var ImageUtilities = (_ => {
toast_saveimage_success: "Saved image in '{{path}}'", toast_saveimage_success: "Saved image in '{{path}}'",
toast_saveimage_failed: "Failed to save image in '{{path}}'", toast_saveimage_failed: "Failed to save image in '{{path}}'",
context_viewimage_text: "View Image", context_viewimage_text: "View Image",
context_saveimage_text: "Download Image", context_saveimage_text: "Save Image",
context_saveimageas_text: "Save Image as ...",
context_copyimage_text: "Copy Image", context_copyimage_text: "Copy Image",
context_copyimagelink_text: "Copy Image Link", context_copyimagelink_text: "Copy Image Link",
context_reverseimagesearch_text: "Search Image with ...", context_reverseimagesearch_text: "Search Image with ...",