aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-03-02 21:15:19 +0000
committerMario <mario@mariovavti.com>2023-03-02 21:15:19 +0000
commitda034045cc1bba74287b7c3e83f4a94ff5359150 (patch)
tree10e2ae77b7ab81811cf8e63cf5a38cf04761ebf4 /view
parent65f001b4b7dcf23ee80e137cfca64993a3da5318 (diff)
downloadvolse-hubzilla-da034045cc1bba74287b7c3e83f4a94ff5359150.tar.gz
volse-hubzilla-da034045cc1bba74287b7c3e83f4a94ff5359150.tar.bz2
volse-hubzilla-da034045cc1bba74287b7c3e83f4a94ff5359150.zip
some work on bringing bang tags back for forums
Diffstat (limited to 'view')
-rw-r--r--view/js/autocomplete.js25
1 files changed, 23 insertions, 2 deletions
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js
index 8edd8dafa..09f6a71c4 100644
--- a/view/js/autocomplete.js
+++ b/view/js/autocomplete.js
@@ -178,6 +178,16 @@ function string2bb(element) {
template: contact_format
};
+ // Autocomplete forums
+ forums = {
+ match: /(^|\s)(\!\!*)([^ \n]{3,})$/,
+ index: 3,
+ cache: true,
+ search: function(term, callback) { contact_search(term, callback, backend_url, 'f', extra_channels, spinelement=false); },
+ replace: editor_replace,
+ template: contact_format
+ };
+
// Autocomplete hashtags
tags = {
match: /(^|\s)(\#)([^ \n]{2,})$/,
@@ -210,7 +220,7 @@ function string2bb(element) {
}
});
// it seems important that contacts are before channels here. Otherwise we run into regex issues.
- textcomplete.register([contacts,channels,smilies,tags]);
+ textcomplete.register([contacts, channels, smilies, forums, tags]);
});
};
})( jQuery );
@@ -234,6 +244,17 @@ function string2bb(element) {
template: contact_format,
};
+ // Autocomplete forums
+ forums = {
+ match: /(^\!)([^\n]{2,})$/,
+ index: 2,
+ cache: true,
+ search: function(term, callback) { contact_search(term, callback, backend_url, 'f', [], spinelement='#nav-search-spinner'); },
+ replace: basic_replace,
+ template: contact_format
+ };
+
+
// Autocomplete hashtags
tags = {
match: /(^\#)([^ \n]{2,})$/,
@@ -257,7 +278,7 @@ function string2bb(element) {
maxCount: 100
}
});
- textcomplete.register([contacts,tags]);
+ textcomplete.register([contacts, forums, tags]);
});
textcomplete.on('selected', function() { this.editor.el.form.submit(); });