]> git.mxchange.org Git - friendica.git/blob - view/js/jquery-textcomplete/README.md
Improve search box
[friendica.git] / view / js / jquery-textcomplete / README.md
1 # Autocomplete for Textarea
2
3 [![npm version](https://badge.fury.io/js/jquery-textcomplete.svg)](http://badge.fury.io/js/jquery-textcomplete)
4 [![Bower version](https://badge.fury.io/bo/jquery-textcomplete.svg)](http://badge.fury.io/bo/jquery-textcomplete)
5 [![Analytics](https://ga-beacon.appspot.com/UA-4932407-14/jquery-textcomplete/readme)](https://github.com/igrigorik/ga-beacon)
6
7 Introduces autocompleting power to textareas, like a GitHub comment form has.
8
9 ![Demo](http://yuku-t.com/jquery-textcomplete/media/images/demo.gif)
10
11 [Demo](http://yuku-t.com/jquery-textcomplete/).
12
13 ## Synopsis
14
15 ```js
16 $('textarea').textcomplete([{
17     match: /(^|\b)(\w{2,})$/,
18     search: function (term, callback) {
19         var words = ['google', 'facebook', 'github', 'microsoft', 'yahoo'];
20         callback($.map(words, function (word) {
21             return word.indexOf(term) === 0 ? word : null;
22         }));
23     },
24     replace: function (word) {
25         return word + ' ';
26     }
27 }]);
28 ```
29
30 ## Dependencies
31
32 - jQuery (>= 1.7.0) OR Zepto (>= 1.0)
33
34 ## Documents
35
36 See [doc](https://github.com/yuku-t/jquery-textcomplete/tree/master/doc) dir.
37
38 ## License
39
40 Licensed under the MIT License.
41
42 ## Contributors
43
44 Patches and code improvements were contributed by:
45
46 https://github.com/yuku-t/jquery-textcomplete/graphs/contributors