diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-08-07 00:05:43 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-08-07 00:06:18 +0200 |
commit | 2eac79b7820ecb0270c72428277d0528ea4ac724 (patch) | |
tree | ff11221fea522566a681a2d7ec9e7710efec7eb8 /apps/contacts/js | |
parent | de7f48b0509a60835643c9776bfd9e0626a76440 (diff) | |
download | nextcloud-server-2eac79b7820ecb0270c72428277d0528ea4ac724.tar.gz nextcloud-server-2eac79b7820ecb0270c72428277d0528ea4ac724.zip |
Some UI improvements on the addressbooks settings.
Diffstat (limited to 'apps/contacts/js')
-rw-r--r-- | apps/contacts/js/settings.js | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/apps/contacts/js/settings.js b/apps/contacts/js/settings.js index 284f972be8e..67aaa5b5f88 100644 --- a/apps/contacts/js/settings.js +++ b/apps/contacts/js/settings.js @@ -89,8 +89,7 @@ OC.Contacts.Settings = OC.Contacts.Settings || { + '<td class="action"><a class="svg action globe" title="'+t('contacts', 'Show CardDav link')+'"></a></td>' + '<td class="action"><a class="svg action cloud" title="'+t('contacts', 'Show read-only VCF link')+'"></a></td>' + '<td class="action"><a class="svg action download" title="'+t('contacts', 'Download')+'" ' - + 'href="'+totalurl+'/'+encodeURIComponent(oc_current_user)+'/' - + encodeURIComponent(jsondata.data.addressbook.uri)+'?export"></a></td>' + + 'href="'+OC.linkTo('contacts', 'export.php')+'?bookid='+jsondata.data.addressbook.id+'"></a></td>' + '<td class="action"><a class="svg action edit" title="'+t('contacts', 'Edit')+'"></a></td>' + '<td class="action"><a class="svg action delete" title="'+t('contacts', 'Delete')+'"></a></td>' + '</tr>'); @@ -106,17 +105,27 @@ OC.Contacts.Settings = OC.Contacts.Settings || { } }); }, + showLink:function(id, row, link) { + console.log('row:', row.length); + row.next('tr.link').remove(); + var linkrow = $('<tr class="link"><td colspan="5"><input style="width: 95%;" type="text" value="'+link+'" /></td>' + + '<td colspan="3"><button>'+t('contacts', 'Cancel')+'</button></td></tr>').insertAfter(row); + linkrow.find('input').focus().select(); + linkrow.find('button').click(function() { + $(this).parents('tr').first().remove(); + }); + }, showCardDAV:function(id) { console.log('showCardDAV: ', id); var row = this.adrsettings.find('tr[data-id="'+id+'"]'); - this.adractions.find('.link').val(totalurl+'/'+encodeURIComponent(oc_current_user)+'/'); - this.showActions(['link','cancel']); + this.showLink(id, row, totalurl+'/'+encodeURIComponent(oc_current_user)); }, showVCF:function(id) { console.log('showVCF: ', id); var row = this.adrsettings.find('tr[data-id="'+id+'"]'); - this.adractions.find('.link').val(totalurl+'/'+encodeURIComponent(oc_current_user)+'/'+encodeURIComponent(row.data('uri'))+'?export'); - this.showActions(['link','cancel']); + var link = totalurl+'/'+encodeURIComponent(oc_current_user)+'/'+encodeURIComponent(row.data('uri'))+'?export'; + console.log(link); + this.showLink(id, row, link); } } }; |