Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.3 KiB

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