From 464025361403747c2d9519382d2ab0df2147a6a6 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 6 May 2018 20:30:49 -0700 Subject: autocomplete after 2 chars instead of 3; this was changed some months back to work around implementation quirks in the custom cache driver that is now disabled. --- view/js/autocomplete.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'view/js') diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index 97bb62fef..2a2d1454a 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -188,7 +188,7 @@ function string2bb(element) { // Autocomplete contacts contacts = { - match: /(^|\s)(@\!*)([^ \n]{3,})$/, + match: /(^|\s)(@\!*)([^ \n]{2,})$/, index: 3, cache: true, search: function(term, callback) { contact_search(term, callback, backend_url, 'c', extra_channels, spinelement=false); }, @@ -198,7 +198,7 @@ function string2bb(element) { // Autocomplete forums forums = { - match: /(^|\s)(\!\!*)([^ \n]{3,})$/, + match: /(^|\s)(\!\!*)([^ \n]{2,})$/, index: 3, cache: true, search: function(term, callback) { contact_search(term, callback, backend_url, 'f', extra_channels, spinelement=false); }, @@ -209,7 +209,7 @@ function string2bb(element) { // Autocomplete hashtags tags = { - match: /(^|\s)(\#)([^ \n]{3,})$/, + match: /(^|\s)(\#)([^ \n]{2,})$/, index: 3, cache: true, search: function(term, callback) { $.getJSON('/hashtags/' + '$f=&t=' + term).done(function(data) { callback($.map(data, function(entry) { return entry.text.toLowerCase().indexOf(term.toLowerCase()) === 0 ? entry : null; })); }); }, @@ -253,7 +253,7 @@ function string2bb(element) { // Autocomplete contacts contacts = { - match: /(^@)([^\n]{3,})$/, + match: /(^@)([^\n]{2,})$/, index: 2, cache: true, search: function(term, callback) { contact_search(term, callback, backend_url, 'x', [], spinelement='#nav-search-spinner'); }, @@ -263,7 +263,7 @@ function string2bb(element) { // Autocomplete forums forums = { - match: /(^\!)([^\n]{3,})$/, + match: /(^\!)([^\n]{2,})$/, index: 2, cache: true, search: function(term, callback) { contact_search(term, callback, backend_url, 'f', [], spinelement='#nav-search-spinner'); }, @@ -273,7 +273,7 @@ function string2bb(element) { // Autocomplete hashtags tags = { - match: /(^\#)([^ \n]{3,})$/, + match: /(^\#)([^ \n]{2,})$/, index: 2, cache: true, search: function(term, callback) { $.getJSON('/hashtags/' + '$f=&t=' + term).done(function(data) { callback($.map(data, function(entry) { return entry.text.toLowerCase().indexOf(term.toLowerCase()) === 0 ? entry : null; })); }); }, @@ -306,7 +306,7 @@ function string2bb(element) { // Autocomplete contacts contacts = { - match: /(^)([^\n]{3,})$/, + match: /(^)([^\n]{2,})$/, index: 2, cache: true, search: function(term, callback) { contact_search(term, callback, backend_url, typ,[], spinelement=false); }, @@ -344,7 +344,7 @@ function string2bb(element) { // Autocomplete contacts names = { - match: /(^)([^\n]{3,})$/, + match: /(^)([^\n]{2,})$/, index: 2, cache: true, search: function(term, callback) { contact_search(term, callback, backend_url, typ,[], spinelement=false); }, -- cgit v1.2.3