@mention autocomplete like Facebook, Twitter and Sandglaz.
<script src="jquery.js"></script> <script src="deps/bootstrap-typeahead.js></script> <script src="deps/rangy-core.js></script> <script src="deps/caret-position.js></script> <script src="bootstrap-tagautocomplete.js"></script>You can find these files at https://github.com/Sandglaz/bootstrap-tagautocomplete/tree/master/deps. Note the version of bootstrap-typeahead.js used is from this fork. It's updated to work on contenteditable divs, and has not been pulled in yet.
<div id="example" contenteditable="true"></div>
$('div#example').tagautocomplete({ source: ['@ann', '@bill', '@casey'] });
$('div#example').tagautocomplete({ source: ['@ann', '@bill', '@casey', '#work', '#finance', '#home'], character: '@#', //accept both @ and # after: function () {} //to run after selection });It also accepts bootstrap-typeahead's options: items, updater, matcher, highlighter and sorter.
Bug reports and pull requests are welcomed! If your pull request contains JavaScript patches or features, you must include relevant unit tests.
Code licensed under the Apache License v2.0. Documentation licensed under CC BY 3.0.