From 9bbbc6bf003497694133d40db7417e6698a3ea7c Mon Sep 17 00:00:00 2001 From: Erik Andresen Date: Sat, 11 Nov 2023 09:25:19 +0100 Subject: [PATCH] contacts: add vcard export --- apps/contacts/interface.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/contacts/interface.html b/apps/contacts/interface.html index f87feebf5..4a533bff7 100644 --- a/apps/contacts/interface.html +++ b/apps/contacts/interface.html @@ -47,6 +47,7 @@ Name Number + @@ -186,7 +187,9 @@ } else { $contact.innerHTML = `${contact.name}${contact.number}`; } - $contact.innerHTML += ``; + let buttons = ``; + buttons += ``; + $contact.innerHTML += `${buttons}`; $list.appendChild($contact) }) $name.focus() @@ -228,6 +231,13 @@ } } + function exportVcard(index){ + const vCard = new vcf(); + vCard.set('n', contacts[index].name); + vCard.set('tel', contacts[index].number); + Util.saveFile(contacts[index].name+".vcf", "text/vcard", vCard.toString()); + } + // ========================================================================== UPLOAD/DOWNLOAD function downloadJSONfile(fileid, callback) {