aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorRedMatrix <info@friendica.com>2014-12-21 20:32:12 +1100
committerRedMatrix <info@friendica.com>2014-12-21 20:32:12 +1100
commit0c98cacbcf0c27aba6bea62b4bf3dc00c91b3962 (patch)
tree22e1676a173167b6f340fa8826a184d9efe9479b /view
parent148f0eb4aed6fdbec62f50d87e6db0c8df35fe28 (diff)
parent4e5118650225fe0e194ac8164c47916575e898b3 (diff)
downloadvolse-hubzilla-0c98cacbcf0c27aba6bea62b4bf3dc00c91b3962.tar.gz
volse-hubzilla-0c98cacbcf0c27aba6bea62b4bf3dc00c91b3962.tar.bz2
volse-hubzilla-0c98cacbcf0c27aba6bea62b4bf3dc00c91b3962.zip
Merge pull request #751 from pafcu/autocomplete
Autocomplete smilies
Diffstat (limited to 'view')
-rw-r--r--view/js/autocomplete.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js
index 31d693c7b..fa293fdfd 100644
--- a/view/js/autocomplete.js
+++ b/view/js/autocomplete.js
@@ -46,6 +46,14 @@ function replace(item) {
replace: replace,
template: format,
}
- this.textcomplete([contacts],{});
+
+ smilies = {
+ match: /(^|\s)(:[a-z]{2,})$/,
+ index: 2,
+ search: function(term, callback) { $.getJSON('https://caterva.eu/smilies/json').done(function(data) { callback($.map(data, function(entry) { return entry['text'].indexOf(term) === 0 ? entry : null })) }) },
+ template: function(item) { return item['icon'] + item['text'] },
+ replace: function(item) { return item['text'] + ' '; },
+ }
+ this.textcomplete([contacts,smilies],{});
};
})( jQuery );