diff options
author | Mario <mario@mariovavti.com> | 2021-09-06 19:22:39 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-09-06 19:22:39 +0000 |
commit | c1ce211b566a68b02f1197ef1bd0fc79385c1c48 (patch) | |
tree | 81d8b40691e73abcb5e988cd42d11d6a1e396c60 /view/js/autocomplete.js | |
parent | 3d40ea7f4417a1134dc53cc2e804af13370cd57b (diff) | |
parent | 1aa782633184f41733778ce75139f0d9a890e1e3 (diff) | |
download | volse-hubzilla-c1ce211b566a68b02f1197ef1bd0fc79385c1c48.tar.gz volse-hubzilla-c1ce211b566a68b02f1197ef1bd0fc79385c1c48.tar.bz2 volse-hubzilla-c1ce211b566a68b02f1197ef1bd0fc79385c1c48.zip |
Merge branch 'dev' into 6.2RC
Diffstat (limited to 'view/js/autocomplete.js')
-rw-r--r-- | view/js/autocomplete.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index f20c45982..596dc7076 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -162,20 +162,20 @@ function string2bb(element) { if (typeof extra_channels === 'undefined') extra_channels = false; // Autocomplete contacts - channels = { - match: /(^(?=[^\!]{2})|\s)(@)([^ \n]{3,})$/, + contacts = { + match: /(^|\s)(@\!)([^ \n]{3,})$/, index: 3, cache: true, - search: function(term, callback) { contact_search(term, callback, backend_url, 'c', extra_channels, spinelement=false); }, + search: function(term, callback) { contact_search(term, callback, backend_url, 'm', extra_channels, spinelement=false); }, replace: editor_replace, template: contact_format }; - contacts = { - match: /(^|\s)(@\!)([^ \n]{3,})$/, + channels = { + match: /(^(?=[^\!]{2})|\s)(@)([^ \n]{3,})$/, index: 3, cache: true, - search: function(term, callback) { contact_search(term, callback, backend_url, 'm', extra_channels, spinelement=false); }, + search: function(term, callback) { contact_search(term, callback, backend_url, 'c', extra_channels, spinelement=false); }, replace: editor_replace, template: contact_format }; @@ -211,7 +211,8 @@ function string2bb(element) { maxCount: 100 } }); - textcomplete.register([channels,contacts,smilies,tags]); + // it seems important that contacts are before channels here. Otherwise we run into regex issues. + textcomplete.register([contacts,channels,smilies,tags]); }); }; })( jQuery ); |