summaryrefslogtreecommitdiff
path: root/searx/static/default/js/searx.js
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2015-01-01 17:48:12 +0100
committerAdam Tauber <asciimoo@gmail.com>2015-01-01 17:48:12 +0100
commit9f12605f7ebc9ca5575fc4ee9900e0e821366c4d (patch)
treecbb1e9c475134ebbc22edefa4128b0a48f1e5770 /searx/static/default/js/searx.js
parente3957d6adf5298dbc009a0892f5c088c397c586b (diff)
[enh] themes static content refactor
Diffstat (limited to 'searx/static/default/js/searx.js')
-rw-r--r--searx/static/default/js/searx.js49
1 files changed, 0 insertions, 49 deletions
diff --git a/searx/static/default/js/searx.js b/searx/static/default/js/searx.js
deleted file mode 100644
index 9be969bb3..000000000
--- a/searx/static/default/js/searx.js
+++ /dev/null
@@ -1,49 +0,0 @@
-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': false,
- cache: true,
- delay: 300
- });
- });
-}
-
-(function (w, d) {
- 'use strict';
- function addListener(el, type, fn) {
- if (el.addEventListener) {
- el.addEventListener(type, fn, false);
- } else {
- el.attachEvent('on' + type, fn);
- }
- }
-
- function placeCursorAtEnd() {
- if (this.setSelectionRange) {
- var len = this.value.length * 2;
- this.setSelectionRange(len, len);
- }
- }
-
- addListener(w, 'load', function () {
- var qinput = d.getElementById('q');
- if (qinput !== null && qinput.value === "") {
- addListener(qinput, 'focus', placeCursorAtEnd);
- qinput.focus();
- }
- });
-
- if (!!('ontouchstart' in window)) {
- document.getElementsByTagName("html")[0].className += " touch";
- }
-
-})(window, document);
-