summaryrefslogtreecommitdiffstats
path: root/common/coverpage/static/js/bloodhound.js
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2017-01-12 12:55:15 +1100
committerChris Johns <chrisj@rtems.org>2017-01-12 12:56:13 +1100
commit049097fc804b7f0b2fdf54b9ba6a0c2aeae17725 (patch)
treecc525b8b55cbb6fd4dd37ae03573e957429f2555 /common/coverpage/static/js/bloodhound.js
parentconf.py: Fix build_date() to append correct suffix on all days. (diff)
downloadrtems-docs-049097fc804b7f0b2fdf54b9ba6a0c2aeae17725.tar.bz2
coverpage: Update the coverpage to have the table collapse.
Add each doc's conf.py as a dependence to catalogue.xml.
Diffstat (limited to 'common/coverpage/static/js/bloodhound.js')
-rw-r--r--common/coverpage/static/js/bloodhound.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/common/coverpage/static/js/bloodhound.js b/common/coverpage/static/js/bloodhound.js
new file mode 100644
index 0000000..ec2cbf6
--- /dev/null
+++ b/common/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();
+});