mirror of
https://github.com/searxng/searxng.git
synced 2026-05-18 08:54:30 +02:00
[mod] theme/simple: fmt/lint major pass
*Not so safe* changes, no behaviour changes. - More ES5 to ES2015+ conversion. - Make Biome not cry anymore applying remaining changes.
This commit is contained in:
committed by
Markus Heiser
parent
95172213f6
commit
879ac4e60f
@@ -1,23 +1,23 @@
|
||||
/* SPDX-License-Identifier: AGPL-3.0-or-later */
|
||||
/* exported AutoComplete */
|
||||
|
||||
((w, d, searxng) => {
|
||||
var qinput_id = "q",
|
||||
qinput;
|
||||
((_w, d, searxng) => {
|
||||
const qinput_id = "q";
|
||||
let qinput;
|
||||
|
||||
const isMobile = window.matchMedia("only screen and (max-width: 50em)").matches;
|
||||
const isResultsPage = document.querySelector("main").id === "main_results";
|
||||
|
||||
function submitIfQuery() {
|
||||
if (qinput.value.length > 0) {
|
||||
var search = document.getElementById("search");
|
||||
const search = document.getElementById("search");
|
||||
setTimeout(search.submit.bind(search), 0);
|
||||
}
|
||||
}
|
||||
|
||||
function createClearButton(qinput) {
|
||||
var cs = document.getElementById("clear_search");
|
||||
var updateClearButton = () => {
|
||||
const cs = document.getElementById("clear_search");
|
||||
const updateClearButton = () => {
|
||||
if (qinput.value.length === 0) {
|
||||
cs.classList.add("empty");
|
||||
} else {
|
||||
@@ -41,7 +41,7 @@
|
||||
if (searxng.settings.method === "GET") {
|
||||
const reqParams = new URLSearchParams();
|
||||
reqParams.append("q", query);
|
||||
request = fetch("./autocompleter?" + reqParams.toString());
|
||||
request = fetch(`./autocompleter?${reqParams.toString()}`);
|
||||
} else {
|
||||
const formData = new FormData();
|
||||
formData.append("q", query);
|
||||
|
||||
Reference in New Issue
Block a user