From 74b08303622c5545f04a3faf52f6c6962a43ea5f Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Fri, 1 Oct 2021 16:33:31 +0200 Subject: SearXNG: simple theme --- .../themes/simple/src/js/main/searx_search.js | 39 +++++++--------------- 1 file changed, 12 insertions(+), 27 deletions(-) (limited to 'searx/static/themes/simple/src/js/main/searx_search.js') diff --git a/searx/static/themes/simple/src/js/main/searx_search.js b/searx/static/themes/simple/src/js/main/searx_search.js index c593ba6a3..d3149340a 100644 --- a/searx/static/themes/simple/src/js/main/searx_search.js +++ b/searx/static/themes/simple/src/js/main/searx_search.js @@ -1,21 +1,6 @@ -/** -* searx is free software: you can redistribute it and/or modify -* it under the terms of the GNU Affero General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* searx is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Affero General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with searx. If not, see < http://www.gnu.org/licenses/ >. -* -* (C) 2017 by Alexandre Flament, -*/ +/* SPDX-License-Identifier: AGPL-3.0-or-later */ /* global AutoComplete */ -(function(w, d, searx) { +(function(w, d, searxng) { 'use strict'; var firstFocus = true, qinput_id = "q", qinput; @@ -54,7 +39,7 @@ qinput.addEventListener('keyup', updateClearButton, false); } - searx.ready(function() { + searxng.ready(function() { qinput = d.getElementById(qinput_id); function placeCursorAtEndOnce() { @@ -71,11 +56,11 @@ createClearButton(qinput); // autocompleter - if (searx.autocompleter) { - searx.autocomplete = AutoComplete.call(w, { + if (searxng.autocompleter) { + searxng.autocomplete = AutoComplete.call(w, { Url: "./autocompleter", - EmptyMessage: searx.translations.no_item_found, - HttpMethod: searx.method, + EmptyMessage: searxng.translations.no_item_found, + HttpMethod: searxng.method, HttpHeaders: { "Content-type": "application/x-www-form-urlencoded", "X-Requested-With": "XMLHttpRequest" @@ -96,10 +81,10 @@ } // vanilla js version of search_on_category_select.js - if (qinput !== null && d.querySelector('.help') != null && searx.search_on_category_select) { + if (qinput !== null && d.querySelector('.help') != null && searxng.search_on_category_select) { d.querySelector('.help').className='invisible'; - searx.on('#categories input', 'change', function() { + searxng.on('#categories input', 'change', function() { var i, categories = d.querySelectorAll('#categories input[type="checkbox"]'); for(i=0; i