diff options
| author | Adam Tauber <asciimoo@gmail.com> | 2014-03-25 18:00:45 +0100 |
|---|---|---|
| committer | Adam Tauber <asciimoo@gmail.com> | 2014-03-25 18:00:45 +0100 |
| commit | 20504a0e834a99fb1274ad907c0b62fb90eb96d3 (patch) | |
| tree | e15473776d3311379c7a40234beaa7edbb97be53 /searx/static/js/searx.js | |
| parent | 0207070cde9d6319a3403d1a1c6b1a37c8d3c60c (diff) | |
| parent | a76525d1f3256105d45ee0a0f1301a8cc0b2e4c6 (diff) | |
Merge branch 'autocompleter' of https://github.com/pointhi/searx into autocomplete
Diffstat (limited to 'searx/static/js/searx.js')
| -rw-r--r-- | searx/static/js/searx.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/searx/static/js/searx.js b/searx/static/js/searx.js index 7b224a17f..2b2e0c98c 100644 --- a/searx/static/js/searx.js +++ b/searx/static/js/searx.js @@ -1,3 +1,21 @@ +if(searx.autocompleter) { + window.addEvent('domready', function() { + new Autocompleter.Request.JSON('q', '/autocompleter', { + postVar:'q', + postData:{ + 'format': 'json' + }, + ajaxOptions:{ + timeout: 5 // Correct option? + }, + 'minLength': 4, + 'selectMode': 'type-ahead', + cache: true, + delay: 300 + }); + }); +} + (function (w, d) { 'use strict'; function addListener(el, type, fn) { |