mirror of
https://github.com/searxng/searxng.git
synced 2025-12-22 19:50:00 +00:00
[mod] client/simple: client plugins (#5406)
* [mod] client/simple: client plugins
Defines a new interface for client side *"plugins"* that coexist with server
side plugin system. Each plugin (e.g., `InfiniteScroll`) extends the base
`ts Plugin`. Client side plugins are independent and lazy‑loaded via `router.ts`
when their `load()` conditions are met. On each navigation request, all
applicable plugins are instanced.
Since these are client side plugins, we can only invoke them once DOM is fully
loaded. E.g. `Calculator` will not render a new `answer` block until fully
loaded and executed.
For some plugins, we might want to handle its availability in `settings.yml`
and toggle in UI, like we do for server side plugins. In that case, we extend
`py Plugin` instancing only the information and then checking client side if
[`settings.plugins`](1ad832b1dc/client/simple/src/js/toolkit.ts (L134))
array has the plugin id.
* [mod] client/simple: rebuild static
This commit is contained in:
@@ -40,8 +40,8 @@ Known Quirks
|
||||
The implementation to support :py:obj:`paging <searx.enginelib.Engine.paging>`
|
||||
is based on the *nextpage* method of Piped's REST API / the :py:obj:`frontend
|
||||
API <frontend_url>`. This feature is *next page driven* and plays well with the
|
||||
:ref:`infinite_scroll <settings ui>` setting in SearXNG but it does not really
|
||||
fit into SearXNG's UI to select a page by number.
|
||||
:ref:`infinite_scroll <settings plugins>` plugin in SearXNG but it does not
|
||||
really fit into SearXNG's UI to select a page by number.
|
||||
|
||||
Implementations
|
||||
===============
|
||||
|
||||
@@ -32,8 +32,8 @@ Known Quirks
|
||||
|
||||
The implementation to support :py:obj:`paging <searx.enginelib.Engine.paging>`
|
||||
is based on the *nextpage* method of Seekr's REST API. This feature is *next
|
||||
page driven* and plays well with the :ref:`infinite_scroll <settings ui>`
|
||||
setting in SearXNG but it does not really fit into SearXNG's UI to select a page
|
||||
page driven* and plays well with the :ref:`infinite_scroll <settings plugins>`
|
||||
plugin in SearXNG but it does not really fit into SearXNG's UI to select a page
|
||||
by number.
|
||||
|
||||
Implementations
|
||||
|
||||
@@ -1,31 +1,19 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""Calculate mathematical expressions using :py:obj:`ast.parse` (mode="eval")."""
|
||||
# pylint: disable=missing-module-docstring
|
||||
|
||||
import typing
|
||||
import typing as t
|
||||
|
||||
import ast
|
||||
import math
|
||||
import re
|
||||
import operator
|
||||
import multiprocessing
|
||||
from flask_babel import gettext # pyright: ignore[reportUnknownVariableType]
|
||||
|
||||
import babel
|
||||
import babel.numbers
|
||||
from flask_babel import gettext
|
||||
|
||||
from searx.result_types import EngineResults
|
||||
from searx.plugins import Plugin, PluginInfo
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
from searx.search import SearchWithPlugins
|
||||
from searx.extended_types import SXNG_Request
|
||||
if t.TYPE_CHECKING:
|
||||
from searx.plugins import PluginCfg
|
||||
|
||||
|
||||
@t.final
|
||||
class SXNGPlugin(Plugin):
|
||||
"""Plugin converts strings to different hash digests. The results are
|
||||
displayed in area for the "answers".
|
||||
"""
|
||||
"""Parses and solves mathematical expressions."""
|
||||
|
||||
id = "calculator"
|
||||
|
||||
@@ -34,200 +22,7 @@ class SXNGPlugin(Plugin):
|
||||
|
||||
self.info = PluginInfo(
|
||||
id=self.id,
|
||||
name=gettext("Basic Calculator"),
|
||||
description=gettext("Calculate mathematical expressions via the search bar"),
|
||||
preference_section="general",
|
||||
name=gettext("Calculator"),
|
||||
description=gettext("Parses and solves mathematical expressions."),
|
||||
preference_section="query",
|
||||
)
|
||||
|
||||
def timeout_func(self, timeout, func, *args, **kwargs):
|
||||
que = mp_fork.Queue()
|
||||
p = mp_fork.Process(target=handler, args=(que, func, args), kwargs=kwargs)
|
||||
p.start()
|
||||
p.join(timeout=timeout)
|
||||
ret_val = None
|
||||
# pylint: disable=used-before-assignment,undefined-variable
|
||||
if not p.is_alive():
|
||||
ret_val = que.get()
|
||||
else:
|
||||
self.log.debug("terminate function (%s: %s // %s) after timeout is exceeded", func.__name__, args, kwargs)
|
||||
p.terminate()
|
||||
p.join()
|
||||
p.close()
|
||||
return ret_val
|
||||
|
||||
def post_search(self, request: "SXNG_Request", search: "SearchWithPlugins") -> EngineResults:
|
||||
results = EngineResults()
|
||||
|
||||
# only show the result of the expression on the first page
|
||||
if search.search_query.pageno > 1:
|
||||
return results
|
||||
|
||||
query = search.search_query.query
|
||||
# in order to avoid DoS attacks with long expressions, ignore long expressions
|
||||
if len(query) > 100:
|
||||
return results
|
||||
|
||||
# replace commonly used math operators with their proper Python operator
|
||||
query = query.replace("x", "*").replace(":", "/")
|
||||
|
||||
# Is this a term that can be calculated?
|
||||
word, constants = "", set()
|
||||
for x in query:
|
||||
# Alphabetic characters are defined as "Letters" in the Unicode
|
||||
# character database and are the constants in an equation.
|
||||
if x.isalpha():
|
||||
word += x.strip()
|
||||
elif word:
|
||||
constants.add(word)
|
||||
word = ""
|
||||
|
||||
# In the term of an arithmetic operation there should be no other
|
||||
# alphabetic characters besides the constants
|
||||
if constants - set(math_constants):
|
||||
return results
|
||||
|
||||
# use UI language
|
||||
ui_locale = babel.Locale.parse(request.preferences.get_value("locale"), sep="-")
|
||||
|
||||
# parse the number system in a localized way
|
||||
def _decimal(match: re.Match) -> str:
|
||||
val = match.string[match.start() : match.end()]
|
||||
val = babel.numbers.parse_decimal(val, ui_locale, numbering_system="latn")
|
||||
return str(val)
|
||||
|
||||
decimal = ui_locale.number_symbols["latn"]["decimal"]
|
||||
group = ui_locale.number_symbols["latn"]["group"]
|
||||
query = re.sub(f"[0-9]+[{decimal}|{group}][0-9]+[{decimal}|{group}]?[0-9]?", _decimal, query)
|
||||
|
||||
# in python, powers are calculated via **
|
||||
query_py_formatted = query.replace("^", "**")
|
||||
|
||||
# Prevent the runtime from being longer than 50 ms
|
||||
res = self.timeout_func(0.05, _eval_expr, query_py_formatted)
|
||||
if res is None or res[0] == "":
|
||||
return results
|
||||
|
||||
res, is_boolean = res
|
||||
if is_boolean:
|
||||
res = "True" if res != 0 else "False"
|
||||
else:
|
||||
res = babel.numbers.format_decimal(res, locale=ui_locale)
|
||||
results.add(results.types.Answer(answer=f"{search.search_query.query} = {res}"))
|
||||
|
||||
return results
|
||||
|
||||
|
||||
def _compare(ops: list[ast.cmpop], values: list[int | float]) -> int:
|
||||
"""
|
||||
2 < 3 becomes ops=[ast.Lt] and values=[2,3]
|
||||
2 < 3 <= 4 becomes ops=[ast.Lt, ast.LtE] and values=[2,3, 4]
|
||||
"""
|
||||
for op, a, b in zip(ops, values, values[1:]): # pylint: disable=invalid-name
|
||||
if isinstance(op, ast.Eq) and a == b:
|
||||
continue
|
||||
if isinstance(op, ast.NotEq) and a != b:
|
||||
continue
|
||||
if isinstance(op, ast.Lt) and a < b:
|
||||
continue
|
||||
if isinstance(op, ast.LtE) and a <= b:
|
||||
continue
|
||||
if isinstance(op, ast.Gt) and a > b:
|
||||
continue
|
||||
if isinstance(op, ast.GtE) and a >= b:
|
||||
continue
|
||||
|
||||
# Ignore impossible ops:
|
||||
# * ast.Is
|
||||
# * ast.IsNot
|
||||
# * ast.In
|
||||
# * ast.NotIn
|
||||
|
||||
# the result is False for a and b and operation op
|
||||
return 0
|
||||
# the results for all the ops are True
|
||||
return 1
|
||||
|
||||
|
||||
operators: dict[type, typing.Callable] = {
|
||||
ast.Add: operator.add,
|
||||
ast.Sub: operator.sub,
|
||||
ast.Mult: operator.mul,
|
||||
ast.Div: operator.truediv,
|
||||
ast.Pow: operator.pow,
|
||||
ast.BitXor: operator.xor,
|
||||
ast.BitOr: operator.or_,
|
||||
ast.BitAnd: operator.and_,
|
||||
ast.USub: operator.neg,
|
||||
ast.RShift: operator.rshift,
|
||||
ast.LShift: operator.lshift,
|
||||
ast.Mod: operator.mod,
|
||||
ast.Compare: _compare,
|
||||
}
|
||||
|
||||
|
||||
math_constants = {
|
||||
'e': math.e,
|
||||
'pi': math.pi,
|
||||
}
|
||||
|
||||
|
||||
# with multiprocessing.get_context("fork") we are ready for Py3.14 (by emulating
|
||||
# the old behavior "fork") but it will not solve the core problem of fork, nor
|
||||
# will it remove the deprecation warnings in py3.12 & py3.13. Issue is
|
||||
# ddiscussed here: https://github.com/searxng/searxng/issues/4159
|
||||
mp_fork = multiprocessing.get_context("fork")
|
||||
|
||||
|
||||
def _eval_expr(expr):
|
||||
"""
|
||||
Evaluates the given textual expression.
|
||||
|
||||
Returns a tuple of (numericResult, isBooleanResult).
|
||||
|
||||
>>> _eval_expr('2^6')
|
||||
64, False
|
||||
>>> _eval_expr('2**6')
|
||||
64, False
|
||||
>>> _eval_expr('1 + 2*3**(4^5) / (6 + -7)')
|
||||
-5.0, False
|
||||
>>> _eval_expr('1 < 3')
|
||||
1, True
|
||||
>>> _eval_expr('5 < 3')
|
||||
0, True
|
||||
>>> _eval_expr('17 == 11+1+5 == 7+5+5')
|
||||
1, True
|
||||
"""
|
||||
try:
|
||||
root_expr = ast.parse(expr, mode='eval').body
|
||||
return _eval(root_expr), isinstance(root_expr, ast.Compare)
|
||||
|
||||
except (SyntaxError, TypeError, ZeroDivisionError):
|
||||
# Expression that can't be evaluated (i.e. not a math expression)
|
||||
return "", False
|
||||
|
||||
|
||||
def _eval(node):
|
||||
if isinstance(node, ast.Constant) and isinstance(node.value, (int, float)):
|
||||
return node.value
|
||||
|
||||
if isinstance(node, ast.BinOp):
|
||||
return operators[type(node.op)](_eval(node.left), _eval(node.right))
|
||||
|
||||
if isinstance(node, ast.UnaryOp):
|
||||
return operators[type(node.op)](_eval(node.operand))
|
||||
|
||||
if isinstance(node, ast.Compare):
|
||||
return _compare(node.ops, [_eval(node.left)] + [_eval(c) for c in node.comparators])
|
||||
|
||||
if isinstance(node, ast.Name) and node.id in math_constants:
|
||||
return math_constants[node.id]
|
||||
|
||||
raise TypeError(node)
|
||||
|
||||
|
||||
def handler(q: multiprocessing.Queue, func, args, **kwargs): # pylint:disable=invalid-name
|
||||
try:
|
||||
q.put(func(*args, **kwargs))
|
||||
except:
|
||||
q.put(None)
|
||||
raise
|
||||
|
||||
28
searx/plugins/infinite_scroll.py
Normal file
28
searx/plugins/infinite_scroll.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# pylint: disable=missing-module-docstring
|
||||
|
||||
import typing as t
|
||||
|
||||
from flask_babel import gettext # pyright: ignore[reportUnknownVariableType]
|
||||
|
||||
from searx.plugins import Plugin, PluginInfo
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from searx.plugins import PluginCfg
|
||||
|
||||
|
||||
@t.final
|
||||
class SXNGPlugin(Plugin):
|
||||
"""Automatically loads the next page when scrolling to bottom of the current page."""
|
||||
|
||||
id = "infiniteScroll"
|
||||
|
||||
def __init__(self, plg_cfg: "PluginCfg") -> None:
|
||||
super().__init__(plg_cfg)
|
||||
|
||||
self.info = PluginInfo(
|
||||
id=self.id,
|
||||
name=gettext("Infinite scroll"),
|
||||
description=gettext("Automatically loads the next page when scrolling to bottom of the current page"),
|
||||
preference_section="ui",
|
||||
)
|
||||
@@ -476,10 +476,6 @@ class Preferences:
|
||||
settings['ui']['query_in_title'],
|
||||
locked=is_locked('query_in_title')
|
||||
),
|
||||
'infinite_scroll': BooleanSetting(
|
||||
settings['ui']['infinite_scroll'],
|
||||
locked=is_locked('infinite_scroll')
|
||||
),
|
||||
'search_on_category_select': BooleanSetting(
|
||||
settings['ui']['search_on_category_select'],
|
||||
locked=is_locked('search_on_category_select')
|
||||
|
||||
@@ -124,8 +124,6 @@ ui:
|
||||
# query_in_title: When true, the result page's titles contains the query
|
||||
# it decreases the privacy, since the browser can records the page titles.
|
||||
query_in_title: false
|
||||
# infinite_scroll: When true, automatically loads the next page when scrolling to bottom of the current page.
|
||||
infinite_scroll: false
|
||||
# ui theme
|
||||
default_theme: simple
|
||||
# center the results ?
|
||||
@@ -162,7 +160,6 @@ ui:
|
||||
# - locale
|
||||
# - theme
|
||||
# - results_on_new_tab
|
||||
# - infinite_scroll
|
||||
# - search_on_category_select
|
||||
# - method
|
||||
# - image_proxy
|
||||
@@ -214,6 +211,7 @@ outgoing:
|
||||
# - 1.1.1.2
|
||||
# - fe80::/126
|
||||
|
||||
|
||||
# Plugin configuration, for more details see
|
||||
# https://docs.searxng.org/admin/settings/settings_plugins.html
|
||||
#
|
||||
@@ -222,6 +220,9 @@ plugins:
|
||||
searx.plugins.calculator.SXNGPlugin:
|
||||
active: true
|
||||
|
||||
searx.plugins.infinite_scroll.SXNGPlugin:
|
||||
active: false
|
||||
|
||||
searx.plugins.hash_plugin.SXNGPlugin:
|
||||
active: true
|
||||
|
||||
|
||||
@@ -238,7 +238,6 @@ SCHEMA: dict[str, t.Any] = {
|
||||
'results_on_new_tab': SettingsValue(bool, False),
|
||||
'advanced_search': SettingsValue(bool, False),
|
||||
'query_in_title': SettingsValue(bool, False),
|
||||
'infinite_scroll': SettingsValue(bool, False),
|
||||
'cache_url': SettingsValue(str, 'https://web.archive.org/web/'),
|
||||
'search_on_category_select': SettingsValue(bool, True),
|
||||
'hotkeys': SettingsValue(('default', 'vim'), 'default'),
|
||||
|
||||
2
searx/static/themes/simple/chunk/13gvpunf.min.js
vendored
Normal file
2
searx/static/themes/simple/chunk/13gvpunf.min.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
const e=e=>{if(!e)throw Error(`DOM element not found`)};export{e as t};
|
||||
//# sourceMappingURL=13gvpunf.min.js.map
|
||||
1
searx/static/themes/simple/chunk/13gvpunf.min.js.map
Normal file
1
searx/static/themes/simple/chunk/13gvpunf.min.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"13gvpunf.min.js","names":["assertElement: AssertElement"],"sources":["../../../../../client/simple/src/js/util/assertElement.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n\ntype AssertElement = <T>(element?: T | null) => asserts element is T;\nexport const assertElement: AssertElement = <T>(element?: T | null): asserts element is T => {\n if (!element) {\n throw new Error(\"DOM element not found\");\n }\n};\n"],"mappings":"AAGA,MAAaA,EAAmC,GAA6C,CAC3F,GAAI,CAAC,EACH,MAAU,MAAM,wBAAwB"}
|
||||
8
searx/static/themes/simple/chunk/BAcZkB_P.min.js
vendored
Normal file
8
searx/static/themes/simple/chunk/BAcZkB_P.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
searx/static/themes/simple/chunk/BAcZkB_P.min.js.map
Normal file
1
searx/static/themes/simple/chunk/BAcZkB_P.min.js.map
Normal file
File diff suppressed because one or more lines are too long
15
searx/static/themes/simple/chunk/CHkLfdMs.min.js
vendored
Normal file
15
searx/static/themes/simple/chunk/CHkLfdMs.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
searx/static/themes/simple/chunk/CHkLfdMs.min.js.map
Normal file
1
searx/static/themes/simple/chunk/CHkLfdMs.min.js.map
Normal file
File diff suppressed because one or more lines are too long
2
searx/static/themes/simple/chunk/CyyZ9XJS.min.js
vendored
Normal file
2
searx/static/themes/simple/chunk/CyyZ9XJS.min.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import{i as e,n as t,t as n}from"../sxng-core.min.js";import{t as r}from"./13gvpunf.min.js";var i,a=async()=>{if(!i){try{i=await(await n(`GET`,`engine_descriptions.json`)).json()}catch(e){console.error(`Error fetching engineDescriptions:`,e)}if(i)for(let[t,[n,r]]of Object.entries(i)){let i=document.querySelectorAll(`[data-engine-name="${t}"] .engine-description`),a=` (<i>${e.translations?.Source}: ${r}</i>)`;for(let e of i)e.innerHTML=n+a}}},o=(e,t)=>{for(let n of t)n.offsetParent&&(n.checked=!e)},s=document.querySelectorAll(`[data-engine-name]`);for(let e of s)t(`mouseenter`,e,a);var c=document.querySelectorAll(`tbody input[type=checkbox][class~=checkbox-onoff]`),l=document.querySelectorAll(`.enable-all-engines`);for(let e of l)t(`click`,e,()=>o(!0,c));var u=document.querySelectorAll(`.disable-all-engines`);for(let e of u)t(`click`,e,()=>o(!1,c));t(`click`,`#copy-hash`,async function(){let e=this.parentElement?.querySelector(`pre`);if(r(e),window.isSecureContext)await navigator.clipboard.writeText(e.innerText);else{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n),document.execCommand(`copy`)}}let t=this.dataset.copiedText;t&&(this.innerText=t)});
|
||||
//# sourceMappingURL=CyyZ9XJS.min.js.map
|
||||
1
searx/static/themes/simple/chunk/CyyZ9XJS.min.js.map
Normal file
1
searx/static/themes/simple/chunk/CyyZ9XJS.min.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CyyZ9XJS.min.js","names":["engineDescriptions: Record<string, [string, string]> | undefined","engineElements: NodeListOf<HTMLElement>","engineToggles: NodeListOf<HTMLInputElement>","enableAllEngines: NodeListOf<HTMLElement>","disableAllEngines: NodeListOf<HTMLElement>"],"sources":["../../../../../client/simple/src/js/main/preferences.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport { http, listen, settings } from \"../toolkit.ts\";\nimport { assertElement } from \"../util/assertElement.ts\";\n\nlet engineDescriptions: Record<string, [string, string]> | undefined;\n\nconst loadEngineDescriptions = async (): Promise<void> => {\n if (engineDescriptions) return;\n try {\n const res = await http(\"GET\", \"engine_descriptions.json\");\n engineDescriptions = await res.json();\n } catch (error) {\n console.error(\"Error fetching engineDescriptions:\", error);\n }\n if (!engineDescriptions) return;\n\n for (const [engine_name, [description, source]] of Object.entries(engineDescriptions)) {\n const elements = document.querySelectorAll<HTMLElement>(`[data-engine-name=\"${engine_name}\"] .engine-description`);\n const sourceText = ` (<i>${settings.translations?.Source}: ${source}</i>)`;\n\n for (const element of elements) {\n element.innerHTML = description + sourceText;\n }\n }\n};\n\nconst toggleEngines = (enable: boolean, engineToggles: NodeListOf<HTMLInputElement>): void => {\n for (const engineToggle of engineToggles) {\n // check if element visible, so that only engines of the current category are modified\n if (engineToggle.offsetParent) {\n engineToggle.checked = !enable;\n }\n }\n};\n\nconst engineElements: NodeListOf<HTMLElement> = document.querySelectorAll<HTMLElement>(\"[data-engine-name]\");\nfor (const engineElement of engineElements) {\n listen(\"mouseenter\", engineElement, loadEngineDescriptions);\n}\n\nconst engineToggles: NodeListOf<HTMLInputElement> = document.querySelectorAll<HTMLInputElement>(\n \"tbody input[type=checkbox][class~=checkbox-onoff]\"\n);\n\nconst enableAllEngines: NodeListOf<HTMLElement> = document.querySelectorAll<HTMLElement>(\".enable-all-engines\");\nfor (const engine of enableAllEngines) {\n listen(\"click\", engine, () => toggleEngines(true, engineToggles));\n}\n\nconst disableAllEngines: NodeListOf<HTMLElement> = document.querySelectorAll<HTMLElement>(\".disable-all-engines\");\nfor (const engine of disableAllEngines) {\n listen(\"click\", engine, () => toggleEngines(false, engineToggles));\n}\n\nlisten(\"click\", \"#copy-hash\", async function (this: HTMLElement) {\n const target = this.parentElement?.querySelector<HTMLPreElement>(\"pre\");\n assertElement(target);\n\n if (window.isSecureContext) {\n await navigator.clipboard.writeText(target.innerText);\n } else {\n const selection = window.getSelection();\n if (selection) {\n const range = document.createRange();\n range.selectNodeContents(target);\n selection.removeAllRanges();\n selection.addRange(range);\n document.execCommand(\"copy\");\n }\n }\n\n const copiedText = this.dataset.copiedText;\n if (copiedText) {\n this.innerText = copiedText;\n }\n});\n"],"mappings":"4FAKA,IAAIA,EAEE,EAAyB,SAA2B,CACpD,MACJ,IAAI,CAEF,EAAqB,MADT,MAAM,EAAK,MAAO,2BAA2B,EAC1B,MAAM,OAC9B,EAAO,CACd,QAAQ,MAAM,qCAAsC,EAAM,CAEvD,KAEL,IAAK,GAAM,CAAC,EAAa,CAAC,EAAa,MAAY,OAAO,QAAQ,EAAmB,CAAE,CACrF,IAAM,EAAW,SAAS,iBAA8B,sBAAsB,EAAY,wBAAwB,CAC5G,EAAa,QAAQ,EAAS,cAAc,OAAO,SAAS,EAAO,OAEzE,IAAK,IAAM,KAAW,EACpB,EAAQ,UAAY,EAAc,KAKlC,GAAiB,EAAiB,IAAsD,CAC5F,IAAK,IAAM,KAAgB,EAErB,EAAa,eACf,EAAa,QAAU,CAAC,IAKxBC,EAA0C,SAAS,iBAA8B,qBAAqB,CAC5G,IAAK,IAAM,KAAiB,EAC1B,EAAO,aAAc,EAAe,EAAuB,CAG7D,IAAMC,EAA8C,SAAS,iBAC3D,oDACD,CAEKC,EAA4C,SAAS,iBAA8B,sBAAsB,CAC/G,IAAK,IAAM,KAAU,EACnB,EAAO,QAAS,MAAc,EAAc,GAAM,EAAc,CAAC,CAGnE,IAAMC,EAA6C,SAAS,iBAA8B,uBAAuB,CACjH,IAAK,IAAM,KAAU,EACnB,EAAO,QAAS,MAAc,EAAc,GAAO,EAAc,CAAC,CAGpE,EAAO,QAAS,aAAc,gBAAmC,CAC/D,IAAM,EAAS,KAAK,eAAe,cAA8B,MAAM,CAGvE,GAFA,EAAc,EAAO,CAEjB,OAAO,gBACT,MAAM,UAAU,UAAU,UAAU,EAAO,UAAU,KAChD,CACL,IAAM,EAAY,OAAO,cAAc,CACvC,GAAI,EAAW,CACb,IAAM,EAAQ,SAAS,aAAa,CACpC,EAAM,mBAAmB,EAAO,CAChC,EAAU,iBAAiB,CAC3B,EAAU,SAAS,EAAM,CACzB,SAAS,YAAY,OAAO,EAIhC,IAAM,EAAa,KAAK,QAAQ,WAC5B,IACF,KAAK,UAAY,IAEnB"}
|
||||
2
searx/static/themes/simple/chunk/DBO1tjH7.min.js
vendored
Normal file
2
searx/static/themes/simple/chunk/DBO1tjH7.min.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import{a as e,i as t,t as n}from"../sxng-core.min.js";import{t as r}from"./13gvpunf.min.js";import{t as i}from"./gZqIRpW1.min.js";var a=class extends e{constructor(){super(`infiniteScroll`)}async run(){let e=i(`results`).classList.contains(`only_template_images`),a=`article.result:last-child`,o=document.createElement(`div`);o.className=`loader`;let s=async i=>{let a=document.querySelector(`#search`);r(a);let s=document.querySelector(`#pagination form.next_page`);r(s);let c=a.getAttribute(`action`);if(!c)throw Error(`Form action not defined`);let l=document.querySelector(`#pagination`);r(l),l.replaceChildren(o);try{let t=await(await n(`POST`,c,{body:new FormData(s)})).text();if(!t)return;let r=new DOMParser().parseFromString(t,`text/html`),a=r.querySelectorAll(`#urls article`),o=r.querySelector(`#pagination`);document.querySelector(`#pagination`)?.remove();let l=document.querySelector(`#urls`);if(!l)throw Error(`URLs element not found`);a.length>0&&!e&&l.appendChild(document.createElement(`hr`)),l.append(...a),o&&(document.querySelector(`#results`)?.appendChild(o),i())}catch(e){console.error(`Error loading next page:`,e);let n=Object.assign(document.createElement(`div`),{textContent:t.translations?.error_loading_next_page??`Error loading next page`,className:`dialog-error`});n.setAttribute(`role`,`alert`),document.querySelector(`#pagination`)?.replaceChildren(n)}},c=new IntersectionObserver(async e=>{let[t]=e;t?.isIntersecting&&(c.unobserve(t.target),await s(()=>{let e=document.querySelector(a);e&&c.observe(e)}))},{rootMargin:`320px`}),l=document.querySelector(a);l&&c.observe(l)}async post(){}};export{a as default};
|
||||
//# sourceMappingURL=DBO1tjH7.min.js.map
|
||||
1
searx/static/themes/simple/chunk/DBO1tjH7.min.js.map
Normal file
1
searx/static/themes/simple/chunk/DBO1tjH7.min.js.map
Normal file
File diff suppressed because one or more lines are too long
2
searx/static/themes/simple/chunk/Db5v-hxx.min.js
vendored
Normal file
2
searx/static/themes/simple/chunk/Db5v-hxx.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
searx/static/themes/simple/chunk/Db5v-hxx.min.js.map
Normal file
1
searx/static/themes/simple/chunk/Db5v-hxx.min.js.map
Normal file
File diff suppressed because one or more lines are too long
2
searx/static/themes/simple/chunk/DxJxX49r.min.js
vendored
Normal file
2
searx/static/themes/simple/chunk/DxJxX49r.min.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import{n as e}from"../sxng-core.min.js";import"./13gvpunf.min.js";import{t}from"./gZqIRpW1.min.js";var n=t(`search`),r=t(`q`),i=t(`clear_search`),a=window.matchMedia(`(max-width: 50em)`).matches,o=document.querySelector(`main`)?.id===`main_results`,s=Array.from(document.querySelectorAll(`#categories_container button.category`));r.value.length===0&&i.classList.add(`empty`),a||o||r.focus(),a&&e(`focus`,r,()=>{requestAnimationFrame(()=>{let e=r.value.length;r.setSelectionRange(e,e),r.scrollLeft=r.scrollWidth})}),e(`input`,r,()=>{i.classList.toggle(`empty`,r.value.length===0)}),e(`click`,i,()=>{i.classList.add(`empty`),r.focus()});for(let t of s)e(`click`,t,e=>{if(e.shiftKey){e.preventDefault(),t.classList.toggle(`selected`);return}for(let e of s)e.classList.toggle(`selected`,e===t)});if(document.querySelector(`div.search_filters`)){let t=document.getElementById(`safesearch`);t&&e(`change`,t,()=>n.submit());let r=document.getElementById(`time_range`);r&&e(`change`,r,()=>n.submit());let i=document.getElementById(`language`);i&&e(`change`,i,()=>n.submit())}e(`submit`,n,e=>{if(e.preventDefault(),s.length>0){let e=t(`selected-categories`);e.value=s.filter(e=>e.classList.contains(`selected`)).map(e=>e.name.replace(`category_`,``)).join(`,`)}n.submit()});
|
||||
//# sourceMappingURL=DxJxX49r.min.js.map
|
||||
1
searx/static/themes/simple/chunk/DxJxX49r.min.js.map
Normal file
1
searx/static/themes/simple/chunk/DxJxX49r.min.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"DxJxX49r.min.js","names":["searchForm: HTMLFormElement","searchInput: HTMLInputElement","searchReset: HTMLButtonElement","isMobile: boolean","isResultsPage: boolean","categoryButtons: HTMLButtonElement[]"],"sources":["../../../../../client/simple/src/js/main/search.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport { listen } from \"../toolkit.ts\";\nimport { getElement } from \"../util/getElement.ts\";\n\nconst searchForm: HTMLFormElement = getElement<HTMLFormElement>(\"search\");\nconst searchInput: HTMLInputElement = getElement<HTMLInputElement>(\"q\");\nconst searchReset: HTMLButtonElement = getElement<HTMLButtonElement>(\"clear_search\");\n\nconst isMobile: boolean = window.matchMedia(\"(max-width: 50em)\").matches;\nconst isResultsPage: boolean = document.querySelector(\"main\")?.id === \"main_results\";\n\nconst categoryButtons: HTMLButtonElement[] = Array.from(\n document.querySelectorAll<HTMLButtonElement>(\"#categories_container button.category\")\n);\n\nif (searchInput.value.length === 0) {\n searchReset.classList.add(\"empty\");\n}\n\n// focus search input on large screens\nif (!(isMobile || isResultsPage)) {\n searchInput.focus();\n}\n\n// On mobile, move cursor to the end of the input on focus\nif (isMobile) {\n listen(\"focus\", searchInput, () => {\n // Defer cursor move until the next frame to prevent a visual jump\n requestAnimationFrame(() => {\n const end = searchInput.value.length;\n searchInput.setSelectionRange(end, end);\n searchInput.scrollLeft = searchInput.scrollWidth;\n });\n });\n}\n\nlisten(\"input\", searchInput, () => {\n searchReset.classList.toggle(\"empty\", searchInput.value.length === 0);\n});\n\nlisten(\"click\", searchReset, () => {\n searchReset.classList.add(\"empty\");\n searchInput.focus();\n});\n\nfor (const button of categoryButtons) {\n listen(\"click\", button, (event: MouseEvent) => {\n if (event.shiftKey) {\n event.preventDefault();\n button.classList.toggle(\"selected\");\n return;\n }\n\n // deselect all other categories\n for (const categoryButton of categoryButtons) {\n categoryButton.classList.toggle(\"selected\", categoryButton === button);\n }\n });\n}\n\nif (document.querySelector(\"div.search_filters\")) {\n const safesearchElement = document.getElementById(\"safesearch\");\n if (safesearchElement) {\n listen(\"change\", safesearchElement, () => searchForm.submit());\n }\n\n const timeRangeElement = document.getElementById(\"time_range\");\n if (timeRangeElement) {\n listen(\"change\", timeRangeElement, () => searchForm.submit());\n }\n\n const languageElement = document.getElementById(\"language\");\n if (languageElement) {\n listen(\"change\", languageElement, () => searchForm.submit());\n }\n}\n\n// override searchForm submit event\nlisten(\"submit\", searchForm, (event: Event) => {\n event.preventDefault();\n\n if (categoryButtons.length > 0) {\n const searchCategories = getElement<HTMLInputElement>(\"selected-categories\");\n searchCategories.value = categoryButtons\n .filter((button) => button.classList.contains(\"selected\"))\n .map((button) => button.name.replace(\"category_\", \"\"))\n .join(\",\");\n }\n\n searchForm.submit();\n});\n"],"mappings":"mGAKA,IAAMA,EAA8B,EAA4B,SAAS,CACnEC,EAAgC,EAA6B,IAAI,CACjEC,EAAiC,EAA8B,eAAe,CAE9EC,EAAoB,OAAO,WAAW,oBAAoB,CAAC,QAC3DC,EAAyB,SAAS,cAAc,OAAO,EAAE,KAAO,eAEhEC,EAAuC,MAAM,KACjD,SAAS,iBAAoC,wCAAwC,CACtF,CAEG,EAAY,MAAM,SAAW,GAC/B,EAAY,UAAU,IAAI,QAAQ,CAI9B,GAAY,GAChB,EAAY,OAAO,CAIjB,GACF,EAAO,QAAS,MAAmB,CAEjC,0BAA4B,CAC1B,IAAM,EAAM,EAAY,MAAM,OAC9B,EAAY,kBAAkB,EAAK,EAAI,CACvC,EAAY,WAAa,EAAY,aACrC,EACF,CAGJ,EAAO,QAAS,MAAmB,CACjC,EAAY,UAAU,OAAO,QAAS,EAAY,MAAM,SAAW,EAAE,EACrE,CAEF,EAAO,QAAS,MAAmB,CACjC,EAAY,UAAU,IAAI,QAAQ,CAClC,EAAY,OAAO,EACnB,CAEF,IAAK,IAAM,KAAU,EACnB,EAAO,QAAS,EAAS,GAAsB,CAC7C,GAAI,EAAM,SAAU,CAClB,EAAM,gBAAgB,CACtB,EAAO,UAAU,OAAO,WAAW,CACnC,OAIF,IAAK,IAAM,KAAkB,EAC3B,EAAe,UAAU,OAAO,WAAY,IAAmB,EAAO,EAExE,CAGJ,GAAI,SAAS,cAAc,qBAAqB,CAAE,CAChD,IAAM,EAAoB,SAAS,eAAe,aAAa,CAC3D,GACF,EAAO,SAAU,MAAyB,EAAW,QAAQ,CAAC,CAGhE,IAAM,EAAmB,SAAS,eAAe,aAAa,CAC1D,GACF,EAAO,SAAU,MAAwB,EAAW,QAAQ,CAAC,CAG/D,IAAM,EAAkB,SAAS,eAAe,WAAW,CACvD,GACF,EAAO,SAAU,MAAuB,EAAW,QAAQ,CAAC,CAKhE,EAAO,SAAU,EAAa,GAAiB,CAG7C,GAFA,EAAM,gBAAgB,CAElB,EAAgB,OAAS,EAAG,CAC9B,IAAM,EAAmB,EAA6B,sBAAsB,CAC5E,EAAiB,MAAQ,EACtB,OAAQ,GAAW,EAAO,UAAU,SAAS,WAAW,CAAC,CACzD,IAAK,GAAW,EAAO,KAAK,QAAQ,YAAa,GAAG,CAAC,CACrD,KAAK,IAAI,CAGd,EAAW,QAAQ,EACnB"}
|
||||
2
searx/static/themes/simple/chunk/KPZlR0ib.min.js
vendored
Normal file
2
searx/static/themes/simple/chunk/KPZlR0ib.min.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import{i as e,n as t,t as n}from"../sxng-core.min.js";import{t as r}from"./13gvpunf.min.js";var i=async(i,a)=>{try{let o;o=e.method===`GET`?await n(`GET`,`./autocompleter?q=${a}`):await n(`POST`,`./autocompleter`,{body:new URLSearchParams({q:a})});let s=await o.json(),c=document.querySelector(`.autocomplete`);r(c);let l=document.querySelector(`.autocomplete ul`);if(r(l),c.classList.add(`open`),l.replaceChildren(),s?.[1]?.length===0){let t=Object.assign(document.createElement(`li`),{className:`no-item-found`,textContent:e.translations?.no_item_found??`No results found`});l.append(t);return}let u=new DocumentFragment;for(let e of s[1]){let n=Object.assign(document.createElement(`li`),{textContent:e});t(`mousedown`,n,()=>{i.value=e,document.querySelector(`#search`)?.submit(),c.classList.remove(`open`)}),u.append(n)}l.append(u)}catch(e){console.error(`Error fetching autocomplete results:`,e)}},a=document.getElementById(`q`);r(a);var o;t(`input`,a,()=>{clearTimeout(o);let t=a.value,n=e.autocomplete_min??2;t.length<n||(o=window.setTimeout(async()=>{t===a.value&&await i(a,t)},300))});var s=document.querySelector(`.autocomplete`),c=document.querySelector(`.autocomplete ul`);c&&t(`keyup`,a,e=>{let t=[...c.children],n=t.findIndex(e=>e.classList.contains(`active`)),r=-1;switch(e.key){case`ArrowUp`:{let e=t[n];e&&n>=0&&e.classList.remove(`active`),r=(n-1+t.length)%t.length;break}case`ArrowDown`:{let e=t[n];e&&n>=0&&e.classList.remove(`active`),r=(n+1)%t.length;break}case`Tab`:case`Enter`:s&&s.classList.remove(`open`);break;default:break}if(r!==-1){let e=t[r];if(e&&(e.classList.add(`active`),!e.classList.contains(`no-item-found`))){let t=document.getElementById(`q`);t&&(t.value=e.textContent??``)}}});
|
||||
//# sourceMappingURL=KPZlR0ib.min.js.map
|
||||
1
searx/static/themes/simple/chunk/KPZlR0ib.min.js.map
Normal file
1
searx/static/themes/simple/chunk/KPZlR0ib.min.js.map
Normal file
File diff suppressed because one or more lines are too long
2
searx/static/themes/simple/chunk/Q2SRo2ED.min.js
vendored
Normal file
2
searx/static/themes/simple/chunk/Q2SRo2ED.min.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import{i as e,n as t,r as n}from"../sxng-core.min.js";import{t as r}from"./13gvpunf.min.js";(function(e,t){typeof e.CustomEvent!=`function`&&(e.CustomEvent=function(e,n){n||={bubbles:!1,cancelable:!1,detail:void 0};var r=t.createEvent(`CustomEvent`);return r.initCustomEvent(e,n.bubbles,n.cancelable,n.detail),r},e.CustomEvent.prototype=e.Event.prototype),t.addEventListener(`touchstart`,u,!1),t.addEventListener(`touchmove`,d,!1),t.addEventListener(`touchend`,l,!1);var n=null,r=null,i=null,a=null,o=null,s=null,c=0;function l(e){if(s===e.target){var l=parseInt(f(s,`data-swipe-threshold`,`20`),10),u=f(s,`data-swipe-unit`,`px`),d=parseInt(f(s,`data-swipe-timeout`,`500`),10),p=Date.now()-o,m=``,h=e.changedTouches||e.touches||[];if(u===`vh`&&(l=Math.round(l/100*t.documentElement.clientHeight)),u===`vw`&&(l=Math.round(l/100*t.documentElement.clientWidth)),Math.abs(i)>Math.abs(a)?Math.abs(i)>l&&p<d&&(m=i>0?`swiped-left`:`swiped-right`):Math.abs(a)>l&&p<d&&(m=a>0?`swiped-up`:`swiped-down`),m!==``){var g={dir:m.replace(/swiped-/,``),touchType:(h[0]||{}).touchType||`direct`,fingers:c,xStart:parseInt(n,10),xEnd:parseInt((h[0]||{}).clientX||-1,10),yStart:parseInt(r,10),yEnd:parseInt((h[0]||{}).clientY||-1,10)};s.dispatchEvent(new CustomEvent(`swiped`,{bubbles:!0,cancelable:!0,detail:g})),s.dispatchEvent(new CustomEvent(m,{bubbles:!0,cancelable:!0,detail:g}))}n=null,r=null,o=null}}function u(e){e.target.getAttribute(`data-swipe-ignore`)!==`true`&&(s=e.target,o=Date.now(),n=e.touches[0].clientX,r=e.touches[0].clientY,i=0,a=0,c=e.touches.length)}function d(e){if(!(!n||!r)){var t=e.touches[0].clientX,o=e.touches[0].clientY;i=n-t,a=r-o}}function f(e,n,r){for(;e&&e!==t.documentElement;){var i=e.getAttribute(n);if(i)return i;e=e.parentNode}return r}})(window,document);var i,a=t=>{i&&clearTimeout(i);let n=t.querySelector(`.result-images-source img`);if(!n)return;let r=t.querySelector(`.image_thumbnail`);if(r){if(r.src===`${e.theme_static_path}/img/img_load_error.svg`)return;n.onerror=()=>{n.src=r.src},n.src=r.src}let a=n.getAttribute(`data-src`);a&&(i=setTimeout(()=>{n.src=a,n.removeAttribute(`data-src`)},1e3))},o=document.querySelectorAll(`#urls img.image_thumbnail`);for(let t of o)t.complete&&t.naturalWidth===0&&(t.src=`${e.theme_static_path}/img/img_load_error.svg`),t.onerror=()=>{t.src=`${e.theme_static_path}/img/img_load_error.svg`};document.querySelector(`#search_url button#copy_url`)?.style.setProperty(`display`,`block`),n.selectImage=e=>{document.getElementById(`results`)?.classList.add(`image-detail-open`),window.location.hash=`#image-viewer`,n.scrollPageToSelected?.(),e&&a(e)},n.closeDetail=()=>{document.getElementById(`results`)?.classList.remove(`image-detail-open`),window.location.hash===`#image-viewer`&&window.history.back(),n.scrollPageToSelected?.()},t(`click`,`.btn-collapse`,function(){let e=this.getAttribute(`data-btn-text-collapsed`),t=this.getAttribute(`data-btn-text-not-collapsed`),n=this.getAttribute(`data-target`);if(!(n&&e&&t))return;let i=document.querySelector(n);r(i);let a=this.classList.contains(`collapsed`),o=a?t:e,s=a?e:t;this.innerHTML=this.innerHTML.replace(s,o),this.classList.toggle(`collapsed`),i.classList.toggle(`invisible`)}),t(`click`,`.media-loader`,function(){let e=this.getAttribute(`data-target`);if(!e)return;let t=document.querySelector(`${e} > iframe`);if(r(t),!t.getAttribute(`src`)){let e=t.getAttribute(`data-src`);e&&t.setAttribute(`src`,e)}}),t(`click`,`#copy_url`,async function(){let e=this.parentElement?.querySelector(`pre`);if(r(e),window.isSecureContext)await navigator.clipboard.writeText(e.innerText);else{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n),document.execCommand(`copy`)}}let t=this.dataset.copiedText;t&&(this.innerText=t)}),t(`click`,`.result-detail-close`,e=>{e.preventDefault(),n.closeDetail?.()}),t(`click`,`.result-detail-previous`,e=>{e.preventDefault(),n.selectPrevious?.(!1)}),t(`click`,`.result-detail-next`,e=>{e.preventDefault(),n.selectNext?.(!1)}),window.addEventListener(`hashchange`,()=>{window.location.hash!==`#image-viewer`&&n.closeDetail?.()});var s=document.querySelectorAll(`.swipe-horizontal`);for(let e of s)t(`swiped-left`,e,()=>{n.selectNext?.(!1)}),t(`swiped-right`,e,()=>{n.selectPrevious?.(!1)});window.addEventListener(`scroll`,()=>{let e=document.getElementById(`backToTop`),t=document.getElementById(`results`);if(e&&t){let e=(document.documentElement.scrollTop||document.body.scrollTop)>=100;t.classList.toggle(`scrolling`,e)}},!0);
|
||||
//# sourceMappingURL=Q2SRo2ED.min.js.map
|
||||
1
searx/static/themes/simple/chunk/Q2SRo2ED.min.js.map
Normal file
1
searx/static/themes/simple/chunk/Q2SRo2ED.min.js.map
Normal file
File diff suppressed because one or more lines are too long
2
searx/static/themes/simple/chunk/gZqIRpW1.min.js
vendored
Normal file
2
searx/static/themes/simple/chunk/gZqIRpW1.min.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import{t as e}from"./13gvpunf.min.js";function t(t,n={}){n.assert??=!0;let r=document.getElementById(t);return n.assert&&e(r),r}export{t};
|
||||
//# sourceMappingURL=gZqIRpW1.min.js.map
|
||||
1
searx/static/themes/simple/chunk/gZqIRpW1.min.js.map
Normal file
1
searx/static/themes/simple/chunk/gZqIRpW1.min.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"gZqIRpW1.min.js","names":[],"sources":["../../../../../client/simple/src/js/util/getElement.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport { assertElement } from \"./assertElement.ts\";\n\ntype Options = {\n assert?: boolean;\n};\n\nexport function getElement<T>(id: string, options?: { assert: true }): T;\nexport function getElement<T>(id: string, options?: { assert: false }): T | null;\nexport function getElement<T>(id: string, options: Options = {}): T | null {\n options.assert ??= true;\n\n const element = document.getElementById(id) as T | null;\n\n if (options.assert) {\n assertElement(element);\n }\n\n return element;\n}\n"],"mappings":"sCAUA,SAAgB,EAAc,EAAY,EAAmB,EAAE,CAAY,CACzE,EAAQ,SAAW,GAEnB,IAAM,EAAU,SAAS,eAAe,EAAG,CAM3C,OAJI,EAAQ,QACV,EAAc,EAAQ,CAGjB"}
|
||||
1
searx/static/themes/simple/css/ol.min.css
vendored
1
searx/static/themes/simple/css/ol.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -1,2 +0,0 @@
|
||||
import{i as e,n as t,o as n,r}from"./searxng.core.min.js";var i=async(i,a)=>{try{let o;o=n.method===`GET`?await r(`GET`,`./autocompleter?q=${a}`):await r(`POST`,`./autocompleter`,{body:new URLSearchParams({q:a})});let s=await o.json(),c=document.querySelector(`.autocomplete`);t(c);let l=document.querySelector(`.autocomplete ul`);if(t(l),c.classList.add(`open`),l.replaceChildren(),s?.[1]?.length===0){let e=Object.assign(document.createElement(`li`),{className:`no-item-found`,textContent:n.translations?.no_item_found??`No results found`});l.append(e);return}let u=new DocumentFragment;for(let t of s[1]){let n=Object.assign(document.createElement(`li`),{textContent:t});e(`mousedown`,n,()=>{i.value=t,document.querySelector(`#search`)?.submit(),c.classList.remove(`open`)}),u.append(n)}l.append(u)}catch(e){console.error(`Error fetching autocomplete results:`,e)}},a=document.getElementById(`q`);t(a);var o;e(`input`,a,()=>{clearTimeout(o);let e=a.value,t=n.autocomplete_min??2;e.length<t||(o=window.setTimeout(async()=>{e===a.value&&await i(a,e)},300))});var s=document.querySelector(`.autocomplete`),c=document.querySelector(`.autocomplete ul`);c&&e(`keyup`,a,e=>{let t=[...c.children],n=t.findIndex(e=>e.classList.contains(`active`)),r=-1;switch(e.key){case`ArrowUp`:{let e=t[n];e&&n>=0&&e.classList.remove(`active`),r=(n-1+t.length)%t.length;break}case`ArrowDown`:{let e=t[n];e&&n>=0&&e.classList.remove(`active`),r=(n+1)%t.length;break}case`Tab`:case`Enter`:s&&s.classList.remove(`open`);break;default:break}if(r!==-1){let e=t[r];if(e&&(e.classList.add(`active`),!e.classList.contains(`no-item-found`))){let t=document.getElementById(`q`);t&&(t.value=e.textContent??``)}}});
|
||||
//# sourceMappingURL=autocomplete.min.js.map
|
||||
File diff suppressed because one or more lines are too long
1
searx/static/themes/simple/js/chunk.min.js
vendored
1
searx/static/themes/simple/js/chunk.min.js
vendored
@@ -1 +0,0 @@
|
||||
Object.create,Object.defineProperty,Object.getOwnPropertyDescriptor,Object.getOwnPropertyNames,Object.getPrototypeOf,Object.prototype.hasOwnProperty;
|
||||
@@ -1,2 +0,0 @@
|
||||
import{n as e,o as t,r as n}from"./searxng.core.min.js";var r=()=>Object.assign(document.createElement(`div`),{className:`loader`}),i=async(i,a)=>{let o=document.querySelector(`#search`);e(o);let s=document.querySelector(`#pagination form.next_page`);e(s);let c=o.getAttribute(`action`);if(!c)throw Error(`Form action not defined`);let l=document.querySelector(`#pagination`);e(l),l.replaceChildren(r());try{let e=await(await n(`POST`,c,{body:new FormData(s)})).text();if(!e)return;let t=new DOMParser().parseFromString(e,`text/html`),r=t.querySelectorAll(`#urls article`),o=t.querySelector(`#pagination`);document.querySelector(`#pagination`)?.remove();let l=document.querySelector(`#urls`);if(!l)throw Error(`URLs element not found`);r.length>0&&!i&&l.appendChild(document.createElement(`hr`)),l.append(...Array.from(r)),o&&(document.querySelector(`#results`)?.appendChild(o),a())}catch(e){console.error(`Error loading next page:`,e);let n=Object.assign(document.createElement(`div`),{textContent:t.translations?.error_loading_next_page??`Error loading next page`,className:`dialog-error`});n.setAttribute(`role`,`alert`),document.querySelector(`#pagination`)?.replaceChildren(n)}},a=document.getElementById(`results`);if(!a)throw Error(`Results element not found`);var o=a.classList.contains(`only_template_images`),s=`article.result:last-child`,c=new IntersectionObserver(e=>{let[t]=e;t?.isIntersecting&&(c.unobserve(t.target),i(o,()=>{let e=document.querySelector(s);e&&c.observe(e)}).then(()=>{}))},{rootMargin:`320px`}),l=document.querySelector(s);l&&c.observe(l);
|
||||
//# sourceMappingURL=infinite_scroll.min.js.map
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,3 +0,0 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["css/ol.min.css"])))=>i.map(i=>d[i]);
|
||||
import{i as e,t}from"./searxng.core.min.js";e(`click`,`.searxng_init_map`,async function(e){e.preventDefault(),this.classList.remove(`searxng_init_map`);let{View:n,OlMap:r,TileLayer:i,VectorLayer:a,OSM:o,VectorSource:s,Style:c,Stroke:l,Fill:u,Circle:d,fromLonLat:f,GeoJSON:p,Feature:m,Point:h}=await t(async()=>{let{View:e,OlMap:t,TileLayer:n,VectorLayer:r,OSM:i,VectorSource:a,Style:o,Stroke:s,Fill:c,Circle:l,fromLonLat:u,GeoJSON:d,Feature:f,Point:p}=await import(`./ol.min.js`);return{View:e,OlMap:t,TileLayer:n,VectorLayer:r,OSM:i,VectorSource:a,Style:o,Stroke:s,Fill:c,Circle:l,fromLonLat:u,GeoJSON:d,Feature:f,Point:p}},[]);t(()=>Promise.resolve({}),__vite__mapDeps([0]));let{leafletTarget:g,mapLon:_,mapLat:v,mapGeojson:y}=this.dataset,b=Number.parseFloat(_||`0`),x=Number.parseFloat(v||`0`),S=new n({maxZoom:16,enableRotation:!1}),C=new r({target:g,layers:[new i({source:new o({maxZoom:16})})],view:S});try{let e=new a({source:new s({features:[new m({geometry:new h(f([b,x]))})]}),style:new c({image:new d({radius:6,fill:new u({color:`#3050ff`})})})});C.addLayer(e)}catch(e){console.error(`Failed to create marker layer:`,e)}if(y)try{let e=new s({features:new p().readFeatures(JSON.parse(y),{dataProjection:`EPSG:4326`,featureProjection:`EPSG:3857`})}),t=new a({source:e,style:new c({stroke:new l({color:`#3050ff`,width:2}),fill:new u({color:`#3050ff33`})})});C.addLayer(t),S.fit(e.getExtent(),{padding:[20,20,20,20]})}catch(e){console.error(`Failed to create GeoJSON layer:`,e)}});
|
||||
//# sourceMappingURL=mapresult.min.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"mappings":";4CAIA,EAAO,QAAS,oBAAqB,eAAmC,EAAc,CACpF,EAAM,gBAAgB,CACtB,KAAK,UAAU,OAAO,mBAAmB,CAEzC,GAAM,CACJ,OACA,QACA,YACA,cACA,MACA,eACA,QACA,SACA,OACA,SACA,aACA,UACA,UACA,8BAdI,CACJ,OACA,QACA,YACA,cACA,MACA,eACA,QACA,SACA,OACA,SACA,aACA,UACA,UACA,SACE,MAAM,OAAO,sBAdf,OACA,QACA,YACA,cACA,MACA,eACA,QACA,SACA,OACA,SACA,aACA,UACA,UACA,cAEF,MAAK,mBAAO,uBAEZ,GAAM,CAAE,cAAe,EAAQ,SAAQ,SAAQ,cAAe,KAAK,QAE7D,EAAM,OAAO,WAAW,GAAU,IAAI,CACtC,EAAM,OAAO,WAAW,GAAU,IAAI,CACtC,EAAO,IAAI,EAAK,CAAE,QAAS,GAAI,eAAgB,GAAO,CAAC,CACvD,EAAM,IAAI,EAAM,CACZ,SACR,OAAQ,CAAC,IAAI,EAAU,CAAE,OAAQ,IAAI,EAAI,CAAE,QAAS,GAAI,CAAC,CAAE,CAAC,CAAC,CACvD,OACP,CAAC,CAEF,GAAI,CASF,IAAM,EAAc,IAAI,EAAY,CAClC,OATmB,IAAI,EAAa,CACpC,SAAU,CACR,IAAI,EAAQ,CACV,SAAU,IAAI,EAAM,EAAW,CAAC,EAAK,EAAI,CAAC,CAAC,CAC5C,CAAC,CACH,CACF,CAAC,CAIA,MAAO,IAAI,EAAM,CACf,MAAO,IAAI,EAAO,CAChB,OAAQ,EACR,KAAM,IAAI,EAAK,CAAE,MAAO,UAAW,CAAC,CACrC,CAAC,CACH,CAAC,CACH,CAAC,CAEF,EAAI,SAAS,EAAY,OAClB,EAAO,CACd,QAAQ,MAAM,iCAAkC,EAAM,CAGxD,GAAI,EACF,GAAI,CACF,IAAM,EAAY,IAAI,EAAa,CACjC,SAAU,IAAI,GAAS,CAAC,aAAa,KAAK,MAAM,EAAW,CAAE,CAC3D,eAAgB,YAChB,kBAAmB,YACpB,CAAC,CACH,CAAC,CAEI,EAAW,IAAI,EAAY,CAC/B,OAAQ,EACR,MAAO,IAAI,EAAM,CACf,OAAQ,IAAI,EAAO,CAAE,MAAO,UAAW,MAAO,EAAG,CAAC,CAClD,KAAM,IAAI,EAAK,CAAE,MAAO,YAAa,CAAC,CACvC,CAAC,CACH,CAAC,CAEF,EAAI,SAAS,EAAS,CAEtB,EAAK,IAAI,EAAU,WAAW,CAAE,CAAE,QAAS,CAAC,GAAI,GAAI,GAAI,GAAG,CAAE,CAAC,OACvD,EAAO,CACd,QAAQ,MAAM,kCAAmC,EAAM,GAG3D","names":[],"ignoreList":[],"sources":["../../../../../client/simple/src/js/main/mapresult.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport { listen } from \"../core/toolkit.ts\";\n\nlisten(\"click\", \".searxng_init_map\", async function (this: HTMLElement, event: Event) {\n event.preventDefault();\n this.classList.remove(\"searxng_init_map\");\n\n const {\n View,\n OlMap,\n TileLayer,\n VectorLayer,\n OSM,\n VectorSource,\n Style,\n Stroke,\n Fill,\n Circle,\n fromLonLat,\n GeoJSON,\n Feature,\n Point\n } = await import(\"../pkg/ol.ts\");\n void import(\"ol/ol.css\");\n\n const { leafletTarget: target, mapLon, mapLat, mapGeojson } = this.dataset;\n\n const lon = Number.parseFloat(mapLon || \"0\");\n const lat = Number.parseFloat(mapLat || \"0\");\n const view = new View({ maxZoom: 16, enableRotation: false });\n const map = new OlMap({\n target: target,\n layers: [new TileLayer({ source: new OSM({ maxZoom: 16 }) })],\n view: view\n });\n\n try {\n const markerSource = new VectorSource({\n features: [\n new Feature({\n geometry: new Point(fromLonLat([lon, lat]))\n })\n ]\n });\n\n const markerLayer = new VectorLayer({\n source: markerSource,\n style: new Style({\n image: new Circle({\n radius: 6,\n fill: new Fill({ color: \"#3050ff\" })\n })\n })\n });\n\n map.addLayer(markerLayer);\n } catch (error) {\n console.error(\"Failed to create marker layer:\", error);\n }\n\n if (mapGeojson) {\n try {\n const geoSource = new VectorSource({\n features: new GeoJSON().readFeatures(JSON.parse(mapGeojson), {\n dataProjection: \"EPSG:4326\",\n featureProjection: \"EPSG:3857\"\n })\n });\n\n const geoLayer = new VectorLayer({\n source: geoSource,\n style: new Style({\n stroke: new Stroke({ color: \"#3050ff\", width: 2 }),\n fill: new Fill({ color: \"#3050ff33\" })\n })\n });\n\n map.addLayer(geoLayer);\n\n view.fit(geoSource.getExtent(), { padding: [20, 20, 20, 20] });\n } catch (error) {\n console.error(\"Failed to create GeoJSON layer:\", error);\n }\n }\n});\n"],"file":"mapresult.min.js"}
|
||||
8
searx/static/themes/simple/js/ol.min.js
vendored
8
searx/static/themes/simple/js/ol.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +0,0 @@
|
||||
import{i as e,n as t,o as n,r}from"./searxng.core.min.js";var i,a=async()=>{if(!i){try{i=await(await r(`GET`,`engine_descriptions.json`)).json()}catch(e){console.error(`Error fetching engineDescriptions:`,e)}if(i)for(let[e,[t,r]]of Object.entries(i)){let i=document.querySelectorAll(`[data-engine-name="${e}"] .engine-description`),a=` (<i>${n.translations?.Source}: ${r}</i>)`;for(let e of i)e.innerHTML=t+a}}},o=(e,t)=>{for(let n of t)n.offsetParent&&(n.checked=!e)},s=document.querySelectorAll(`[data-engine-name]`);for(let t of s)e(`mouseenter`,t,a);var c=document.querySelectorAll(`tbody input[type=checkbox][class~=checkbox-onoff]`),l=document.querySelectorAll(`.enable-all-engines`);for(let t of l)e(`click`,t,()=>o(!0,c));var u=document.querySelectorAll(`.disable-all-engines`);for(let t of u)e(`click`,t,()=>o(!1,c));e(`click`,`#copy-hash`,async function(){let e=this.parentElement?.querySelector(`pre`);if(t(e),window.isSecureContext)await navigator.clipboard.writeText(e.innerText);else{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n),document.execCommand(`copy`)}}let n=this.dataset.copiedText;n&&(this.innerText=n)});
|
||||
//# sourceMappingURL=preferences.min.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"preferences.min.js","names":["engineDescriptions: Record<string, [string, string]> | undefined","engineElements: NodeListOf<HTMLElement>","engineToggles: NodeListOf<HTMLInputElement>","enableAllEngines: NodeListOf<HTMLElement>","disableAllEngines: NodeListOf<HTMLElement>"],"sources":["../../../../../client/simple/src/js/main/preferences.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport { assertElement, http, listen, settings } from \"../core/toolkit.ts\";\n\nlet engineDescriptions: Record<string, [string, string]> | undefined;\n\nconst loadEngineDescriptions = async (): Promise<void> => {\n if (engineDescriptions) return;\n try {\n const res = await http(\"GET\", \"engine_descriptions.json\");\n engineDescriptions = await res.json();\n } catch (error) {\n console.error(\"Error fetching engineDescriptions:\", error);\n }\n if (!engineDescriptions) return;\n\n for (const [engine_name, [description, source]] of Object.entries(engineDescriptions)) {\n const elements = document.querySelectorAll<HTMLElement>(`[data-engine-name=\"${engine_name}\"] .engine-description`);\n const sourceText = ` (<i>${settings.translations?.Source}: ${source}</i>)`;\n\n for (const element of elements) {\n element.innerHTML = description + sourceText;\n }\n }\n};\n\nconst toggleEngines = (enable: boolean, engineToggles: NodeListOf<HTMLInputElement>): void => {\n for (const engineToggle of engineToggles) {\n // check if element visible, so that only engines of the current category are modified\n if (engineToggle.offsetParent) {\n engineToggle.checked = !enable;\n }\n }\n};\n\nconst engineElements: NodeListOf<HTMLElement> = document.querySelectorAll<HTMLElement>(\"[data-engine-name]\");\nfor (const engineElement of engineElements) {\n listen(\"mouseenter\", engineElement, loadEngineDescriptions);\n}\n\nconst engineToggles: NodeListOf<HTMLInputElement> = document.querySelectorAll<HTMLInputElement>(\n \"tbody input[type=checkbox][class~=checkbox-onoff]\"\n);\n\nconst enableAllEngines: NodeListOf<HTMLElement> = document.querySelectorAll<HTMLElement>(\".enable-all-engines\");\nfor (const engine of enableAllEngines) {\n listen(\"click\", engine, () => toggleEngines(true, engineToggles));\n}\n\nconst disableAllEngines: NodeListOf<HTMLElement> = document.querySelectorAll<HTMLElement>(\".disable-all-engines\");\nfor (const engine of disableAllEngines) {\n listen(\"click\", engine, () => toggleEngines(false, engineToggles));\n}\n\nlisten(\"click\", \"#copy-hash\", async function (this: HTMLElement) {\n const target = this.parentElement?.querySelector<HTMLPreElement>(\"pre\");\n assertElement(target);\n\n if (window.isSecureContext) {\n await navigator.clipboard.writeText(target.innerText);\n } else {\n const selection = window.getSelection();\n if (selection) {\n const range = document.createRange();\n range.selectNodeContents(target);\n selection.removeAllRanges();\n selection.addRange(range);\n document.execCommand(\"copy\");\n }\n }\n\n const copiedText = this.dataset.copiedText;\n if (copiedText) {\n this.innerText = copiedText;\n }\n});\n"],"mappings":"0DAIA,IAAIA,EAEE,EAAyB,SAA2B,CACpD,MACJ,IAAI,CAEF,EAAqB,MADT,MAAM,EAAK,MAAO,2BAA2B,EAC1B,MAAM,OAC9B,EAAO,CACd,QAAQ,MAAM,qCAAsC,EAAM,CAEvD,KAEL,IAAK,GAAM,CAAC,EAAa,CAAC,EAAa,MAAY,OAAO,QAAQ,EAAmB,CAAE,CACrF,IAAM,EAAW,SAAS,iBAA8B,sBAAsB,EAAY,wBAAwB,CAC5G,EAAa,QAAQ,EAAS,cAAc,OAAO,SAAS,EAAO,OAEzE,IAAK,IAAM,KAAW,EACpB,EAAQ,UAAY,EAAc,KAKlC,GAAiB,EAAiB,IAAsD,CAC5F,IAAK,IAAM,KAAgB,EAErB,EAAa,eACf,EAAa,QAAU,CAAC,IAKxBC,EAA0C,SAAS,iBAA8B,qBAAqB,CAC5G,IAAK,IAAM,KAAiB,EAC1B,EAAO,aAAc,EAAe,EAAuB,CAG7D,IAAMC,EAA8C,SAAS,iBAC3D,oDACD,CAEKC,EAA4C,SAAS,iBAA8B,sBAAsB,CAC/G,IAAK,IAAM,KAAU,EACnB,EAAO,QAAS,MAAc,EAAc,GAAM,EAAc,CAAC,CAGnE,IAAMC,EAA6C,SAAS,iBAA8B,uBAAuB,CACjH,IAAK,IAAM,KAAU,EACnB,EAAO,QAAS,MAAc,EAAc,GAAO,EAAc,CAAC,CAGpE,EAAO,QAAS,aAAc,gBAAmC,CAC/D,IAAM,EAAS,KAAK,eAAe,cAA8B,MAAM,CAGvE,GAFA,EAAc,EAAO,CAEjB,OAAO,gBACT,MAAM,UAAU,UAAU,UAAU,EAAO,UAAU,KAChD,CACL,IAAM,EAAY,OAAO,cAAc,CACvC,GAAI,EAAW,CACb,IAAM,EAAQ,SAAS,aAAa,CACpC,EAAM,mBAAmB,EAAO,CAChC,EAAU,iBAAiB,CAC3B,EAAU,SAAS,EAAM,CACzB,SAAS,YAAY,OAAO,EAIhC,IAAM,EAAa,KAAK,QAAQ,WAC5B,IACF,KAAK,UAAY,IAEnB"}
|
||||
2
searx/static/themes/simple/js/results.min.js
vendored
2
searx/static/themes/simple/js/results.min.js
vendored
@@ -1,2 +0,0 @@
|
||||
import{a as e,i as t,n,o as r}from"./searxng.core.min.js";(function(e,t){typeof e.CustomEvent!=`function`&&(e.CustomEvent=function(e,n){n||={bubbles:!1,cancelable:!1,detail:void 0};var r=t.createEvent(`CustomEvent`);return r.initCustomEvent(e,n.bubbles,n.cancelable,n.detail),r},e.CustomEvent.prototype=e.Event.prototype),t.addEventListener(`touchstart`,u,!1),t.addEventListener(`touchmove`,d,!1),t.addEventListener(`touchend`,l,!1);var n=null,r=null,i=null,a=null,o=null,s=null,c=0;function l(e){if(s===e.target){var l=parseInt(f(s,`data-swipe-threshold`,`20`),10),u=f(s,`data-swipe-unit`,`px`),d=parseInt(f(s,`data-swipe-timeout`,`500`),10),p=Date.now()-o,m=``,h=e.changedTouches||e.touches||[];if(u===`vh`&&(l=Math.round(l/100*t.documentElement.clientHeight)),u===`vw`&&(l=Math.round(l/100*t.documentElement.clientWidth)),Math.abs(i)>Math.abs(a)?Math.abs(i)>l&&p<d&&(m=i>0?`swiped-left`:`swiped-right`):Math.abs(a)>l&&p<d&&(m=a>0?`swiped-up`:`swiped-down`),m!==``){var g={dir:m.replace(/swiped-/,``),touchType:(h[0]||{}).touchType||`direct`,fingers:c,xStart:parseInt(n,10),xEnd:parseInt((h[0]||{}).clientX||-1,10),yStart:parseInt(r,10),yEnd:parseInt((h[0]||{}).clientY||-1,10)};s.dispatchEvent(new CustomEvent(`swiped`,{bubbles:!0,cancelable:!0,detail:g})),s.dispatchEvent(new CustomEvent(m,{bubbles:!0,cancelable:!0,detail:g}))}n=null,r=null,o=null}}function u(e){e.target.getAttribute(`data-swipe-ignore`)!==`true`&&(s=e.target,o=Date.now(),n=e.touches[0].clientX,r=e.touches[0].clientY,i=0,a=0,c=e.touches.length)}function d(e){if(!(!n||!r)){var t=e.touches[0].clientX,o=e.touches[0].clientY;i=n-t,a=r-o}}function f(e,n,r){for(;e&&e!==t.documentElement;){var i=e.getAttribute(n);if(i)return i;e=e.parentNode}return r}})(window,document);var i,a=e=>{i&&clearTimeout(i);let t=e.querySelector(`.result-images-source img`);if(!t)return;let n=e.querySelector(`.image_thumbnail`);if(n){if(n.src===`${r.theme_static_path}/img/img_load_error.svg`)return;t.onerror=()=>{t.src=n.src},t.src=n.src}let a=t.getAttribute(`data-src`);a&&(i=setTimeout(()=>{t.src=a,t.removeAttribute(`data-src`)},1e3))},o=document.querySelectorAll(`#urls img.image_thumbnail`);for(let e of o)e.complete&&e.naturalWidth===0&&(e.src=`${r.theme_static_path}/img/img_load_error.svg`),e.onerror=()=>{e.src=`${r.theme_static_path}/img/img_load_error.svg`};document.querySelector(`#search_url button#copy_url`)?.style.setProperty(`display`,`block`),e.selectImage=t=>{document.getElementById(`results`)?.classList.add(`image-detail-open`),window.location.hash=`#image-viewer`,e.scrollPageToSelected?.(),t&&a(t)},e.closeDetail=()=>{document.getElementById(`results`)?.classList.remove(`image-detail-open`),window.location.hash===`#image-viewer`&&window.history.back(),e.scrollPageToSelected?.()},t(`click`,`.btn-collapse`,function(){let e=this.getAttribute(`data-btn-text-collapsed`),t=this.getAttribute(`data-btn-text-not-collapsed`),r=this.getAttribute(`data-target`);if(!(r&&e&&t))return;let i=document.querySelector(r);n(i);let a=this.classList.contains(`collapsed`),o=a?t:e,s=a?e:t;this.innerHTML=this.innerHTML.replace(s,o),this.classList.toggle(`collapsed`),i.classList.toggle(`invisible`)}),t(`click`,`.media-loader`,function(){let e=this.getAttribute(`data-target`);if(!e)return;let t=document.querySelector(`${e} > iframe`);if(n(t),!t.getAttribute(`src`)){let e=t.getAttribute(`data-src`);e&&t.setAttribute(`src`,e)}}),t(`click`,`#copy_url`,async function(){let e=this.parentElement?.querySelector(`pre`);if(n(e),window.isSecureContext)await navigator.clipboard.writeText(e.innerText);else{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n),document.execCommand(`copy`)}}let t=this.dataset.copiedText;t&&(this.innerText=t)}),t(`click`,`.result-detail-close`,t=>{t.preventDefault(),e.closeDetail?.()}),t(`click`,`.result-detail-previous`,t=>{t.preventDefault(),e.selectPrevious?.(!1)}),t(`click`,`.result-detail-next`,t=>{t.preventDefault(),e.selectNext?.(!1)}),window.addEventListener(`hashchange`,()=>{window.location.hash!==`#image-viewer`&&e.closeDetail?.()});var s=document.querySelectorAll(`.swipe-horizontal`);for(let n of s)t(`swiped-left`,n,()=>{e.selectNext?.(!1)}),t(`swiped-right`,n,()=>{e.selectPrevious?.(!1)});window.addEventListener(`scroll`,()=>{let e=document.getElementById(`backToTop`),t=document.getElementById(`results`);if(e&&t){let e=(document.documentElement.scrollTop||document.body.scrollTop)>=100;t.classList.toggle(`scrolling`,e)}},!0);
|
||||
//# sourceMappingURL=results.min.js.map
|
||||
File diff suppressed because one or more lines are too long
2
searx/static/themes/simple/js/search.min.js
vendored
2
searx/static/themes/simple/js/search.min.js
vendored
@@ -1,2 +0,0 @@
|
||||
import{i as e,n as t,o as n}from"./searxng.core.min.js";var r=e=>{e.value.length>0&&document.getElementById(`search`)?.submit()},i=(e,t)=>{t.classList.toggle(`empty`,e.value.length===0)},a=n=>{let r=document.getElementById(`clear_search`);t(r),i(n,r),e(`click`,r,e=>{e.preventDefault(),n.value=``,n.focus(),i(n,r)}),e(`input`,n,()=>i(n,r),{passive:!0})},o=document.getElementById(`q`);t(o);var s=window.matchMedia(`(max-width: 50em)`).matches,c=document.querySelector(`main`)?.id===`main_results`;if(s||c||o.focus(),s&&e(`focus`,o,()=>{requestAnimationFrame(()=>{let e=o.value.length;o.setSelectionRange(e,e),o.scrollLeft=o.scrollWidth})}),a(o),n.search_on_category_select&&document.querySelector(`.search_filters`)){let t=document.getElementById(`safesearch`);t&&e(`change`,t,()=>r(o));let n=document.getElementById(`time_range`);n&&e(`change`,n,()=>r(o));let i=document.getElementById(`language`);i&&e(`change`,i,()=>r(o))}var l=[...document.querySelectorAll(`button.category_button`)];for(let t of l)e(`click`,t,e=>{if(e.shiftKey){e.preventDefault(),t.classList.toggle(`selected`);return}for(let e of l)e.classList.toggle(`selected`,e===t)});var u=document.querySelector(`#search`);t(u),e(`submit`,u,e=>{e.preventDefault();let t=document.querySelector(`#selected-categories`);t&&(t.value=l.filter(e=>e.classList.contains(`selected`)).map(e=>e.name.replace(`category_`,``)).join(`,`)),u.submit()});
|
||||
//# sourceMappingURL=search.min.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,2 +0,0 @@
|
||||
const e={index:`index`,results:`results`,preferences:`preferences`,unknown:`unknown`},t={closeDetail:void 0,scrollPageToSelected:void 0,selectImage:void 0,selectNext:void 0,selectPrevious:void 0};var n=()=>{let t=document.querySelector(`meta[name="endpoint"]`)?.getAttribute(`content`);return t&&t in e?t:e.unknown},r=()=>{let e=document.querySelector(`script[client_settings]`)?.getAttribute(`client_settings`);if(!e)return{};try{return JSON.parse(atob(e))}catch(e){return console.error(`Failed to load client_settings:`,e),{}}};const i=e=>{if(!e)throw Error(`Bad assertion: DOM element not found`)},a=async(e,t,n)=>{let r=new AbortController,i=setTimeout(()=>r.abort(),n?.timeout??3e4),a=await fetch(t,{body:n?.body,method:e,signal:r.signal}).finally(()=>clearTimeout(i));if(!a.ok)throw Error(a.statusText);return a},o=(e,t,n,r)=>{if(typeof t!=`string`){t.addEventListener(e,n,r);return}document.addEventListener(e,e=>{for(let r of e.composedPath())if(r instanceof HTMLElement&&r.matches(t)){try{n.call(r,e)}catch(e){console.error(e)}break}},r)},s=(e,t)=>{for(let e of t?.on??[])if(!e)return;document.readyState===`loading`?o(`DOMContentLoaded`,document,e,{once:!0}):e()},c=n(),l=r();s(()=>{document.documentElement.classList.remove(`no-js`),document.documentElement.classList.add(`js`)});var u=`modulepreload`,d=function(e){return`/static/themes/simple/`+e},f={};const p=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=d(t,n),t in f)return;f[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:u,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};s(()=>{p(()=>import(`./keyboard.min.js`),[]),p(()=>import(`./search.min.js`),[]),l.autocomplete&&p(()=>import(`./autocomplete.min.js`),[])},{on:[c===e.index]}),s(()=>{p(()=>import(`./keyboard.min.js`),[]),p(()=>import(`./mapresult.min.js`),[]),p(()=>import(`./results.min.js`),[]),p(()=>import(`./search.min.js`),[]),l.infinite_scroll&&p(()=>import(`./infinite_scroll.min.js`),[]),l.autocomplete&&p(()=>import(`./autocomplete.min.js`),[])},{on:[c===e.results]}),s(()=>{p(()=>import(`./preferences.min.js`),[])},{on:[c===e.preferences]}),o(`click`,`.close`,function(){this.parentNode?.classList.add(`invisible`)});export{t as a,o as i,i as n,l as o,a as r,p as t};
|
||||
//# sourceMappingURL=searxng.core.min.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,107 +1,116 @@
|
||||
{
|
||||
"_chunk.min.js": {
|
||||
"file": "js/chunk.min.js",
|
||||
"name": "chunk"
|
||||
"_13gvpunf.min.js": {
|
||||
"file": "chunk/13gvpunf.min.js",
|
||||
"name": "assertelement"
|
||||
},
|
||||
"node_modules/ol/ol.css": {
|
||||
"file": "css/ol.min.css",
|
||||
"name": "ol.css",
|
||||
"names": [
|
||||
"ol.css"
|
||||
],
|
||||
"src": "node_modules/ol/ol.css",
|
||||
"isEntry": true
|
||||
"_gZqIRpW1.min.js": {
|
||||
"file": "chunk/gZqIRpW1.min.js",
|
||||
"name": "getelement",
|
||||
"imports": [
|
||||
"_13gvpunf.min.js"
|
||||
]
|
||||
},
|
||||
"src/js/core/index.ts": {
|
||||
"file": "js/searxng.core.min.js",
|
||||
"name": "searxng.core",
|
||||
"src": "src/js/core/index.ts",
|
||||
"src/js/index.ts": {
|
||||
"file": "sxng-core.min.js",
|
||||
"name": "core",
|
||||
"src": "src/js/index.ts",
|
||||
"isEntry": true,
|
||||
"dynamicImports": [
|
||||
"src/js/plugin/MapView.ts",
|
||||
"src/js/plugin/InfiniteScroll.ts",
|
||||
"src/js/plugin/Calculator.ts",
|
||||
"src/js/main/keyboard.ts",
|
||||
"src/js/main/search.ts",
|
||||
"src/js/main/autocomplete.ts",
|
||||
"src/js/main/mapresult.ts",
|
||||
"src/js/main/results.ts",
|
||||
"src/js/main/infinite_scroll.ts",
|
||||
"src/js/main/preferences.ts"
|
||||
]
|
||||
},
|
||||
"src/js/main/autocomplete.ts": {
|
||||
"file": "js/autocomplete.min.js",
|
||||
"file": "chunk/KPZlR0ib.min.js",
|
||||
"name": "autocomplete",
|
||||
"src": "src/js/main/autocomplete.ts",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"src/js/core/index.ts"
|
||||
]
|
||||
},
|
||||
"src/js/main/infinite_scroll.ts": {
|
||||
"file": "js/infinite_scroll.min.js",
|
||||
"name": "infinite_scroll",
|
||||
"src": "src/js/main/infinite_scroll.ts",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"src/js/core/index.ts"
|
||||
"src/js/index.ts",
|
||||
"_13gvpunf.min.js"
|
||||
]
|
||||
},
|
||||
"src/js/main/keyboard.ts": {
|
||||
"file": "js/keyboard.min.js",
|
||||
"file": "chunk/Db5v-hxx.min.js",
|
||||
"name": "keyboard",
|
||||
"src": "src/js/main/keyboard.ts",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"src/js/core/index.ts"
|
||||
]
|
||||
},
|
||||
"src/js/main/mapresult.ts": {
|
||||
"file": "js/mapresult.min.js",
|
||||
"name": "mapresult",
|
||||
"src": "src/js/main/mapresult.ts",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"src/js/core/index.ts"
|
||||
],
|
||||
"dynamicImports": [
|
||||
"src/js/pkg/ol.ts"
|
||||
"src/js/index.ts",
|
||||
"_13gvpunf.min.js"
|
||||
]
|
||||
},
|
||||
"src/js/main/preferences.ts": {
|
||||
"file": "js/preferences.min.js",
|
||||
"file": "chunk/CyyZ9XJS.min.js",
|
||||
"name": "preferences",
|
||||
"src": "src/js/main/preferences.ts",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"src/js/core/index.ts"
|
||||
"src/js/index.ts",
|
||||
"_13gvpunf.min.js"
|
||||
]
|
||||
},
|
||||
"src/js/main/results.ts": {
|
||||
"file": "js/results.min.js",
|
||||
"file": "chunk/Q2SRo2ED.min.js",
|
||||
"name": "results",
|
||||
"src": "src/js/main/results.ts",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"src/js/core/index.ts"
|
||||
"src/js/index.ts",
|
||||
"_13gvpunf.min.js"
|
||||
]
|
||||
},
|
||||
"src/js/main/search.ts": {
|
||||
"file": "js/search.min.js",
|
||||
"file": "chunk/DxJxX49r.min.js",
|
||||
"name": "search",
|
||||
"src": "src/js/main/search.ts",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"src/js/core/index.ts"
|
||||
"src/js/index.ts",
|
||||
"_13gvpunf.min.js",
|
||||
"_gZqIRpW1.min.js"
|
||||
]
|
||||
},
|
||||
"src/js/pkg/ol.ts": {
|
||||
"file": "js/ol.min.js",
|
||||
"name": "ol",
|
||||
"src": "src/js/pkg/ol.ts",
|
||||
"isEntry": true
|
||||
"src/js/plugin/Calculator.ts": {
|
||||
"file": "chunk/CHkLfdMs.min.js",
|
||||
"name": "calculator",
|
||||
"src": "src/js/plugin/Calculator.ts",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"src/js/index.ts",
|
||||
"_13gvpunf.min.js",
|
||||
"_gZqIRpW1.min.js"
|
||||
]
|
||||
},
|
||||
"src/js/plugin/InfiniteScroll.ts": {
|
||||
"file": "chunk/DBO1tjH7.min.js",
|
||||
"name": "infinitescroll",
|
||||
"src": "src/js/plugin/InfiniteScroll.ts",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"src/js/index.ts",
|
||||
"_13gvpunf.min.js",
|
||||
"_gZqIRpW1.min.js"
|
||||
]
|
||||
},
|
||||
"src/js/plugin/MapView.ts": {
|
||||
"file": "chunk/BAcZkB_P.min.js",
|
||||
"name": "mapview",
|
||||
"src": "src/js/plugin/MapView.ts",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"src/js/index.ts"
|
||||
]
|
||||
},
|
||||
"src/less/rss.less": {
|
||||
"file": "css/rss.min.css",
|
||||
"name": "rss.css",
|
||||
"file": "sxng-rss.min.css",
|
||||
"name": "rss",
|
||||
"names": [
|
||||
"rss.css"
|
||||
],
|
||||
@@ -109,19 +118,19 @@
|
||||
"isEntry": true
|
||||
},
|
||||
"src/less/style-ltr.less": {
|
||||
"file": "css/searxng-ltr.min.css",
|
||||
"name": "searxng-ltr.css",
|
||||
"file": "sxng-ltr.min.css",
|
||||
"name": "ltr",
|
||||
"names": [
|
||||
"searxng-ltr.css"
|
||||
"ltr.css"
|
||||
],
|
||||
"src": "src/less/style-ltr.less",
|
||||
"isEntry": true
|
||||
},
|
||||
"src/less/style-rtl.less": {
|
||||
"file": "css/searxng-rtl.min.css",
|
||||
"name": "searxng-rtl.css",
|
||||
"file": "sxng-rtl.min.css",
|
||||
"name": "rtl",
|
||||
"names": [
|
||||
"searxng-rtl.css"
|
||||
"rtl.css"
|
||||
],
|
||||
"src": "src/less/style-rtl.less",
|
||||
"isEntry": true
|
||||
|
||||
3
searx/static/themes/simple/sxng-core.min.js
vendored
Normal file
3
searx/static/themes/simple/sxng-core.min.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["chunk/DBO1tjH7.min.js","chunk/13gvpunf.min.js","chunk/gZqIRpW1.min.js","chunk/CHkLfdMs.min.js","chunk/Db5v-hxx.min.js","chunk/DxJxX49r.min.js","chunk/KPZlR0ib.min.js","chunk/Q2SRo2ED.min.js","chunk/CyyZ9XJS.min.js"])))=>i.map(i=>d[i]);
|
||||
var e=class{id;constructor(e){this.id=e,this.invoke()}async invoke(){try{console.debug(`[PLUGIN] ${this.id}: Running...`);let e=await this.run();if(!e)return;console.debug(`[PLUGIN] ${this.id}: Running post-exec...`),await this.post(e)}catch(e){console.error(`[PLUGIN] ${this.id}:`,e)}finally{console.debug(`[PLUGIN] ${this.id}: Done.`)}}};const t={index:`index`,results:`results`,preferences:`preferences`,unknown:`unknown`},n={closeDetail:void 0,scrollPageToSelected:void 0,selectImage:void 0,selectNext:void 0,selectPrevious:void 0};var r=()=>{let e=document.querySelector(`meta[name="endpoint"]`)?.getAttribute(`content`);return e&&e in t?e:t.unknown},i=()=>{let e=document.querySelector(`script[client_settings]`)?.getAttribute(`client_settings`);if(!e)return{};try{return JSON.parse(atob(e))}catch(e){return console.error(`Failed to load client_settings:`,e),{}}};const a=async(e,t,n)=>{let r=new AbortController,i=setTimeout(()=>r.abort(),n?.timeout??3e4),a=await fetch(t,{body:n?.body,method:e,signal:r.signal}).finally(()=>clearTimeout(i));if(!a.ok)throw Error(a.statusText);return a},o=(e,t,n,r)=>{if(typeof t!=`string`){t.addEventListener(e,n,r);return}document.addEventListener(e,e=>{for(let r of e.composedPath())if(r instanceof HTMLElement&&r.matches(t)){try{n.call(r,e)}catch(e){console.error(e)}break}},r)},s=(e,t)=>{for(let e of t?.on??[])if(!e)return;document.readyState===`loading`?o(`DOMContentLoaded`,document,e,{once:!0}):e()},c=r(),l=i(),u=(e,t)=>{d(t)&&e()};var d=e=>{switch(e.on){case`global`:return!0;case`endpoint`:return!!e.where.includes(c)}},f=`modulepreload`,p=function(e){return`/static/themes/simple/`+e},m={};const h=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=p(t,n),t in m)return;m[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:f,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};s(()=>{document.documentElement.classList.remove(`no-js`),document.documentElement.classList.add(`js`),o(`click`,`.close`,function(){this.parentNode?.classList.add(`invisible`)}),o(`click`,`.searxng_init_map`,async function(e){e.preventDefault(),this.classList.remove(`searxng_init_map`),u(()=>h(async()=>{let{default:e}=await import(`./chunk/BAcZkB_P.min.js`);return{default:e}},[]).then(({default:e})=>new e(this)),{on:`endpoint`,where:[t.results]})}),l.plugins?.includes(`infiniteScroll`)&&u(()=>h(async()=>{let{default:e}=await import(`./chunk/DBO1tjH7.min.js`);return{default:e}},__vite__mapDeps([0,1,2])).then(({default:e})=>new e),{on:`endpoint`,where:[t.results]}),l.plugins?.includes(`calculator`)&&u(()=>h(async()=>{let{default:e}=await import(`./chunk/CHkLfdMs.min.js`);return{default:e}},__vite__mapDeps([3,1,2])).then(({default:e})=>new e),{on:`endpoint`,where:[t.results]})}),s(()=>{h(()=>import(`./chunk/Db5v-hxx.min.js`),__vite__mapDeps([4,1])),h(()=>import(`./chunk/DxJxX49r.min.js`),__vite__mapDeps([5,1,2])),l.autocomplete&&h(()=>import(`./chunk/KPZlR0ib.min.js`),__vite__mapDeps([6,1]))},{on:[c===t.index]}),s(()=>{h(()=>import(`./chunk/Db5v-hxx.min.js`),__vite__mapDeps([4,1])),h(()=>import(`./chunk/Q2SRo2ED.min.js`),__vite__mapDeps([7,1])),h(()=>import(`./chunk/DxJxX49r.min.js`),__vite__mapDeps([5,1,2])),l.autocomplete&&h(()=>import(`./chunk/KPZlR0ib.min.js`),__vite__mapDeps([6,1]))},{on:[c===t.results]}),s(()=>{h(()=>import(`./chunk/CyyZ9XJS.min.js`),__vite__mapDeps([8,1]))},{on:[c===t.preferences]});export{e as a,l as i,o as n,n as r,a as t};
|
||||
//# sourceMappingURL=sxng-core.min.js.map
|
||||
1
searx/static/themes/simple/sxng-core.min.js.map
Normal file
1
searx/static/themes/simple/sxng-core.min.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -10,12 +10,12 @@
|
||||
<meta name="robots" content="noarchive">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{% block title %}{% endblock %}{{ instance_name }}</title>
|
||||
<script type="module" src="{{ url_for('static', filename='js/searxng.core.min.js') }}" client_settings="{{ client_settings }}"></script>
|
||||
<script type="module" src="{{ url_for('static', filename='sxng-core.min.js') }}" client_settings="{{ client_settings }}"></script>
|
||||
{% block meta %}{% endblock %}
|
||||
{% if rtl %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/searxng-rtl.min.css') }}" type="text/css" media="screen">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='sxng-rtl.min.css') }}" type="text/css" media="screen">
|
||||
{% else %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/searxng-ltr.min.css') }}" type="text/css" media="screen">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='sxng-ltr.min.css') }}" type="text/css" media="screen">
|
||||
{% endif %}
|
||||
{% if get_setting('server.limiter') or get_setting('server.public_instance') %}
|
||||
<link rel="stylesheet" href="{{ url_for('client_token', token=link_token) }}" type="text/css">
|
||||
|
||||
@@ -211,9 +211,6 @@
|
||||
{%- if 'results_on_new_tab' not in locked_preferences -%}
|
||||
{%- include 'simple/preferences/results_on_new_tab.html' -%}
|
||||
{%- endif -%}
|
||||
{%- if 'infinite_scroll' not in locked_preferences -%}
|
||||
{%- include 'simple/preferences/infinite_scroll.html' -%}
|
||||
{%- endif -%}
|
||||
{%- if 'search_on_category_select' not in locked_preferences -%}
|
||||
{%- include 'simple/preferences/search_on_category_select.html' -%}
|
||||
{%- endif -%}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<fieldset>{{- '' -}}
|
||||
<legend>{{ _('Infinite scroll') }}</legend>{{- '' -}}
|
||||
<p class="value">{{- '' -}}
|
||||
<input type="checkbox" {{- ' ' -}}
|
||||
name="infinite_scroll" {{- ' ' -}}
|
||||
aria-labelledby="pref_infinite_scroll" {{- ' ' -}}
|
||||
class="checkbox-onoff" {{- ' ' -}}
|
||||
{%- if preferences.get_value('infinite_scroll') -%}
|
||||
checked
|
||||
{%- endif -%}{{- ' ' -}}
|
||||
>{{- '' -}}
|
||||
</p>{{- '' -}}
|
||||
<div class="description" id="pref_infinite_scroll">
|
||||
{{- _('Automatically load the next page when scrolling to the bottom of the current page') -}}
|
||||
</div>{{- '' -}}
|
||||
</fieldset>{{- '' -}}
|
||||
@@ -8,7 +8,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="x-ua-compatible" content="IE=edge,chrome=1" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/rss.min.css') }}" type="text/css" media="screen"/>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='sxng-rss.min.css') }}" type="text/css" media="screen"/>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
|
||||
@@ -368,10 +368,10 @@ def get_pretty_url(parsed_url: urllib.parse.ParseResult):
|
||||
def get_client_settings():
|
||||
req_pref = sxng_request.preferences
|
||||
return {
|
||||
'plugins': req_pref.plugins.get_enabled(),
|
||||
'autocomplete': req_pref.get_value('autocomplete'),
|
||||
'autocomplete_min': get_setting('search.autocomplete_min'),
|
||||
'method': req_pref.get_value('method'),
|
||||
'infinite_scroll': req_pref.get_value('infinite_scroll'),
|
||||
'translations': get_translations(),
|
||||
'search_on_category_select': req_pref.get_value('search_on_category_select'),
|
||||
'hotkeys': req_pref.get_value('hotkeys'),
|
||||
|
||||
Reference in New Issue
Block a user