diff options
Diffstat (limited to 'apps/contacts/js')
-rw-r--r-- | apps/contacts/js/contacts.js | 8 | ||||
-rw-r--r-- | apps/contacts/js/settings.js | 21 |
2 files changed, 19 insertions, 10 deletions
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js index 9aec02557fc..67bfa9847ee 100644 --- a/apps/contacts/js/contacts.js +++ b/apps/contacts/js/contacts.js @@ -835,7 +835,7 @@ OC.Contacts={ OC.Contacts.propertyContainerFor(obj).data('checksum', ''); if(proptype == 'PHOTO') { OC.Contacts.Contacts.refreshThumbnail(OC.Contacts.Card.id); - OC.Contacts.Card.loadPhoto(true); + OC.Contacts.Card.loadPhoto(); } else if(proptype == 'NOTE') { $('#note').find('textarea').val(''); OC.Contacts.propertyContainerFor(obj).hide(); @@ -1218,9 +1218,9 @@ OC.Contacts={ } }); }, - loadPhoto:function(refresh){ + loadPhoto:function(){ var self = this; - var refreshstr = (refresh?'&refresh=1'+Math.random():'') + var refreshstr = ''; //'&refresh='+Math.random(); $('#phototools li a').tipsy('hide'); var wrapper = $('#contacts_details_photo_wrapper'); wrapper.addClass('loading').addClass('wait'); @@ -1278,7 +1278,7 @@ OC.Contacts={ var response=jQuery.parseJSON(target.contents().text()); if(response != undefined && response.status == 'success'){ // load cropped photo. - self.loadPhoto(true); + self.loadPhoto(); OC.Contacts.Card.data.PHOTO = true; }else{ OC.dialogs.alert(response.data.message, t('contacts', 'Error')); diff --git a/apps/contacts/js/settings.js b/apps/contacts/js/settings.js index ee8d889d722..69cf473e06a 100644 --- a/apps/contacts/js/settings.js +++ b/apps/contacts/js/settings.js @@ -90,8 +90,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>'); @@ -107,17 +106,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); } } }; |