File: README.md

package info (click to toggle)
node-jquery-textcomplete 1.8.5%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 340 kB
  • sloc: javascript: 1,141; makefile: 7; sh: 6
file content (48 lines) | stat: -rw-r--r-- 1,434 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
jquery-textcomplete is no longer maintained. Please use [yuku-t/textcomplete](https://github.com/yuku-t/textcomplete) instead.

# Autocomplete for Textarea

[![npm version](https://badge.fury.io/js/jquery-textcomplete.svg)](http://badge.fury.io/js/jquery-textcomplete)
[![Bower version](https://badge.fury.io/bo/jquery-textcomplete.svg)](http://badge.fury.io/bo/jquery-textcomplete)
[![Analytics](https://ga-beacon.appspot.com/UA-4932407-14/jquery-textcomplete/readme)](https://github.com/igrigorik/ga-beacon)

Introduces autocompleting power to textareas, like a GitHub comment form has.

![Demo](http://yuku-t.com/jquery-textcomplete/media/images/demo.gif)

[Demo](http://yuku-t.com/jquery-textcomplete/).

## Synopsis

```js
$('textarea').textcomplete([{
    match: /(^|\b)(\w{2,})$/,
    search: function (term, callback) {
        var words = ['google', 'facebook', 'github', 'microsoft', 'yahoo'];
        callback($.map(words, function (word) {
            return word.indexOf(term) === 0 ? word : null;
        }));
    },
    replace: function (word) {
        return word + ' ';
    }
}]);
```

## Dependencies

- jQuery (>= 1.7.0) OR Zepto (>= 1.0)

## Documents

See [doc](https://github.com/yuku-t/jquery-textcomplete/tree/master/doc) dir.

## License

Licensed under the MIT License.

## Contributors

Patches and code improvements were contributed by:

https://github.com/yuku-t/jquery-textcomplete/graphs/contributors