aboutsummaryrefslogtreecommitdiffstats
path: root/view/js
diff options
context:
space:
mode:
authorStefan Parviainen <saparvia@caterva.eu>2015-01-07 20:38:56 +0100
committerStefan Parviainen <saparvia@caterva.eu>2015-01-07 20:38:56 +0100
commitc9b15bbab530264c4d5e1a648fc62153843b0618 (patch)
tree1b35cec7c119624190d697de9eba4d14f6ca32da /view/js
parent9f8ce331f3661463573dac9d1bd0bf68eb15a322 (diff)
downloadvolse-hubzilla-c9b15bbab530264c4d5e1a648fc62153843b0618.tar.gz
volse-hubzilla-c9b15bbab530264c4d5e1a648fc62153843b0618.tar.bz2
volse-hubzilla-c9b15bbab530264c4d5e1a648fc62153843b0618.zip
Allow passing autocomplete type to contact_autocomplete
Diffstat (limited to 'view/js')
-rw-r--r--view/js/autocomplete.js6
-rw-r--r--view/js/mod_mail.js2
-rw-r--r--view/js/mod_poke.js2
3 files changed, 6 insertions, 4 deletions
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js
index 66d8cf90c..26d3f6211 100644
--- a/view/js/autocomplete.js
+++ b/view/js/autocomplete.js
@@ -91,13 +91,15 @@ function basic_replace(item) {
})( jQuery );
(function( $ ){
- $.fn.contact_autocomplete = function(backend_url, onselect) {
+ $.fn.contact_autocomplete = function(backend_url, typ, onselect) {
+
+ if(typeof typ === 'undefined') typ = '';
// Autocomplete contacts
contacts = {
match: /(^)([^\n]+)$/,
index: 2,
- search: function(term, callback) { contact_search(term, callback, backend_url, '',[]); },
+ search: function(term, callback) { contact_search(term, callback, backend_url, typ,[]); },
replace: basic_replace,
template: contact_format,
}
diff --git a/view/js/mod_mail.js b/view/js/mod_mail.js
index 9c4597866..2cbc924f4 100644
--- a/view/js/mod_mail.js
+++ b/view/js/mod_mail.js
@@ -1,5 +1,5 @@
$(document).ready(function() {
- $("#recip").contact_autocomplete(baseurl + '/acl', function(data) {
+ $("#recip").contact_autocomplete(baseurl + '/acl', '', function(data) {
$("#recip-complete").val(data.xid);
});
diff --git a/view/js/mod_poke.js b/view/js/mod_poke.js
index c5ca5399c..3c07fcef7 100644
--- a/view/js/mod_poke.js
+++ b/view/js/mod_poke.js
@@ -1,5 +1,5 @@
$(document).ready(function() {
- $("#poke-recip").contact_autocomplete(baseurl + '/acl', function(data) {
+ $("#poke-recip").contact_autocomplete(baseurl + '/acl', 'a', function(data) {
$("#poke-recip-complete").val(data.id);
});
});