diff --git a/searx/static/themes/oscar/css/logicodev-dark.min.css.map b/searx/static/themes/oscar/css/logicodev-dark.min.css.map index 223d05821..73d244632 100644 Binary files a/searx/static/themes/oscar/css/logicodev-dark.min.css.map and b/searx/static/themes/oscar/css/logicodev-dark.min.css.map differ diff --git a/searx/static/themes/oscar/css/pointhi.min.css.map b/searx/static/themes/oscar/css/pointhi.min.css.map index 6af5eab23..0786f3734 100644 Binary files a/searx/static/themes/oscar/css/pointhi.min.css.map and b/searx/static/themes/oscar/css/pointhi.min.css.map differ diff --git a/searx/static/themes/simple/js/searx.head.js b/searx/static/themes/simple/js/searx.head.js index be7560451..0a4fafbce 100644 --- a/searx/static/themes/simple/js/searx.head.js +++ b/searx/static/themes/simple/js/searx.head.js @@ -15,6 +15,7 @@ * (C) 2019 by Alexandre Flament * */ +/* global DocumentTouch:readonly */ (function(w, d) { 'use strict'; diff --git a/searx/static/themes/simple/js/searx.head.min.js.map b/searx/static/themes/simple/js/searx.head.min.js.map index 04525c616..69490193e 100644 Binary files a/searx/static/themes/simple/js/searx.head.min.js.map and b/searx/static/themes/simple/js/searx.head.min.js.map differ diff --git a/searx/static/themes/simple/js/searx.js b/searx/static/themes/simple/js/searx.js index 5ded864cb..5982a06cf 100644 --- a/searx/static/themes/simple/js/searx.js +++ b/searx/static/themes/simple/js/searx.js @@ -70,7 +70,7 @@ window.searx = (function(w, d) { } }; - searx.http = function(method, url, callback) { + searx.http = function(method, url) { var req = new XMLHttpRequest(), resolve = function() {}, reject = function() {}, @@ -148,21 +148,22 @@ window.searx = (function(w, d) { }; searx.insertBefore = function (newNode, referenceNode) { - element.parentNode.insertBefore(newNode, referenceNode); + referenceNode.parentNode.insertBefore(newNode, referenceNode); }; searx.insertAfter = function(newNode, referenceNode) { - referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); + referenceNode.parentNode.insertAfter(newNode, referenceNode.nextSibling); }; - searx.on('.close', 'click', function(e) { - var el = e.target || e.srcElement; + searx.on('.close', 'click', function() { this.parentNode.classList.add('invisible'); }); return searx; })(window, document); -;searx.ready(function() { +;/*global searx*/ + +searx.ready(function() { searx.on('.result', 'click', function() { highlightResult(this)(true); @@ -244,13 +245,13 @@ window.searx = (function(w, d) { }, 80: { key: 'p', - fun: pageButtonClick(0), + fun: GoToPreviousPage(), des: 'go to previous page', cat: 'Results' }, 78: { key: 'n', - fun: pageButtonClick(1), + fun: GoToNextPage(), des: 'go to next page', cat: 'Results' }, @@ -282,7 +283,7 @@ window.searx = (function(w, d) { searx.on(document, "keydown", function(e) { // check for modifiers so we don't break browser's hotkeys - if (vimKeys.hasOwnProperty(e.keyCode) && !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey) { + if (Object.prototype.hasOwnProperty.call(vimKeys, e.keyCode) && !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey) { var tagName = e.target.tagName.toLowerCase(); if (e.keyCode === 27) { if (tagName === 'input' || tagName === 'select' || tagName === 'textarea') { @@ -380,21 +381,23 @@ window.searx = (function(w, d) { } } - function pageButtonClick(num) { + function pageButtonClick(css_selector) { return function() { - var buttons = $('div#pagination button[type="submit"]'); - if (buttons.length !== 2) { - console.log('page navigation with this theme is not supported'); - return; - } - if (num >= 0 && num < buttons.length) { - buttons[num].click(); - } else { - console.log('pageButtonClick(): invalid argument'); + var button = document.querySelector(css_selector); + if (button) { + button.click(); } }; } + function GoToNextPage() { + return pageButtonClick('nav#pagination .next_page button[type="submit"]'); + } + + function GoToPreviousPage() { + return pageButtonClick('nav#pagination .previous_page button[type="submit"]'); + } + function scrollPageToSelected() { var sel = document.querySelector('.result[data-vim-selected]'); if (sel === null) { @@ -472,9 +475,9 @@ window.searx = (function(w, d) { return; } - var html = '×'; - html += '