aboutsummaryrefslogtreecommitdiffstats
path: root/view/js/autocomplete.js
diff options
context:
space:
mode:
authorStefan Parviainen <saparvia@caterva.eu>2015-01-07 18:57:16 +0100
committerStefan Parviainen <saparvia@caterva.eu>2015-01-07 18:57:16 +0100
commit4e3aadc38a671ebd37d3619ea64f278f5a06f6dc (patch)
tree5148a621e02a7e82e8b0f66c91622c1be59775a7 /view/js/autocomplete.js
parente3d064ff22a69766226766557ff2a5b094c74e27 (diff)
downloadvolse-hubzilla-4e3aadc38a671ebd37d3619ea64f278f5a06f6dc.tar.gz
volse-hubzilla-4e3aadc38a671ebd37d3619ea64f278f5a06f6dc.tar.bz2
volse-hubzilla-4e3aadc38a671ebd37d3619ea64f278f5a06f6dc.zip
Rename some stuff related to autocomplete
Diffstat (limited to 'view/js/autocomplete.js')
-rw-r--r--view/js/autocomplete.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js
index e68356057..1fa20cc3b 100644
--- a/view/js/autocomplete.js
+++ b/view/js/autocomplete.js
@@ -3,7 +3,7 @@
*
* require jQuery, jquery.textcomplete
*/
-function mysearch(term, callback, backend_url, extra_channels) {
+function contact_search(term, callback, backend_url, extra_channels) {
var postdata = {
start:0,
count:100,
@@ -25,11 +25,11 @@ function mysearch(term, callback, backend_url, extra_channels) {
}).fail(function () {callback([]); }); // Callback must be invoked even if something went wrong.
}
-function format(item) {
+function contact_format(item) {
return "<div class='{0}' title='{4}'><img src='{1}'>{2} ({3})</div>".format(item.taggable, item.photo, item.name, ((item.label) ? item.nick + ' ' + item.label : item.nick), item.link )
}
-function replace(item) {
+function editor_replace(item) {
// $2 ensures that prefix (@,@!) is preserved
var id = item.id;
// 16 chars of hash should be enough. Full hash could be used if it can be done in a visually appealing way.
@@ -40,19 +40,19 @@ function replace(item) {
}
/**
- * jQuery plugin 'contact_autocomplete'
+ * jQuery plugin 'editor_autocomplete'
*/
(function( $ ){
- $.fn.contact_autocomplete = function(backend_url, extra_channels) {
+ $.fn.editor_autocomplete = function(backend_url, extra_channels) {
if (typeof extra_channels === 'undefined') extra_channels = false;
// Autocomplete contacts
contacts = {
match: /(^|\s)(@\!*)([^ \n]+)$/,
index: 3,
- search: function(term, callback) { mysearch(term, callback, backend_url, extra_channels); },
- replace: replace,
- template: format,
+ search: function(term, callback) { contact_search(term, callback, backend_url, extra_channels); },
+ replace: editor_replace,
+ template: contact_format,
}
smilies = {