summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-11-14 09:38:55 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2013-11-14 09:38:55 +0100
commitd4c0ac779034a47d4fc8a56e0a96a7d84170e03c (patch)
tree1dff93f90fa3264f02c6f15934b469afc6b79533 /core/js
parent8d0d0836bae968d3abff5f5ff9db230d449397a6 (diff)
downloadnextcloud-server-d4c0ac779034a47d4fc8a56e0a96a7d84170e03c.tar.gz
nextcloud-server-d4c0ac779034a47d4fc8a56e0a96a7d84170e03c.zip
introduce auto completion on share email - integrated with the contactsmanager api
Diffstat (limited to 'core/js')
-rw-r--r--core/js/share.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/core/js/share.js b/core/js/share.js
index 411f0d23c36..44c58a3f942 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -314,6 +314,26 @@ OC.Share={
.append( insert )
.appendTo( ul );
};
+ $('#email').autocomplete({
+ minLength: 1,
+ source: function (search, response) {
+ $.get(OC.filePath('core', 'ajax', 'share.php'), { fetch: 'getShareWithEmail', search: search.term }, function(result) {
+ if (result.status == 'success' && result.data.length > 0) {
+ response(result.data);
+ }
+ });
+ },
+ select: function( event, item ) {
+ $('#email').val(item.item.email);
+ return false;
+ }
+ })
+ .data("ui-autocomplete")._renderItem = function( ul, item ) {
+ return $( "<li>" )
+ .append( "<a>" + item.displayname + "<br>" + item.email + "</a>" )
+ .appendTo( ul );
+ };
+
} else {
html += '<input id="shareWith" type="text" placeholder="'+t('core', 'Resharing is not allowed')+'" style="width:90%;" disabled="disabled"/>';
html += '</div>';