aboutsummaryrefslogtreecommitdiffstats
path: root/apps/contacts
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-08-07 00:05:43 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-08-07 00:06:18 +0200
commit2eac79b7820ecb0270c72428277d0528ea4ac724 (patch)
treeff11221fea522566a681a2d7ec9e7710efec7eb8 /apps/contacts
parentde7f48b0509a60835643c9776bfd9e0626a76440 (diff)
downloadnextcloud-server-2eac79b7820ecb0270c72428277d0528ea4ac724.tar.gz
nextcloud-server-2eac79b7820ecb0270c72428277d0528ea4ac724.zip
Some UI improvements on the addressbooks settings.
Diffstat (limited to 'apps/contacts')
-rw-r--r--apps/contacts/css/contacts.css3
-rw-r--r--apps/contacts/js/settings.js21
-rw-r--r--apps/contacts/templates/settings.php4
3 files changed, 19 insertions, 9 deletions
diff --git a/apps/contacts/css/contacts.css b/apps/contacts/css/contacts.css
index 0961550c7a6..c5308c4d25a 100644
--- a/apps/contacts/css/contacts.css
+++ b/apps/contacts/css/contacts.css
@@ -140,4 +140,7 @@ input[type="checkbox"] { width: 20px; height: 20px; vertical-align: bottom; }
.addressbooks-settings .actions * { float: left; }
.addressbooks-settings .actions input.name { width: 5em; }
.addressbooks-settings .actions input.name { width: 7em; }
+.addressbooks-settings a.action { opacity: 0.2; }
+.addressbooks-settings a.action:hover { opacity: 1; }
+.addressbooks-settings td.active, .addressbooks-settings td.action { width: 20px; }
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);
}
}
};
diff --git a/apps/contacts/templates/settings.php b/apps/contacts/templates/settings.php
index 85dbca36fac..3fddc59588a 100644
--- a/apps/contacts/templates/settings.php
+++ b/apps/contacts/templates/settings.php
@@ -24,8 +24,7 @@
</td>
<td class="action">
<a class="svg action download" title="<?php echo $l->t('Download'); ?>"
- href="<?php echo OCP\Util::linkToRemote('carddav').'addressbooks/'.OCP\USER::getUser().'/'
- .rawurlencode($addressbook['uri']) ?>?export"></a>
+ href="<?php echo OCP\Util::linkToAbsolute('contacts', 'export.php'); ?>?bookid=<?php echo $addressbook['id'] ?>"></a>
</td>
<td class="action">
<a class="svg action edit" title="<?php echo $l->t("Edit"); ?>"></a>
@@ -41,7 +40,6 @@
<button class="new"><?php echo $l->t('New Address Book') ?></button>
<input class="name hidden" type="text" autofocus="autofocus" placeholder="<?php echo $l->t('Name'); ?>" />
<input class="description hidden" type="text" placeholder="<?php echo $l->t('Description'); ?>" />
- <input class="link hidden" style="width: 80%" type="text" autofocus="autofocus" />
<button class="save hidden"><?php echo $l->t('Save') ?></button>
<button class="cancel hidden"><?php echo $l->t('Cancel') ?></button>
</div>