diff options
| author | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2014-03-19 20:19:44 +0100 |
|---|---|---|
| committer | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2014-03-19 20:19:44 +0100 |
| commit | ecd293c8a90f0adef5f3e07f8c99c94a3beae63a (patch) | |
| tree | 812c881a3fb80593d7546ae2ea32142277c9ad1c /searx/static/js/searx.js | |
| parent | ce08abe2232473cf9c4e90e60b6510831a289ada (diff) | |
add front-part of autocompleter function
Diffstat (limited to 'searx/static/js/searx.js')
| -rw-r--r-- | searx/static/js/searx.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/searx/static/js/searx.js b/searx/static/js/searx.js index 7b224a17f..15e6012c2 100644 --- a/searx/static/js/searx.js +++ b/searx/static/js/searx.js @@ -1,3 +1,20 @@ +window.addEvent('domready', function() { + new Autocompleter.Request.JSON('q', '/', { + postVar:'q', + postData:{ + 'autocompleter': 1, + '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) { |