From 7b2f16cf1eeaf27bcb0dc8cd36ddd407c4c893f0 Mon Sep 17 00:00:00 2001 From: Gregory-K Date: Fri, 8 Jul 2022 17:56:39 +0300 Subject: [PATCH] > Fetch : fetch & merge official CardBook v81.6 :: [Rel.verUp 81.6.1] [Release version Up - 81.6.1] --- README.md | 2 +- src/README.md | 2 +- src/_locales/ar/messages.json | 36 +- src/_locales/cs/messages.json | 30 +- src/_locales/da/messages.json | 32 +- src/_locales/de/messages.json | 30 +- src/_locales/el/messages.json | 36 +- src/_locales/en-US/messages.json | 30 +- src/_locales/es-ES/messages.json | 30 +- src/_locales/fr/messages.json | 30 +- src/_locales/hr/messages.json | 36 +- src/_locales/hu/messages.json | 30 +- src/_locales/id/messages.json | 36 +- src/_locales/it/messages.json | 32 +- src/_locales/ja/messages.json | 32 +- src/_locales/ko/messages.json | 30 +- src/_locales/lt/messages.json | 36 +- src/_locales/nl/messages.json | 64 +++- src/_locales/pl/messages.json | 36 +- src/_locales/pt-BR/messages.json | 30 +- src/_locales/pt-PT/messages.json | 34 +- src/_locales/ro/messages.json | 36 +- src/_locales/ru/messages.json | 30 +- src/_locales/sk/messages.json | 30 +- src/_locales/sl/messages.json | 36 +- src/_locales/sv-SE/messages.json | 36 +- src/_locales/tr/messages.json | 44 ++- src/_locales/uk/messages.json | 36 +- src/_locales/vi/messages.json | 36 +- src/_locales/zh-CN/messages.json | 30 +- src/background.js | 8 +- .../wdw_addressbooksAdd.js | 28 +- .../wdw_addressbooksAdd.xhtml | 1 + .../api/DomContentScript/implementation.js | 76 +++++ .../content/api/DomContentScript/schema.json | 25 ++ .../birthdays/cardbookBirthdaysUtils.js | 4 +- .../content/cardEdition/wdw_cardEdition.js | 4 +- .../content/cardEdition/wdw_cardEdition.xhtml | 1 + .../content/cardEdition/wdw_imageEdition.js | 31 +- src/chrome/content/cardbookActions.js | 14 +- src/chrome/content/cardbookInit.js | 2 +- src/chrome/content/cardbookRepository.js | 47 +-- .../content/cardbookSynchronization.jsm | 151 ++++++--- .../cardbookSynchronizationGoogle2.jsm | 10 +- .../cardbookSynchronizationOffice365.jsm | 20 +- src/chrome/content/cardbookUtils.jsm | 310 +++++++++--------- src/chrome/content/cardbookWebDAV.js | 9 +- src/chrome/content/cardbookWindowUtils.js | 1 - .../csvTranslator/wdw_csvTranslator.js | 9 +- .../content/enigmail/cardbookEnigmail.js | 5 +- .../filters/wl_cardbookFilterAction.js | 3 - .../findDuplicates/cardbookDuplicate.js | 4 +- .../findDuplicates/wdw_findDuplicates.js | 17 +- .../content/indexedDB/cardbookIDBCard.js | 59 ++-- .../content/indexedDB/cardbookIDBCat.js | 54 +-- .../content/indexedDB/cardbookIDBImage.js | 91 ++--- .../content/indexedDB/cardbookIDBMailPop.js | 60 ++-- .../indexedDB/cardbookIDBPrefDispName.js | 54 ++- .../content/indexedDB/cardbookIDBSearch.js | 28 +- .../content/indexedDB/cardbookIDBUndo.js | 105 +++--- .../content/indexedDB/cardbookIndexedDB.js | 12 +- .../mailContact/ovl_cardbookMailContacts.js | 57 +++- .../content/mergeCards/wdw_mergeCards.js | 15 +- .../content/migrate/cardbookMigrate.jsm | 125 ++----- .../observers/cardBookWindowObserver.js | 4 +- src/chrome/content/ovl_cardbook.js | 1 + src/chrome/content/scripts/unload.js | 9 + .../content/skin/cardbookLittleIcons.css | 35 ++ src/chrome/content/skin/cardbookMain.css | 38 --- src/chrome/content/wdw_bulkOperation.js | 35 +- src/chrome/content/wdw_cardbook.js | 206 +++++++----- src/chrome/content/wl_cardbookMessenger.js | 84 +++-- src/manifest.json | 10 +- version.txt | 2 +- 74 files changed, 1945 insertions(+), 887 deletions(-) create mode 100644 src/chrome/content/api/DomContentScript/implementation.js create mode 100644 src/chrome/content/api/DomContentScript/schema.json delete mode 100644 src/chrome/content/filters/wl_cardbookFilterAction.js create mode 100644 src/chrome/content/skin/cardbookLittleIcons.css diff --git a/README.md b/README.md index 9d6be49..419e99f 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ GitHub (main) - https://github.com/Gregory-K/CardBook.Alt.Icon GitLab (alt.) - https://gitlab.com/Gregory.K/CardBook.Alt.Icon Version: -**80.5.1 (pre-release)** +**81.6.1 (pre-release)** Compatibility: 102.0a1 <= Thunderbird version >= 102.* diff --git a/src/README.md b/src/README.md index a2388e6..f40c015 100644 --- a/src/README.md +++ b/src/README.md @@ -5,7 +5,7 @@ This is a **fork** of [**CardBook**](https://gitlab.com/CardBook/CardBook), a [T **CardBook Alt.Icon** simply provides an **alternative** main **icon** more aligned with Thunderbird's toolbar icon design. Version: -**80.5.1 (pre-release)** +**81.6.1 (pre-release)** Icon Variation (sub-release): %sub_release% Compatibility: diff --git a/src/_locales/ar/messages.json b/src/_locales/ar/messages.json index 2a8800d..2d68831 100644 --- a/src/_locales/ar/messages.json +++ b/src/_locales/ar/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "??Images exported to directory $P1$??", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "تم التراجع ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "??$P1$ image exported into the directory $P2$;$P1$ images exported into the directory $P2$??", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "تم تصدير $P1$ جهة الإتصال إلى الدليل $P2$;تم تصدير $P1$ جهتين إتصال إلى الدليل $P2$;تم تصدير $P1$ جهات إتصال إلى الدليل $P2$;تم تصدير $P1$ جهة إتصال إلى الدليل $P2$;تم تصدير $P1$ جهات إتصال إلى الدليل $P2$;لم يتم تصدير أي جهة إتصال إلى الدليل $P2$", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "ترويسة عمود" }, - "importblankColumn": { + "importBlankColumn": { "message": "عمود فارغ" }, "importNoTypeLabel": { @@ -3404,10 +3423,10 @@ "message": "تعطيل توليد اسم العرض" }, "autoConvertField": { - "message": "??Enable the convertion of this field??" + "message": "??Enable the conversion of this field??" }, "dontAutoConvertField": { - "message": "??Disable the convertion of this field??" + "message": "??Disable the conversion of this field??" }, "customLabel": { "message": "مخصص" @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "لصق القيد" }, + "exportsMenu": { + "message": "??Exports??" + }, + "exportCardImagesLabel": { + "message": "??Export images??" + }, "exportCardToFileLabel": { "message": "تصدير إلى ملف" }, "exportCardToDirLabel": { "message": "تصدير إلى الدليل" }, + "importsMenu": { + "message": "??Imports??" + }, "importCardFromFileLabel": { "message": "استيراد جهات الاتصال من ملف" }, @@ -5991,7 +6019,7 @@ "message": "حوّل إلى" }, "wdw_cardbookConfigurationEditFieldTitle": { - "message": "??Choose a convertion function??" + "message": "??Choose a conversion function??" }, "uppercaseLabel": { "message": "??Uppercase??" diff --git a/src/_locales/cs/messages.json b/src/_locales/cs/messages.json index d965b1b..b8b2f4a 100644 --- a/src/_locales/cs/messages.json +++ b/src/_locales/cs/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "Obrázky exportovány do adresáře $P1$", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "Zpět hotovo ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "$P1$ obrázek exportován do adresáře $P2$;$P1$ obrázky exportovány do adresáře $P2$;$P1$ obrázků exportováno do adresáře $P2$", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ kontakt exportován do adresáře $P2$;$P1$ kontakty exportovány do adresáře $P2$;$P1$ kontaktů exportováno do adresáře $P2$", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Sloupec hlavičky" }, - "importblankColumn": { + "importBlankColumn": { "message": "Prázdný sloupec" }, "importNoTypeLabel": { @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Vložit záznam" }, + "exportsMenu": { + "message": "Exporty" + }, + "exportCardImagesLabel": { + "message": "Exportovat obrázky" + }, "exportCardToFileLabel": { "message": "Exportovat do souboru" }, "exportCardToDirLabel": { "message": "Exportovat do adresáře" }, + "importsMenu": { + "message": "Importy" + }, "importCardFromFileLabel": { "message": "Importovat kontakty ze souboru" }, diff --git a/src/_locales/da/messages.json b/src/_locales/da/messages.json index e309d73..25d8a45 100644 --- a/src/_locales/da/messages.json +++ b/src/_locales/da/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "Billeder eksporteret til katalog $P1$", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "Fortryd udført ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "$P1$ billede eksporteret ind i kataloget $P2$;$P1$ billeder eksporteret ind i kataloget $P2$", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ kontakt eksporteret ind i kataloget $P2$;$P1$ kontakter eksporteret ind i kataloget $P2$", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Overskriftkolonne" }, - "importblankColumn": { + "importBlankColumn": { "message": "Tom kolonne" }, "importNoTypeLabel": { @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Indsæt indgang" }, + "exportsMenu": { + "message": "Eksporteringer" + }, + "exportCardImagesLabel": { + "message": "Eksportér billeder" + }, "exportCardToFileLabel": { "message": "Eksporter til en fil" }, "exportCardToDirLabel": { "message": "Eksporter til et katalog" }, + "importsMenu": { + "message": "Importeringer" + }, "importCardFromFileLabel": { "message": "Importer kontakter fra en fil" }, @@ -5985,7 +6013,7 @@ "message": "Valgte" }, "conversionWarn": { - "message": "Det er muligt at gennemtvinge konverteringen af nogle felter men de bliver skaffet." + "message": "Det er muligt at gennemtvinge konverteringen af nogle felter mens de bliver skaffet." }, "convertToLabel": { "message": "Konverter til" diff --git a/src/_locales/de/messages.json b/src/_locales/de/messages.json index 4b593c8..26d272f 100644 --- a/src/_locales/de/messages.json +++ b/src/_locales/de/messages.json @@ -2031,6 +2031,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "Bilder wurden in das Verzeichnis $P1$ exportiert", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "Rückgängigmachen abgeschlossen ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "$P1$ Bild wurde in das Verzeichnis $P2$ exportiert;$P1$ Bilder wurden in das Verzeichnis $P2$ exportiert", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ Kontakt wurde in das Verzeichnis $P2$ exportiert;$P1$ Kontakte wurden in das Verzeichnis $P2$ exportiert", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Kopfspalte" }, - "importblankColumn": { + "importBlankColumn": { "message": "Leere Spalte" }, "importNoTypeLabel": { @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Eintrag einfügen" }, + "exportsMenu": { + "message": "Exporte" + }, + "exportCardImagesLabel": { + "message": "Exportieren Bilder" + }, "exportCardToFileLabel": { "message": "Exportieren in eine Datei" }, "exportCardToDirLabel": { "message": "Exportieren in ein Verzeichnis" }, + "importsMenu": { + "message": "Importe" + }, "importCardFromFileLabel": { "message": "Importieren aus einer Datei" }, diff --git a/src/_locales/el/messages.json b/src/_locales/el/messages.json index c662555..0deded5 100644 --- a/src/_locales/el/messages.json +++ b/src/_locales/el/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "??Images exported to directory $P1$??", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "Αναίρεση ενέργειας ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "??$P1$ image exported into the directory $P2$;$P1$ images exported into the directory $P2$??", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ επαφή που εξάγεται στον κατάλογο $P2$;$P1$ επαφές που εξάγεται στον κατάλογο $P2$", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Στήλη επικεφαλίδας" }, - "importblankColumn": { + "importBlankColumn": { "message": "Αδειάστε στήλη" }, "importNoTypeLabel": { @@ -3404,10 +3423,10 @@ "message": "Να μη δημιουργείται όνομα προβολής" }, "autoConvertField": { - "message": "??Enable the convertion of this field??" + "message": "??Enable the conversion of this field??" }, "dontAutoConvertField": { - "message": "??Disable the convertion of this field??" + "message": "??Disable the conversion of this field??" }, "customLabel": { "message": "Προσαρμοσμένη" @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Επικόλληση πεδίο" }, + "exportsMenu": { + "message": "??Exports??" + }, + "exportCardImagesLabel": { + "message": "??Export images??" + }, "exportCardToFileLabel": { "message": "Εξαγωγή σε αρχείο" }, "exportCardToDirLabel": { "message": "Εξαγωγή σε έναν κατάλογο" }, + "importsMenu": { + "message": "??Imports??" + }, "importCardFromFileLabel": { "message": "Εισαγωγή επαφών από ένα αρχείο" }, @@ -5991,7 +6019,7 @@ "message": "Μετατροπή σε" }, "wdw_cardbookConfigurationEditFieldTitle": { - "message": "??Choose a convertion function??" + "message": "??Choose a conversion function??" }, "uppercaseLabel": { "message": "??Uppercase??" diff --git a/src/_locales/en-US/messages.json b/src/_locales/en-US/messages.json index 10cea35..8341fb0 100644 --- a/src/_locales/en-US/messages.json +++ b/src/_locales/en-US/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "Images exported to directory $P1$", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "Undo done ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "$P1$ image exported into the directory $P2$;$P1$ images exported into the directory $P2$", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ contact exported into the directory $P2$;$P1$ contacts exported into the directory $P2$", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Header Column" }, - "importblankColumn": { + "importBlankColumn": { "message": "Empty column" }, "importNoTypeLabel": { @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Paste Entry" }, + "exportsMenu": { + "message": "Exports" + }, + "exportCardImagesLabel": { + "message": "Export images" + }, "exportCardToFileLabel": { "message": "Export to a File" }, "exportCardToDirLabel": { "message": "Export to a Directory" }, + "importsMenu": { + "message": "Imports" + }, "importCardFromFileLabel": { "message": "Import Contacts from a File" }, diff --git a/src/_locales/es-ES/messages.json b/src/_locales/es-ES/messages.json index 9cbf845..9ebcb02 100644 --- a/src/_locales/es-ES/messages.json +++ b/src/_locales/es-ES/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "Imágenes exportadas al directorio $P1$", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "Deshecho ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "$P1$ imagen exportada al directorio $P2$;$P1$ imágenes exportadas al directorio $P2$", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ contacto exportado en el directorio $P2$;$P1$ contactos exportados en el directorio $P2$", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Columna de encabezado" }, - "importblankColumn": { + "importBlankColumn": { "message": "Columna vacía" }, "importNoTypeLabel": { @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Pegar entrada" }, + "exportsMenu": { + "message": "Exportaciones" + }, + "exportCardImagesLabel": { + "message": "Exportar imágenes" + }, "exportCardToFileLabel": { "message": "Exportar a un archivo" }, "exportCardToDirLabel": { "message": "Exportar a un directorio" }, + "importsMenu": { + "message": "Importaciones" + }, "importCardFromFileLabel": { "message": "Importar contactos desde un archivo" }, diff --git a/src/_locales/fr/messages.json b/src/_locales/fr/messages.json index a69a9d0..5dc01d7 100644 --- a/src/_locales/fr/messages.json +++ b/src/_locales/fr/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "Images exportése vers le répertoire $P1$", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "Action annulée ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "$P1$ image exportée vers le répertoire $P2$;$P1$ images exportées vers le répertoire $P2$", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ contact exporté vers le répertoire $P2$;$P1$ contacts exportés vers le répertoire $P2$", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Colonne d'en-tête" }, - "importblankColumn": { + "importBlankColumn": { "message": "Colonne vide" }, "importNoTypeLabel": { @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Coller l'élément" }, + "exportsMenu": { + "message": "Exports" + }, + "exportCardImagesLabel": { + "message": "Exporter les images" + }, "exportCardToFileLabel": { "message": "Exporter vers un fichier" }, "exportCardToDirLabel": { "message": "Exporter vers un répertoire" }, + "importsMenu": { + "message": "Imports" + }, "importCardFromFileLabel": { "message": "Importer des contacts depuis un fichier" }, diff --git a/src/_locales/hr/messages.json b/src/_locales/hr/messages.json index 3d701f7..7295183 100644 --- a/src/_locales/hr/messages.json +++ b/src/_locales/hr/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "??Images exported to directory $P1$??", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "??Undo done ($P1$)??", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "??$P1$ image exported into the directory $P2$;$P1$ images exported into the directory $P2$??", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "??$P1$ contact exported into the directory $P2$;$P1$ contacts exported into the directory $P2$??", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Stupac zaglavlja" }, - "importblankColumn": { + "importBlankColumn": { "message": "Isprazni stupac" }, "importNoTypeLabel": { @@ -3404,10 +3423,10 @@ "message": "??Disable the generation of the display name??" }, "autoConvertField": { - "message": "??Enable the convertion of this field??" + "message": "??Enable the conversion of this field??" }, "dontAutoConvertField": { - "message": "??Disable the convertion of this field??" + "message": "??Disable the conversion of this field??" }, "customLabel": { "message": "Običaj" @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Zalijepi unos" }, + "exportsMenu": { + "message": "??Exports??" + }, + "exportCardImagesLabel": { + "message": "??Export images??" + }, "exportCardToFileLabel": { "message": "Izvezi u dosje" }, "exportCardToDirLabel": { "message": "Prebaci u imenik" }, + "importsMenu": { + "message": "??Imports??" + }, "importCardFromFileLabel": { "message": "Unesi kontakte iz dosjea" }, @@ -5991,7 +6019,7 @@ "message": "Pretvori u" }, "wdw_cardbookConfigurationEditFieldTitle": { - "message": "??Choose a convertion function??" + "message": "??Choose a conversion function??" }, "uppercaseLabel": { "message": "??Uppercase??" diff --git a/src/_locales/hu/messages.json b/src/_locales/hu/messages.json index 171b281..9e8be8e 100644 --- a/src/_locales/hu/messages.json +++ b/src/_locales/hu/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "Képek exportálva a(z) $P1$ könyvtárba", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "Visszavonása kész ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "$P1$ kép exportálva a(z) $P2$ könyvtárba;$P1$ kép exportálva a(z) $P2$ könyvtárba", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ névjegy exportálva a(z) $P2$ könyvtárba;$P1$ névjegy exportálva a(z) $P2$ könyvtárba", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Oszlop fejléc" }, - "importblankColumn": { + "importBlankColumn": { "message": "Üres oszlop" }, "importNoTypeLabel": { @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Mező beillesztése" }, + "exportsMenu": { + "message": "Exportálások" + }, + "exportCardImagesLabel": { + "message": "Képek exportálása" + }, "exportCardToFileLabel": { "message": "Fájl mentése" }, "exportCardToDirLabel": { "message": "Mappa mentése" }, + "importsMenu": { + "message": "Importálások" + }, "importCardFromFileLabel": { "message": "Megnyitás és mentés fájlból" }, diff --git a/src/_locales/id/messages.json b/src/_locales/id/messages.json index a5fca34..e1ffc7f 100644 --- a/src/_locales/id/messages.json +++ b/src/_locales/id/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "??Images exported to directory $P1$??", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "??Undo done ($P1$)??", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "??$P1$ image exported into the directory $P2$;$P1$ images exported into the directory $P2$??", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ kontak diekspor ke direktori $P2$", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Kolom judul" }, - "importblankColumn": { + "importBlankColumn": { "message": "Kolom kosong" }, "importNoTypeLabel": { @@ -3404,10 +3423,10 @@ "message": "??Disable the generation of the display name??" }, "autoConvertField": { - "message": "??Enable the convertion of this field??" + "message": "??Enable the conversion of this field??" }, "dontAutoConvertField": { - "message": "??Disable the convertion of this field??" + "message": "??Disable the conversion of this field??" }, "customLabel": { "message": "Khusus" @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Tempel Data" }, + "exportsMenu": { + "message": "??Exports??" + }, + "exportCardImagesLabel": { + "message": "??Export images??" + }, "exportCardToFileLabel": { "message": "Ekspor ke file" }, "exportCardToDirLabel": { "message": "Ekspor ke direktori" }, + "importsMenu": { + "message": "??Imports??" + }, "importCardFromFileLabel": { "message": "mpor kontak dari sebuah file" }, @@ -5991,7 +6019,7 @@ "message": "Konversikan Ke" }, "wdw_cardbookConfigurationEditFieldTitle": { - "message": "??Choose a convertion function??" + "message": "??Choose a conversion function??" }, "uppercaseLabel": { "message": "??Uppercase??" diff --git a/src/_locales/it/messages.json b/src/_locales/it/messages.json index 13ab0f8..fcfa40c 100644 --- a/src/_locales/it/messages.json +++ b/src/_locales/it/messages.json @@ -127,7 +127,7 @@ "message": "Nessun contatto duplicato trovato." }, "noDataAvailable": { - "message": "Dati non disponibili." + "message": "Nessun dato disponibile." }, "targetCategoryLabel": { "message": "risultati" @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "Immagini esportate nella directory $P1$", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "Annulla fatto ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "$P1$ immagine esportata nella directory $P2$;$P1$ immagini esportate nella directory $P2$", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ contatto esportato nella directory $P2$;$P1$ contatti esportati nella directory $P2$", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Intestazione colonna" }, - "importblankColumn": { + "importBlankColumn": { "message": "Colonna vuota" }, "importNoTypeLabel": { @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Incolla voce" }, + "exportsMenu": { + "message": "Esportazioni" + }, + "exportCardImagesLabel": { + "message": "Esporta immagini" + }, "exportCardToFileLabel": { "message": "Esporta su file" }, "exportCardToDirLabel": { "message": "Esporta in cartella" }, + "importsMenu": { + "message": "Importazioni" + }, "importCardFromFileLabel": { "message": "Importa contatti da file" }, diff --git a/src/_locales/ja/messages.json b/src/_locales/ja/messages.json index 2081a1b..b9995e5 100644 --- a/src/_locales/ja/messages.json +++ b/src/_locales/ja/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "??Images exported to directory $P1$??", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "取り消しを完了しました($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "??$P1$ image exported into the directory $P2$;$P1$ images exported into the directory $P2$??", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ 件の連絡先をディレクトリ $P2$ にエクスポートしました", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "ヘッダー列" }, - "importblankColumn": { + "importBlankColumn": { "message": "空の列" }, "importNoTypeLabel": { @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "項目を貼り付け" }, + "exportsMenu": { + "message": "??Exports??" + }, + "exportCardImagesLabel": { + "message": "??Export images??" + }, "exportCardToFileLabel": { "message": "ファイルにエクスポート" }, "exportCardToDirLabel": { "message": "ディレクトリにエクスポート" }, + "importsMenu": { + "message": "??Imports??" + }, "importCardFromFileLabel": { "message": "ファイルから連絡先をインポート" }, @@ -5991,7 +6019,7 @@ "message": "変換" }, "wdw_cardbookConfigurationEditFieldTitle": { - "message": "??Choose a convertion function??" + "message": "??Choose a conversion function??" }, "uppercaseLabel": { "message": "??Uppercase??" diff --git a/src/_locales/ko/messages.json b/src/_locales/ko/messages.json index 153fd52..8799b3c 100644 --- a/src/_locales/ko/messages.json +++ b/src/_locales/ko/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "디렉토리 $P1$ 로 이미지를 내보냈습니다", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "실행 취소 완료 ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "디렉토리 $P2$ 로 $P1$개의 이미지를 내보냈습니다", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$개의 연락처를 디렉토리 $P2$ 로 내보냈습니다", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "헤더 열" }, - "importblankColumn": { + "importBlankColumn": { "message": "빈 열" }, "importNoTypeLabel": { @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "항목 붙여넣기" }, + "exportsMenu": { + "message": "내보내기" + }, + "exportCardImagesLabel": { + "message": "이미지 내보내기" + }, "exportCardToFileLabel": { "message": "파일로 내보내기" }, "exportCardToDirLabel": { "message": "디렉토리로 내보내기" }, + "importsMenu": { + "message": "가져오기" + }, "importCardFromFileLabel": { "message": "파일에서 연락처 가져 오기" }, diff --git a/src/_locales/lt/messages.json b/src/_locales/lt/messages.json index 9da40d2..10e2b50 100644 --- a/src/_locales/lt/messages.json +++ b/src/_locales/lt/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "??Images exported to directory $P1$??", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "??Undo done ($P1$)??", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "??$P1$ image exported into the directory $P2$;$P1$ images exported into the directory $P2$??", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "??$P1$ contact exported into the directory $P2$;$P1$ contacts exported into the directory $P2$??", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Antraštės stulpelis" }, - "importblankColumn": { + "importBlankColumn": { "message": "Tuščias stulpelis" }, "importNoTypeLabel": { @@ -3404,10 +3423,10 @@ "message": "??Disable the generation of the display name??" }, "autoConvertField": { - "message": "??Enable the convertion of this field??" + "message": "??Enable the conversion of this field??" }, "dontAutoConvertField": { - "message": "??Disable the convertion of this field??" + "message": "??Disable the conversion of this field??" }, "customLabel": { "message": "Pritaikyti" @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Įdėti lauką" }, + "exportsMenu": { + "message": "??Exports??" + }, + "exportCardImagesLabel": { + "message": "??Export images??" + }, "exportCardToFileLabel": { "message": "Eksportuoti į failą" }, "exportCardToDirLabel": { "message": "Eksportuoti į katalogą" }, + "importsMenu": { + "message": "??Imports??" + }, "importCardFromFileLabel": { "message": "Importuoti kontaktus iš failo" }, @@ -5991,7 +6019,7 @@ "message": "Konvertuoti į" }, "wdw_cardbookConfigurationEditFieldTitle": { - "message": "??Choose a convertion function??" + "message": "??Choose a conversion function??" }, "uppercaseLabel": { "message": "??Uppercase??" diff --git a/src/_locales/nl/messages.json b/src/_locales/nl/messages.json index 4faf4c1..acf7480 100644 --- a/src/_locales/nl/messages.json +++ b/src/_locales/nl/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "Afbeeldingen geëxporteerd naar de map $P1$", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "Herstel uitgevoerd ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "$P1$ afbeelding geëxporteerd naar de map $P2$;$P1$ afbeeldingen geëxporteerd naar de map $P2$", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ contactpersoon geëxporteerd naar map $P2$;$P1$ contactpersonen geëxporteerd naar map $P2$", "placeholders": { @@ -2516,13 +2535,13 @@ "message": "Geslacht" }, "bdayLabel": { - "message": "Geboortedatum" + "message": "Verjaardag" }, "birthplaceLabel": { "message": "Geboorteplaats" }, "anniversaryLabel": { - "message": "Verjaardag" + "message": "Jubileum" }, "deathdateLabel": { "message": "Overlijdensdatum" @@ -2660,7 +2679,7 @@ "message": "Bevestigen" }, "birthdaysListWindowLabel": { - "message": "Lijst van geboortedata (Totaal : $P1$)", + "message": "Lijst van verjaardagen (totaal: $P1$)", "placeholders": { "P1": { "content": "$1" @@ -2668,7 +2687,7 @@ } }, "syncListWindowLabelRunning": { - "message": "Synchronisatie van geboortedata bezig… ($P1$/$P2$)", + "message": "Synchronisatie van verjaardagen bezig… ($P1$/$P2$)", "placeholders": { "P1": { "content": "$1" @@ -2679,7 +2698,7 @@ } }, "syncListWindowLabelEnded": { - "message": "Synchronisatie van geboortedata beëindigd ($P1$/$P2$)", + "message": "Synchronisatie van verjaardagen beëindigd ($P1$/$P2$)", "placeholders": { "P1": { "content": "$1" @@ -2690,7 +2709,7 @@ } }, "syncListWindowLabelFailed": { - "message": "Synchronisatie van geboortedata mislukt" + "message": "Synchronisatie van verjaardagen mislukt" }, "syncListExistingEntry": { "message": "$P1$ : Gebeurtenis komt al voor in Lightning : $P2$", @@ -2726,7 +2745,7 @@ } }, "noBirthdaysFoundMessage": { - "message": "Geen geboortedata gevonden tot $P1$", + "message": "Geen gebeurtenis gevonden tot $P1$", "placeholders": { "P1": { "content": "$1" @@ -2742,10 +2761,10 @@ } }, "eventEntryTitleMessage": { - "message": "Geboortedatum van %1$S" + "message": "Verjaardag van %1$S" }, "anniversaryCategory": { - "message": "Cliënten" + "message": "Jubileum" }, "calendarNotFoundTitle": { "message": "Verjaardagsherinnering - synchronisatie met Lightning afgebroken" @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Kopregel" }, - "importblankColumn": { + "importBlankColumn": { "message": "Lege kolom" }, "importNoTypeLabel": { @@ -4100,7 +4119,7 @@ "message": "E-mail" }, "birthdaylistTabLabel": { - "message": "Geboortedata" + "message": "Verjaardagen" }, "helpTabLabel": { "message": "Help" @@ -4877,7 +4896,7 @@ "message": "V" }, "birthdayListWarn": { - "message": "Let op: geboortedata worden uitsluitend in CardBook adresboeken gezocht." + "message": "Let op: gebeurtenissen worden uitsluitend in CardBook adresboeken gezocht." }, "generalGroupboxLabel": { "message": "Algemeen" @@ -4892,13 +4911,13 @@ "message": "Zoeken naar:" }, "bday.conf.label": { - "message": "Geboortedatum" + "message": "Verjaardag" }, "bday.conf.accesskey": { - "message": "G" + "message": "B" }, "anniversary.conf.label": { - "message": "Verjaardag (uitsluitend voor vCard 4.0)" + "message": "Jubileum (uitsluitend voor vCard 4.0)" }, "anniversary.conf.accesskey": { "message": "V" @@ -5018,7 +5037,7 @@ "message": "Herinnering(en) tot x uren voor gebeurtenis (Voorbeeld: 4,+1):" }, "calendarEntryAlarmTooltip": { - "message": "Stel het aantal uren in vóór de verjaardag waarop Lightning een herinnering moet geven. Indien leeg, dan wordt er geen herinnering gegeven. Als er meerdere alarmeringen gewenst zijn, dan kunnen ze worden gescheiden door komma's." + "message": "Stel het aantal uren in vóór de gebeurtenis waarop Lightning een herinnering moet geven. Indien leeg, dan wordt er geen herinnering gegeven. Als er meerdere alarmeringen gewenst zijn, dan kunnen ze worden gescheiden door komma's." }, "calendarEntryAlarmAccesskey": { "message": "H" @@ -5186,10 +5205,10 @@ "message": "Tools" }, "cardbookToolsMenuBirthdayListLabel": { - "message": "Bekijk geboortedata-lijst" + "message": "Bekijk verjaardagen lijst" }, "cardbookToolsMenuSyncLightningLabel": { - "message": "Geboortedata toevoegen aan agenda" + "message": "Verjaardagen toevoegen aan agenda" }, "cardbookToolsMenuFindAllDuplicatesLabel": { "message": "Zoek overeenkomende contactpersonen in alle adresboeken" @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Overnemen entry" }, + "exportsMenu": { + "message": "Geëxporteerd" + }, + "exportCardImagesLabel": { + "message": "Exporteren van afbeeldingen" + }, "exportCardToFileLabel": { "message": "Exporteer naar een bestand" }, "exportCardToDirLabel": { "message": "Exporteer naar een map" }, + "importsMenu": { + "message": "Geïmporteerd" + }, "importCardFromFileLabel": { "message": "Importeer contactpersoon van een bestand" }, diff --git a/src/_locales/pl/messages.json b/src/_locales/pl/messages.json index ff98b2a..c084e97 100644 --- a/src/_locales/pl/messages.json +++ b/src/_locales/pl/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "??Images exported to directory $P1$??", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "Cofnij wykonane ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "??$P1$ image exported into the directory $P2$;$P1$ images exported into the directory $P2$??", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "??$P1$ contact exported into the directory $P2$;$P1$ contacts exported into the directory $P2$??", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Kolumna nagłówków" }, - "importblankColumn": { + "importBlankColumn": { "message": "Pusta kolumna" }, "importNoTypeLabel": { @@ -3404,10 +3423,10 @@ "message": "Wyłącz generowanie wyświetlanej nazwy" }, "autoConvertField": { - "message": "??Enable the convertion of this field??" + "message": "??Enable the conversion of this field??" }, "dontAutoConvertField": { - "message": "??Disable the convertion of this field??" + "message": "??Disable the conversion of this field??" }, "customLabel": { "message": "Informacja" @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Wklej pozycję" }, + "exportsMenu": { + "message": "??Exports??" + }, + "exportCardImagesLabel": { + "message": "??Export images??" + }, "exportCardToFileLabel": { "message": "Eksportuj do pliku" }, "exportCardToDirLabel": { "message": "Eksportuj do katalogu" }, + "importsMenu": { + "message": "??Imports??" + }, "importCardFromFileLabel": { "message": "Importuj wizytówkę z pliku" }, @@ -5991,7 +6019,7 @@ "message": "Zamień na" }, "wdw_cardbookConfigurationEditFieldTitle": { - "message": "??Choose a convertion function??" + "message": "??Choose a conversion function??" }, "uppercaseLabel": { "message": "??Uppercase??" diff --git a/src/_locales/pt-BR/messages.json b/src/_locales/pt-BR/messages.json index e3ff1c8..e637dba 100644 --- a/src/_locales/pt-BR/messages.json +++ b/src/_locales/pt-BR/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "Imagens exportadas para o diretório $P1$", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "Desfazer finalizado ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "$P1$ imagem exportada para o diretório $P2$;$P1$ imagens exportadas para o diretório $P2$", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ contato exportado para o diretório $P2$;$P1$ contatos exportados para o diretório $P2$", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Cabeçalho da coluna" }, - "importblankColumn": { + "importBlankColumn": { "message": "Coluna vazia" }, "importNoTypeLabel": { @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Colar entrada" }, + "exportsMenu": { + "message": "Exportações" + }, + "exportCardImagesLabel": { + "message": "Exportar imagens" + }, "exportCardToFileLabel": { "message": "Exportar para arquivo" }, "exportCardToDirLabel": { "message": "Exportar para diretório" }, + "importsMenu": { + "message": "Importações" + }, "importCardFromFileLabel": { "message": "Importar cartões de um arquivo" }, diff --git a/src/_locales/pt-PT/messages.json b/src/_locales/pt-PT/messages.json index c900229..0dd0811 100644 --- a/src/_locales/pt-PT/messages.json +++ b/src/_locales/pt-PT/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "Imagens exportadas para a diretoria $P1$", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "Desfazer feito ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "$P1$ imagem exportada para a diretoria $P2$;$P1$ imagens exportadas para a diretoria $P2$", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ contacto exportado para a diretoria $P2$;$P1$ contactos exportados para a diretoria $P2$", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Cabeçalho da Coluna" }, - "importblankColumn": { + "importBlankColumn": { "message": "Coluna vazia" }, "importNoTypeLabel": { @@ -3404,10 +3423,10 @@ "message": "Desativar a geração do nome mostrado" }, "autoConvertField": { - "message": "Ativar a conversão neste campo" + "message": "Ativar a conversão deste campo" }, "dontAutoConvertField": { - "message": "Desativar a conversão neste campo" + "message": "Desativar a conversão deste campo" }, "customLabel": { "message": "Personalizado" @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Colar Entrada" }, + "exportsMenu": { + "message": "Exporta" + }, + "exportCardImagesLabel": { + "message": "Exportar imagens" + }, "exportCardToFileLabel": { "message": "Exportar para Ficheiro" }, "exportCardToDirLabel": { "message": "Exportar para Diretoria" }, + "importsMenu": { + "message": "Importa" + }, "importCardFromFileLabel": { "message": "Importar Contactos de um Ficheiro" }, diff --git a/src/_locales/ro/messages.json b/src/_locales/ro/messages.json index f6542b6..2e30741 100644 --- a/src/_locales/ro/messages.json +++ b/src/_locales/ro/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "??Images exported to directory $P1$??", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "Anulare terminată ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "??$P1$ image exported into the directory $P2$;$P1$ images exported into the directory $P2$??", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ contact exportat în directorul $P2$;$P1$ contacte exportate în directorul $P2$", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Coloane antet" }, - "importblankColumn": { + "importBlankColumn": { "message": "Coloană goală" }, "importNoTypeLabel": { @@ -3404,10 +3423,10 @@ "message": "Dezactivează generarea numelui afișat" }, "autoConvertField": { - "message": "??Enable the convertion of this field??" + "message": "??Enable the conversion of this field??" }, "dontAutoConvertField": { - "message": "??Disable the convertion of this field??" + "message": "??Disable the conversion of this field??" }, "customLabel": { "message": "Personalizat" @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Lipeşte înregistrarea" }, + "exportsMenu": { + "message": "??Exports??" + }, + "exportCardImagesLabel": { + "message": "??Export images??" + }, "exportCardToFileLabel": { "message": "Exportă agenda într-un fișier" }, "exportCardToDirLabel": { "message": "Exportă agenda într-un director" }, + "importsMenu": { + "message": "??Imports??" + }, "importCardFromFileLabel": { "message": "Importă contacte dintr-un fișier" }, @@ -5991,7 +6019,7 @@ "message": "Convertește în" }, "wdw_cardbookConfigurationEditFieldTitle": { - "message": "??Choose a convertion function??" + "message": "??Choose a conversion function??" }, "uppercaseLabel": { "message": "??Uppercase??" diff --git a/src/_locales/ru/messages.json b/src/_locales/ru/messages.json index eba829b..2a870fa 100644 --- a/src/_locales/ru/messages.json +++ b/src/_locales/ru/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "Изображения экспортированы в папку «$P1$»", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "Отменено ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "$P1$ изображение экспортировано в папку «$P2$»;$P1$ изображения экспортированы в папку «$P2$»;$P1$ изображений экспортированы в папку «$P2$»", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ контакт экспортирован в папку «$P2$»;$P1$ контакта экспортировано в папку «$P2$»;$P1$ контактов экспортировано в папку «$P2$»", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Заголовок столбца" }, - "importblankColumn": { + "importBlankColumn": { "message": "Пустой столбец" }, "importNoTypeLabel": { @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Вставить значение" }, + "exportsMenu": { + "message": "Экспорт" + }, + "exportCardImagesLabel": { + "message": "Экспорт изображений" + }, "exportCardToFileLabel": { "message": "Экспортировать в файл" }, "exportCardToDirLabel": { "message": "Экспортировать в каталог" }, + "importsMenu": { + "message": "Импорт" + }, "importCardFromFileLabel": { "message": "Импортировать контакт из файла" }, diff --git a/src/_locales/sk/messages.json b/src/_locales/sk/messages.json index 7727c83..c678f7e 100644 --- a/src/_locales/sk/messages.json +++ b/src/_locales/sk/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "Obrázky exportované do priečinka $P1$", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "Späť vykonané ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "$P1$ obrázok exportovaný do priečinka $P2$;$P1$ obrázky exportované do priečinka $P2$;$P1$ obrázkov exportovaných do priečinka $P2$", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ kontakt exportovaný do priečinka $P2$;$P1$ kontakty exportované do priečinka $P2$;$P1$ kontaktov exportovaných do priečinka $P2$", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Stĺpec hlavičky" }, - "importblankColumn": { + "importBlankColumn": { "message": "Prázdny stĺpec" }, "importNoTypeLabel": { @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Vložiť záznam" }, + "exportsMenu": { + "message": "Exporty" + }, + "exportCardImagesLabel": { + "message": "Exportovať obrázky" + }, "exportCardToFileLabel": { "message": "Exportovať do súboru" }, "exportCardToDirLabel": { "message": "Exportovať do priečinka" }, + "importsMenu": { + "message": "Importy" + }, "importCardFromFileLabel": { "message": "Importovať kontakty zo súboru" }, diff --git a/src/_locales/sl/messages.json b/src/_locales/sl/messages.json index 54845a5..b4af7d0 100644 --- a/src/_locales/sl/messages.json +++ b/src/_locales/sl/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "??Images exported to directory $P1$??", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "Razveljavitev končana ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "??$P1$ image exported into the directory $P2$;$P1$ images exported into the directory $P2$??", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "??$P1$ contact exported into the directory $P2$;$P1$ contacts exported into the directory $P2$??", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Nazivni stolpec" }, - "importblankColumn": { + "importBlankColumn": { "message": "Prazen stolpec" }, "importNoTypeLabel": { @@ -3404,10 +3423,10 @@ "message": "??Disable the generation of the display name??" }, "autoConvertField": { - "message": "??Enable the convertion of this field??" + "message": "??Enable the conversion of this field??" }, "dontAutoConvertField": { - "message": "??Disable the convertion of this field??" + "message": "??Disable the conversion of this field??" }, "customLabel": { "message": "Po meri" @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "??Paste entry??" }, + "exportsMenu": { + "message": "??Exports??" + }, + "exportCardImagesLabel": { + "message": "??Export images??" + }, "exportCardToFileLabel": { "message": "Izvozi v datoteko" }, "exportCardToDirLabel": { "message": "Izvozi v mapo" }, + "importsMenu": { + "message": "??Imports??" + }, "importCardFromFileLabel": { "message": "Uvozi stike iz datoteke" }, @@ -5991,7 +6019,7 @@ "message": "Pretvori v" }, "wdw_cardbookConfigurationEditFieldTitle": { - "message": "??Choose a convertion function??" + "message": "??Choose a conversion function??" }, "uppercaseLabel": { "message": "??Uppercase??" diff --git a/src/_locales/sv-SE/messages.json b/src/_locales/sv-SE/messages.json index cde9c92..b37837d 100644 --- a/src/_locales/sv-SE/messages.json +++ b/src/_locales/sv-SE/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "??Images exported to directory $P1$??", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "??Undo done ($P1$)??", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "??$P1$ image exported into the directory $P2$;$P1$ images exported into the directory $P2$??", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ kontakt exporterad till katalogen $P2$;$P1$ kontakter som exporteras till katalogen $P2$", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Rubrikkolumn" }, - "importblankColumn": { + "importBlankColumn": { "message": "Tom kolumn" }, "importNoTypeLabel": { @@ -3404,10 +3423,10 @@ "message": "??Disable the generation of the display name??" }, "autoConvertField": { - "message": "??Enable the convertion of this field??" + "message": "??Enable the conversion of this field??" }, "dontAutoConvertField": { - "message": "??Disable the convertion of this field??" + "message": "??Disable the conversion of this field??" }, "customLabel": { "message": "Anpassat" @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Klistra in fältet" }, + "exportsMenu": { + "message": "??Exports??" + }, + "exportCardImagesLabel": { + "message": "??Export images??" + }, "exportCardToFileLabel": { "message": "Exportera kontakter till fil" }, "exportCardToDirLabel": { "message": "Exportera kontakter till katalog" }, + "importsMenu": { + "message": "??Imports??" + }, "importCardFromFileLabel": { "message": "Importera kontakter från fil" }, @@ -5991,7 +6019,7 @@ "message": "Konvertera till" }, "wdw_cardbookConfigurationEditFieldTitle": { - "message": "??Choose a convertion function??" + "message": "??Choose a conversion function??" }, "uppercaseLabel": { "message": "??Uppercase??" diff --git a/src/_locales/tr/messages.json b/src/_locales/tr/messages.json index 7a1ddb6..3f4593d 100644 --- a/src/_locales/tr/messages.json +++ b/src/_locales/tr/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "Resimler şu klasöre aktarıldı $P1$", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "Geri alma tamamlandı ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "$P1$ resim şu klasöre çıkarıldı $P2$;$P1$ resimler şu klasöre çıkarıldı $P2$", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ kişi şu klasöre çıkarıldı $P2$;$P1$ kişi şu klasöre çıkarıldı $P2$", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Başlık Sütunu" }, - "importblankColumn": { + "importBlankColumn": { "message": "Boş Sütun" }, "importNoTypeLabel": { @@ -3404,10 +3423,10 @@ "message": "Görünen ismi üretmeyi kapat" }, "autoConvertField": { - "message": "??Enable the convertion of this field??" + "message": "Bu alanın dönüştürülmesini aç" }, "dontAutoConvertField": { - "message": "??Disable the convertion of this field??" + "message": "Bu alanın dönüştürülmesini kapat" }, "customLabel": { "message": "Özel" @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Girişi Yapıştır" }, + "exportsMenu": { + "message": "Dışa Aktarmalar" + }, + "exportCardImagesLabel": { + "message": "Resimleri dışa aktar" + }, "exportCardToFileLabel": { "message": "Dışa Aktar: Dosyaya" }, "exportCardToDirLabel": { "message": "Dışa Aktar: Klasöre" }, + "importsMenu": { + "message": "İçe Aktarmalar" + }, "importCardFromFileLabel": { "message": "Kişileri Dosyadan İçe Aktar" }, @@ -5985,21 +6013,21 @@ "message": "Seçildi" }, "conversionWarn": { - "message": "??It is possible to force the convertion of some fields while providing them.??" + "message": "Bazı bilgileri temin ederken onları dönüştürmeye zorlamak mümkündür." }, "convertToLabel": { "message": "Dönüştür" }, "wdw_cardbookConfigurationEditFieldTitle": { - "message": "??Choose a convertion function??" + "message": "Dönüştürme fonksiyonunu seç" }, "uppercaseLabel": { - "message": "??Uppercase??" + "message": "Büyük harf" }, "lowercaseLabel": { - "message": "??Lowercase??" + "message": "Küçük harf" }, "capitalizationLabel": { - "message": "??Capitalization??" + "message": "Büyük/Küçük Harf" } } diff --git a/src/_locales/uk/messages.json b/src/_locales/uk/messages.json index 8d97319..2e1fd9f 100644 --- a/src/_locales/uk/messages.json +++ b/src/_locales/uk/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "??Images exported to directory $P1$??", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "??Undo done ($P1$)??", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "??$P1$ image exported into the directory $P2$;$P1$ images exported into the directory $P2$??", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "??$P1$ contact exported into the directory $P2$;$P1$ contacts exported into the directory $P2$??", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Колонка заголовка" }, - "importblankColumn": { + "importBlankColumn": { "message": "Порожній стовпчик" }, "importNoTypeLabel": { @@ -3404,10 +3423,10 @@ "message": "??Disable the generation of the display name??" }, "autoConvertField": { - "message": "??Enable the convertion of this field??" + "message": "??Enable the conversion of this field??" }, "dontAutoConvertField": { - "message": "??Disable the convertion of this field??" + "message": "??Disable the conversion of this field??" }, "customLabel": { "message": "Власна" @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Вставити введення" }, + "exportsMenu": { + "message": "??Exports??" + }, + "exportCardImagesLabel": { + "message": "??Export images??" + }, "exportCardToFileLabel": { "message": "Експорт у файл" }, "exportCardToDirLabel": { "message": "Експортувати в каталог" }, + "importsMenu": { + "message": "??Imports??" + }, "importCardFromFileLabel": { "message": "Імпортувати контакти з файлу" }, @@ -5991,7 +6019,7 @@ "message": "Перетворити на" }, "wdw_cardbookConfigurationEditFieldTitle": { - "message": "??Choose a convertion function??" + "message": "??Choose a conversion function??" }, "uppercaseLabel": { "message": "??Uppercase??" diff --git a/src/_locales/vi/messages.json b/src/_locales/vi/messages.json index 631210c..a5d975c 100644 --- a/src/_locales/vi/messages.json +++ b/src/_locales/vi/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "??Images exported to directory $P1$??", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "??Undo done ($P1$)??", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "??$P1$ image exported into the directory $P2$;$P1$ images exported into the directory $P2$??", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "??$P1$ contact exported into the directory $P2$;$P1$ contacts exported into the directory $P2$??", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "Cột Tiêu đề" }, - "importblankColumn": { + "importBlankColumn": { "message": "Cánh đồng trống" }, "importNoTypeLabel": { @@ -3404,10 +3423,10 @@ "message": "??Disable the generation of the display name??" }, "autoConvertField": { - "message": "??Enable the convertion of this field??" + "message": "??Enable the conversion of this field??" }, "dontAutoConvertField": { - "message": "??Disable the convertion of this field??" + "message": "??Disable the conversion of this field??" }, "customLabel": { "message": "Tùy biến" @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "Dán nhập" }, + "exportsMenu": { + "message": "??Exports??" + }, + "exportCardImagesLabel": { + "message": "??Export images??" + }, "exportCardToFileLabel": { "message": "Xuất sang tệp tin" }, "exportCardToDirLabel": { "message": "Xuất khẩu vào một thư mục" }, + "importsMenu": { + "message": "??Imports??" + }, "importCardFromFileLabel": { "message": "Nhập địa chỉ liên hệ từ tệp" }, @@ -5991,7 +6019,7 @@ "message": "Chuyển đổi thành" }, "wdw_cardbookConfigurationEditFieldTitle": { - "message": "??Choose a convertion function??" + "message": "??Choose a conversion function??" }, "uppercaseLabel": { "message": "??Uppercase??" diff --git a/src/_locales/zh-CN/messages.json b/src/_locales/zh-CN/messages.json index bbfe786..c2afcfa 100644 --- a/src/_locales/zh-CN/messages.json +++ b/src/_locales/zh-CN/messages.json @@ -2047,6 +2047,14 @@ } } }, + "cardsImagesExportedUndo": { + "message": "已导出图片到目录 $P1$", + "placeholders": { + "P1": { + "content": "$1" + } + } + }, "undoActionDoneUndo": { "message": "完成撤销 ($P1$)", "placeholders": { @@ -2271,6 +2279,17 @@ } } }, + "exportImagesToDirMessagePF": { + "message": "$P1$ 图像导出到目录 $P2$;$P1$ 图像导出到目录 $P2$", + "placeholders": { + "P1": { + "content": "$1" + }, + "P2": { + "content": "$2" + } + } + }, "exportCardToDirMessagePF": { "message": "$P1$ 联系人导出到目录 $P2$;$P1$ 联系人导出到目录 $P2$", "placeholders": { @@ -3223,7 +3242,7 @@ "importfoundColumnsGroupboxLabel": { "message": "标题列" }, - "importblankColumn": { + "importBlankColumn": { "message": "空列" }, "importNoTypeLabel": { @@ -5524,12 +5543,21 @@ "pasteEntryLabel": { "message": "粘贴项" }, + "exportsMenu": { + "message": "导出" + }, + "exportCardImagesLabel": { + "message": "导出图像" + }, "exportCardToFileLabel": { "message": "导出到文件" }, "exportCardToDirLabel": { "message": "导出到目录" }, + "importsMenu": { + "message": "导入" + }, "importCardFromFileLabel": { "message": "从文件导入联系人" }, diff --git a/src/background.js b/src/background.js index 2c1aa85..8453633 100644 --- a/src/background.js +++ b/src/background.js @@ -33,10 +33,10 @@ async function main() { messenger.WindowListener.registerWindow("chrome://messenger/content/messengercompose/messengercompose.xhtml", "chrome://cardbook/content/composeMsg/wl_composeMsg.js"); // // support for filter messages - messenger.WindowListener.registerWindow("chrome://messenger/content/FilterEditor.xhtml", "chrome://cardbook/content/filters/wl_cardbookFilterAction.js"); - messenger.WindowListener.registerWindow("chrome://messenger/content/SearchDialog.xhtml", "chrome://cardbook/content/filters/wl_cardbookFilterAction.js"); - messenger.WindowListener.registerWindow("chrome://messenger/content/mailViewSetup.xhtml", "chrome://cardbook/content/filters/wl_cardbookFilterAction.js"); - messenger.WindowListener.registerWindow("chrome://messenger/content/virtualFolderProperties.xhtml", "chrome://cardbook/content/filters/wl_cardbookFilterAction.js"); + messenger.DomContentScript.registerWindow("chrome://messenger/content/FilterEditor.xhtml", "chrome://cardbook/content/filters/cardbookFilterAction.js"); + messenger.DomContentScript.registerWindow("chrome://messenger/content/SearchDialog.xhtml", "chrome://cardbook/content/filters/cardbookFilterAction.js"); + messenger.DomContentScript.registerWindow("chrome://messenger/content/mailViewSetup.xhtml", "chrome://cardbook/content/filters/cardbookFilterAction.js"); + messenger.DomContentScript.registerWindow("chrome://messenger/content/virtualFolderProperties.xhtml", "chrome://cardbook/content/filters/cardbookFilterAction.js"); messenger.WindowListener.startListening(); diff --git a/src/chrome/content/addressbooksconfiguration/wdw_addressbooksAdd.js b/src/chrome/content/addressbooksconfiguration/wdw_addressbooksAdd.js index eeb6134..c228361 100644 --- a/src/chrome/content/addressbooksconfiguration/wdw_addressbooksAdd.js +++ b/src/chrome/content/addressbooksconfiguration/wdw_addressbooksAdd.js @@ -78,9 +78,9 @@ if ("undefined" == typeof(wdw_addressbooksAdd)) { loadStandardAddressBooks: function () { for (let addrbook of MailServices.ab.directories) { if (addrbook.dirPrefId == "ldap_2.servers.history") { - wdw_addressbooksAdd.gAccountsFound.push(["STANDARD", "", "", addrbook.dirName, cardbookRepository.supportedVersion, "", addrbook.dirPrefId, true]); + wdw_addressbooksAdd.gAccountsFound.push(["STANDARD", "", "", addrbook.dirName, cardbookRepository.supportedVersion, "", addrbook.dirPrefId, true, false]); } else { - wdw_addressbooksAdd.gAccountsFound.push(["STANDARD", "", "", addrbook.dirName, cardbookRepository.supportedVersion, "", addrbook.dirPrefId, false]); + wdw_addressbooksAdd.gAccountsFound.push(["STANDARD", "", "", addrbook.dirName, cardbookRepository.supportedVersion, "", addrbook.dirPrefId, false, false]); } } }, @@ -302,6 +302,7 @@ if ("undefined" == typeof(wdw_addressbooksAdd)) { cardbookRepository.supportedVersion, "", "", + false, false]); break; case "createDirectory": @@ -312,6 +313,7 @@ if ("undefined" == typeof(wdw_addressbooksAdd)) { cardbookRepository.supportedVersion, "CREATEDIRECTORY", "", + false, false]); break; case "createFile": @@ -322,6 +324,7 @@ if ("undefined" == typeof(wdw_addressbooksAdd)) { cardbookRepository.supportedVersion, "CREATEFILE", "", + false, false]); break; case "openDirectory": @@ -332,6 +335,7 @@ if ("undefined" == typeof(wdw_addressbooksAdd)) { cardbookRepository.supportedVersion, "OPENDIRECTORY", "", + false, false]); break; case "openFile": @@ -342,6 +346,7 @@ if ("undefined" == typeof(wdw_addressbooksAdd)) { cardbookRepository.supportedVersion, "OPENFILE", "", + false, false]); break; } @@ -774,6 +779,7 @@ if ("undefined" == typeof(wdw_addressbooksAdd)) { cardbookRepository.cardbookOAuthData[aType].VCARD_VERSIONS, "", "", + false, false]); wdw_addressbooksAdd.setResultsFlags(2, aValidationButton, aNotification); wdw_addressbooksAdd.gValidateURL = true; @@ -814,7 +820,7 @@ if ("undefined" == typeof(wdw_addressbooksAdd)) { wdw_addressbooksAdd.checkRequired(); }, - createBoxesForNames: function (aType, aURL, aName, aVersionList, aUsername, aActionType, aSourceDirPrefId, aSourceCollected) { + createBoxesForNames: function (aType, aURL, aName, aVersionList, aUsername, aActionType, aSourceDirPrefId, aSourceCollected, aReadOnly) { let table = document.getElementById('namesTable'); let aId = table.rows.length - 1; let aRow = cardbookElementTools.addHTMLTR(table, 'namesRow' + aId); @@ -829,6 +835,7 @@ if ("undefined" == typeof(wdw_addressbooksAdd)) { checkbox.setAttribute('actionType', aActionType); checkbox.setAttribute('sourceDirPrefId', aSourceDirPrefId); checkbox.setAttribute('sourceCollected', aSourceCollected.toString()); + checkbox.setAttribute('readOnly', aReadOnly.toString()); checkbox.setAttribute("aria-labelledby", "namesPageSelectedLabel"); checkbox.addEventListener("command", function() { let textbox = document.getElementById('namesTextbox' + this.id.replace("namesCheckbox","")); @@ -903,7 +910,8 @@ if ("undefined" == typeof(wdw_addressbooksAdd)) { } for (let myAccountFound of wdw_addressbooksAdd.gAccountsFound) { wdw_addressbooksAdd.createBoxesForNames(myAccountFound[0], myAccountFound[1], myAccountFound[3], - myAccountFound[4], myAccountFound[2], myAccountFound[5], myAccountFound[6], myAccountFound[7]); + myAccountFound[4], myAccountFound[2], myAccountFound[5], myAccountFound[6], + myAccountFound[7], myAccountFound[8]); } wdw_addressbooksAdd.checkNamesLinesRequired(); }, @@ -1160,6 +1168,7 @@ if ("undefined" == typeof(wdw_addressbooksAdd)) { var aAddressbookActionType = aCheckbox.getAttribute('actionType'); var aAddressbookSourceDirPrefId = aCheckbox.getAttribute('sourceDirPrefId'); var aAddressbookSourceCollected = (aCheckbox.getAttribute('sourceCollected') == 'true'); + var aAddressbookReadOnly = (aCheckbox.getAttribute('readOnly') == 'true'); if (cardbookRepository.cardbookUtils.isMyAccountRemote(myType)) { // the discover should be redone at every sync @@ -1167,19 +1176,18 @@ if ("undefined" == typeof(wdw_addressbooksAdd)) { let connection = cardbookRepository.supportedConnections.filter(connection => connection.id == myType); aAddressbookURL = connection[0].url; } - let aReadonly = false; if (myType == 'GOOGLE3' || aAddressbookUsername == "") { - aReadonly = true; + aAddressbookReadOnly = true; } wdw_addressbooksAdd.gFinishParams.push({type: aAddressbookValidationType, url: aAddressbookURL, name: aAddressbookName, username: aAddressbookUsername, color: aAddressbookColor, - vcard: aAddressbookVCard, readonly: aReadonly, dirPrefId: aAddressbookId, sourceDirPrefId: aAddressbookSourceDirPrefId, + vcard: aAddressbookVCard, readonly: aAddressbookReadOnly, dirPrefId: aAddressbookId, sourceDirPrefId: aAddressbookSourceDirPrefId, DBcached: aAddressbookDBCached, firstAction: false}); } else if (myType == "LOCALDB") { - wdw_addressbooksAdd.gFinishParams.push({type: aAddressbookValidationType, name: aAddressbookName, username: "", color: aAddressbookColor, vcard: aAddressbookVCard, readonly: false, dirPrefId: aAddressbookId, + wdw_addressbooksAdd.gFinishParams.push({type: aAddressbookValidationType, name: aAddressbookName, username: "", color: aAddressbookColor, vcard: aAddressbookVCard, readonly: aAddressbookReadOnly, dirPrefId: aAddressbookId, DBcached: true, firstAction: false}); } else if (myType == "FILE" || myType == "DIRECTORY") { wdw_addressbooksAdd.gFinishParams.push({type: aAddressbookValidationType, actionType: aAddressbookActionType, file: wdw_addressbooksAdd.gFile, name: aAddressbookName, username: "", - color: aAddressbookColor, vcard: aAddressbookVCard, readonly: false, dirPrefId: aAddressbookId, DBcached: false, firstAction: false}); + color: aAddressbookColor, vcard: aAddressbookVCard, readonly: aAddressbookReadOnly, dirPrefId: aAddressbookId, DBcached: false, firstAction: false}); } else if (myType == "STANDARD") { if (window.arguments[0].action == "first") { var aFirstAction = true; @@ -1187,7 +1195,7 @@ if ("undefined" == typeof(wdw_addressbooksAdd)) { var aFirstAction = false; } wdw_addressbooksAdd.gFinishParams.push({type: "STANDARD", sourceDirPrefId: aAddressbookSourceDirPrefId, - name: aAddressbookName, username: "", color: aAddressbookColor, vcard: aAddressbookVCard, readonly: false, + name: aAddressbookName, username: "", color: aAddressbookColor, vcard: aAddressbookVCard, readonly: aAddressbookReadOnly, dirPrefId: aAddressbookId, collected: aAddressbookSourceCollected, DBcached: true, firstAction: aFirstAction}); } diff --git a/src/chrome/content/addressbooksconfiguration/wdw_addressbooksAdd.xhtml b/src/chrome/content/addressbooksconfiguration/wdw_addressbooksAdd.xhtml index cb97a59..6da6654 100644 --- a/src/chrome/content/addressbooksconfiguration/wdw_addressbooksAdd.xhtml +++ b/src/chrome/content/addressbooksconfiguration/wdw_addressbooksAdd.xhtml @@ -1,6 +1,7 @@ + diff --git a/src/chrome/content/api/DomContentScript/implementation.js b/src/chrome/content/api/DomContentScript/implementation.js new file mode 100644 index 0000000..032089b --- /dev/null +++ b/src/chrome/content/api/DomContentScript/implementation.js @@ -0,0 +1,76 @@ + +var { ExtensionCommon } = ChromeUtils.import( + "resource://gre/modules/ExtensionCommon.jsm" +); +var { ExtensionUtils } = ChromeUtils.import( + "resource://gre/modules/ExtensionUtils.jsm" +); +var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); + +var { ExtensionError } = ExtensionUtils; + +var registeredWindows = new Map(); + +var DomContentScript = class extends ExtensionCommon.ExtensionAPI { + constructor(extension) { + super(extension); + + this._windowListener = { + // nsIWindowMediatorListener functions + onOpenWindow(appWindow) { + // A new window has opened. + let domWindow = appWindow.docShell.domWindow; + + /** + * Set up listeners to run the callbacks on the given window. + * + * @param aWindow {nsIDOMWindow} The window to set up. + * @param aID {String} Optional. ID of the new caller that has registered right now. + */ + domWindow.addEventListener( + "DOMContentLoaded", + function() { + // do stuff + let windowChromeURL = domWindow.document.location.href; + if (registeredWindows.has(windowChromeURL)) { + let jsPath = registeredWindows.get(windowChromeURL); + Services.scriptloader.loadSubScript(jsPath, domWindow, "UTF-8"); + } + }, + { once: true } + ); + }, + + onCloseWindow(appWindow) { + // One of the windows has closed. + let domWindow = appWindow.docShell.domWindow; // we don't need to do anything (script only loads once) + }, + }; + + Services.wm.addListener(this._windowListener); + + } + + + + + + onShutdown(isAppShutdown) { + if (isAppShutdown) { + return; // the application gets unloaded anyway + } + Services.wm.removeListener(this._windowListener); + } + + getAPI(context) { + /** API IMPLEMENTATION **/ + return { + DomContentScript: { + // only returns something, if a user pref value is set + registerWindow: async function (windowUrl,jsPath) { + registeredWindows.set(windowUrl,jsPath); + } + }, + }; + } +}; diff --git a/src/chrome/content/api/DomContentScript/schema.json b/src/chrome/content/api/DomContentScript/schema.json new file mode 100644 index 0000000..8dcbb2b --- /dev/null +++ b/src/chrome/content/api/DomContentScript/schema.json @@ -0,0 +1,25 @@ +[ + { + "namespace": "DomContentScript", + "functions": [ + { + "name": "registerWindow", + "type": "function", + "async": true, + "description": "Register a script for onDOMContentLoaded", + "parameters": [ + { + "name": "windowUrl", + "type": "string", + "description": "chrome URL of the window " + }, + { + "name": "jsPath", + "type": "string", + "description": "chrome URL of the script" + } + ] + } + ] + } +] diff --git a/src/chrome/content/birthdays/cardbookBirthdaysUtils.js b/src/chrome/content/birthdays/cardbookBirthdaysUtils.js index 2620b1c..d9a4da1 100644 --- a/src/chrome/content/birthdays/cardbookBirthdaysUtils.js +++ b/src/chrome/content/birthdays/cardbookBirthdaysUtils.js @@ -91,7 +91,7 @@ if ("undefined" == typeof(cardbookBirthdaysUtils)) { var lBirthdayName = cardbookBirthdaysUtils.lBirthdayList[i][7]; var lBirthdayDate = new Date(); - lBirthdayDate.setDate(date_of_today.getUTCDate()+parseInt(ldaysUntilNextBirthday)); + lBirthdayDate.setDate(date_of_today.getDate()+parseInt(ldaysUntilNextBirthday)); // generate Date as Ical compatible text string var lYear = lBirthdayDate.getUTCFullYear(); @@ -264,7 +264,7 @@ if ("undefined" == typeof(cardbookBirthdaysUtils)) { var lDateOfBirth = cardbookRepository.cardbookDates.convertDateStringToDateUTC(aDateOfBirth, aDateFormat); var leventEntryTitle = cardbookRepository.cardbookPreferences.getStringPref("extensions.cardbook.eventEntryTitle"); - endDate.setUTCDate(date_of_today.getUTCDate()+parseInt(aNumberOfDays)); + endDate.setUTCDate(date_of_today.getDate()+parseInt(aNumberOfDays)); while (dateRef < endDate) { lnextBirthday = this.calcDateOfNextBirthday(dateRef,lDateOfBirth); ldaysUntilNextBirthday = this.daysBetween(lnextBirthday, date_of_today); diff --git a/src/chrome/content/cardEdition/wdw_cardEdition.js b/src/chrome/content/cardEdition/wdw_cardEdition.js index 1633600..b70861a 100644 --- a/src/chrome/content/cardEdition/wdw_cardEdition.js +++ b/src/chrome/content/cardEdition/wdw_cardEdition.js @@ -1679,9 +1679,9 @@ if ("undefined" == typeof(wdw_cardEdition)) { // no change, no save if (window.arguments[0].editionMode != "ViewResult" && window.arguments[0].editionMode != "ViewResultHideCreate") { cardbookRepository.cardbookUtils.sortArrayByString(window.arguments[0].cardIn.categories,1) - var cardin = await cardbookRepository.cardbookUtils.cardToVcardData(window.arguments[0].cardIn, true); + var cardin = await cardbookRepository.cardbookUtils.cardToVcardData(window.arguments[0].cardIn); cardbookRepository.cardbookUtils.sortArrayByString(myOutCard.categories,1) - var cardout = await cardbookRepository.cardbookUtils.cardToVcardData(myOutCard, true); + var cardout = await cardbookRepository.cardbookUtils.cardToVcardData(myOutCard, false); if (cardin == cardout && window.arguments[0].cardIn.dirPrefId == myOutCard.dirPrefId) { if (aClose) { wdw_cardEdition.cancel(); diff --git a/src/chrome/content/cardEdition/wdw_cardEdition.xhtml b/src/chrome/content/cardEdition/wdw_cardEdition.xhtml index d826df7..9e4f07a 100644 --- a/src/chrome/content/cardEdition/wdw_cardEdition.xhtml +++ b/src/chrome/content/cardEdition/wdw_cardEdition.xhtml @@ -1,6 +1,7 @@ + diff --git a/src/chrome/content/cardEdition/wdw_imageEdition.js b/src/chrome/content/cardEdition/wdw_imageEdition.js index 8118795..bcff5d7 100644 --- a/src/chrome/content/cardEdition/wdw_imageEdition.js +++ b/src/chrome/content/cardEdition/wdw_imageEdition.js @@ -166,20 +166,25 @@ if ("undefined" == typeof(wdw_imageEdition)) { }, addImageCard: async function (aFileOrURL) { - if (aFileOrURL) { - let URI; - if (aFileOrURL instanceof Components.interfaces.nsIFile) { - URI = "file://" + aFileOrURL.path; - } else { - URI = aFileOrURL; - } - var myExtension = cardbookRepository.cardbookUtils.getFileNameExtension(URI); - if (!myExtension) { - return; + try { + if (aFileOrURL) { + let URI; + if (aFileOrURL instanceof Components.interfaces.nsIFile) { + URI = "file://" + aFileOrURL.path; + } else { + URI = aFileOrURL; + } + let dirname = cardbookRepository.cardbookPreferences.getName(wdw_cardEdition.workingCard.dirPrefId); + let [ base64, extension ] = await cardbookRepository.cardbookUtils.getImageFromURI(wdw_cardEdition.workingCard.dirPrefId, wdw_cardEdition.workingCard.fn, dirname, URI); + var extension1 = extension || cardbookRepository.cardbookUtils.getFileNameExtension(URI); + if (!extension1) { + return; + } + wdw_imageEdition.resizeImageCard({extension: extension1, content: base64}, true); } - let dirname = cardbookRepository.cardbookPreferences.getName(wdw_cardEdition.workingCard.dirPrefId); - let base64 = await cardbookRepository.cardbookUtils.getImageFromURI(wdw_cardEdition.workingCard.fn, dirname, URI); - wdw_imageEdition.resizeImageCard({extension: myExtension, content: base64}, true); + } + catch (e) { + cardbookRepository.cardbookLog.updateStatusProgressInformation("wdw_imageEdition.addImageCard error : " + e, "Error"); } }, diff --git a/src/chrome/content/cardbookActions.js b/src/chrome/content/cardbookActions.js index 33c3cec..3a55a64 100644 --- a/src/chrome/content/cardbookActions.js +++ b/src/chrome/content/cardbookActions.js @@ -179,6 +179,7 @@ if ("undefined" == typeof(cardbookActions)) { break; case "cardsExportedToFile": case "cardsExportedToDir": + case "cardsImagesExported": case "cardsPasted": case "cardsDragged": case "linePasted": @@ -219,6 +220,7 @@ if ("undefined" == typeof(cardbookActions)) { case "cardsImportedFromDir": case "cardsExportedToFile": case "cardsExportedToDir": + case "cardsImagesExported": case "undoActionDone": case "redoActionDone": case "cardCreated": @@ -278,6 +280,9 @@ if ("undefined" == typeof(cardbookActions)) { case "cardsExportedToFile": cardbookRepository.cardbookSynchronization.finishExportToFile(aFinishParams.window, aFinishParams.length, aFinishParams.name); break; + case "cardsImagesExported": + cardbookRepository.cardbookSynchronization.finishExportImages(aFinishParams.window, cardbookRepository.currentAction[aActionId].totalCards, aFinishParams.name); + break; } } }, @@ -304,12 +309,12 @@ if ("undefined" == typeof(cardbookActions)) { if (myAction.files.length > 0) { cardbookActions.addActivityFromUndo(aActionId); if (myAction.actionCode != "undoActionDone" && myAction.actionCode != "redoActionDone" && myAction.actionCode != "syncMyPhoneExplorer" - && myAction.actionCode != "cardsExportedToFile" && myAction.actionCode != "cardsExportedToDir" + && myAction.actionCode != "cardsExportedToFile" && myAction.actionCode != "cardsExportedToDir" && myAction.actionCode != "cardsImagesExported" && myAction.doneCards != 0) { await cardbookActions.addUndoCardsAction(myAction.actionCode, myAction.message, myAction.oldCards, myAction.newCards, myAction.oldCats, myAction.newCats); } if (myAction.refresh != "") { - cardbookRepository.cardbookUtils.notifyObservers(myAction.actionCode, "force::" + myAction.refresh); + cardbookRepository.cardbookUtils.notifyObservers(myAction.actionCode, "forceAccount::" + myAction.refresh); } else { cardbookRepository.cardbookUtils.notifyObservers(myAction.actionCode); } @@ -318,10 +323,11 @@ if ("undefined" == typeof(cardbookActions)) { cardbookRepository.cardbookSynchronization.syncAccounts(myAction.files); } } else if (aForceRefresh == true) { - cardbookRepository.cardbookUtils.notifyObservers(myAction.actionCode, "force::" + myAction.refresh); + cardbookRepository.cardbookUtils.notifyObservers(myAction.actionCode, "forceAccount::" + myAction.refresh); } + cardbookRepository.currentAction[aActionId] = null; + cardbookActions.setUndoAndRedoMenuAndButton(); } } - }; }; diff --git a/src/chrome/content/cardbookInit.js b/src/chrome/content/cardbookInit.js index e80bb86..9ef1306 100644 --- a/src/chrome/content/cardbookInit.js +++ b/src/chrome/content/cardbookInit.js @@ -104,7 +104,7 @@ var cardbookInit = { prefs.setCharPref("accountShown", ""); prefs.setCharPref("uncategorizedCards", ""); prefs.setCharPref("categoryColors", ""); - prefs.setCharPref("addonVersion", "80.5.1"); + prefs.setCharPref("addonVersion", "81.6.1"); prefs.setCharPref("defaultRegion", "NOTSET"); prefs.setBoolPref("localDataEncryption", false); diff --git a/src/chrome/content/cardbookRepository.js b/src/chrome/content/cardbookRepository.js index 8586dc6..99f9541 100644 --- a/src/chrome/content/cardbookRepository.js +++ b/src/chrome/content/cardbookRepository.js @@ -875,7 +875,7 @@ var cardbookRepository = { for (var dirPrefId in cardbookRepository.cardbookComplexSearch) { if (cardbookRepository.cardbookDisplayCards[dirPrefId].cards.length != 0) { for (let card of cardbookRepository.cardbookDisplayCards[aDirPrefId].cards) { - cardbookRepository.removeCardFromDisplayAndCat(card, dirPrefId, false); + cardbookRepository.removeCardFromDisplayAndCat(card, dirPrefId); } } } @@ -1008,11 +1008,11 @@ var cardbookRepository = { cardbookRepository.removeCardFromLongSearch(aCard); cardbookRepository.removeCardFromShortSearch(aCard); cardbookRepository.removeCardFromEmails(aCard); - cardbookRepository.removeCardFromDisplayAndCat(aCard, aCard.dirPrefId, aCacheDeletion); + cardbookRepository.removeCardFromDisplayAndCat(aCard, aCard.dirPrefId); cardbookRepository.removeCardFromOrg(aCard, aCard.dirPrefId); for (var dirPrefId in cardbookRepository.cardbookComplexSearch) { if (cardbookRepository.cardbookPreferences.getEnabled(dirPrefId)) { - cardbookRepository.removeCardFromDisplayAndCat(aCard, dirPrefId, false); + cardbookRepository.removeCardFromDisplayAndCat(aCard, dirPrefId); } } if (aCacheDeletion) { @@ -1133,23 +1133,19 @@ var cardbookRepository = { var myDirPrefIdUrl = cardbookRepository.cardbookPreferences.getUrl(aCard.dirPrefId); var myDirPrefIdDBCached = cardbookRepository.cardbookPreferences.getDBCached(aCard.dirPrefId); - var mediaAdded = false; for (let media of cardbookRepository.allColumns.media) { - var addMedia = aAddCardToCache || (aCard[media].value && aCard[media].value != "") || (aCard[media].localURI && aCard[media].localURI != ""); - if (addMedia) { + if (aAddCardToCache) { await cardbookRepository.cardbookUtils.cachePutMediaCard(aCard, media); - mediaAdded = true; } } cardbookRepository.cardbookUtils.setCacheURIFromCard(aCard, myDirPrefIdType); - let addCard = aAddCardToCache || mediaAdded; if (myDirPrefIdType == "DIRECTORY") { if (aAddCardToCache) { var myFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile); myFile.initWithPath(myDirPrefIdUrl); myFile.append(aCard.cacheuri); - await cardbookRepository.cardbookSynchronization.writeCardsToFile(myFile.path, [aCard], true); + await cardbookRepository.cardbookSynchronization.writeCardsToFile(myFile.path, [aCard]); cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(myDirPrefIdName + " : debug mode : Contact " + aCard.fn + " written to directory"); } } else if (myDirPrefIdType != "FILE") { @@ -1159,8 +1155,8 @@ var cardbookRepository = { cardbookRepository.cardbookFileCacheCards[aCard.dirPrefId] = {}; cardbookRepository.cardbookFileCacheCards[aCard.dirPrefId][aCard.cacheuri] = aCard; } - if (myDirPrefIdDBCached && addCard) { - cardbookIDBCard.addCard(myDirPrefIdName, aCard); + if (myDirPrefIdDBCached && aAddCardToCache) { + cardbookIDBCard.addCard(myDirPrefIdName, aCard); } } } catch(e) { @@ -1202,10 +1198,8 @@ var cardbookRepository = { myFile.remove(true); cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(myDirPrefIdName + " : debug mode : Contact " + aCard.fn + " deleted from directory"); } - } else { - if (myDirPrefIdDBCached) { - cardbookIDBCard.removeCard(myDirPrefIdName, aCard); - } + } else if (myDirPrefIdDBCached) { + cardbookIDBCard.removeCard(myDirPrefIdName, aCard); if (cardbookRepository.cardbookFileCacheCards[aCard.dirPrefId][aCard.cacheuri]) { delete cardbookRepository.cardbookFileCacheCards[aCard.dirPrefId][aCard.cacheuri]; } @@ -1287,7 +1281,7 @@ var cardbookRepository = { } }, - removeCardFromDisplayAndCat: function(aCard, aDirPrefId, aCacheDeletion) { + removeCardFromDisplayAndCat: function(aCard, aDirPrefId) { if (cardbookRepository.cardbookDisplayCards[aDirPrefId]) { let ABType = cardbookRepository.cardbookPreferences.getType(aDirPrefId); cardbookRepository.cardbookDisplayCards[aDirPrefId].cards = cardbookRepository.cardbookDisplayCards[aDirPrefId].cards.filter(child => child.dirPrefId + child.uid != aCard.dirPrefId + aCard.uid); @@ -2035,12 +2029,7 @@ var cardbookRepository = { if (aActionId && cardbookRepository.currentAction[aActionId]) { await cardbookRepository.addCardToAction(aActionId, "oldCards", myCard); } - if (myDirPrefIdType === "FILE") { - await cardbookRepository.removeCardFromRepository(myCard, false); - cardbookRepository.cardbookUtils.nullifyTagModification(aNewCard); - cardbookRepository.cardbookUtils.nullifyEtag(aNewCard); - await cardbookRepository.addCardToRepository(aNewCard, true); - } else if (myDirPrefIdType === "DIRECTORY" || myDirPrefIdType === "LOCALDB") { + if (myDirPrefIdType === "FILE" || myDirPrefIdType === "DIRECTORY" || myDirPrefIdType === "LOCALDB") { await cardbookRepository.removeCardFromRepository(myCard, true); cardbookRepository.cardbookUtils.nullifyTagModification(aNewCard); cardbookRepository.cardbookUtils.nullifyEtag(aNewCard); @@ -2062,9 +2051,7 @@ var cardbookRepository = { } var myDirPrefIdName = cardbookRepository.cardbookPreferences.getName(myCard.dirPrefId); var myDirPrefIdType = cardbookRepository.cardbookPreferences.getType(myCard.dirPrefId); - if (myDirPrefIdType === "FILE") { - await cardbookRepository.removeCardFromRepository(myCard, false); - } else if (myDirPrefIdType === "DIRECTORY" || myDirPrefIdType === "LOCALDB") { + if (myDirPrefIdType === "FILE" || myDirPrefIdType === "DIRECTORY" || myDirPrefIdType === "LOCALDB") { await cardbookRepository.removeCardFromRepository(myCard, true); } else { if (myCard.created) { @@ -2127,9 +2114,7 @@ var cardbookRepository = { } var myDirPrefIdName = cardbookRepository.cardbookPreferences.getName(myDirPrefId); var myDirPrefIdType = cardbookRepository.cardbookPreferences.getType(myDirPrefId); - if (myDirPrefIdType === "FILE") { - await cardbookRepository.removeCardFromRepository(card, false); - } else if (myDirPrefIdType === "DIRECTORY" || myDirPrefIdType === "LOCALDB") { + if (myDirPrefIdType === "FILE" || myDirPrefIdType === "DIRECTORY" || myDirPrefIdType === "LOCALDB") { await cardbookRepository.removeCardFromRepository(card, true); } else { if (card.created) { @@ -2168,9 +2153,7 @@ var cardbookRepository = { } var myDirPrefIdName = cardbookRepository.cardbookPreferences.getName(myDirPrefId); var myDirPrefIdType = cardbookRepository.cardbookPreferences.getType(myDirPrefId); - if (myDirPrefIdType === "FILE") { - await cardbookRepository.removeCardFromRepository(card, false); - } else if (myDirPrefIdType === "DIRECTORY" || myDirPrefIdType === "LOCALDB") { + if (myDirPrefIdType === "FILE" || myDirPrefIdType === "DIRECTORY" || myDirPrefIdType === "LOCALDB") { await cardbookRepository.removeCardFromRepository(card, true); } else { if (card.created) { @@ -2216,7 +2199,7 @@ var cardbookRepository = { if (cardbookRepository.cardbookPreferences.getType(listOfFilesToRewrite[i]) === "FILE" && !cardbookRepository.cardbookPreferences.getReadOnly(listOfFilesToRewrite[i])) { let myArray = JSON.parse(JSON.stringify(cardbookRepository.cardbookDisplayCards[listOfFilesToRewrite[i]].cards)); cardbookRepository.cardbookUtils.sortCardsTreeArrayByString(myArray, "uid", 1); - await cardbookRepository.cardbookSynchronization.writeCardsToFile(cardbookRepository.cardbookPreferences.getUrl(listOfFilesToRewrite[i]), myArray, true); + await cardbookRepository.cardbookSynchronization.writeCardsToFile(cardbookRepository.cardbookPreferences.getUrl(listOfFilesToRewrite[i]), myArray); } } }, diff --git a/src/chrome/content/cardbookSynchronization.jsm b/src/chrome/content/cardbookSynchronization.jsm index c577af2..40b6fb7 100644 --- a/src/chrome/content/cardbookSynchronization.jsm +++ b/src/chrome/content/cardbookSynchronization.jsm @@ -512,6 +512,13 @@ var cardbookSynchronization = { Services.prompt.alert(aWindow, alertTitle, alertMessage); }, + finishExportImages: function (aWindow, aImageLength, aDirName) { + let alertTitle = cardbookRepository.extension.localeData.localizeMessage("exportCardImagesLabel"); + let message = cardbookRepository.extension.localeData.localizeMessage("exportImagesToDirMessagePF", [aImageLength, aDirName]); + let alertMessage = PluralForm.get(aImageLength, message); + Services.prompt.alert(aWindow, alertTitle, alertMessage); + }, + finishImportFromFile: function (aWindow, aListOfSelectedCardLength, aFileName) { let alertTitle = cardbookRepository.extension.localeData.localizeMessage("importCardFromFileLabel"); let message = cardbookRepository.extension.localeData.localizeMessage("importCardFromFileMessagePF", [aListOfSelectedCardLength, aFileName]); @@ -637,7 +644,34 @@ var cardbookSynchronization = { return ""; } }, - + + + getDisplayname: function (aProp) { + let displayName = ""; + if (aProp["displayname"]) { + displayName = aProp["displayname"][0]; + } + return displayName; + }, + + getReadOnly: function (aProp) { + let readOnly = true; + if (aProp["current-user-privilege-set"]) { + let privs = aProp["current-user-privilege-set"][0] + if (privs["privilege"]) { + let writePrivs = [ "write", "write-content", "write-properties", "all" ]; + for (let priv of privs["privilege"]) { + let privname = Object.keys(priv)[0].toLowerCase(); + if (writePrivs.includes(privname)) { + readOnly = false; + break; + } + } + } + } + return readOnly; + }, + // from Sogo cleanedUpHref: function(origHref, origUrl) { // href might be something like: http://foo:80/bar while this.gURL might @@ -736,10 +770,10 @@ var cardbookSynchronization = { onDAVQueryComplete: async function(status, response, askCertificate) { if (status > 199 && status < 400) { cardbookRepository.cardbookUtils.formatStringForOutput("serverCardDeletedFromServer", [aConnection.connDescription, aCard.fn]); - await cardbookRepository.removeCardFromRepository(aCard, true); + await cardbookRepository.removeCardFromRepository(aCard); } else if (status == 404) { cardbookRepository.cardbookUtils.formatStringForOutput("serverCardNotExistServer", [aConnection.connDescription, aCard.fn]); - await cardbookRepository.removeCardFromRepository(aCard, true); + await cardbookRepository.removeCardFromRepository(aCard); } else { cardbookRepository.cardbookServerDeletedCardError[aConnection.connPrefId]++; cardbookRepository.cardbookUtils.formatStringForOutput("serverCardDeleteFailed", [aConnection.connDescription, aCard.fn, aConnection.connUrl, status], "Error"); @@ -1057,19 +1091,19 @@ var cardbookSynchronization = { var aListOfFileName = []; aListOfFileName = cardbookSynchronization.getFilesFromDir(aDir.path); // we presume we've got one contact per file + if (aActionId) { + cardbookRepository.currentAction[aActionId].totalEstimatedCards = aListOfFileName.length * 2; + } cardbookRepository.cardbookServerCardSyncTotal[aDirPrefId] = aListOfFileName.length; // load dir in background - Services.tm.currentThread.dispatch({ run: function() { + Services.tm.currentThread.dispatch({ run: async function() { for (var i = 0; i < aListOfFileName.length; i++) { var myFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile); myFile.initWithPath(aDir.path); myFile.append(aListOfFileName[i]); if (myFile.exists() && myFile.isFile()) { cardbookRepository.cardbookFileRequest[aDirPrefId]++; - // then load the files one by one to avoid freeze - Services.tm.currentThread.dispatch({ run: function() { - cardbookSynchronization.loadFile(myFile, aDirPrefId, aTarget, aImportMode, aActionId); - }}, Components.interfaces.nsIEventTarget.DISPATCH_SYNC); + await cardbookSynchronization.loadFile(myFile, aDirPrefId, aTarget, aImportMode, aActionId); } else { cardbookRepository.cardbookFileResponse[aDirPrefId]++; cardbookRepository.cardbookServerCardSyncDone[aDirPrefId]++; @@ -1505,12 +1539,12 @@ var cardbookSynchronization = { let rsrcType = prop2["resourcetype"][0]; cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aConnection.connDescription + " : rsrcType found : " + rsrcType.toSource()); if (rsrcType["vcard-collection"] || rsrcType["addressbook"]) { - var displayName = ""; - if (prop2["displayname"] != null && prop2["displayname"] !== undefined && prop2["displayname"] != "") { - displayName = prop2["displayname"][0]; - } + let displayName = cardbookSynchronization.getDisplayname(prop2); + let readOnly = cardbookSynchronization.getReadOnly(prop2); cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aConnection.connDescription + " : href found : " + href); cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aConnection.connDescription + " : displayName found : " + displayName); + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aConnection.connDescription + " : readonly found : " + readOnly); + if (href.indexOf(aRootUrl) >= 0 ) { aConnection.connUrl = href; } else { @@ -1520,6 +1554,7 @@ var cardbookSynchronization = { cardbookRepository.cardbookServerValidation[aConnection.connPrefId][aConnection.connUrl] = {} cardbookRepository.cardbookServerValidation[aConnection.connPrefId][aConnection.connUrl].displayName = displayName; cardbookRepository.cardbookServerValidation[aConnection.connPrefId][aConnection.connUrl].forget = false; + cardbookRepository.cardbookServerValidation[aConnection.connPrefId][aConnection.connUrl].readOnly = readOnly; var aABConnection = {connPrefId: aConnection.connPrefId, connUser: aConnection.connUser, connUrl: aConnection.connUrl, connDescription: aConnection.connDescription}; cardbookSynchronization.discoverPhase4(aABConnection, aRootUrl, aOperationType, aParams); } @@ -1547,7 +1582,7 @@ var cardbookSynchronization = { cardbookRepository.cardbookServerDiscoveryRequest[aConnection.connPrefId]++; cardbookRepository.cardbookUtils.formatStringForOutput("synchronizationRequestDiscovery", [aConnection.connDescription, aConnection.connUrl]); var request = new cardbookWebDAV(aConnection, listener_checkpropfind4, "", true); - request.propfind(["D:resourcetype", "D:displayname"], true); + request.propfind(["D:current-user-privilege-set", "D:resourcetype", "D:displayname"], true); }, // no errors to report in this function @@ -1656,12 +1691,6 @@ var cardbookSynchronization = { let rsrcType = prop2["resourcetype"][0]; cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aConnection.connDescription + " : rsrcType found : " + rsrcType.toSource()); if (rsrcType["vcard-collection"] || rsrcType["addressbook"]) { - var displayName = ""; - if (prop2["displayname"] != null && prop2["displayname"] !== undefined && prop2["displayname"] != "") { - displayName = prop2["displayname"][0]; - } - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aConnection.connDescription + " : href found : " + href); - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aConnection.connDescription + " : displayName found : " + displayName); if (href.startsWith("http")) { aConnection.connUrl = href; } else { @@ -1669,10 +1698,16 @@ var cardbookSynchronization = { } if (aOperationType == "GETDISPLAYNAME") { + let displayName = cardbookSynchronization.getDisplayname(prop2); + let readOnly = cardbookSynchronization.getReadOnly(prop2); + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aConnection.connDescription + " : href found : " + href); + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aConnection.connDescription + " : displayName found : " + displayName); + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aConnection.connDescription + " : readonly found : " + readOnly); cardbookRepository.cardbookServerValidation[aConnection.connPrefId]['length']++; cardbookRepository.cardbookServerValidation[aConnection.connPrefId][aConnection.connUrl] = {} cardbookRepository.cardbookServerValidation[aConnection.connPrefId][aConnection.connUrl].displayName = displayName; cardbookRepository.cardbookServerValidation[aConnection.connPrefId][aConnection.connUrl].forget = false; + cardbookRepository.cardbookServerValidation[aConnection.connPrefId][aConnection.connUrl].readOnly = readOnly; var aABConnection = {connPrefId: aConnection.connPrefId, connUser: aConnection.connUser, connUrl: aConnection.connUrl, connDescription: aConnection.connDescription}; cardbookSynchronization.discoverPhase4(aABConnection, aRootUrl, aOperationType, aParams); } else if (aOperationType == "GOOGLE") { @@ -1708,7 +1743,7 @@ var cardbookSynchronization = { cardbookRepository.cardbookServerDiscoveryRequest[aConnection.connPrefId]++; cardbookRepository.cardbookUtils.formatStringForOutput("synchronizationRequestDiscovery3", [aConnection.connDescription, aConnection.connUrl]); var request = new cardbookWebDAV(aConnection, listener_checkpropfind3, "", true); - request.propfind(["D:resourcetype", "D:displayname"], true); + request.propfind(["D:current-user-privilege-set", "D:resourcetype", "D:displayname"], true); }, discoverPhase2: function(aConnection, aRootUrl, aOperationType, aParams) { @@ -2303,6 +2338,9 @@ var cardbookSynchronization = { for (let dirPrefId of result) { cardbookSynchronization.loadAccount(dirPrefId, initialSync, true, runBirthdaysAfterLoad); } + if (result.length == 0) { + cardbookRepository.initialSync = false; + } cardbookSynchronization.setPeriodicSyncs(); cardbookRepository.cardbookUtils.notifyObservers("accountsLoaded"); }, @@ -2448,13 +2486,13 @@ var cardbookSynchronization = { } } - for (var i = 0; i < myAccountsToAdd.length; i++) { - cardbookRepository.cardbookDiscovery.addAddressbook(myAccountsToAdd[i]); + for (let addAB of myAccountsToAdd) { + cardbookRepository.cardbookDiscovery.addAddressbook(addAB); } - for (var i = 0; i < myAccountsToRemove.length; i++) { - cardbookRepository.cardbookDiscovery.removeAddressbook(myAccountsToRemove[i]); + for (let removeAB of myAccountsToRemove) { + cardbookRepository.cardbookDiscovery.removeAddressbook(removeAB); } - for (var dirPrefId in cardbookRepository.cardbookServerValidation) { + for (let dirPrefId in cardbookRepository.cardbookServerValidation) { cardbookSynchronization.stopDiscoveryOperations(dirPrefId); } } @@ -2482,7 +2520,7 @@ var cardbookSynchronization = { }, 1000, Components.interfaces.nsITimer.TYPE_REPEATING_SLACK); }, - loadFile: function (aFile, aDirPrefId, aTarget, aImportMode, aActionId) { + loadFile: async function (aFile, aDirPrefId, aTarget, aImportMode, aActionId) { var params = {}; params["showError"] = true; params["aFile"] = aFile; @@ -2498,7 +2536,7 @@ var cardbookSynchronization = { params["aActionId"] = aActionId; cardbookRepository.currentAction[aActionId].totalCards++; } - cardbookRepository.cardbookUtils.readContentFromFile(aFile.path, cardbookSynchronization.loadFileAsync, params); + await cardbookRepository.cardbookUtils.readContentFromFile(aFile.path, cardbookSynchronization.loadFileAsync, params); }, loadFileAsync: async function (aContent, aParams) { @@ -2686,9 +2724,9 @@ var cardbookSynchronization = { } }, - writeCardsToFile: async function (aFileName, aListofCard, aMediaConversion, aActionId, aCount) { + writeCardsToFile: async function (aFileName, aListofCard, aActionId, aCount) { try { - var output = await cardbookRepository.cardbookUtils.getDataForUpdatingFile(aListofCard, aMediaConversion); + var output = await cardbookRepository.cardbookUtils.getDataForUpdatingFile(aListofCard); await cardbookRepository.cardbookUtils.writeContentToFile(aFileName, output, "UTF8", aActionId, aCount); } catch (e) { @@ -2696,29 +2734,60 @@ var cardbookSynchronization = { } }, - writeCardsToDir: function (aDirName, aListofCard, aMediaConversion, aActionId) { + writeCardsToDir: function (aDirName, aListofCard, aActionId) { try { - var myDirectory = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile); // write dir in background Services.tm.currentThread.dispatch({ run: async function() { for (var i = 0; i < aListofCard.length; i++) { var myCard = aListofCard[i]; - myDirectory.initWithPath(aDirName); - var myFile = myDirectory; - myFile.append(cardbookRepository.cardbookUtils.getFileNameForCard(aDirName, myCard.fn, myCard.uid)); - if (myFile.exists() == false){ - myFile.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 420); + let file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile); + file.initWithPath(aDirName); + let filename = cardbookRepository.cardbookUtils.getFileNameForCard(aDirName, myCard.fn, ".vcf"); + if (filename) { + file.append(filename); + if (file.exists() == false){ + file.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 420); + } + let content = await cardbookRepository.cardbookUtils.cardToVcardData(myCard); + await cardbookRepository.cardbookUtils.writeContentToFile(file.path, content, "UTF8", aActionId, 1); + } else { + cardbookRepository.currentAction[aActionId].totalCards--; } - // then write the files one by one to avoid freeze - // Services.tm.currentThread.dispatch({ run: async function() { - let content = await cardbookRepository.cardbookUtils.cardToVcardData(myCard, aMediaConversion); - await cardbookRepository.cardbookUtils.writeContentToFile(myFile.path, content, "UTF8", aActionId, 1); - // }}, Components.interfaces.nsIEventTarget.DISPATCH_SYNC); } }}, Components.interfaces.nsIEventTarget.DISPATCH_NORMAL); } catch (e) { cardbookRepository.cardbookLog.updateStatusProgressInformation("cardbookSynchronization.writeCardsToDir error : " + e, "Error"); } + }, + + writeCardsImages: function (aDirName, aListofCard, aActionId) { + try { + // write dir in background + Services.tm.currentThread.dispatch({ run: async function() { + for (let card of aListofCard) { + for (let media of cardbookRepository.allColumns.media) { + let dirname = cardbookRepository.cardbookPreferences.getName(card.dirPrefId); + let image = await cardbookIDBImage.getImage(media, dirname, card.cbid, card.fn); + if (image && image.content && image.extension) { + let file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile); + file.initWithPath(aDirName); + let filename = cardbookRepository.cardbookUtils.getFileNameForCard(aDirName, card.fn + "." + media, "." + image.extension); + if (filename) { + file.append(filename); + await cardbookRepository.cardbookUtils.writeContentToFile(file.path, atob(image.content), "NOUTF8", aActionId, 1); + } else { + cardbookRepository.currentAction[aActionId].totalCards--; + } + } else { + cardbookRepository.currentAction[aActionId].totalCards--; + } + } + } + }}, Components.interfaces.nsIEventTarget.DISPATCH_NORMAL); + } + catch (e) { + cardbookRepository.cardbookLog.updateStatusProgressInformation("cardbookSynchronization.writeCardsImages error : " + e, "Error"); + } } }; diff --git a/src/chrome/content/cardbookSynchronizationGoogle2.jsm b/src/chrome/content/cardbookSynchronizationGoogle2.jsm index 7bfec98..7b07bac 100644 --- a/src/chrome/content/cardbookSynchronizationGoogle2.jsm +++ b/src/chrome/content/cardbookSynchronizationGoogle2.jsm @@ -1299,7 +1299,7 @@ var cardbookSynchronizationGoogle2 = { }, parseCardToGoogleContact: async function (aCard) { - console.debug(aCard); + // console.debug(aCard); let dateFormat = cardbookRepository.getDateFormat(aCard.dirPrefId, aCard.version); let GoogleContact = {}; // no need for created contacts @@ -1540,12 +1540,12 @@ var cardbookSynchronizationGoogle2 = { GoogleContact.imClients.push(imClient); } } - console.debug(GoogleContact); + // console.debug(GoogleContact); return GoogleContact; }, parseGoogleContactToCard: function (aGoogleContact, aDirPrefId) { - console.debug(aGoogleContact); + // console.debug(aGoogleContact); let tmpArray = aGoogleContact.resourceName.split("/"); let uid = tmpArray[tmpArray.length - 1]; let ABType = cardbookRepository.cardbookPreferences.getType(aDirPrefId); @@ -1648,7 +1648,7 @@ var cardbookSynchronizationGoogle2 = { for (let photo of aGoogleContact.photos) { if (!photo.url.includes("___________")) { let value = photo.url; - let extension = cardbookRepository.cardbookUtils.getFileNameExtension(value); + let extension = cardbookRepository.cardbookUtils.getFileExtension(value); aCard.photo = {types: [], value: "", URI: value, extension: extension, attachmentId: ""}; break; } @@ -1815,7 +1815,7 @@ var cardbookSynchronizationGoogle2 = { [aCard.org, aCard.title, aCard.role]); } cardbookRepository.cardbookUtils.setCalculatedFields(aCard); - console.debug(aCard); + // console.debug(aCard); return aCard; }, diff --git a/src/chrome/content/cardbookSynchronizationOffice365.jsm b/src/chrome/content/cardbookSynchronizationOffice365.jsm index 96bf515..329fff2 100644 --- a/src/chrome/content/cardbookSynchronizationOffice365.jsm +++ b/src/chrome/content/cardbookSynchronizationOffice365.jsm @@ -1001,7 +1001,7 @@ var cardbookSynchronizationOffice365 = { }, parseCardToOffice365UpdateContact: function (aCard) { - console.debug(aCard); + // console.debug(aCard); function addItemField(aField, aEWSField) { if (aCard[aField]) { Office365Contact = cardbookSynchronizationOffice365.addEntry(Office365Contact, "SetItemField", [], false); @@ -1380,12 +1380,12 @@ var cardbookSynchronizationOffice365 = { Office365Contact = cardbookSynchronizationOffice365.addEntry(Office365Contact, "Updates", [], true); Office365Contact = cardbookSynchronizationOffice365.addEntry(Office365Contact, "ItemChange", [], true); - console.debug(Office365Contact); + // console.debug(Office365Contact); return Office365Contact; }, parseCardToOffice365UpdateDistributionList: function (aCard) { - console.debug(aCard); + // console.debug(aCard); function addItemField(aField, aEWSField) { if (aCard[aField]) { Office365DistributionList = cardbookSynchronizationOffice365.addEntry(Office365DistributionList, "SetItemField", [], false); @@ -1507,12 +1507,12 @@ var cardbookSynchronizationOffice365 = { Office365DistributionList = cardbookSynchronizationOffice365.addEntry(Office365DistributionList, "Updates", [], true); Office365DistributionList = cardbookSynchronizationOffice365.addEntry(Office365DistributionList, "ItemChange", [], true); - console.debug(Office365DistributionList); + // console.debug(Office365DistributionList); return Office365DistributionList; }, parseCardToOffice365CreateContact: function (aCard) { - console.debug(aCard); + // console.debug(aCard); let dateFormat = cardbookRepository.getDateFormat(aCard.dirPrefId, aCard.version); let Office365Contact = ""; @@ -1735,12 +1735,12 @@ var cardbookSynchronizationOffice365 = { Office365Contact = cardbookSynchronizationOffice365.addEntry(Office365Contact, "Contact", [], true); - console.debug(Office365Contact); + // console.debug(Office365Contact); return Office365Contact; }, parseCardToOffice365CreateDistributionList: function (aCard) { - console.debug(aCard); + // console.debug(aCard); let Office365DistributionList = ""; Office365DistributionList = cardbookSynchronizationOffice365.addEntry(Office365DistributionList, "DistributionList", [], false); Office365DistributionList = cardbookSynchronizationOffice365.addContent(Office365DistributionList, "DisplayName", [], aCard.fn); @@ -1801,12 +1801,12 @@ var cardbookSynchronizationOffice365 = { } Office365DistributionList = cardbookSynchronizationOffice365.addEntry(Office365DistributionList, "DistributionList", [], true); - console.debug(Office365DistributionList); + // console.debug(Office365DistributionList); return Office365DistributionList; }, parseOffice365ContactToCard: function (aOffice365Contact, aDirPrefId) { - console.debug(aOffice365Contact); + // console.debug(aOffice365Contact); let itemId = aOffice365Contact.getElementsByTagNameNS(cardbookSynchronizationOffice365.nsTypes, "ItemId")[0]; let uid = itemId.getAttribute("Id"); let etag = itemId.getAttribute("ChangeKey"); @@ -2065,7 +2065,7 @@ var cardbookSynchronizationOffice365 = { } cardbookRepository.cardbookUtils.setCalculatedFields(aCard); - console.debug(aCard); + // console.debug(aCard); return aCard; }, diff --git a/src/chrome/content/cardbookUtils.jsm b/src/chrome/content/cardbookUtils.jsm index 757b3e5..e399215 100644 --- a/src/chrome/content/cardbookUtils.jsm +++ b/src/chrome/content/cardbookUtils.jsm @@ -196,11 +196,7 @@ var cardbookUtils = { function compare5(a, b) { let aValue = cardbookUtils.getCardValueByField(a, aIndex, false); let bValue = cardbookUtils.getCardValueByField(b, aIndex, false); - if (aValue.length && bValue.length) { - return aValue.join().localeCompare(bValue.join())*aInvert; - } else { - return aValue.length || bValue.length; - } + return aValue.join().localeCompare(bValue.join())*aInvert; }; function compare6(a, b) { return cardbookRepository.cardbookGenderLookup[a.gender].localeCompare(cardbookRepository.cardbookGenderLookup[b.gender])*aInvert; }; function compare7(a, b) { return (cardbookRepository.cardbookDates.getDateForCompare(a, aIndex)*aInvert > cardbookRepository.cardbookDates.getDateForCompare(b, aIndex)*aInvert); }; @@ -509,7 +505,7 @@ var cardbookUtils = { return lTemp; }, - cardToVcardData: async function (vCard, aMediaConversion) { + cardToVcardData: async function (vCard, aMediaFromDB = true) { if (vCard.uid == "") { return ""; } @@ -572,12 +568,12 @@ var cardbookUtils = { for (let media of cardbookRepository.allColumns.media) { // always convert - await cardbookUtils.cacheGetMediaCard(vCard, media, true) - .then( content => { - vCardData = this.appendToVcardData3(vCardData, media.toUpperCase(), content); - }).catch( () => {} ); + let content = await cardbookUtils.cacheGetMediaCard(vCard, media, aMediaFromDB); + if (content.length) { + vCardData = this.appendToVcardData3(vCardData, media.toUpperCase(), content); + } } - + if (cardbookRepository.cardbookPreferences.getType(vCard.dirPrefId) == "GOOGLE") { vCardData = this.appendToVcardData2(vCardData,"X-CATEGORIES",false,this.unescapeArrayComma(this.escapeArrayComma(vCard.categories)).join(",")); } @@ -593,13 +589,13 @@ var cardbookUtils = { var myTempCard = new cardbookCardParser(); cardbookUtils.cloneCard(aCard, myTempCard); myTempCard.rev = ""; - var cardContent = await cardbookUtils.cardToVcardData(myTempCard, true); + var cardContent = await cardbookUtils.cardToVcardData(myTempCard); myTempCard = null; return cardContent; }, getvCardForServer: async function(aCard) { - return await cardbookUtils.cardToVcardData(aCard, true); + return await cardbookUtils.cardToVcardData(aCard); }, addCardFromDisplayAndEmail: async function (aDirPrefId, aDisplayName, aEmail, aCategory, aActionId) { @@ -638,39 +634,69 @@ var cardbookUtils = { } }, - getImageFromURI: function (aCardName, aDirname, aImageURI) { + getImageFromURI: function (aDirPrefId, aCardName, aDirname, aImageURI) { return new Promise((resolve, reject) => { - cardbookRepository.cardbookUtils.formatStringForOutput("serverCardGettingImage", [aDirname, aCardName]); - let xhr = new XMLHttpRequest(); - xhr.responseType = "arraybuffer"; - - xhr.onload = function () { - if (xhr.status === 200) { - cardbookRepository.cardbookUtils.formatStringForOutput("serverCardGetImageOK", [aDirname, aCardName]); - let uInt8Array = new Uint8Array(this.response); - let i = uInt8Array.length; - let binaryString = new Array(i); - while (i--) { - binaryString[i] = String.fromCharCode(uInt8Array[i]); + if (aImageURI.startsWith("http")) { + let listener_getimage = { + onDAVQueryComplete: function(status, response, askCertificate, etag, reportLength, contentType) { + if (status > 199 && status < 400) { + let extension = cardbookRepository.cardbookUtils.getFileExtension(aImageURI); + if (extension == "" && contentType) { + extension = contentType.replace(/^image\//, "").toLowerCase(); + } + cardbookRepository.cardbookUtils.formatStringForOutput("serverCardGetImageOK", [aDirname, aCardName]); + let binary = "" + for (i = 0; i < response.length; i++) { + binary += String.fromCharCode(response.charCodeAt(i) & 0xff); + } + let base64 = btoa(binary); + resolve([base64, extension]); + } else { + cardbookRepository.cardbookUtils.formatStringForOutput("serverCardGetImageFailed", [aDirname, aCardName, aImageURI, status]); + reject(); + } } - let data = binaryString.join(''); - let base64 = btoa(data); - resolve(base64); - } else { + }; + let aImageConnection = {connPrefId: aDirPrefId, connUrl: aImageURI, connDescription: aDirname}; + let request = new cardbookWebDAV(aImageConnection, listener_getimage); + cardbookRepository.cardbookUtils.formatStringForOutput("serverCardGettingImage", [aDirname, aCardName]); + request.getimage(); + } else { + cardbookRepository.cardbookUtils.formatStringForOutput("serverCardGettingImage", [aDirname, aCardName]); + let xhr = new XMLHttpRequest(); + xhr.responseType = "arraybuffer"; + xhr.onload = function () { + if (xhr.status === 200) { + let extension = cardbookRepository.cardbookUtils.getFileExtension(aImageURI); + if (extension == "" && xhr.channel && xhr.channel.contentType) { + extension = xhr.channel.contentType.replace(/^image\//, "").toLowerCase(); + } + cardbookRepository.cardbookUtils.formatStringForOutput("serverCardGetImageOK", [aDirname, aCardName]); + let uInt8Array = new Uint8Array(this.response); + let i = uInt8Array.length; + let binaryString = new Array(i); + while (i--) { + binaryString[i] = String.fromCharCode(uInt8Array[i]); + } + let data = binaryString.join(''); + let base64 = btoa(data); + resolve([base64, extension]); + } else { + cardbookRepository.cardbookUtils.formatStringForOutput("serverCardGetImageFailed", [aDirname, aCardName, aImageURI, xhr.status]); + reject(); + } + }; + xhr.onerror = function () { cardbookRepository.cardbookUtils.formatStringForOutput("serverCardGetImageFailed", [aDirname, aCardName, aImageURI, xhr.status]); reject(); - } - }; - xhr.onerror = function () { - cardbookRepository.cardbookUtils.formatStringForOutput("serverCardGetImageFailed", [aDirname, aCardName, aImageURI, xhr.status]); - reject(); - }; - xhr.ontimeout = function () { - cardbookRepository.cardbookUtils.formatStringForOutput("serverCardGetImageFailed", [aDirname, aCardName, aImageURI, xhr.status]); - reject(); - }; - xhr.open("GET", aImageURI, true); - xhr.send(); + }; + xhr.ontimeout = function () { + cardbookRepository.cardbookUtils.formatStringForOutput("serverCardGetImageFailed", [aDirname, aCardName, aImageURI, xhr.status]); + reject(); + }; + xhr.open("GET", aImageURI, true); + xhr.send(); + } }); }, @@ -1385,10 +1411,10 @@ var cardbookUtils = { }, getTemplate: function (aFieldList) { - var myFieldArray = aFieldList.split('|'); - var result = []; - for (var i = 0; i < myFieldArray.length; i++) { - result.push([myFieldArray[i], cardbookRepository.cardbookUtils.getTranslatedField(myFieldArray[i])]); + let fields = aFieldList.split('|'); + let result = []; + for (let field of fields) { + result.push([field, cardbookRepository.cardbookUtils.getTranslatedField(field)]); } return result; }, @@ -1435,7 +1461,7 @@ var cardbookUtils = { } } if ("blank" == aField) { - return cardbookRepository.extension.localeData.localizeMessage(window.arguments[0].mode + "blankColumn"); + return cardbookRepository.extension.localeData.localizeMessage("importBlankColumn"); } return ""; }, @@ -1539,15 +1565,15 @@ var cardbookUtils = { }; }, - getDataForUpdatingFile: async function(aList, aMediaConversion) { + getDataForUpdatingFile: async function(aList) { var dataForExport = ""; var k = 0; for (var i = 0; i < aList.length; i++) { if (k === 0) { - dataForExport = await cardbookUtils.cardToVcardData(aList[i], aMediaConversion); + dataForExport = await cardbookUtils.cardToVcardData(aList[i]); k = 1; } else { - dataForExport = dataForExport + "\r\n" + await cardbookUtils.cardToVcardData(aList[i], aMediaConversion); + dataForExport = dataForExport + "\r\n" + await cardbookUtils.cardToVcardData(aList[i]); } } return dataForExport; @@ -1728,36 +1754,28 @@ var cardbookUtils = { return cardbookRepository.cardbookPreferences.getName(aPrefId); }, - getFreeFileName: function(aDirName, aName, aId, aExtension) { - var myFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile); - myFile.initWithPath(aDirName); - myFile.append(aName.replace(/([\\\/\:\*\?\"\<\>\|]+)/g, '-') + aExtension); - if (myFile.exists()) { - var i = 0; - while (i < 100) { - var myFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile); - myFile.initWithPath(aDirName); - myFile.append(aName.replace(/([\\\/\:\*\?\"\<\>\|]+)/g, '-') + "." + i + aExtension); - if (!(myFile.exists())) { - return myFile.leafName; - } - i++; - } - return aId + aExtension; - } else { - return myFile.leafName; - } + getFormattedFileName: function(aName) { + return aName.replace(/([\\\/\:\*\?\"\<\>\|]+)/g, '-'); }, - getFileNameForCard: function(aDirName, aName, aId) { - return cardbookUtils.getFreeFileName(aDirName, aName, aId.replace(/^urn:uuid:/i, ""), ".vcf"); + getFileNameForCard: function(aDirName, aName, aExtension) { + try { + let file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile); + file.initWithPath(aDirName); + file.append(cardbookUtils.getFormattedFileName(aName) + aExtension); + file.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 420); + return file.leafName; + } + catch (e) { + return ""; + } }, - getFileNameForCard2: function(aCard, aListOfName, aExtension) { + getFileNameForCard2: function(aCard, aListOfNames, aExtension) { let i = 1; - let name = aCard.fn.replace(/([\\\/\:\*\?\"\<\>\|]+)/g, '-') + "." + aExtension; - while (aListOfName.includes(name) && i < 100) { - name = aCard.fn.replace(/([\\\/\:\*\?\"\<\>\|]+)/g, '-') + i + "." + aExtension; + let name = cardbookUtils.getFormattedFileName(aCard.fn) + aExtension; + while (aListOfNames.includes(name) && i < 100) { + name = cardbookUtils.getFormattedFileName(aCard.fn) + i + aExtension; i++; } return name; @@ -1766,8 +1784,8 @@ var cardbookUtils = { getFileNameFromUrl: function(aUrl) { let cleanUrl = cardbookRepository.cardbookSynchronization.getSlashedUrl(aUrl).slice(0, -1); let keyArray = cleanUrl.split("/"); - let key = decodeURIComponent(keyArray[keyArray.length - 1]); - return key.replace(/^urn:uuid:/i, "").replace(/([\\\/\:\*\?\"\<\>\|]+)/g, '-'); + let key = decodeURIComponent(keyArray[keyArray.length - 1]).replace(/^urn:uuid:/i, ""); + return cardbookUtils.getFormattedFileName(key); }, setCacheURIFromCard: function(aCard, aPrefIdType) { @@ -1775,7 +1793,7 @@ var cardbookUtils = { return; } else if (aPrefIdType === "DIRECTORY") { let myDirPrefIdUrl = cardbookRepository.cardbookPreferences.getUrl(aCard.dirPrefId); - aCard.cacheuri = cardbookUtils.getFileNameForCard(myDirPrefIdUrl, aCard.fn, aCard.uid); + aCard.cacheuri = cardbookUtils.getFileNameForCard(myDirPrefIdUrl, aCard.fn, ".vcf"); } else { if (aCard.cardurl) { if (aPrefIdType == "OFFICE365") { @@ -2333,62 +2351,55 @@ var cardbookUtils = { id = cardbookRepository.cardbookServerValidation[aDirPrefId][url].id; serverUrl = cardbookRepository.cardbookServerValidation[aDirPrefId][url].url; } - if (cardbookRepository.cardbookServerValidation[aDirPrefId][url].displayName) { - aTargetArray.push([type, serverUrl, cardbookRepository.cardbookServerValidation[aDirPrefId].user, cardbookRepository.cardbookServerValidation[aDirPrefId][url].displayName, - version, "", id, false]); - } else { - aTargetArray.push([type, serverUrl, cardbookRepository.cardbookServerValidation[aDirPrefId].user, cardbookRepository.cardbookServerValidation[aDirPrefId].user, - version, "", id, false]); - } + + let displayname = cardbookRepository.cardbookServerValidation[aDirPrefId][url].displayName || cardbookRepository.cardbookServerValidation[aDirPrefId].user; + let readOnly = cardbookRepository.cardbookServerValidation[aDirPrefId][url].readOnly || false; + + aTargetArray.push([type, serverUrl, cardbookRepository.cardbookServerValidation[aDirPrefId].user, displayname, + version, "", id, false, readOnly]); } return aTargetArray; }, - cacheGetMediaCard: async function(aCard, aType, aMediaConversion) { + cacheGetMediaCard: async function(aCard, aType, aMediaFromDB = true) { return new Promise( async function(resolve, reject) { var result = []; - if (aMediaConversion) { - if (aCard[aType].value) { + if (aCard[aType].value) { + if (aCard.version === "4.0") { + if (aCard[aType].extension != "") { + let myExtension = cardbookRepository.cardbookUtils.formatExtension(aCard[aType].extension, aCard[aType].version); + result.push(":data:image/" + myExtension + ";base64," + aCard[aType].value); + } else { + result.push(":base64," + aCard[aType].value); + } + } else if (aCard.version === "3.0") { + if (aCard[aType].extension != "") { + let myExtension = cardbookRepository.cardbookUtils.formatExtension(aCard[aType].extension, aCard[aType].version); + result.push(";ENCODING=B;TYPE=" + myExtension + ":" + aCard[aType].value); + } else { + result.push(";ENCODING=B:" + aCard[aType].value); + } + } + } else if (aMediaFromDB) { + let dirname = cardbookRepository.cardbookPreferences.getName(aCard.dirPrefId); + let image = await cardbookIDBImage.getImage(aType, dirname, aCard.cbid, aCard.fn); + if (image && image.content && image.extension) { + let extension = image.extension || aCard[aType].extension; if (aCard.version === "4.0") { - if (aCard[aType].extension != "") { - let myExtension = cardbookRepository.cardbookUtils.formatExtension(aCard[aType].extension, aCard[aType].version); - result.push(":data:image/" + myExtension + ";base64," + aCard[aType].value); + if (extension) { + let extension1 = cardbookRepository.cardbookUtils.formatExtension(extension, aCard.version); + result.push(":data:image/" + extension1 + ";base64," + image.content); } else { - result.push(":base64," + aCard[aType].value); + result.push(":base64," + image.content); } } else if (aCard.version === "3.0") { - if (aCard[aType].extension != "") { - let myExtension = cardbookRepository.cardbookUtils.formatExtension(aCard[aType].extension, aCard[aType].version); - result.push(";ENCODING=B;TYPE=" + myExtension + ":" + aCard[aType].value); + if (extension) { + let extension1 = cardbookRepository.cardbookUtils.formatExtension(extension, aCard.version); + result.push(";ENCODING=B;TYPE=" + extension1 + ":" + image.content); } else { - result.push(";ENCODING=B:" + aCard[aType].value); + result.push(";ENCODING=B:" + image.content); } } - } else { - let dirname = cardbookRepository.cardbookPreferences.getName(aCard.dirPrefId); - await cardbookIDBImage.getImage(aType, dirname, aCard.cbid, aCard.fn) - .then( image => { - if (image) { - if (aCard.version === "4.0") { - if (aCard[aType].extension != "") { - let myExtension = cardbookRepository.cardbookUtils.formatExtension(aCard[aType].extension, aCard.version); - result.push(":data:image/" + myExtension + ";base64," + image.content); - } else { - result.push(":base64," + image.content); - } - } else if (aCard.version === "3.0") { - if (aCard[aType].extension != "") { - let myExtension = cardbookRepository.cardbookUtils.formatExtension(aCard[aType].extension, aCard.version); - result.push(";ENCODING=B;TYPE=" + myExtension + ":" + image.content); - } else { - result.push(";ENCODING=B:" + image.content); - } - } - } else { - reject([]); - } - }) - .catch( () => { reject([]); }); } } resolve(result); @@ -2399,34 +2410,30 @@ var cardbookUtils = { try { var myPrefName = cardbookUtils.getPrefNameFromPrefId(aCard.dirPrefId); if (aCard[aField].value != "") { - cardbookIDBImage.addImage( aField, myPrefName, + await cardbookIDBImage.addImage( aField, myPrefName, {cbid: aCard.dirPrefId+"::"+aCard.uid, dirPrefId: aCard.dirPrefId, extension: aCard[aField].extension, content: aCard[aField].value}, - aCard.fn, function () { - aCard[aField].value = ""; - }); + aCard.fn); + aCard[aField].value = ""; } else if (aCard[aField].localURI) { let imageFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile); imageFile.initWithPath(aCard[aField].localURI.replace("file://", "")); if (imageFile.exists() && imageFile.isFile()) { - let base64 = await cardbookRepository.cardbookUtils.getImageFromURI(aCard.fn, myPrefName, "file://" + imageFile.path); + let [ base64, extension ] = await cardbookRepository.cardbookUtils.getImageFromURI(aCard.dirPrefId, aCard.fn, myPrefName, "file://" + imageFile.path); let filenameArray = imageFile.leafName.split("."); - let uid = filenameArray[0]; - let extension = filenameArray[filenameArray.length-1]; - cardbookIDBImage.addImage( aField, myPrefName, - {cbid: aCard.dirPrefId+"::"+aCard.uid, dirPrefId: aCard.dirPrefId, extension: aCard[aField].extension, content: base64}, - aCard.fn, function () { - aCard[aField].localURI = null; - }); + let extension1 = extension || filenameArray[filenameArray.length-1]; + await cardbookIDBImage.addImage( aField, myPrefName, + {cbid: aCard.dirPrefId+"::"+aCard.uid, dirPrefId: aCard.dirPrefId, extension: extension1, content: base64}, + aCard.fn); + aCard[aField].localURI = ""; } else { - aCard[aField].localURI = null; + aCard[aField].localURI = ""; } } else if (aCard[aField].URI != "") { - let base64 = await cardbookRepository.cardbookUtils.getImageFromURI(aCard.fn, myPrefName, aCard[aField].URI); + let [ base64, extension ] = await cardbookRepository.cardbookUtils.getImageFromURI(aCard.dirPrefId, aCard.fn, myPrefName, aCard[aField].URI); let filenameArray = aCard[aField].URI.split("."); - let uid = filenameArray[0]; - let extension = filenameArray[filenameArray.length-1]; - cardbookIDBImage.addImage( aField, myPrefName, - {cbid: aCard.dirPrefId+"::"+aCard.uid, dirPrefId: aCard.dirPrefId, extension: aCard[aField].extension, content: base64}, + let extension1 = extension || filenameArray[filenameArray.length-1]; + await cardbookIDBImage.addImage( aField, myPrefName, + {cbid: aCard.dirPrefId+"::"+aCard.uid, dirPrefId: aCard.dirPrefId, extension: extension1, content: base64}, aCard.fn); } } @@ -2442,16 +2449,18 @@ var cardbookUtils = { for (let media of cardbookRepository.allColumns.media) { if (aCard[media].value == "") { if (aCard[media].URI && aCard[media].URI != "") { - let base64 = await cardbookRepository.cardbookUtils.getImageFromURI(aCard.fn, dirname, aCard[media].URI); + let [ base64, extension ] = await cardbookRepository.cardbookUtils.getImageFromURI(aCard.dirPrefId, aCard.fn, dirname, aCard[media].URI); let filenameArray = aCard[media].URI.split("."); let uid = filenameArray[0]; - let extension = filenameArray[filenameArray.length-1]; + let extension1 = extension || filenameArray[filenameArray.length-1]; aCard[media].value = base64; - aCard[media].extension = extension; + aCard[media].extension = extension1; } else { await cardbookIDBImage.getImage(media, dirname, aCard.cbid, aCard.fn) .then( image => { - aCard[media].value = image.content; + if (image && image.content && image.extension) { + aCard[media].value = image.content; + } }) .catch( () => {} ); } @@ -2486,18 +2495,17 @@ var cardbookUtils = { } }, - readContentFromFile: function (aFilePath, aCallback, aParams) { - let win = Services.wm.getMostRecentWindow("mail:3pane", true); - let result = win.IOUtils.readUTF8(aFilePath); - - result.then(data => { - aCallback(data, aParams); - }).catch( () => { + readContentFromFile: async function (aFilePath, aCallback, aParams) { + try { + let win = Services.wm.getMostRecentWindow("mail:3pane", true); + let result = await win.IOUtils.readUTF8(aFilePath); + await aCallback(result, aParams); + } catch(e) { if (aParams.showError) { cardbookRepository.cardbookLog.updateStatusProgressInformation("cardbookUtils.readContentFromFile error : filename : " + aFilePath, "Error"); } aCallback("", aParams); - }); + }; }, notifyObservers: function (aTopic, aParam) { diff --git a/src/chrome/content/cardbookWebDAV.js b/src/chrome/content/cardbookWebDAV.js index afb3c13..6b54052 100644 --- a/src/chrome/content/cardbookWebDAV.js +++ b/src/chrome/content/cardbookWebDAV.js @@ -465,7 +465,9 @@ if ("undefined" == typeof(cardbookWebDAV)) { } } if (this.target && this.target.onDAVQueryComplete) { - this.target.onDAVQueryComplete(status, response, this.askCertificate, aChannel.getResponseHeader("ETag"), this.reportLength); + let etag = aChannel.getResponseHeader("ETag"); + let contentType = aChannel.getResponseHeader("content-type"); + this.target.onDAVQueryComplete(status, response, this.askCertificate, etag, this.reportLength, contentType); } }, @@ -476,7 +478,10 @@ if ("undefined" == typeof(cardbookWebDAV)) { headers.accept = parameters.accept; } this.sendHTTPRequest(operation, null, headers); - } else if (operation == "GETIMAGE" || operation == "GETKEY") { + } else if (operation == "GETIMAGE") { + let headers = {"responsetype" : "arraybuffer"}; + this.sendHTTPRequest("GET", null, headers, null, null, true); + } else if (operation == "GETKEY") { let headers = {}; this.sendHTTPRequest("GET", null, headers, null, null, true); } else if (operation == "GETCONTACTS") { diff --git a/src/chrome/content/cardbookWindowUtils.js b/src/chrome/content/cardbookWindowUtils.js index e1629fa..f3a428c 100644 --- a/src/chrome/content/cardbookWindowUtils.js +++ b/src/chrome/content/cardbookWindowUtils.js @@ -850,7 +850,6 @@ if ("undefined" == typeof(cardbookWindowUtils)) { } else { if (field == "impp") { cardbookRepository.cardbookTypes.loadIMPPs(aCard[field]); - cardbookRepository.cardbookUtils.sortMultipleArrayByString(aCard[field],1,1); } cardbookWindowUtils.constructDynamicRows(field, aCard[field], aCard.version); } diff --git a/src/chrome/content/csvTranslator/wdw_csvTranslator.js b/src/chrome/content/csvTranslator/wdw_csvTranslator.js index 75a2146..ff67404 100644 --- a/src/chrome/content/csvTranslator/wdw_csvTranslator.js +++ b/src/chrome/content/csvTranslator/wdw_csvTranslator.js @@ -390,7 +390,7 @@ function onLoadDialog () { document.getElementById('includePrefCheckBox').hidden = true; document.getElementById('lineHeaderCheckBox').setAttribute('checked', true); document.getElementById('fieldDelimiterTextBox').value = window.arguments[0].columnSeparator; - blankColumn = cardbookRepository.extension.localeData.localizeMessage(window.arguments[0].mode + "blankColumn"); + blankColumn = cardbookRepository.extension.localeData.localizeMessage("importBlankColumn"); cardbookeditlists.availableColumnsTable.push(["blank", blankColumn]); } @@ -413,11 +413,12 @@ function onAcceptDialog () { if (window.arguments[0].columnSeparator == "") { window.arguments[0].columnSeparator = ";"; } - window.arguments[0].action = "SAVE"; if (window.arguments[0].mode == "import") { - if (!validateImportColumns()) { - return; + if (validateImportColumns()) { + window.arguments[0].action = "SAVE"; } + } else { + window.arguments[0].action = "SAVE"; } onCancelDialog(); }; diff --git a/src/chrome/content/enigmail/cardbookEnigmail.js b/src/chrome/content/enigmail/cardbookEnigmail.js index 4900cbf..91a1da9 100644 --- a/src/chrome/content/enigmail/cardbookEnigmail.js +++ b/src/chrome/content/enigmail/cardbookEnigmail.js @@ -187,7 +187,7 @@ var cardbookEnigmail = { } }, - searchForThKeyEdit: function (aListOfSelectedEmails) { + searchForThKeyEdit: async function (aListOfSelectedEmails) { for (let email of aListOfSelectedEmails) { email = email.trim().toLowerCase(); if (EnigmailFuncs.stringLooksLikeEmailAddress(email)) { @@ -195,8 +195,7 @@ var cardbookEnigmail = { for (let key of keyList) { let keyIdArray = [ "0x" + key.keyId ]; let exitCodeObj = {}; - let errorMsgObj = {}; - let keyData = EnigmailKeyRing.extractKey(0, keyIdArray, null, exitCodeObj, errorMsgObj); + let keyData = await EnigmailKeyRing.extractPublicKeys(keyIdArray, null, null, exitCodeObj, {}); if (exitCodeObj.value === 0) { wdw_cardEdition.addKeyToEdit(keyData); } diff --git a/src/chrome/content/filters/wl_cardbookFilterAction.js b/src/chrome/content/filters/wl_cardbookFilterAction.js deleted file mode 100644 index 3556f2f..0000000 --- a/src/chrome/content/filters/wl_cardbookFilterAction.js +++ /dev/null @@ -1,3 +0,0 @@ -// Import any needed modules. -var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); -Services.scriptloader.loadSubScript("chrome://cardbook/content/filters/cardbookFilterAction.js", window, "UTF-8"); diff --git a/src/chrome/content/findDuplicates/cardbookDuplicate.js b/src/chrome/content/findDuplicates/cardbookDuplicate.js index ba79b90..d9e049b 100644 --- a/src/chrome/content/findDuplicates/cardbookDuplicate.js +++ b/src/chrome/content/findDuplicates/cardbookDuplicate.js @@ -26,13 +26,13 @@ if ("undefined" == typeof(cardbookDuplicate)) { if (cacheDir.exists()) { var params = {}; params["showError"] = true; - cardbookRepository.cardbookUtils.readContentFromFile(cacheDir.path, cardbookDuplicate.loadDuplicateAsync, params); + cardbookRepository.cardbookUtils.readContentFromFile(cacheDir.path, cardbookDuplicate.loadDuplicateNext, params); } else { wdw_findDuplicates.load(); } }, - loadDuplicateAsync: function (aContent) { + loadDuplicateNext: function (aContent) { var re = /[\n\u0085\u2028\u2029]|\r\n?/; var fileContentArray = aContent.split(re); for (var i = 0; i < fileContentArray.length; i++) { diff --git a/src/chrome/content/findDuplicates/wdw_findDuplicates.js b/src/chrome/content/findDuplicates/wdw_findDuplicates.js index da27998..17fc7e8 100644 --- a/src/chrome/content/findDuplicates/wdw_findDuplicates.js +++ b/src/chrome/content/findDuplicates/wdw_findDuplicates.js @@ -195,7 +195,10 @@ if ("undefined" == typeof(wdw_findDuplicates)) { var dirname = cardbookRepository.cardbookPreferences.getName(myOutCard.dirPrefId); var image = {}; await cardbookIDBImage.getImage(j, dirname, wdw_findDuplicates.gResults[aLineNumber][0].dirPrefId+"::"+wdw_findDuplicates.gResults[aLineNumber][0].uid, wdw_findDuplicates.gResults[aLineNumber][0].fn) - .then(imageFound => { image = imageFound }) + .then(imageFound => { + if (imageFound && imageFound.content && imageFound.extension) { + image = imageFound; + }}) .catch( () => {} ); if (image.content && image.content != "") { myOutCard[j].value = image.content; @@ -205,9 +208,11 @@ if ("undefined" == typeof(wdw_findDuplicates)) { for (var k = 1; k < wdw_findDuplicates.gResults[aLineNumber].length; k++) { await cardbookIDBImage.getImage(j, dirname, wdw_findDuplicates.gResults[aLineNumber][k].dirPrefId+"::"+wdw_findDuplicates.gResults[aLineNumber][k].uid, wdw_findDuplicates.gResults[aLineNumber][k][j].fn) .then(image => { - myOutCard[j].value = image.content; - myOutCard[j].extension = image.extension; - out = true; + if (image && image.content && image.extension) { + myOutCard[j].value = image.content; + myOutCard[j].extension = image.extension; + out = true; + } }) .catch( () => { } ); if (out == true) { @@ -552,9 +557,9 @@ if ("undefined" == typeof(wdw_findDuplicates)) { wdw_findDuplicates.load(); }, - preload: function () { + preload: async function () { cardbookRepository.cardbookDuplicateIndex = {}; - cardbookDuplicate.loadDuplicate(); + await cardbookDuplicate.loadDuplicate(); }, load: async function () { diff --git a/src/chrome/content/indexedDB/cardbookIDBCard.js b/src/chrome/content/indexedDB/cardbookIDBCard.js index 3078460..a188c1d 100644 --- a/src/chrome/content/indexedDB/cardbookIDBCard.js +++ b/src/chrome/content/indexedDB/cardbookIDBCard.js @@ -68,28 +68,32 @@ var cardbookIDBCard = { // add or override the contact to the cache addCard: async function(aDirPrefName, aCard, aMode) { - var storedCard = cardbookIndexedDB.encryptionEnabled ? (await cardbookEncryptor.encryptCard(aCard)) : aCard; - var db = cardbookRepository.cardbookDatabase.db; - var transaction = db.transaction(["cards"], "readwrite"); - var store = transaction.objectStore("cards"); - var cursorRequest = store.put(storedCard); - cursorRequest.onsuccess = function(e) { - if (cardbookIndexedDB.encryptionEnabled) { - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aDirPrefName + " : debug mode : Contact " + aCard.fn + " written to encrypted DB"); - } else { - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aDirPrefName + " : debug mode : Contact " + aCard.fn + " written to DB"); - } - if (aMode) { - cardbookActions.fetchCryptoActivity(aMode); - } - }; - - cursorRequest.onerror = function(e) { - if (aMode) { - cardbookActions.fetchCryptoActivity(aMode); - } + try { + var storedCard = cardbookIndexedDB.encryptionEnabled ? (await cardbookEncryptor.encryptCard(aCard)) : aCard; + var db = cardbookRepository.cardbookDatabase.db; + var transaction = db.transaction(["cards"], "readwrite"); + var store = transaction.objectStore("cards"); + var cursorRequest = store.put(storedCard); + cursorRequest.onsuccess = function(e) { + if (cardbookIndexedDB.encryptionEnabled) { + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aDirPrefName + " : debug mode : Contact " + aCard.fn + " written to encrypted DB"); + } else { + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aDirPrefName + " : debug mode : Contact " + aCard.fn + " written to DB"); + } + if (aMode) { + cardbookActions.fetchCryptoActivity(aMode); + } + }; + + cursorRequest.onerror = function(e) { + if (aMode) { + cardbookActions.fetchCryptoActivity(aMode); + } + cardbookRepository.cardbookDatabase.onerror(e); + }; + } catch(e) { cardbookRepository.cardbookDatabase.onerror(e); - }; + } }, // delete the contact @@ -129,10 +133,7 @@ var cardbookIDBCard = { resolve(); }; - cursorRequest.onerror = function(e) { - reject(); - cardbookRepository.cardbookDatabase.onerror(e); - }; + cursorRequest.onerror = cardbookRepository.cardbookDatabase.onerror; }); }, @@ -155,9 +156,7 @@ var cardbookIDBCard = { cardbookRepository.cardbookServerCardSyncTotal[aDirPrefId] = countRequest.result; }; - countRequest.onerror = function(e) { - cardbookRepository.cardbookDatabase.onerror(e); - }; + countRequest.onerror = cardbookRepository.cardbookDatabase.onerror; const handleCard = async card => { try { @@ -192,9 +191,7 @@ var cardbookIDBCard = { } }; - cursorRequest.onerror = function(e) { - cardbookRepository.cardbookDatabase.onerror(e); - }; + cursorRequest.onerror = cardbookRepository.cardbookDatabase.onerror; }, // when all contacts were loaded from the cache diff --git a/src/chrome/content/indexedDB/cardbookIDBCat.js b/src/chrome/content/indexedDB/cardbookIDBCat.js index 4c65ca7..941fddd 100644 --- a/src/chrome/content/indexedDB/cardbookIDBCat.js +++ b/src/chrome/content/indexedDB/cardbookIDBCat.js @@ -66,28 +66,32 @@ var cardbookIDBCat = { // add or override the category to the cache addCategory: async function(aDirPrefName, aCategory, aMode) { - var storedCategory = cardbookIndexedDB.encryptionEnabled ? (await cardbookEncryptor.encryptCategory(aCategory)) : aCategory; - var db = cardbookRepository.cardbookCatDatabase.db; - var transaction = db.transaction(["categories"], "readwrite"); - var store = transaction.objectStore("categories"); - var cursorRequest = store.put(storedCategory); - cursorRequest.onsuccess = function(e) { - if (cardbookIndexedDB.encryptionEnabled) { - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aDirPrefName + " : debug mode : Category " + aCategory.name + " written to encrypted CatDB"); - } else { - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aDirPrefName + " : debug mode : Category " + aCategory.name + " written to CatDB"); - } - if (aMode) { - cardbookActions.fetchCryptoActivity(aMode); - } - }; - - cursorRequest.onerror = function(e) { - if (aMode) { - cardbookActions.fetchCryptoActivity(aMode); - } + try { + var storedCategory = cardbookIndexedDB.encryptionEnabled ? (await cardbookEncryptor.encryptCategory(aCategory)) : aCategory; + var db = cardbookRepository.cardbookCatDatabase.db; + var transaction = db.transaction(["categories"], "readwrite"); + var store = transaction.objectStore("categories"); + var cursorRequest = store.put(storedCategory); + cursorRequest.onsuccess = function(e) { + if (cardbookIndexedDB.encryptionEnabled) { + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aDirPrefName + " : debug mode : Category " + aCategory.name + " written to encrypted CatDB"); + } else { + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aDirPrefName + " : debug mode : Category " + aCategory.name + " written to CatDB"); + } + if (aMode) { + cardbookActions.fetchCryptoActivity(aMode); + } + }; + + cursorRequest.onerror = function(e) { + if (aMode) { + cardbookActions.fetchCryptoActivity(aMode); + } + cardbookRepository.cardbookCatDatabase.onerror(e); + }; + } catch(e) { cardbookRepository.cardbookCatDatabase.onerror(e); - }; + } }, // delete the category @@ -146,9 +150,7 @@ var cardbookIDBCat = { cardbookRepository.cardbookServerCatSyncTotal[aDirPrefId] = countRequest.result; }; - countRequest.onerror = function(e) { - cardbookRepository.cardbookCatDatabase.onerror(e); - }; + countRequest.onerror = cardbookRepository.cardbookCatDatabase.onerror; const handleCategory = async category => { try { @@ -181,9 +183,7 @@ var cardbookIDBCat = { } }; - cursorRequest.onerror = function(e) { - cardbookRepository.cardbookCatDatabase.onerror(e); - }; + cursorRequest.onerror = cardbookRepository.cardbookCatDatabase.onerror; }, // when all categories were loaded from the cache diff --git a/src/chrome/content/indexedDB/cardbookIDBImage.js b/src/chrome/content/indexedDB/cardbookIDBImage.js index e03f610..e4dd22a 100644 --- a/src/chrome/content/indexedDB/cardbookIDBImage.js +++ b/src/chrome/content/indexedDB/cardbookIDBImage.js @@ -69,11 +69,13 @@ var cardbookIDBImage = { let imageFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile); imageFile.initWithPath(imageFilePath); if (imageFile.exists() && imageFile.isFile()) { - let base64 = await cardbookRepository.cardbookUtils.getImageFromURI("", "", "file://" + imageFile.path); - let filenameArray = imageFile.leafName.split("."); - let uid = filenameArray[0]; - let extension = filenameArray[filenameArray.length-1]; - cardbookIDBImage.addImage( "photo", "Migration", {cbid: name+"::"+uid, dirPrefId: name, extension: extension, content: base64}); + try { + let [ base64, extension ] = await cardbookRepository.cardbookUtils.getImageFromURI("", "", "", "file://" + imageFile.path); + let filenameArray = imageFile.leafName.split("."); + let uid = filenameArray[0]; + let extension1 = extension || filenameArray[filenameArray.length-1]; + await cardbookIDBImage.addImage( "photo", "Migration", {cbid: name+"::"+uid, dirPrefId: name, extension: extension1, content: base64}); + } catch (e) {} } } } @@ -102,7 +104,7 @@ var cardbookIDBImage = { if ('encrypted' in aImage) { aImage = await cardbookEncryptor.decryptImage(aImage); } - cardbookIDBImage.addImage(aDB, aDirPrefName, aImage); + await cardbookIDBImage.addImage(aDB, aDirPrefName, aImage); } else { if ('encrypted' in aImage) { aImage = await cardbookEncryptor.decryptImage(aImage); @@ -117,33 +119,42 @@ var cardbookIDBImage = { }, // add or override the image to the cache - addImage: async function(aDB, aDirPrefName, aImage, aCardName, aCallback, aMode) { - var storedImage = cardbookIndexedDB.encryptionEnabled ? (await cardbookEncryptor.encryptImage(aImage)) : aImage; - var db = cardbookRepository.cardbookImageDatabase.db; - var transaction = db.transaction([aDB], "readwrite"); - var store = transaction.objectStore(aDB); - var cursorRequest = store.put(storedImage); - cursorRequest.onsuccess = function(e) { - if (cardbookIndexedDB.encryptionEnabled) { - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aDirPrefName + " : debug mode : Image for " + aCardName + " written to encrypted ImageDB (" + aDB + ")"); - } else { - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aDirPrefName + " : debug mode : Image for " + aCardName + " written to ImageDB (" + aDB + ")"); - } - if (aMode) { - cardbookActions.fetchCryptoActivity(aMode); - } - if (aCallback) { - aCallback; - } - }; - - cursorRequest.onerror = function(e) { - if (aMode) { - cardbookActions.fetchCryptoActivity(aMode); - } - cardbookRepository.cardbookImageDatabase.onerror(e); - }; - }, + addImage: async function(aDB, aDirPrefName, aImage, aCardName, aMode) { + try { + var storedImage = cardbookIndexedDB.encryptionEnabled ? (await cardbookEncryptor.encryptImage(aImage)) : aImage; + let result = new Promise( function(resolve, reject) { + try { + var db = cardbookRepository.cardbookImageDatabase.db; + var transaction = db.transaction([aDB], "readwrite"); + var store = transaction.objectStore(aDB); + var cursorRequest = store.put(storedImage); + cursorRequest.onsuccess = function(e) { + if (cardbookIndexedDB.encryptionEnabled) { + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aDirPrefName + " : debug mode : Image for " + aCardName + " written to encrypted ImageDB (" + aDB + ")"); + } else { + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2(aDirPrefName + " : debug mode : Image for " + aCardName + " written to ImageDB (" + aDB + ")"); + } + if (aMode) { + cardbookActions.fetchCryptoActivity(aMode); + } + resolve(); + }; + + cursorRequest.onerror = function(e) { + if (aMode) { + cardbookActions.fetchCryptoActivity(aMode); + } + cardbookRepository.cardbookImageDatabase.onerror(e); + reject(); + }; + } catch(e) { + cardbookRepository.cardbookImageDatabase.onerror(e); + reject(); + } + }); + let dummy = await result; + } catch(e) {} + }, // delete the image removeImage: async function(aDB, aDirPrefName, aImage, aCardName) { @@ -162,7 +173,7 @@ var cardbookIDBImage = { }; cursorRequest.onerror = function(e) { reject(); - cardbookRepository.cardbookImageDatabase.onerror; + cardbookRepository.cardbookImageDatabase.onerror(e); }; }); }, @@ -179,12 +190,12 @@ var cardbookIDBImage = { let image = await cardbookIDBImage.checkImage(aDB, aDirPrefName, result, aCardName); resolve(image); } else { - reject(); + resolve(); } }; cursorRequest.onerror = function(e) { - cardbookRepository.cardbookImageDatabase.onerror; - reject(); + cardbookRepository.cardbookImageDatabase.onerror(e); + resolve(); }; }); }, @@ -198,7 +209,7 @@ var cardbookIDBImage = { imagesTransaction.objectStore(media), async image => { try { - cardbookIDBImage.addImage(media, cardbookRepository.cardbookPreferences.getName(image.dirPrefId), image, "unknown", null, "encryption"); + await cardbookIDBImage.addImage(media, cardbookRepository.cardbookPreferences.getName(image.dirPrefId), image, "unknown", "encryption"); } catch(e) { cardbookRepository.cardbookLog.updateStatusProgressInformation("debug mode : Encryption failed e : " + e, "Error"); @@ -220,7 +231,7 @@ var cardbookIDBImage = { async image => { try { image = await cardbookEncryptor.decryptImage(image); - cardbookIDBImage.addImage(media, cardbookRepository.cardbookPreferences.getName(image.dirPrefId), image, "unknown", null, "decryption"); + await cardbookIDBImage.addImage(media, cardbookRepository.cardbookPreferences.getName(image.dirPrefId), image, "unknown", "decryption"); } catch(e) { cardbookActions.fetchCryptoActivity("decryption"); @@ -243,7 +254,7 @@ var cardbookIDBImage = { async image => { try { image = await cardbookEncryptor.decryptCard(image); - cardbookIDBImage.addImage(media, cardbookRepository.cardbookPreferences.getName(image.dirPrefId), image, "unknown", null, "encryption"); + await cardbookIDBImage.addImage(media, cardbookRepository.cardbookPreferences.getName(image.dirPrefId), image, "unknown", "encryption"); } catch(e) { cardbookActions.fetchCryptoActivity("encryption"); diff --git a/src/chrome/content/indexedDB/cardbookIDBMailPop.js b/src/chrome/content/indexedDB/cardbookIDBMailPop.js index 94f6954..417ac6a 100644 --- a/src/chrome/content/indexedDB/cardbookIDBMailPop.js +++ b/src/chrome/content/indexedDB/cardbookIDBMailPop.js @@ -120,35 +120,37 @@ var cardbookIDBMailPop = { // add or override the mail popularity to the cache addMailPop: async function(aMailPop, aMode) { - if (aMailPop.count == "0") { - return - } - aMailPop.email = aMailPop.email.toLowerCase(); - aMailPop.count = parseInt(aMailPop.count); - if (!aMailPop.mailPopId) { - aMailPop.mailPopId = cardbookIDBMailPop.getMailPopId(); - } - var db = cardbookRepository.cardbookMailPopDatabase.db; - var storedMailPop = cardbookIndexedDB.encryptionEnabled ? (await cardbookEncryptor.encryptMailPop(aMailPop)) : aMailPop; - var transaction = db.transaction(["mailPop"], "readwrite"); - var store = transaction.objectStore("mailPop"); - var cursorRequest = store.put(storedMailPop); - - cursorRequest.onsuccess = function(e) { - cardbookIDBMailPop.addMailPopToIndex(aMailPop); - if (cardbookIndexedDB.encryptionEnabled) { - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : Mail popularity " + aMailPop.email + " written to encrypted MailPopDB"); - } else { - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : Mail popularity " + aMailPop.email + " written to MailPopDB"); + try { + if (aMailPop.count == "0") { + return } - if (aMode) { - cardbookActions.fetchCryptoActivity(aMode); + aMailPop.email = aMailPop.email.toLowerCase(); + aMailPop.count = parseInt(aMailPop.count); + if (!aMailPop.mailPopId) { + aMailPop.mailPopId = cardbookIDBMailPop.getMailPopId(); } - }; + var db = cardbookRepository.cardbookMailPopDatabase.db; + var storedMailPop = cardbookIndexedDB.encryptionEnabled ? (await cardbookEncryptor.encryptMailPop(aMailPop)) : aMailPop; + var transaction = db.transaction(["mailPop"], "readwrite"); + var store = transaction.objectStore("mailPop"); + var cursorRequest = store.put(storedMailPop); - cursorRequest.onerror = function(e) { + cursorRequest.onsuccess = function(e) { + cardbookIDBMailPop.addMailPopToIndex(aMailPop); + if (cardbookIndexedDB.encryptionEnabled) { + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : Mail popularity " + aMailPop.email + " written to encrypted MailPopDB"); + } else { + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : Mail popularity " + aMailPop.email + " written to MailPopDB"); + } + if (aMode) { + cardbookActions.fetchCryptoActivity(aMode); + } + }; + + cursorRequest.onerror = cardbookRepository.cardbookMailPopDatabase.onerror; + } catch(e) { cardbookRepository.cardbookMailPopDatabase.onerror(e); - }; + } }, // delete the mail popularity @@ -174,9 +176,7 @@ var cardbookIDBMailPop = { cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : Mail popularity " + aEmail + " deleted from MailPopDB"); } }; - cursorDelete.onerror = function(e) { - cardbookRepository.cardbookMailPopDatabase.onerror(e); - }; + cursorDelete.onerror = cardbookRepository.cardbookMailPopDatabase.onerror; }, // once the DB is open, this is the second step @@ -204,9 +204,7 @@ var cardbookIDBMailPop = { } }; - cursorRequest.onerror = function(e) { - cardbookRepository.cardbookMailPopDatabase.onerror(e); - }; + cursorRequest.onerror = cardbookRepository.cardbookMailPopDatabase.onerror; }, getMailPopId: function() { diff --git a/src/chrome/content/indexedDB/cardbookIDBPrefDispName.js b/src/chrome/content/indexedDB/cardbookIDBPrefDispName.js index 7874ce3..6e4a7a4 100644 --- a/src/chrome/content/indexedDB/cardbookIDBPrefDispName.js +++ b/src/chrome/content/indexedDB/cardbookIDBPrefDispName.js @@ -88,31 +88,33 @@ var cardbookIDBPrefDispName = { // add or override the prefer display name to the cache addPrefDispName: async function(aPrefDispName, aMode) { - aPrefDispName.email = aPrefDispName.email.toLowerCase(); - if (!aPrefDispName.mailPopId) { - aPrefDispName.prefDispNameId = cardbookIDBPrefDispName.getPrefDispNameId(); - } - var db = cardbookRepository.cardbookPrefDispNameDatabase.db; - var storedPrefDispName = cardbookIndexedDB.encryptionEnabled ? (await cardbookEncryptor.encryptPrefDispName(aPrefDispName)) : aPrefDispName; - var transaction = db.transaction(["prefDispName"], "readwrite"); - var store = transaction.objectStore("prefDispName"); - var cursorRequest = store.put(storedPrefDispName); - - cursorRequest.onsuccess = function(e) { - cardbookIDBPrefDispName.addPrefDispNameToIndex(aPrefDispName); - if (cardbookIndexedDB.encryptionEnabled) { - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : Prefer display name " + aPrefDispName + " written to encrypted PrefDispNameDB"); - } else { - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : Prefer display name " + aPrefDispName + " written to PrefDispNameDB"); - } - if (aMode) { - cardbookActions.fetchCryptoActivity(aMode); + try { + aPrefDispName.email = aPrefDispName.email.toLowerCase(); + if (!aPrefDispName.mailPopId) { + aPrefDispName.prefDispNameId = cardbookIDBPrefDispName.getPrefDispNameId(); } - }; + var db = cardbookRepository.cardbookPrefDispNameDatabase.db; + var storedPrefDispName = cardbookIndexedDB.encryptionEnabled ? (await cardbookEncryptor.encryptPrefDispName(aPrefDispName)) : aPrefDispName; + var transaction = db.transaction(["prefDispName"], "readwrite"); + var store = transaction.objectStore("prefDispName"); + var cursorRequest = store.put(storedPrefDispName); + + cursorRequest.onsuccess = function(e) { + cardbookIDBPrefDispName.addPrefDispNameToIndex(aPrefDispName); + if (cardbookIndexedDB.encryptionEnabled) { + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : Prefer display name " + aPrefDispName + " written to encrypted PrefDispNameDB"); + } else { + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : Prefer display name " + aPrefDispName + " written to PrefDispNameDB"); + } + if (aMode) { + cardbookActions.fetchCryptoActivity(aMode); + } + }; - cursorRequest.onerror = function(e) { + cursorRequest.onerror = cardbookRepository.cardbookPrefDispNameDatabase.onerror; + } catch(e) { cardbookRepository.cardbookPrefDispNameDatabase.onerror(e); - }; + } }, // delete the prefer display name @@ -142,9 +144,7 @@ var cardbookIDBPrefDispName = { cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : Prefer display name " + aEmail + " deleted from PrefDispNameDB"); } }; - cursorDelete.onerror = function(e) { - cardbookRepository.cardbookPrefDispNameDatabase.onerror(e); - }; + cursorDelete.onerror = cardbookRepository.cardbookPrefDispNameDatabase.onerror; }, // once the DB is open, this is the second step @@ -176,9 +176,7 @@ var cardbookIDBPrefDispName = { } }; - cursorRequest.onerror = function(e) { - cardbookRepository.cardbookPrefDispNameDatabase.onerror(e); - }; + cursorRequest.onerror = cardbookRepository.cardbookPrefDispNameDatabase.onerror; }, getPrefDispNameId: function() { diff --git a/src/chrome/content/indexedDB/cardbookIDBSearch.js b/src/chrome/content/indexedDB/cardbookIDBSearch.js index 3c72a60..40ceaa1 100644 --- a/src/chrome/content/indexedDB/cardbookIDBSearch.js +++ b/src/chrome/content/indexedDB/cardbookIDBSearch.js @@ -92,18 +92,20 @@ var cardbookIDBSearch = { // add or override the search to the cache addSearch: function(aSearch) { - var db = cardbookRepository.cardbookSearchDatabase.db; - var transaction = db.transaction(["search"], "readwrite"); - var store = transaction.objectStore("search"); - var cursorRequest = store.put(aSearch); + try { + var db = cardbookRepository.cardbookSearchDatabase.db; + var transaction = db.transaction(["search"], "readwrite"); + var store = transaction.objectStore("search"); + var cursorRequest = store.put(aSearch); - cursorRequest.onsuccess = function(e) { - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : Search " + aSearch.dirPrefId + " written to searchDB"); - }; + cursorRequest.onsuccess = function(e) { + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : Search " + aSearch.dirPrefId + " written to searchDB"); + }; - cursorRequest.onerror = function(e) { + cursorRequest.onerror = cardbookRepository.cardbookSearchDatabase.onerror; + } catch(e) { cardbookRepository.cardbookSearchDatabase.onerror(e); - }; + } }, // delete the search @@ -117,9 +119,7 @@ var cardbookIDBSearch = { cursorDelete.onsuccess = async function(e) { cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : Search " + aDirPrefId + " deleted from searchDB"); }; - cursorDelete.onerror = function(e) { - cardbookRepository.cardbookSearchDatabase.onerror(e); - }; + cursorDelete.onerror = cardbookRepository.cardbookSearchDatabase.onerror; }, // once the DB is open, this is the second step @@ -149,9 +149,7 @@ var cardbookIDBSearch = { } }; - cursorRequest.onerror = function(e) { - cardbookRepository.cardbookSearchDatabase.onerror(e); - }; + cursorRequest.onerror = cardbookRepository.cardbookSearchDatabase.onerror; transaction.oncomplete = function() { aCallBack(aDirPrefId); diff --git a/src/chrome/content/indexedDB/cardbookIDBUndo.js b/src/chrome/content/indexedDB/cardbookIDBUndo.js index f22da9b..fae0fb5 100644 --- a/src/chrome/content/indexedDB/cardbookIDBUndo.js +++ b/src/chrome/content/indexedDB/cardbookIDBUndo.js @@ -32,9 +32,7 @@ var cardbookIDBUndo = { cardbookRepository.cardbookUtils.notifyObservers("undoDBOpen"); }; - request.onerror = function(e) { - cardbookRepository.cardbookActionsDatabase.onerror(e); - }; + request.onerror = cardbookRepository.cardbookActionsDatabase.onerror; }, // check if the card is in a wrong encryption state @@ -92,58 +90,63 @@ var cardbookIDBUndo = { } else { var keyRange = IDBKeyRange.lowerBound(aUndoId); } - var cursorDeleteRequest = store.delete(keyRange); - cursorDeleteRequest.onsuccess = function(e) { - if (cardbookIndexedDB.encryptionEnabled) { - if (aExactId) { - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : undo " + aUndoId + " deleted from encrypted undoDB"); - } else { - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : undos more than " + aUndoId + " deleted from encrypted undoDB"); - } - } else { - if (aExactId) { - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : undo " + aUndoId + " deleted from undoDB"); - } else { - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : undos more than " + aUndoId + " deleted from undoDB"); - } - } - - var cursorAddRequest = store.put(storedItem); - cursorAddRequest.onsuccess = function(e) { - cardbookRepository.currentUndoId = aUndoId; - cardbookActions.saveCurrentUndoId(); + try { + var cursorDeleteRequest = store.delete(keyRange); + cursorDeleteRequest.onsuccess = function(e) { if (cardbookIndexedDB.encryptionEnabled) { - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : undo " + aUndoId + " written to encrypted undoDB"); + if (aExactId) { + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : undo " + aUndoId + " deleted from encrypted undoDB"); + } else { + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : undos more than " + aUndoId + " deleted from encrypted undoDB"); + } } else { - cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : undo " + aUndoId + " written to undoDB"); + if (aExactId) { + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : undo " + aUndoId + " deleted from undoDB"); + } else { + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : undos more than " + aUndoId + " deleted from undoDB"); + } } - var maxUndoChanges = cardbookRepository.cardbookPreferences.getStringPref("extensions.cardbook.maxUndoChanges"); - var undoIdToDelete = aUndoId - maxUndoChanges; - if (undoIdToDelete > 0) { - cardbookIDBUndo.removeUndoItem(undoIdToDelete); + try { + var cursorAddRequest = store.put(storedItem); + cursorAddRequest.onsuccess = function(e) { + cardbookRepository.currentUndoId = aUndoId; + cardbookActions.saveCurrentUndoId(); + if (cardbookIndexedDB.encryptionEnabled) { + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : undo " + aUndoId + " written to encrypted undoDB"); + } else { + cardbookRepository.cardbookLog.updateStatusProgressInformationWithDebug2("debug mode : undo " + aUndoId + " written to undoDB"); + } + var maxUndoChanges = cardbookRepository.cardbookPreferences.getStringPref("extensions.cardbook.maxUndoChanges"); + var undoIdToDelete = aUndoId - maxUndoChanges; + if (undoIdToDelete > 0) { + cardbookIDBUndo.removeUndoItem(undoIdToDelete); + } + if (aMode) { + cardbookActions.fetchCryptoActivity(aMode); + } + resolve(); + }; + + cursorAddRequest.onerror = function(e) { + if (aMode) { + cardbookActions.fetchCryptoActivity(aMode); + } + cardbookRepository.cardbookActionsDatabase.onerror(e); + }; + } catch(e) { + cardbookRepository.cardbookActionsDatabase.onerror(e); } - if (aMode) { - cardbookActions.fetchCryptoActivity(aMode); - } - resolve(); }; - - cursorAddRequest.onerror = function(e) { + + cursorDeleteRequest.onerror = function(e) { if (aMode) { cardbookActions.fetchCryptoActivity(aMode); } cardbookRepository.cardbookActionsDatabase.onerror(e); - reject(); }; - }; - - cursorDeleteRequest.onerror = function(e) { - if (aMode) { - cardbookActions.fetchCryptoActivity(aMode); - } + } catch(e) { cardbookRepository.cardbookActionsDatabase.onerror(e); - reject(); - }; + } }); }, @@ -187,7 +190,7 @@ var cardbookIDBUndo = { cursorRequest.onsuccess = async function(e) { var result = e.target.result; if (result && result.length != 0) { - for (var item of result) { + for (let item of result) { handleItem(item); } } else { @@ -199,9 +202,7 @@ var cardbookIDBUndo = { } }; - cursorRequest.onerror = function(e) { - cardbookRepository.cardbookActionsDatabase.onerror(e); - }; + cursorRequest.onerror = cardbookRepository.cardbookActionsDatabase.onerror; }, // do the undo action @@ -290,9 +291,7 @@ var cardbookIDBUndo = { } }; - cursorRequest.onerror = function(e) { - cardbookRepository.cardbookActionsDatabase.onerror(e); - }; + cursorRequest.onerror = cardbookRepository.cardbookActionsDatabase.onerror; }, // do the redo action @@ -379,9 +378,7 @@ var cardbookIDBUndo = { } }; - cursorRequest.onerror = function(e) { - cardbookRepository.cardbookActionsDatabase.onerror(e); - }; + cursorRequest.onerror = cardbookRepository.cardbookActionsDatabase.onerror; }, encryptUndos: async function() { diff --git a/src/chrome/content/indexedDB/cardbookIndexedDB.js b/src/chrome/content/indexedDB/cardbookIndexedDB.js index 5627757..6722ffd 100644 --- a/src/chrome/content/indexedDB/cardbookIndexedDB.js +++ b/src/chrome/content/indexedDB/cardbookIndexedDB.js @@ -23,9 +23,7 @@ var cardbookIndexedDB = { } }; - cursorRequest.onerror = function(e) { - cardbookRepository.cardbookDatabase.onerror(e); - }; + cursorRequest.onerror = cardbookRepository.cardbookDatabase.onerror; // categories var db = cardbookRepository.cardbookCatDatabase.db; @@ -42,9 +40,7 @@ var cardbookIndexedDB = { } }; - cursorRequest.onerror = function(e) { - cardbookRepository.cardbookCatDatabase.onerror(e); - }; + cursorRequest.onerror = cardbookRepository.cardbookCatDatabase.onerror; // images for (let media of cardbookRepository.allColumns.media) { @@ -62,9 +58,7 @@ var cardbookIndexedDB = { } }; - cursorRequest.onerror = function(e) { - cardbookRepository.cardbookCatDatabase.onerror(e); - }; + cursorRequest.onerror = cardbookRepository.cardbookImageDatabase.onerror; } }, diff --git a/src/chrome/content/mailContact/ovl_cardbookMailContacts.js b/src/chrome/content/mailContact/ovl_cardbookMailContacts.js index 475f99d..8307acf 100644 --- a/src/chrome/content/mailContact/ovl_cardbookMailContacts.js +++ b/src/chrome/content/mailContact/ovl_cardbookMailContacts.js @@ -43,7 +43,7 @@ if ("undefined" == typeof(ovl_cardbookMailContacts)) { myNewCard.email.push([[aEmailAddress], [], "", []]); myNewCard.fn = aDisplayName; if (myNewCard.fn == "") { - myNewCard.fn = myEmail.substr(0, aEmailAddress.indexOf("@")).replace("."," ").replace("_"," "); + myNewCard.fn = aEmailAddress.substr(0, aEmailAddress.indexOf("@")).replace("."," ").replace("_"," "); } let myDisplayNameArray = myNewCard.fn.split(" "); if (myDisplayNameArray.length > 1) { @@ -99,7 +99,7 @@ if ("undefined" == typeof(ovl_cardbookMailContacts)) { document.getElementById("viewContactItem").setAttribute("hidden", true); document.getElementById("editCardBookSeparator").setAttribute("hidden", true); } else { - document.getElementById("editCardBookSeparator").setAttribute("hidden", false); + document.getElementById("editCardBookSeparator").removeAttribute("hidden"); } }, @@ -157,6 +157,53 @@ if ("undefined" == typeof(ovl_cardbookMailContacts)) { }; })(); +(function() { + // Keep a reference to the original function. + ovl_cardbookMailContacts.origFunctions._updateAvatar = customElements.get("header-recipient").prototype._updateAvatar; + + // Override a function. + // _updateAvatar + customElements.get("header-recipient").prototype._updateAvatar = async function() { + this.avatar.replaceChildren(); + + if (!this.cardDetails.card) { + this._createAvatarPlaceholder(); + return; + } + + // We have a card, so let's try to fetch the image. + let card = this.cardDetails.card; + if (card.cbid) { + let image = await cardbookIDBImage.getImage("photo", "", card.cbid, card.fn); + if (image && image.content && image.extension) { + let file = Services.dirsvc.get("ProfD", Components.interfaces.nsIFile); + file.append("Photos"); + file.append(card.uid + "." + image.extension); + await cardbookRepository.cardbookUtils.writeContentToFile(file.path, atob(image.content), "NOUTF8"); + var photoURL = Services.io.newFileURI(file).spec; + } else { + return + } + } else { + var photoURL = card.photoURL; + } + if (photoURL) { + let img = document.createElement("img"); + document.l10n.setAttributes(img, "message-header-recipient-avatar", { + address: this.emailAddress, + }); + // TODO: We should fetch a dynamically generated smaller version of the + // uploaded picture to avoid loading large images that will only be used + // in smaller format. + img.src = photoURL; + this.avatar.appendChild(img); + this.avatar.classList.add("has-avatar"); + } else { + this._createAvatarPlaceholder(); + } + }; +})(); + (function() { // Keep a reference to the original function. @@ -166,11 +213,10 @@ if ("undefined" == typeof(ovl_cardbookMailContacts)) { // gMessageHeader.openEmailAddressPopup gMessageHeader.openEmailAddressPopup = function() { // Execute original function. - var rv = ovl_cardbookMailContacts.origFunctions.openEmailAddressPopup.apply(null, arguments); + let rv = ovl_cardbookMailContacts.origFunctions.openEmailAddressPopup.apply(null, arguments); // Execute some action afterwards. - var exclusive = cardbookRepository.cardbookPreferences.getBoolPref("extensions.cardbook.exclusive"); - ovl_cardbookMailContacts.hideOldAddressbook(exclusive); + let exclusive = cardbookRepository.cardbookPreferences.getBoolPref("extensions.cardbook.exclusive"); if (arguments[1].cardDetails.card && arguments[1].cardDetails.card.cbid) { ovl_cardbookMailContacts.hideOrShowNewAddressbook(true); @@ -197,6 +243,7 @@ if ("undefined" == typeof(ovl_cardbookMailContacts)) { ovl_cardbookMailContacts.hideOrShowNewAddressbook(false); cardbookWindowUtils.addCardToIMPPMenuSubMenu(null, 'IMPPCardsMenuPopup'); } + ovl_cardbookMailContacts.hideOldAddressbook(exclusive); if (document.documentElement.getAttribute("windowtype") == "mail:messageWindow") { document.getElementById('findEmailsFromEmailMessenger').setAttribute('hidden', 'true'); diff --git a/src/chrome/content/mergeCards/wdw_mergeCards.js b/src/chrome/content/mergeCards/wdw_mergeCards.js index 5de09ba..defa675 100644 --- a/src/chrome/content/mergeCards/wdw_mergeCards.js +++ b/src/chrome/content/mergeCards/wdw_mergeCards.js @@ -348,7 +348,9 @@ if ("undefined" == typeof(wdw_mergeCards)) { let dirname = cardbookRepository.cardbookPreferences.getName(card.dirPrefId); await cardbookIDBImage.getImage(aField, dirname, card.cbid, card.fn) .then( image => { - result = true; + if (image && image.content && image.extension) { + result = true; + } }) .catch( () => { } ); } @@ -381,9 +383,14 @@ if ("undefined" == typeof(wdw_mergeCards)) { } else { await cardbookIDBImage.getImage(i, dirname, listOfCards[j].cbid, listOfCards[j].fn) .then( image => { - wdw_mergeCards.createCheckBox1(aRow, i + 'Checkbox' + j, selected); - wdw_mergeCards.createImageBox(aRow, i + 'Textbox' + j, image.content, image.extension, selected, false); - selected = false; + if (image && image.content && image.extension) { + wdw_mergeCards.createCheckBox1(aRow, i + 'Checkbox' + j, selected); + wdw_mergeCards.createImageBox(aRow, i + 'Textbox' + j, image.content, image.extension, selected, false); + selected = false; + } else { + wdw_mergeCards.createHbox(aRow, true); + wdw_mergeCards.createHbox(aRow, true); + } }).catch( () => { wdw_mergeCards.createHbox(aRow, true); wdw_mergeCards.createHbox(aRow, true); diff --git a/src/chrome/content/migrate/cardbookMigrate.jsm b/src/chrome/content/migrate/cardbookMigrate.jsm index 4545e8c..4d11670 100644 --- a/src/chrome/content/migrate/cardbookMigrate.jsm +++ b/src/chrome/content/migrate/cardbookMigrate.jsm @@ -1,6 +1,7 @@ var { MailServices } = ChromeUtils.import("resource:///modules/MailServices.jsm"); var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); var { cardbookRepository } = ChromeUtils.import("chrome://cardbook/content/cardbookRepository.js"); +var { VCardUtils } = ChromeUtils.import("resource:///modules/VCardUtils.jsm"); try { // import categories @@ -16,98 +17,28 @@ var cardbookMigrate = { translateStandardCards: async function (aDirPrefIdTarget, aDirPrefIdTargetName, aABCard, aVersion, aDateFormat) { try { - var myCard = new cardbookCardParser(); - myCard.dirPrefId = aDirPrefIdTarget; - myCard.version = aVersion; - var myMap = [ ["FirstName", "firstname"], ["LastName", "lastname"], ["DisplayName", "fn"], ["NickName", "nickname"], ["JobTitle", "title"], ["Notes", "note"] ]; - for (let i = 0; i < myMap.length; i++) { - var myMapData = aABCard.getProperty(myMap[i][0],""); - myCard[myMap[i][1]] = myMapData; - } - let listOfChangedFields = [ ["Custom1", "X-CUSTOM1"], ["Custom2", "X-CUSTOM2"], ["Custom3", "X-CUSTOM3"], ["Custom4", "X-CUSTOM4"], - ["PhoneticFirstName", "X-PHONETIC-FIRST-NAME"], ["PhoneticLastName", "X-PHONETIC-LAST-NAME"] ]; - for (let i = 0; i < listOfChangedFields.length; i++) { - let myField = listOfChangedFields[i][0]; - let myNewField = listOfChangedFields[i][1]; - var myMapData = aABCard.getProperty(myField ,""); - if (myMapData != "") { - myCard.others.push(myNewField + ":" + myMapData); - if (!cardbookRepository.possibleCustomFields[myNewField].add && !cardbookRepository.possibleCustomFields[myNewField].added) { - cardbookRepository.possibleCustomFields[myNewField].add = true; - } - } - } - - var myDep = aABCard.getProperty("Department",""); - var myOrg = aABCard.getProperty("Company",""); - if (myDep != "") { - if (myOrg != "") { - myCard.org = myDep + " - " + myOrg; - } else { - myCard.org = myDep; - } - } else { - if (myOrg != "") { - myCard.org = myOrg; - } + let vCard = aABCard.getProperty("_vCard", ""); + if (!vCard) { + return } + let myCard = new cardbookCardParser(vCard, "", "", aDirPrefIdTarget); + myCard.dirPrefId = aDirPrefIdTarget; - var myListMap = [ ["PrimaryEmail", ["TYPE=PREF" , "TYPE=HOME"] , "email"], ["SecondEmail", ["TYPE=HOME"], "email"], ["WorkPhone", ["TYPE=WORK"], "tel"], ["HomePhone", ["TYPE=HOME"], "tel"], - ["FaxNumber", ["TYPE=FAX"], "tel"], ["PagerNumber", ["TYPE=PAGER"], "tel"], ["CellularNumber", ["TYPE=CELL"], "tel"], ["WebPage1", ["TYPE=WORK"], "url"], - ["WebPage2", ["TYPE=HOME"], "url"] ]; - for (var i = 0; i < myListMap.length; i++) { - var myMapData = aABCard.getProperty(myListMap[i][0],""); - var myPreferDisplayName = aABCard.getProperty("PreferDisplayName","1"); - if (myMapData != "") { - myCard[myListMap[i][2]].push([[myMapData], myListMap[i][1], "", []]); - if (myListMap[i][2] == "email" && myPreferDisplayName == "0") { - cardbookIDBPrefDispName.addPrefDispName({email: myMapData}); - } - } - } - - var myAdrMap = [ [ [ ["HomeAddress", "HomeAddress2"], "HomeCity", "HomeState", "HomeZipCode", "HomeCountry"], ["TYPE=HOME"] ], - [ [ ["WorkAddress", "WorkAddress2"], "WorkCity", "WorkState", "WorkZipCode", "WorkCountry"], ["TYPE=WORK"] ] ]; - for (var i = 0; i < myAdrMap.length; i++) { - var lString = ""; - var myAdr = ["", ""]; - for (var j = 0; j < myAdrMap[i][0][0].length; j++) { - var myProp = aABCard.getProperty(myAdrMap[i][0][0][j],""); - if (myProp != "") { - if (lString != "") { - lString = lString + "\n" + myProp; - } else { - lString = myProp; - } + let photoName = aABCard.getProperty("PhotoName", ""); + let file = Services.dirsvc.get("ProfD", Components.interfaces.nsIFile); + file.append("Photos"); + file.append(photoName); + if (file.exists()) { + let photoURI = Services.io.newFileURI(file).spec; + try { + let [ base64, extension ] = await cardbookRepository.cardbookUtils.getImageFromURI(myCard.dirPrefId, myCard.fn, "import standard AB", photoURI); + if (base64) { + myCard.photo.value = base64; + myCard.photo.extension = extension || cardbookRepository.cardbookUtils.getFileExtension(photoURI); } - } - myAdr.push(lString); - for (var j = 1; j < myAdrMap[i][0].length; j++) { - myAdr.push(aABCard.getProperty(myAdrMap[i][0][j],"")); - } - if (cardbookRepository.cardbookUtils.notNull(myAdr, "") != "") { - myCard.adr.push([myAdr, myAdrMap[i][1], "", []]); - } + } catch (e) {} } - var day = aABCard.getProperty("BirthDay", ""); - var month = aABCard.getProperty("BirthMonth", ""); - var year = aABCard.getProperty("BirthYear", ""); - if (day != "" || month != "" || year != "" ) { - myCard.bday = cardbookRepository.cardbookDates.convertDateStringToDateString(day, month, year, aDateFormat) - } - - var photoURI = aABCard.getProperty("PhotoURI", ""); - var photoType = aABCard.getProperty("PhotoType", ""); - if (photoType == "file" || photoType == "web") { - let base64 = await cardbookRepository.cardbookUtils.getImageFromURI(myCard.fn, "import standard AB", photoURI); - if (base64) { - myCard.photo.value = base64; - myCard.photo.extension = cardbookRepository.cardbookUtils.getFileExtension(photoURI); - } - } - cardbookMigrate.getNotNullFn(myCard, aABCard); - // import categories try { let catsArray = []; @@ -121,16 +52,20 @@ var cardbookMigrate = { myCard.categories = JSON.parse(JSON.stringify(finalcatArray)); } catch (e) {} - var PreferMailFormat = aABCard.getProperty("PreferMailFormat", ""); - if (PreferMailFormat == "1") { - myCard.others.push(cardbookRepository.defaultEmailFormat + ":FALSE"); - } else if (PreferMailFormat == "2") { - myCard.others.push(cardbookRepository.defaultEmailFormat + ":TRUE"); - } await cardbookRepository.saveCardFromUpdate({}, myCard, "", true); - var email = aABCard.getProperty("PrimaryEmail", "").toLowerCase(); - var emailValue = parseInt(aABCard.getProperty("PopularityIndex", "0")); + let preferDisplayName = aABCard.getProperty("PreferDisplayName", ""); + for (let emailLine of myCard.email) { + let email = emailLine[0][0]; + if (preferDisplayName == "1") { + cardbookIDBPrefDispName.removePrefDispName(email); + } else { + cardbookIDBPrefDispName.addPrefDispName({email: email}); + } + } + + let email = aABCard.getProperty("PrimaryEmail", "").toLowerCase(); + let emailValue = parseInt(aABCard.getProperty("PopularityIndex", "0")); if (email != "" && emailValue != "0" && emailValue != " ") { cardbookRepository.addMailPop(email, emailValue); } diff --git a/src/chrome/content/observers/cardBookWindowObserver.js b/src/chrome/content/observers/cardBookWindowObserver.js index 38bf3f9..d414966 100644 --- a/src/chrome/content/observers/cardBookWindowObserver.js +++ b/src/chrome/content/observers/cardBookWindowObserver.js @@ -60,6 +60,8 @@ var cardBookWindowObserver = { case "cardbook.syncFisnished": wdw_cardbook.setSearchRemoteHboxOnSyncFinished(aData); case "cardbook.syncRunning": + wdw_cardbook.refreshWindow(aData); + break; case "cardbook.cardCreated": case "cardbook.cardEdited": case "cardbook.cardModified": @@ -89,7 +91,7 @@ var cardBookWindowObserver = { case "cardbook.nodeDeleted": case "cardbook.nodeRenamed": case "cardbook.cardsFormatted": - wdw_cardbook.refreshWindow(aData); + wdw_cardbook.refreshWindow(aData||":::forceCard"); break; } } diff --git a/src/chrome/content/ovl_cardbook.js b/src/chrome/content/ovl_cardbook.js index 802066f..fd50b54 100644 --- a/src/chrome/content/ovl_cardbook.js +++ b/src/chrome/content/ovl_cardbook.js @@ -284,6 +284,7 @@ var ovl_cardbook = { // functions customElements.get("header-recipient").prototype.addToAddressBook = ovl_cardbookMailContacts.origFunctions.addToAddressBook; + customElements.get("header-recipient").prototype._updateAvatar = ovl_cardbookMailContacts.origFunctions._updateAvatar; gMessageHeader.openEmailAddressPopup = ovl_cardbookMailContacts.origFunctions.openEmailAddressPopup; gMessageHeader.showContactEdit = ovl_cardbookMailContacts.origFunctions.showContactEdit; gMessageHeader.editContact = ovl_cardbookMailContacts.origFunctions.editContact; diff --git a/src/chrome/content/scripts/unload.js b/src/chrome/content/scripts/unload.js index 0f57972..dc360e0 100644 --- a/src/chrome/content/scripts/unload.js +++ b/src/chrome/content/scripts/unload.js @@ -1,3 +1,12 @@ +var { cardbookRepository } = ChromeUtils.import("chrome://cardbook/content/cardbookRepository.js"); +cardbookRepository.cardbookCatDatabase.db.close(); +cardbookRepository.cardbookDatabase.db.close(); +cardbookRepository.cardbookActionsDatabase.db.close(); +cardbookRepository.cardbookMailPopDatabase.db.close(); +cardbookRepository.cardbookPrefDispNameDatabase.db.close(); +cardbookRepository.cardbookSearchDatabase.db.close(); +cardbookRepository.cardbookImageDatabase.db.close(); + let JSMs = [ "chrome://cardbook/content/addressbooksconfiguration/wdw_addressbooksAdd.js", "chrome://cardbook/content/addressbooksconfiguration/wdw_addressbooksEdit.js", diff --git a/src/chrome/content/skin/cardbookLittleIcons.css b/src/chrome/content/skin/cardbookLittleIcons.css new file mode 100644 index 0000000..9582cd9 --- /dev/null +++ b/src/chrome/content/skin/cardbookLittleIcons.css @@ -0,0 +1,35 @@ +.cardbookAdd { + list-style-image: url("chrome://cardbook/content/skin/small-icons/add.svg"); + -moz-context-properties: fill; + fill: currentColor; +} +.cardbookDelete { + list-style-image: url("chrome://cardbook/content/skin/small-icons/delete.svg"); + -moz-context-properties: fill; + fill: currentColor; +} +.cardbookUp { + list-style-image: url("chrome://cardbook/content/skin/small-icons/arrow-up.svg"); + -moz-context-properties: fill; + fill: currentColor; +} +.cardbookDown { + list-style-image: url("chrome://cardbook/content/skin/small-icons/arrow-down.svg"); + -moz-context-properties: fill; + fill: currentColor; +} +.cardbookLink { + list-style-image: url("chrome://cardbook/content/skin/small-icons/link.svg"); + -moz-context-properties: fill; + fill: currentColor; +} +.cardbookValidated { + list-style-image: url("chrome://cardbook/content/skin/small-icons/validated.svg"); + -moz-context-properties: fill; + fill: currentColor; +} +.cardbookNotValidated { + list-style-image: url("chrome://cardbook/content/skin/small-icons/notvalidated.svg"); + -moz-context-properties: fill; + fill: currentColor; +} diff --git a/src/chrome/content/skin/cardbookMain.css b/src/chrome/content/skin/cardbookMain.css index cfa1edb..81b0ebe 100644 --- a/src/chrome/content/skin/cardbookMain.css +++ b/src/chrome/content/skin/cardbookMain.css @@ -191,44 +191,6 @@ treecol#cardIcon.cardIconHeader .treecol-sortdirection { width: 60%; } -.cardbookAdd { - list-style-image: url("chrome://cardbook/content/skin/small-icons/add.svg"); - -moz-context-properties: fill; - fill: currentColor; -} -.cardbookDelete { - list-style-image: url("chrome://cardbook/content/skin/small-icons/delete.svg"); - -moz-context-properties: fill; - fill: currentColor; -} -.cardbookUp { - list-style-image: url("chrome://cardbook/content/skin/small-icons/arrow-up.svg"); - -moz-context-properties: fill; - fill: currentColor; -} -.cardbookDown { - list-style-image: url("chrome://cardbook/content/skin/small-icons/arrow-down.svg"); - -moz-context-properties: fill; - fill: currentColor; -} -.cardbookLink { - list-style-image: url("chrome://cardbook/content/skin/small-icons/link.svg"); - -moz-context-properties: fill; - fill: currentColor; -} -.cardbookValidated { - list-style-image: url("chrome://cardbook/content/skin/small-icons/validated.svg"); - -moz-context-properties: fill; - fill: currentColor; -} -.cardbookNotValidated { - list-style-image: url("chrome://cardbook/content/skin/small-icons/notvalidated.svg"); - -moz-context-properties: fill; - fill: currentColor; -} - - - .box { display: flex; } diff --git a/src/chrome/content/wdw_bulkOperation.js b/src/chrome/content/wdw_bulkOperation.js index 196d914..03279ec 100644 --- a/src/chrome/content/wdw_bulkOperation.js +++ b/src/chrome/content/wdw_bulkOperation.js @@ -5,8 +5,6 @@ if ("undefined" == typeof(wdw_logEdition)) { var wdw_bulkOperation = { lTimerBulkOperation: {}, - numberOfLoop: 0, - maxNumberOfLoop: 2, load: function () { i18n.updateDocument({ extension: cardbookRepository.extension }); @@ -17,29 +15,38 @@ if ("undefined" == typeof(wdw_logEdition)) { wdw_bulkOperation.lTimerBulkOperation[1] = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer); var lTimerBulkOperation = wdw_bulkOperation.lTimerBulkOperation[1]; lTimerBulkOperation.initWithCallback({ notify: function(lTimerBulkOperation) { - let close = true; + let count = 0; + let table = document.getElementById("bulkOperationTable"); for (let actionId in cardbookRepository.currentAction) { - let total = cardbookRepository.currentAction[actionId].totalCards; - let done = cardbookRepository.currentAction[actionId].doneCards; - let message = cardbookRepository.currentAction[actionId].message; - // console.log("test : " + message + " : " + done + " / " + total) - if (total != done) { + try { + let totalEstimatedCards = cardbookRepository.currentAction[actionId].totalEstimatedCards; + let total = cardbookRepository.currentAction[actionId].totalCards; + let done = cardbookRepository.currentAction[actionId].doneCards; + let message = cardbookRepository.currentAction[actionId].message; + // console.log("test : " + message + " : " + done + " / " + total) if (!(document.getElementById("bulkProgressmeter_" + actionId))) { - let currentRow = cardbookElementTools.addHTMLTR(document.getElementById("bulkOperationTable"), 'bulkOperationRow_' + actionId); + let currentRow = cardbookElementTools.addHTMLTR(table, 'bulkOperationRow_' + actionId); let labelData = cardbookElementTools.addHTMLTD(currentRow, 'bulkOperationRowLabel_' + actionId + '.1'); cardbookElementTools.addLabel(labelData, 'bulkOperationRowLabel_' + actionId, message, 'bulkOperationProgressmeter_' + actionId); let progressmeterData = cardbookElementTools.addHTMLTD(currentRow, 'bulkOperationRowLabel_' + actionId + '.2'); cardbookElementTools.addHTMLPROGRESS(progressmeterData, "bulkProgressmeter_" + actionId); } - let totalEstimated = cardbookRepository.currentAction[actionId].totalEstimatedCards || total; + let totalEstimated = totalEstimatedCards || total; let value = Math.round(done / totalEstimated * 100); document.getElementById("bulkProgressmeter_" + actionId).value = value; - close = false; - wdw_bulkOperation.numberOfLoop = 0; + } catch(e) {} + } + // delete finished + let rows = table.querySelectorAll("tr"); + for (let row of rows) { + let actionId = row.id.replace('bulkOperationRow_', ''); + if (cardbookRepository.currentAction[actionId] && cardbookRepository.currentAction[actionId].doneCards) { + count++ + } else { + table.removeChild(row); } } - wdw_bulkOperation.numberOfLoop++; - if (close && wdw_bulkOperation.numberOfLoop == wdw_bulkOperation.maxNumberOfLoop) { + if (!count) { wdw_bulkOperation.cancel(); } } diff --git a/src/chrome/content/wdw_cardbook.js b/src/chrome/content/wdw_cardbook.js index fc1464a..8333108 100644 --- a/src/chrome/content/wdw_cardbook.js +++ b/src/chrome/content/wdw_cardbook.js @@ -20,7 +20,8 @@ if ("undefined" == typeof(wdw_cardbook)) { cutAndPaste : "", cardbookrefresh : false, writeButtonFired : false, - displayCardId: "N", + displayCardDetail: false, + displayCardEtag: 0, setAppMenu: function (remove) { if (document.getElementById('cardbookToolbarThMenuButton')) { @@ -268,22 +269,23 @@ if ("undefined" == typeof(wdw_cardbook)) { displayCard: async function (aCard) { try { - if (wdw_cardbook.displayCardId == "Y") { + if (wdw_cardbook.displayCardDetail == true) { return; } - wdw_cardbook.displayCardId = "Y"; + wdw_cardbook.displayCardDetail = true; wdw_cardbook.clearCard(); await cardbookWindowUtils.displayCard(aCard, true); let panesView = cardbookRepository.cardbookPreferences.getStringPref("extensions.cardbook.panesView"); let aParent = document.getElementById('categories' + panesView + 'Row'); cardbookElementTools.addCategoriesRow(aParent, cardbookRepository.cardbookUtils.sortArrayByString(aCard.categories,1)); - document.getElementById('vcardTextBox').value = await cardbookRepository.cardbookUtils.cardToVcardData(aCard, false); + document.getElementById('vcardTextBox').value = await cardbookRepository.cardbookUtils.cardToVcardData(aCard); document.getElementById('vcardTextBox').setAttribute('readonly', 'true'); cardbookWindowUtils.adjustFields(); - wdw_cardbook.displayCardId = "N"; + wdw_cardbook.displayCardDetail = false; + wdw_cardbook.displayCardEtag = aCard.etag; } catch (e) { - wdw_cardbook.displayCardId = "N"; + wdw_cardbook.displayCardDetail = false; } }, @@ -327,7 +329,6 @@ if ("undefined" == typeof(wdw_cardbook)) { return; } if (cardbookRepository.cardbookSearchMode === "SEARCH") { - await wdw_cardbook.startSearch(aListOfCards); return; } @@ -363,7 +364,7 @@ if ("undefined" == typeof(wdw_cardbook)) { cardbookWindowUtils.setSelectedCards(aListOfCards, myTree.getFirstVisibleRow(), myTree.getLastVisibleRow()); if (aListOfCards.length == 1) { if (cardbookRepository.cardbookCards[aListOfCards[0].cbid]) { - await wdw_cardbook.displayCard(aListOfCards[0]); + await wdw_cardbook.displayCard(cardbookRepository.cardbookCards[aListOfCards[0].cbid]); } } } @@ -754,6 +755,8 @@ if ("undefined" == typeof(wdw_cardbook)) { wdw_cardbook.exportCardsToFile(listOfSelectedCard, defaultFileName); } else if (aMenu.id == "cardbookAccountMenuExportToDir" || aMenu.id == "exportCardsToDirFromAccountsOrCats") { wdw_cardbook.exportCardsToDir(listOfSelectedCard); + } else if (aMenu.id == "cardbookAccountMenuExportImages" || aMenu.id == "exportCardsImagesFromAccountsOrCats") { + wdw_cardbook.exportCardsImages(listOfSelectedCard); } } catch (e) { @@ -775,6 +778,8 @@ if ("undefined" == typeof(wdw_cardbook)) { wdw_cardbook.exportCardsToFile(listOfSelectedCard, defaultFileName); } else if (aMenu.id == "exportCardsToDirFromCards" || aMenu.id == "cardbookContactsMenuExportCardsToDir") { wdw_cardbook.exportCardsToDir(listOfSelectedCard); + } else if (aMenu.id == "exportCardsImagesFromCards" || aMenu.id == "cardbookContactsMenuExportCardsImages") { + wdw_cardbook.exportCardsImages(listOfSelectedCard); } } @@ -813,7 +818,7 @@ if ("undefined" == typeof(wdw_cardbook)) { let myWindow = Services.wm.getMostRecentWindow("mail:3pane").openDialog("chrome://cardbook/content/csvTranslator/wdw_csvTranslator.xhtml", "", cardbookRepository.windowParams, myArgs); } else { wdw_cardbook.bulkOperation(myActionId); - await cardbookRepository.cardbookSynchronization.writeCardsToFile(aFile.path, aListOfSelectedCard, true, myActionId, aListOfSelectedCard.length); + await cardbookRepository.cardbookSynchronization.writeCardsToFile(aFile.path, aListOfSelectedCard, myActionId, aListOfSelectedCard.length); cardbookRepository.cardbookSynchronization.finishExportToFile(window, aListOfSelectedCard.length, aFile.leafName); } } @@ -894,7 +899,7 @@ if ("undefined" == typeof(wdw_cardbook)) { let length = aListOfSelectedCard.length; cardbookRepository.currentAction[myActionId].totalCards = length; wdw_cardbook.bulkOperation(myActionId); - cardbookRepository.cardbookSynchronization.writeCardsToDir(aDirectory.path, aListOfSelectedCard, true, myActionId); + cardbookRepository.cardbookSynchronization.writeCardsToDir(aDirectory.path, aListOfSelectedCard, myActionId); cardbookActions.endAsyncAction(myActionId, {window: window, length: length, name: aDirectory.leafName}); } } @@ -903,6 +908,41 @@ if ("undefined" == typeof(wdw_cardbook)) { } }, + exportCardsImages: function (aListOfSelectedCard) { + try { + cardbookWindowUtils.callDirPicker("dirSaveTitle", wdw_cardbook.exportCardsImagesNext, aListOfSelectedCard); + } + catch (e) { + cardbookRepository.cardbookLog.updateStatusProgressInformation("wdw_cardbook.exportCardsImages error : " + e, "Error"); + } + }, + + exportCardsImagesNext: function (aDirectory, aListOfSelectedCard) { + try { + if (aDirectory) { + if (aDirectory.exists() == false){ + aDirectory.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0o774); + } + + if (cardbookRepository.cardbookUtils.isDirectoryAlreadyOpen(aDirectory.path)) { + cardbookRepository.cardbookUtils.formatStringForOutput("directoryAlreadyOpen", [aDirectory.leafName]); + return; + } + + let myTopic = "cardsImagesExported"; + let myActionId = cardbookActions.startAction(myTopic, [aDirectory.leafName]); + let length = aListOfSelectedCard.length; + cardbookRepository.currentAction[myActionId].totalCards = length * cardbookRepository.allColumns.media.length; + wdw_cardbook.bulkOperation(myActionId); + cardbookRepository.cardbookSynchronization.writeCardsImages(aDirectory.path, aListOfSelectedCard, myActionId); + cardbookActions.endAsyncAction(myActionId, {window: window, name: aDirectory.leafName}); + } + } + catch (e) { + cardbookRepository.cardbookLog.updateStatusProgressInformation("wdw_cardbook.exportCardsToDirNext error : " + e, "Error"); + } + }, + importCardsFromFile: function () { try { cardbookWindowUtils.callFilePicker("fileImportTitle", "OPEN", "EXPORTFILE", "", "", wdw_cardbook.importCardsFromFileNext); @@ -1618,10 +1658,9 @@ if ("undefined" == typeof(wdw_cardbook)) { shareCardsByEmail: async function (aListOfSelectedCard) { if (aListOfSelectedCard.length != 0) { let vCards = []; - let listOfFileNames = []; for (let card of aListOfSelectedCard) { let listOfNames = Array.from(vCards, x => x.filename); - let filename = cardbookRepository.cardbookUtils.getFileNameForCard2(card, listOfNames, "vcf"); + let filename = cardbookRepository.cardbookUtils.getFileNameForCard2(card, listOfNames, ".vcf"); let vCard = await cardbookRepository.cardbookUtils.getvCardForEmail(card); vCards.push({filename: filename, vCard: vCard}); } @@ -1848,8 +1887,12 @@ if ("undefined" == typeof(wdw_cardbook)) { let dirname = cardbookRepository.getParentOrg(cbid); await cardbookIDBImage.getImage("photo", dirname, cbid, "") .then( image => { - let content = 'data:image/' + image.extension + ';base64,' + image.content; - myImage.src = content; + if (image && image.content && image.extension) { + let content = 'data:image/' + image.extension + ';base64,' + image.content; + myImage.src = content; + } else { + myImage.src = cardbookRepository.defaultCardImage; + } }).catch( () => { myImage.src = cardbookRepository.defaultCardImage; }); @@ -1979,18 +2022,22 @@ if ("undefined" == typeof(wdw_cardbook)) { } }, - startSearch: async function (aListOfCards) { + onStartSearch: function () { wdw_cardbook.setSearchRemoteHbox(""); wdw_cardbook.setSearchMode(); + wdw_cardbook.clearAccountOrCat(); + wdw_cardbook.clearCard(); + wdw_cardbook.startSearch(); + }, + + startSearch: async function (aListOfCards) { var listOfSelectedCard = []; if (!(aListOfCards)) { listOfSelectedCard = cardbookWindowUtils.getSelectedCards(); } else { listOfSelectedCard = aListOfCards; } - - wdw_cardbook.clearAccountOrCat(); - wdw_cardbook.clearCard(); + cardbookRepository.cardbookSearchValue = cardbookRepository.makeSearchString(document.getElementById('cardbookSearchInput').value); var myRegexp = new RegExp(cardbookRepository.cardbookSearchValue.replace("*", "(.*)"), "i"); @@ -2025,13 +2072,13 @@ if ("undefined" == typeof(wdw_cardbook)) { displayBirthdayList: function() { if (cardbookRepository.cardbookBirthdayPopup == 0) { cardbookRepository.cardbookBirthdayPopup++; - var MyWindows = Services.wm.getMostRecentWindow("mail:3pane").openDialog("chrome://cardbook/content/birthdays/wdw_birthdayList.xhtml", "", cardbookRepository.windowParams); + var MyWindows = Services.wm.getMostRecentWindow("mail:3pane").openDialog("chrome://cardbook/content/birthdays/wdw_birthdayList.xhtml", "", cardbookRepository.modalWindowParams); cardbookRepository.cardbookBirthdayPopup--; } }, displaySyncList: function() { - var MyWindows = Services.wm.getMostRecentWindow("mail:3pane").openDialog("chrome://cardbook/content/birthdays/wdw_birthdaySync.xhtml", "", cardbookRepository.windowParams); + var MyWindows = Services.wm.getMostRecentWindow("mail:3pane").openDialog("chrome://cardbook/content/birthdays/wdw_birthdaySync.xhtml", "", cardbookRepository.modalWindowParams); }, setSyncControl: function () { @@ -2163,17 +2210,9 @@ if ("undefined" == typeof(wdw_cardbook)) { if (cardbookDirTree.visibleData.length != 0) { var myTree = document.getElementById('accountsOrCatsTree'); if (myTree.currentIndex != -1) { - var myParentIndex = myTree.view.getParentIndex(myTree.currentIndex); - if (myParentIndex == -1) { - var myParentAccountId = myTree.view.getCellText(myTree.currentIndex, myTree.columns.getNamedColumn('accountId')); - var myParentAccountName = myTree.view.getCellText(myTree.currentIndex, myTree.columns.getNamedColumn('accountName')); - var myParentAccountType = myTree.view.getCellText(myTree.currentIndex, myTree.columns.getNamedColumn('accountType')); - } else { - var myParentAccountId = myTree.view.getCellText(myParentIndex, myTree.columns.getNamedColumn('accountId')); - var myParentAccountName = myTree.view.getCellText(myParentIndex, myTree.columns.getNamedColumn('accountName')); - var myParentAccountType = myTree.view.getCellText(myParentIndex, myTree.columns.getNamedColumn('accountType')); - } - + var myParentAccountId = myTree.view.getCellText(myTree.currentIndex, myTree.columns.getNamedColumn('accountRoot')); + var myParentAccountName = cardbookRepository.cardbookPreferences.getName(myParentAccountId); + var myParentAccountType = cardbookRepository.cardbookPreferences.getType(myParentAccountId); if (cardbookRepository.cardbookUtils.isMyAccountSyncing(myParentAccountId)) { return; } @@ -2620,7 +2659,7 @@ if ("undefined" == typeof(wdw_cardbook)) { } if (uncategorized) { cardbookRepository.renameUncategorized(aNodeName, myNewNodeName); - cardbookRepository.cardbookUtils.notifyObservers(myTopic, "force::" + aDirPrefId + "::" + aNodeType + "::" + myNewNodeName); + cardbookRepository.cardbookUtils.notifyObservers(myTopic, "forceAccount::" + aDirPrefId + "::" + aNodeType + "::" + myNewNodeName); } else { var length = myCards.length; for (var i = 0; i < length; i++) { @@ -3209,8 +3248,7 @@ if ("undefined" == typeof(wdw_cardbook)) { if (cardbookDirTree.visibleData.length == 0) { wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuEditServer', 'cardbookAccountMenuCloseServer', 'cardbookAccountMenuEnableOrDisableAddressbook', 'cardbookAccountMenuReadOnlyOrReadWriteAddressbook', 'cardbookAccountMenuSync', 'cardbookAccountMenuPrint', - 'cardbookAccountMenuExportToFile', 'cardbookAccountMenuImportFromFile', - 'cardbookAccountMenuExportToDir', 'cardbookAccountMenuImportFromDir'], true); + 'cardbookAccountMenuExports', 'cardbookAccountMenuImports'], true); wdw_cardbook.setElementIdLabelWithBundle('cardbookAccountMenuEnableOrDisableAddressbook', "disableFromAccountsOrCats"); wdw_cardbook.setElementIdLabelWithBundle('cardbookAccountMenuReadOnlyOrReadWriteAddressbook', "readWriteFromAccountsOrCats"); } else if (myTree.currentIndex != -1) { @@ -3242,41 +3280,39 @@ if ("undefined" == typeof(wdw_cardbook)) { } if (cardbookRepository.cardbookSearchMode === "SEARCH" || cardbookRepository.cardbookComplexSearchMode === "SEARCH") { - wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuImportFromFile', 'cardbookAccountMenuImportFromDir'], true); + wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuImports'], true); if (document.getElementById('cardsTree').view.rowCount == 0) { - wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuPrint', 'cardbookAccountMenuExportToFile', 'cardbookAccountMenuExportToDir'], true); + wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuPrint', 'cardbookAccountMenuExports'], true); } else if (document.getElementById('cardsTree').view.rowCount == 1) { - wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuPrint', 'cardbookAccountMenuExportToFile', 'cardbookAccountMenuExportToDir'], false); + wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuPrint', 'cardbookAccountMenuExports'], false); } else { - wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuPrint', 'cardbookAccountMenuExportToFile', 'cardbookAccountMenuExportToDir'], false); + wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuPrint', 'cardbookAccountMenuExports'], false); } } else if (cardbookRepository.cardbookPreferences.getEnabled(myPrefId)) { if (cardbookRepository.cardbookPreferences.getReadOnly(myPrefId)) { - wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuImportFromFile', 'cardbookAccountMenuImportFromDir'], true); + wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuImports'], true); } else { - wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuImportFromFile', 'cardbookAccountMenuImportFromDir'], false); + wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuImports'], false); } if (document.getElementById('cardsTree').view.rowCount == 0) { - wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuPrint', 'cardbookAccountMenuExportToFile', 'cardbookAccountMenuExportToDir'], true); + wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuPrint', 'cardbookAccountMenuExports'], true); } else if (document.getElementById('cardsTree').view.rowCount == 1) { - wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuPrint', 'cardbookAccountMenuExportToFile', 'cardbookAccountMenuExportToDir'], false); + wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuPrint', 'cardbookAccountMenuExports'], false); } else { - wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuPrint', 'cardbookAccountMenuExportToFile', 'cardbookAccountMenuExportToDir'], false); + wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuPrint', 'cardbookAccountMenuExports'], false); } } else { - wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuPrint', 'cardbookAccountMenuExportToFile', 'cardbookAccountMenuImportFromFile', - 'cardbookAccountMenuExportToDir', 'cardbookAccountMenuImportFromDir'], true); + wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuPrint', 'cardbookAccountMenuExports', 'cardbookAccountMenuImports'], true); } if (cardbookRepository.cardbookComplexSearchMode === "SEARCH") { wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuEditServer', 'cardbookAccountMenuCloseServer', 'cardbookAccountMenuEnableOrDisableAddressbook', - 'cardbookAccountMenuPrint', 'cardbookAccountMenuExportToFile', 'cardbookAccountMenuExportToDir', ''], false); + 'cardbookAccountMenuPrint', 'cardbookAccountMenuExports', ''], false); wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuReadOnlyOrReadWriteAddressbook', 'cardbookAccountMenuSync', 'cardbookAccountMenuImportFromFile', 'cardbookAccountMenuImportFromDir'], true); } } else { wdw_cardbook.enableOrDisableElement(['cardbookAccountMenuEditServer', 'cardbookAccountMenuCloseServer', 'cardbookAccountMenuEnableOrDisableAddressbook', 'cardbookAccountMenuSync', 'cardbookAccountMenuPrint', - 'cardbookAccountMenuExportToFile', 'cardbookAccountMenuImportFromFile', - 'cardbookAccountMenuExportToDir', 'cardbookAccountMenuImportFromDir'], true); + 'cardbookAccountMenuExports', 'cardbookAccountMenuImports'], true); wdw_cardbook.setElementIdLabelWithBundle('cardbookAccountMenuEnableOrDisableAddressbook', "disableFromAccountsOrCats"); wdw_cardbook.setElementIdLabelWithBundle('cardbookAccountMenuReadOnlyOrReadWriteAddressbook', "readWriteFromAccountsOrCats"); } @@ -3288,20 +3324,20 @@ if ("undefined" == typeof(wdw_cardbook)) { if (cardbookDirTree.visibleData.length == 0) { wdw_cardbook.enableOrDisableElement(['cardbookContactsMenuToEmailCards', 'cardbookContactsMenuCcEmailCards', 'cardbookContactsMenuBccEmailCards', 'cardbookContactsMenuFindEmails', 'cardbookContactsMenuLocalizeCards', 'cardbookContactsMenuOpenURL', 'cardbookContactsMenuCutCards', 'cardbookContactsMenuCopyCards', 'cardbookContactsMenuPasteCards', 'cardbookContactsMenuPasteEntry', - 'cardbookContactsMenuPrint', 'cardbookContactsMenuExportCardsToFile', - 'cardbookContactsMenuExportCardsToDir', 'cardbookContactsMenuMergeCards', 'cardbookContactsMenuDuplicateCards', 'cardbookContactsMenuCategories'], true); + 'cardbookContactsMenuPrint', 'cardbookContactsMenuExports', + 'cardbookContactsMenuMergeCards', 'cardbookContactsMenuDuplicateCards', 'cardbookContactsMenuCategories'], true); } else { let myTree = document.getElementById('accountsOrCatsTree'); if (cardbookWindowUtils.getSelectedCardsCount() == 0) { wdw_cardbook.enableOrDisableElement(['cardbookContactsMenuToEmailCards', 'cardbookContactsMenuCcEmailCards', 'cardbookContactsMenuBccEmailCards', 'cardbookContactsMenuFindEmails', 'cardbookContactsMenuLocalizeCards', 'cardbookContactsMenuOpenURL', 'cardbookContactsMenuCutCards', 'cardbookContactsMenuCopyCards', 'cardbookContactsMenuPasteCards', 'cardbookContactsMenuPasteEntry', - 'cardbookContactsMenuPrint', 'cardbookContactsMenuExportCardsToFile', - 'cardbookContactsMenuExportCardsToDir', 'cardbookContactsMenuMergeCards', 'cardbookContactsMenuDuplicateCards', 'cardbookContactsMenuCategories'], true); + 'cardbookContactsMenuPrint', 'cardbookContactsMenuExports', + 'cardbookContactsMenuMergeCards', 'cardbookContactsMenuDuplicateCards', 'cardbookContactsMenuCategories'], true); } else if (cardbookWindowUtils.getSelectedCardsCount() == 1) { wdw_cardbook.enableOrDisableElement(['cardbookContactsMenuToEmailCards', 'cardbookContactsMenuCcEmailCards', 'cardbookContactsMenuBccEmailCards', 'cardbookContactsMenuFindEmails', 'cardbookContactsMenuLocalizeCards', 'cardbookContactsMenuOpenURL', 'cardbookContactsMenuCutCards', 'cardbookContactsMenuCopyCards', 'cardbookContactsMenuPasteCards', - 'cardbookContactsMenuPrint', 'cardbookContactsMenuExportCardsToFile', - 'cardbookContactsMenuExportCardsToDir', 'cardbookContactsMenuDuplicateCards', 'cardbookContactsMenuCategories'], false); + 'cardbookContactsMenuPrint', 'cardbookContactsMenuExports', + 'cardbookContactsMenuDuplicateCards', 'cardbookContactsMenuCategories'], false); if (cardbookRepository.currentCopiedEntryLabel) { wdw_cardbook.enableOrDisableElement(['cardbookContactsMenuPasteEntry'], false); wdw_cardbook.setElementIdLabelWithBundleArray('cardbookContactsMenuPasteEntry', 'pasteFieldValue', [ cardbookRepository.currentCopiedEntryLabel ] ); @@ -3313,8 +3349,8 @@ if ("undefined" == typeof(wdw_cardbook)) { } else { wdw_cardbook.enableOrDisableElement(['cardbookContactsMenuToEmailCards', 'cardbookContactsMenuCcEmailCards', 'cardbookContactsMenuBccEmailCards', 'cardbookContactsMenuLocalizeCards', 'cardbookContactsMenuOpenURL', 'cardbookContactsMenuCutCards', 'cardbookContactsMenuCopyCards', 'cardbookContactsMenuPasteCards', - 'cardbookContactsMenuPrint', 'cardbookContactsMenuExportCardsToFile', - 'cardbookContactsMenuExportCardsToDir', 'cardbookContactsMenuDuplicateCards', 'cardbookContactsMenuCategories'], false); + 'cardbookContactsMenuPrint', 'cardbookContactsMenuExports', + 'cardbookContactsMenuDuplicateCards', 'cardbookContactsMenuCategories'], false); if (cardbookRepository.currentCopiedEntryLabel) { wdw_cardbook.enableOrDisableElement(['cardbookContactsMenuPasteEntry'], false); wdw_cardbook.setElementIdLabelWithBundleArray('cardbookContactsMenuPasteEntry', 'pasteFieldValue', [ cardbookRepository.currentCopiedEntryLabel ] ); @@ -3382,9 +3418,9 @@ if ("undefined" == typeof(wdw_cardbook)) { var myPrefId = myTree.view.getCellText(myTree.currentIndex, myTree.columns.getNamedColumn('accountRoot')); if (cardbookRepository.cardbookPreferences.getEnabled(myPrefId)) { if (cardbookRepository.cardbookPreferences.getReadOnly(myPrefId)) { - wdw_cardbook.enableOrDisableElement(['createNodeFromAccountsOrCats', 'pasteCardsFromAccountsOrCats', 'importCardsFromFileFromAccountsOrCats', 'importCardsFromDirFromAccountsOrCats'], true); + wdw_cardbook.enableOrDisableElement(['createNodeFromAccountsOrCats', 'pasteCardsFromAccountsOrCats', 'importsFromAccountsOrCatsMenu'], true); } else { - wdw_cardbook.enableOrDisableElement(['pasteCardsFromAccountsOrCats', 'importCardsFromFileFromAccountsOrCats', 'importCardsFromDirFromAccountsOrCats'], false); + wdw_cardbook.enableOrDisableElement(['pasteCardsFromAccountsOrCats', 'importsFromAccountsOrCatsMenu'], false); if (cardbookRepository.cardbookPreferences.getType(myPrefId) == "SEARCH") { wdw_cardbook.enableOrDisableElement(['createNodeFromAccountsOrCats'], true); } else { @@ -3404,7 +3440,7 @@ if ("undefined" == typeof(wdw_cardbook)) { } } else { wdw_cardbook.setElementIdLabelWithBundle('enableOrDisableFromAccountsOrCats', "enableFromAccountsOrCats"); - wdw_cardbook.enableOrDisableElement(['createNodeFromAccountsOrCats', 'pasteCardsFromAccountsOrCats', 'importCardsFromFileFromAccountsOrCats', 'importCardsFromDirFromAccountsOrCats', 'syncAccountFromAccountsOrCats'], true); + wdw_cardbook.enableOrDisableElement(['createNodeFromAccountsOrCats', 'pasteCardsFromAccountsOrCats', 'importsFromAccountsOrCatsMenu', 'syncAccountFromAccountsOrCats'], true); } var myNode = cardbookRepository.cardbookPreferences.getNode(myPrefId); @@ -3463,29 +3499,29 @@ if ("undefined" == typeof(wdw_cardbook)) { wdw_cardbook.enableOrDisableElement(['addAccountFromAccountsOrCats'], false); if (document.getElementById('cardsTree').view.rowCount == 0) { wdw_cardbook.enableOrDisableElement(['toEmailCardsFromAccountsOrCats', 'ccEmailCardsFromAccountsOrCats', 'bccEmailCardsFromAccountsOrCats', 'shareCardsByEmailFromAccountsOrCats', 'cutCardsFromAccountsOrCats', - 'copyCardsFromAccountsOrCats', 'exportCardsToFileFromAccountsOrCats', 'exportCardsToDirFromAccountsOrCats', 'generateFnFromAccountsOrCats', + 'copyCardsFromAccountsOrCats', 'exportsFromAccountsOrCatsMenu', 'generateFnFromAccountsOrCats', 'findDuplicatesFromAccountsOrCats', 'formatDataFromAccountsOrCats', 'convertNodeFromAccountsOrCats', 'printFromAccountsOrCats'], true); } else if (document.getElementById('cardsTree').view.rowCount == 1) { wdw_cardbook.enableOrDisableElement(['toEmailCardsFromAccountsOrCats', 'ccEmailCardsFromAccountsOrCats', 'bccEmailCardsFromAccountsOrCats', 'shareCardsByEmailFromAccountsOrCats', - 'copyCardsFromAccountsOrCats', 'exportCardsToFileFromAccountsOrCats', 'exportCardsToDirFromAccountsOrCats', 'findDuplicatesFromAccountsOrCats', + 'copyCardsFromAccountsOrCats', 'exportsFromAccountsOrCatsMenu', 'findDuplicatesFromAccountsOrCats', 'formatDataFromAccountsOrCats', 'printFromAccountsOrCats'], false); } else { wdw_cardbook.enableOrDisableElement(['toEmailCardsFromAccountsOrCats', 'ccEmailCardsFromAccountsOrCats', 'bccEmailCardsFromAccountsOrCats', 'shareCardsByEmailFromAccountsOrCats', - 'copyCardsFromAccountsOrCats', 'exportCardsToFileFromAccountsOrCats', 'exportCardsToDirFromAccountsOrCats', 'findDuplicatesFromAccountsOrCats', + 'copyCardsFromAccountsOrCats', 'exportsFromAccountsOrCatsMenu', 'findDuplicatesFromAccountsOrCats', 'formatDataFromAccountsOrCats', 'printFromAccountsOrCats'], false); } if (cardbookRepository.cardbookComplexSearchMode === "SEARCH") { wdw_cardbook.enableOrDisableElement(['toEmailCardsFromAccountsOrCats', 'ccEmailCardsFromAccountsOrCats', 'bccEmailCardsFromAccountsOrCats', 'shareCardsByEmailFromAccountsOrCats', 'cutCardsFromAccountsOrCats', - 'copyCardsFromAccountsOrCats', 'exportCardsToFileFromAccountsOrCats', 'exportCardsToDirFromAccountsOrCats', + 'copyCardsFromAccountsOrCats', 'exportsFromAccountsOrCatsMenu', 'addAccountFromAccountsOrCats', 'editAccountFromAccountsOrCats', 'removeAccountFromAccountsOrCats', 'enableOrDisableFromAccountsOrCats', 'printFromAccountsOrCats', 'findDuplicatesFromAccountsOrCats', 'formatDataFromAccountsOrCats'], false); - wdw_cardbook.enableOrDisableElement(['pasteCardsFromAccountsOrCats', 'importCardsFromFileFromAccountsOrCats', 'importCardsFromDirFromAccountsOrCats', + wdw_cardbook.enableOrDisableElement(['pasteCardsFromAccountsOrCats', 'importsFromAccountsOrCatsMenu', 'readOnlyOrReadWriteFromAccountsOrCats', 'syncAccountFromAccountsOrCats', 'generateFnFromAccountsOrCats'], true); } } else { wdw_cardbook.enableOrDisableElement(['toEmailCardsFromAccountsOrCats', 'ccEmailCardsFromAccountsOrCats', 'bccEmailCardsFromAccountsOrCats', 'shareCardsByEmailFromAccountsOrCats', 'cutCardsFromAccountsOrCats', - 'copyCardsFromAccountsOrCats', 'pasteCardsFromAccountsOrCats', 'exportCardsToFileFromAccountsOrCats', 'exportCardsToDirFromAccountsOrCats', 'importCardsFromFileFromAccountsOrCats', - 'importCardsFromDirFromAccountsOrCats', 'editAccountFromAccountsOrCats', 'removeAccountFromAccountsOrCats', + 'copyCardsFromAccountsOrCats', 'pasteCardsFromAccountsOrCats', 'exportsFromAccountsOrCatsMenu', 'importsFromAccountsOrCatsMenu', + 'editAccountFromAccountsOrCats', 'removeAccountFromAccountsOrCats', 'createNodeFromAccountsOrCats', 'editNodeFromAccountsOrCats', 'removeNodeFromAccountsOrCats', 'convertNodeFromAccountsOrCats', 'enableOrDisableFromAccountsOrCats', 'syncAccountFromAccountsOrCats', 'generateFnFromAccountsOrCats', 'findDuplicatesFromAccountsOrCats', 'formatDataFromAccountsOrCats', 'printFromAccountsOrCats'], true); } @@ -3504,20 +3540,20 @@ if ("undefined" == typeof(wdw_cardbook)) { cardsTreeContextShowingNext: function () { if (cardbookDirTree.visibleData.length == 0) { wdw_cardbook.enableOrDisableElement(['toEmailCardsFromCards', 'ccEmailCardsFromCards', 'bccEmailCardsFromCards', 'searchForOnlineKeyFromCards', 'shareCardsByEmailFromCards', 'findEmailsFromCards', 'findEventsFromCards', - 'localizeCardsFromCards', 'openURLFromCards', 'cutCardsFromCards', 'copyCardsFromCards', 'pasteCardsFromCards', 'pasteEntryFromCards', 'exportCardsToFileFromCards', - 'exportCardsToDirFromCards', 'mergeCardsFromCards', 'duplicateCardsFromCards', 'convertListToCategoryFromCards', 'categoriesFromCards', 'printFromCards', 'publicKeysFromCards'], true); + 'localizeCardsFromCards', 'openURLFromCards', 'cutCardsFromCards', 'copyCardsFromCards', 'pasteCardsFromCards', 'pasteEntryFromCards', 'exportsFromCardsMenu', + 'mergeCardsFromCards', 'duplicateCardsFromCards', 'convertListToCategoryFromCards', 'categoriesFromCards', 'printFromCards', 'publicKeysFromCards'], true); } else { cardbookWindowUtils.addCardsToCategoryMenuSubMenu('categoriesFromCardsMenuPopup'); wdw_cardbook.enableOrDisableElement(['findEventsFromCards'], true); if (cardbookWindowUtils.getSelectedCardsCount() == 0) { wdw_cardbook.enableOrDisableElement(['toEmailCardsFromCards', 'ccEmailCardsFromCards', 'bccEmailCardsFromCards', 'searchForOnlineKeyFromCards', 'shareCardsByEmailFromCards', 'findEmailsFromCards', 'findEventsFromCards', - 'localizeCardsFromCards', 'openURLFromCards', 'cutCardsFromCards', 'copyCardsFromCards', 'pasteCardsFromCards', 'pasteEntryFromCards', 'exportCardsToFileFromCards', - 'exportCardsToDirFromCards', 'mergeCardsFromCards', 'duplicateCardsFromCards', 'convertListToCategoryFromCards', + 'localizeCardsFromCards', 'openURLFromCards', 'cutCardsFromCards', 'copyCardsFromCards', 'pasteCardsFromCards', 'pasteEntryFromCards', 'exportsFromCardsMenu', + 'mergeCardsFromCards', 'duplicateCardsFromCards', 'convertListToCategoryFromCards', 'categoriesFromCards', 'printFromCards', 'publicKeysFromCards'], true); } else if (cardbookWindowUtils.getSelectedCardsCount() == 1) { wdw_cardbook.enableOrDisableElement(['toEmailCardsFromCards', 'ccEmailCardsFromCards', 'bccEmailCardsFromCards', 'searchForOnlineKeyFromCards', 'shareCardsByEmailFromCards', 'findEmailsFromCards', 'findEventsFromCards', - 'localizeCardsFromCards', 'openURLFromCards', 'cutCardsFromCards', 'copyCardsFromCards', 'pasteCardsFromCards', 'exportCardsToFileFromCards', - 'exportCardsToDirFromCards', 'duplicateCardsFromCards', 'categoriesFromCards', 'printFromCards', 'publicKeysFromCards'], false); + 'localizeCardsFromCards', 'openURLFromCards', 'cutCardsFromCards', 'copyCardsFromCards', 'pasteCardsFromCards', 'exportsFromCardsMenu', + 'duplicateCardsFromCards', 'categoriesFromCards', 'printFromCards', 'publicKeysFromCards'], false); if (cardbookRepository.currentCopiedEntryLabel) { wdw_cardbook.enableOrDisableElement(['pasteEntryFromCards'], false); wdw_cardbook.setElementIdLabelWithBundleArray('pasteEntryFromCards', 'pasteFieldValue', [ cardbookRepository.currentCopiedEntryLabel ] ); @@ -3539,8 +3575,8 @@ if ("undefined" == typeof(wdw_cardbook)) { wdw_cardbook.cardsTreeLightningContextShowing(); } else { wdw_cardbook.enableOrDisableElement(['toEmailCardsFromCards', 'ccEmailCardsFromCards', 'bccEmailCardsFromCards', 'searchForOnlineKeyFromCards', 'shareCardsByEmailFromCards', 'localizeCardsFromCards', - 'openURLFromCards', 'cutCardsFromCards', 'copyCardsFromCards', 'pasteCardsFromCards', 'exportCardsToFileFromCards', - 'exportCardsToDirFromCards', 'duplicateCardsFromCards', 'categoriesFromCards', 'printFromCards', 'publicKeysFromCards'], false); + 'openURLFromCards', 'cutCardsFromCards', 'copyCardsFromCards', 'pasteCardsFromCards', 'exportsFromCardsMenu', + 'duplicateCardsFromCards', 'categoriesFromCards', 'printFromCards', 'publicKeysFromCards'], false); wdw_cardbook.enableOrDisableElement(['convertListToCategoryFromCards', 'findEmailsFromCards', 'findEventsFromCards'], true); if (cardbookRepository.currentCopiedEntryLabel) { wdw_cardbook.enableOrDisableElement(['pasteEntryFromCards'], false); @@ -3851,17 +3887,21 @@ if ("undefined" == typeof(wdw_cardbook)) { }, refreshWindow: async function (aParams) { - cardbookActions.setUndoAndRedoMenuAndButton(); + let forceCard = false; + if (aParams) { + forceCard = aParams.endsWith(":::forceCard"); + aParams = aParams.replace(/:::forceCard$/, ""); + } + if (!document.getElementById('accountsOrCatsTree')) { return; - // no need to refresh cards for others syncing dirprefid } else if (cardbookRepository.cardbookSearchMode == "SEARCH") { - var mySyncCondition = false; + var mySyncCondition = true; } else if (cardbookRepository.cardbookComplexSearchMode == "SEARCH") { var mySyncCondition = true; } else { if (aParams) { - if (aParams.startsWith("force::")) { + if (aParams.startsWith("forceAccount::")) { var mySyncCondition = true; } else { var myDirPredId = cardbookRepository.cardbookUtils.getAccountId(aParams); @@ -3877,8 +3917,8 @@ if ("undefined" == typeof(wdw_cardbook)) { var myAccountId = ""; if (cardbookRepository.cardbookSearchMode == "SEARCH") { myAccountId = ""; - } else if (aParams && aParams.startsWith("force::")) { - myAccountId = aParams.replace("force::", ""); + } else if (aParams && aParams.startsWith("forceAccount::")) { + myAccountId = aParams.replace("forceAccount::", ""); } else { myAccountId = cardbookRepository.currentAccountId; @@ -3909,12 +3949,14 @@ if ("undefined" == typeof(wdw_cardbook)) { // for search mode the reselection is done inside their functions if (mySyncCondition) { - // select cards back if (listOfSelectedCard.length == 1) { if (cardbookRepository.cardbookCards[listOfSelectedCard[0].cbid]) { wdw_cardbook.sortCardsTreeCol(); - await wdw_cardbook.displayCard(listOfSelectedCard[0]); + let card = cardbookRepository.cardbookCards[listOfSelectedCard[0].cbid]; + if (card.etag != wdw_cardbook.displayCardEtag || forceCard) { + await wdw_cardbook.displayCard(card); + } } else { wdw_cardbook.clearCard(); } diff --git a/src/chrome/content/wl_cardbookMessenger.js b/src/chrome/content/wl_cardbookMessenger.js index 4910d0c..be7b36d 100644 --- a/src/chrome/content/wl_cardbookMessenger.js +++ b/src/chrome/content/wl_cardbookMessenger.js @@ -51,7 +51,8 @@ var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); var { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); var { cardbookRepository } = ChromeUtils.import("chrome://cardbook/content/cardbookRepository.js"); -// for the quickfilter bar + +// for the quickfilter bar and the filters var { QuickFilterManager } = ChromeUtils.import("resource:///modules/QuickFilterManager.jsm"); Services.scriptloader.loadSubScript("chrome://cardbook/content/filters/ovl_filters.js", window, "UTF-8"); // Services.scriptloader.loadSubScript("chrome://messenger/content/quickFilterBar.js", window, "UTF-8"); @@ -91,6 +92,15 @@ function onLoad(wasAlreadyOpen) { +
+ +
+ - + - - + + - + - - - - @@ -357,11 +367,20 @@ function onLoad(wasAlreadyOpen) { - - + + + + + + + - - + + + + + + @@ -403,8 +422,13 @@ function onLoad(wasAlreadyOpen) { - - + + + + + + + @@ -429,7 +453,7 @@ function onLoad(wasAlreadyOpen) { class="toolbaritem-noline chromeclass-toolbar-additional"> + oncommand="wdw_cardbook.onStartSearch();"/> - + - - + + + + + + + - - + + + + + + @@ -617,8 +650,13 @@ function onLoad(wasAlreadyOpen) { - - + + + + + + + diff --git a/src/manifest.json b/src/manifest.json index a4a00d6..d7fae7b 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,6 +1,6 @@ { "name": "__MSG_extName__ Alt.Icon", - "version": "80.5.1", + "version": "81.6.1", "description": "__MSG_extDesc__ -- An alternative icon version/fork (**CAUTION**: visit 'Homepage' bellow). --", "homepage_url": "https://github.com/Gregory-K/CardBook.Alt.Icon", "author": "Philippe VIGNEAU", @@ -67,6 +67,14 @@ "script": "chrome/content/api/NotifyTools/implementation.js", "events": ["startup"] } + }, + "DomContentScript": { + "schema": "chrome/content/api/DomContentScript/schema.json", + "parent": { + "scopes": ["addon_parent"], + "paths": [["DomContentScript"]], + "script": "chrome/content/api/DomContentScript/implementation.js" + } } }, "manifest_version": 2 diff --git a/version.txt b/version.txt index f8289d5..f93b42a 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -80.5.1 +81.6.1