diff options
author | Chris Johns <chrisj@rtems.org> | 2017-01-11 15:50:59 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2017-01-11 15:56:04 +1100 |
commit | ecf82d1b3d3a825f0340fd12f0bbe49a5139c31e (patch) | |
tree | 517a17f4cb2fa87daa303d82a5978602978303d7 /common/html-coverpage/static/js/bloodhound.js | |
parent | waf: Add a title to the XML Catalogue. (diff) | |
download | rtems-docs-ecf82d1b3d3a825f0340fd12f0bbe49a5139c31e.tar.bz2 |
html: Add support for an HTML cover page for releases.
Diffstat (limited to 'common/html-coverpage/static/js/bloodhound.js')
-rw-r--r-- | common/html-coverpage/static/js/bloodhound.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/common/html-coverpage/static/js/bloodhound.js b/common/html-coverpage/static/js/bloodhound.js new file mode 100644 index 0000000..ec2cbf6 --- /dev/null +++ b/common/html-coverpage/static/js/bloodhound.js @@ -0,0 +1,30 @@ + +var states = new Bloodhound({ + remote: '/search/autocomplete/?q=%QUERY', + datumTokenizer: function(d) { + return Bloodhound.tokenizers.whitespace(d.value); + }, + queryTokenizer: Bloodhound.tokenizers.whitespace, + limit: 15 +}); + +// kicks off the loading/processing of `local` and `prefetch` +states.initialize(); + +$('#bloodhound .typeahead').typeahead({ + hint: true, + highlight: true, + minLength: 1 +}, +{ + name: 'states', + displayKey: 'value', + // `ttAdapter` wraps the suggestion engine in an adapter that + // is compatible with the typeahead jQuery plugin + source: states.ttAdapter() +}); + + +$('#search_input').bind('typeahead:selected', function(obj, datum, name) { + $("form").submit(); +}); |