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