|
|
|
|
@ -26,6 +26,23 @@
@@ -26,6 +26,23 @@
|
|
|
|
|
let orgs = $derived(contact.vcard.match(/^ORG.*:.+$/gm)); |
|
|
|
|
let urls = $derived(contact.vcard.match(/^URL.*:.+$/gm)); |
|
|
|
|
|
|
|
|
|
function add_address(){ |
|
|
|
|
var new_addr = `ADR;TYPE=WORK:;;${t('street')};${t('locality')};${t('region')};${t('post_code')};${t('country')}`; |
|
|
|
|
patch('END:',`${new_addr}\nEND:`); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function add_email(){ |
|
|
|
|
patch('END:',`EMAIL:${t('email')}@example.com\nEND:`); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function add_number(){ |
|
|
|
|
patch('END:',`TEL:${t('phone')}\nEND:`); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function add_url(){ |
|
|
|
|
patch('END:',`URL:https://example.com\nEND:`); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async function drop(){ |
|
|
|
|
for (let n of names){ |
|
|
|
|
n = name(n); |
|
|
|
|
@ -114,13 +131,15 @@
@@ -114,13 +131,15 @@
|
|
|
|
|
</tr> |
|
|
|
|
<tr> |
|
|
|
|
<td> |
|
|
|
|
<button class="symbol" onclick={add_address} title={t('add_object',{object:t('address')})}></button> |
|
|
|
|
{#each addresses as code} |
|
|
|
|
<Address {code} {patch} /> |
|
|
|
|
{/each} |
|
|
|
|
</td> |
|
|
|
|
</tr> |
|
|
|
|
<tr> |
|
|
|
|
<td> |
|
|
|
|
<td class="phones"> |
|
|
|
|
<button class="symbol" onclick={add_number} title={t('add_object',{object:t('number')})}></button> |
|
|
|
|
{#each numbers as code} |
|
|
|
|
<Number {code} {patch} /> |
|
|
|
|
{/each} |
|
|
|
|
@ -128,6 +147,7 @@
@@ -128,6 +147,7 @@
|
|
|
|
|
</tr> |
|
|
|
|
<tr> |
|
|
|
|
<td> |
|
|
|
|
<button class="symbol" onclick={add_email} title={t('add_object',{object:t('email')})}></button> |
|
|
|
|
{#each emails as code} |
|
|
|
|
<Email {code} {patch} /> |
|
|
|
|
{/each} |
|
|
|
|
@ -142,6 +162,7 @@
@@ -142,6 +162,7 @@
|
|
|
|
|
</tr> |
|
|
|
|
<tr> |
|
|
|
|
<td> |
|
|
|
|
<button class="symbol" onclick={add_url} title={t('add_object',{object:t('website')})}></button> |
|
|
|
|
{#each urls as code} |
|
|
|
|
<URL {code} {patch} /> |
|
|
|
|
{/each} |
|
|
|
|
|