Some UI improvements on the addressbooks settings.
This commit is contained in:
parent
de7f48b050
commit
2eac79b782
|
@ -140,4 +140,7 @@ input[type="checkbox"] { width: 20px; height: 20px; vertical-align: bottom; }
|
||||||
.addressbooks-settings .actions * { float: left; }
|
.addressbooks-settings .actions * { float: left; }
|
||||||
.addressbooks-settings .actions input.name { width: 5em; }
|
.addressbooks-settings .actions input.name { width: 5em; }
|
||||||
.addressbooks-settings .actions input.name { width: 7em; }
|
.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; }
|
||||||
|
|
||||||
|
|
|
@ -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 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 cloud" title="'+t('contacts', 'Show read-only VCF link')+'"></a></td>'
|
||||||
+ '<td class="action"><a class="svg action download" title="'+t('contacts', 'Download')+'" '
|
+ '<td class="action"><a class="svg action download" title="'+t('contacts', 'Download')+'" '
|
||||||
+ 'href="'+totalurl+'/'+encodeURIComponent(oc_current_user)+'/'
|
+ 'href="'+OC.linkTo('contacts', 'export.php')+'?bookid='+jsondata.data.addressbook.id+'"></a></td>'
|
||||||
+ encodeURIComponent(jsondata.data.addressbook.uri)+'?export"></a></td>'
|
|
||||||
+ '<td class="action"><a class="svg action edit" title="'+t('contacts', 'Edit')+'"></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>'
|
+ '<td class="action"><a class="svg action delete" title="'+t('contacts', 'Delete')+'"></a></td>'
|
||||||
+ '</tr>');
|
+ '</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) {
|
showCardDAV:function(id) {
|
||||||
console.log('showCardDAV: ', id);
|
console.log('showCardDAV: ', id);
|
||||||
var row = this.adrsettings.find('tr[data-id="'+id+'"]');
|
var row = this.adrsettings.find('tr[data-id="'+id+'"]');
|
||||||
this.adractions.find('.link').val(totalurl+'/'+encodeURIComponent(oc_current_user)+'/');
|
this.showLink(id, row, totalurl+'/'+encodeURIComponent(oc_current_user));
|
||||||
this.showActions(['link','cancel']);
|
|
||||||
},
|
},
|
||||||
showVCF:function(id) {
|
showVCF:function(id) {
|
||||||
console.log('showVCF: ', id);
|
console.log('showVCF: ', id);
|
||||||
var row = this.adrsettings.find('tr[data-id="'+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');
|
var link = totalurl+'/'+encodeURIComponent(oc_current_user)+'/'+encodeURIComponent(row.data('uri'))+'?export';
|
||||||
this.showActions(['link','cancel']);
|
console.log(link);
|
||||||
|
this.showLink(id, row, link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,8 +24,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td class="action">
|
<td class="action">
|
||||||
<a class="svg action download" title="<?php echo $l->t('Download'); ?>"
|
<a class="svg action download" title="<?php echo $l->t('Download'); ?>"
|
||||||
href="<?php echo OCP\Util::linkToRemote('carddav').'addressbooks/'.OCP\USER::getUser().'/'
|
href="<?php echo OCP\Util::linkToAbsolute('contacts', 'export.php'); ?>?bookid=<?php echo $addressbook['id'] ?>"></a>
|
||||||
.rawurlencode($addressbook['uri']) ?>?export"></a>
|
|
||||||
</td>
|
</td>
|
||||||
<td class="action">
|
<td class="action">
|
||||||
<a class="svg action edit" title="<?php echo $l->t("Edit"); ?>"></a>
|
<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>
|
<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="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="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="save hidden"><?php echo $l->t('Save') ?></button>
|
||||||
<button class="cancel hidden"><?php echo $l->t('Cancel') ?></button>
|
<button class="cancel hidden"><?php echo $l->t('Cancel') ?></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue