summaryrefslogtreecommitdiff
path: root/searx/templates/simple/preferences
AgeCommit message (Collapse)Author
2025-12-02[mod] client/simple: client plugins (#5406)Ivan Gabaldon
* [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`](https://github.com/inetol/searxng/blob/1ad832b1dc33f3f388da361ff2459b05dc86a164/client/simple/src/js/toolkit.ts#L134) array has the plugin id. * [mod] client/simple: rebuild static
2025-10-24[fix] client/simple: insecure ctx clipboard copyIvan Gabaldon
Uses the deprecated [`execCommand()`](https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand) to copy content to clipboard if accessing the instance through HTTP, this method isn't going away soon. Closes https://github.com/searxng/searxng/issues/5359
2025-08-20[fix] template: safesearch uses the wrong type (#5136)Ivan Gabaldon
This fixes a regression from 60bd8b9#diff-1b714182564ef1fa942ff81b28f9ba3365ab76f75346f4255398bf9d6064b4cc Closes https://github.com/searxng/searxng/issues/5135
2025-06-23[chore] docs: various grammatical fixesbenpiano800
2025-06-12[chore] Preferences: Make autocomplete description sound less casual (#4908)benpiano800
2025-06-12[chore] Preferences: Fix grammatical error in results_on_new_tab.html (#4909)benpiano800
2025-05-31[chore] engine preferences: fix grammar mistakes (#4883)benpiano800
2025-02-28[web-client] simple theme: refactor jinja_svg_catalog and cleanup icon namesMarkus Heiser
This patch implements the template generation of the template: searx/templates/simple/icons.html by the way the icon set (the icon names) has been normalized: film-outline --> film magnet-outline --> magnet .. warning --> alert Some missing (categorie) icons had been added. Some of the ionicons are not suitable for a dark theme, we fixed the svg manually in src/svg/ionicons: - https://github.com/searxng/searxng/pull/4284#issuecomment-2680550342 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-02-09[mod] improve description of the prefernces URL in the "COOKIES" tabMarkus Heiser
Closes: https://github.com/searxng/searxng/issues/4272 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-01-28[refactor] typification of SearXNG (initial) / result items (part 1)Markus Heiser
Typification of SearXNG ======================= This patch introduces the typing of the results. The why and how is described in the documentation, please generate the documentation .. $ make docs.clean docs.live and read the following articles in the "Developer documentation": - result types --> http://0.0.0.0:8000/dev/result_types/index.html The result types are available from the `searx.result_types` module. The following have been implemented so far: - base result type: `searx.result_type.Result` --> http://0.0.0.0:8000/dev/result_types/base_result.html - answer results --> http://0.0.0.0:8000/dev/result_types/answer.html including the type for translations (inspired by #3925). For all other types (which still need to be set up in subsequent PRs), template documentation has been created for the transition period. Doc of the fields used in Templates =================================== The template documentation is the basis for the typing and is the first complete documentation of the results (needed for engine development). It is the "working paper" (the plan) with which further typifications can be implemented in subsequent PRs. - https://github.com/searxng/searxng/issues/357 Answer Templates ================ With the new (sub) types for `Answer`, the templates for the answers have also been revised, `Translation` are now displayed with collapsible entries (inspired by #3925). !en-de dog Plugins & Answerer ================== The implementation for `Plugin` and `Answer` has been revised, see documentation: - Plugin: http://0.0.0.0:8000/dev/plugins/index.html - Answerer: http://0.0.0.0:8000/dev/answerers/index.html With `AnswerStorage` and `AnswerStorage` to manage those items (in follow up PRs, `ArticleStorage`, `InfoStorage` and .. will be implemented) Autocomplete ============ The autocompletion had a bug where the results from `Answer` had not been shown in the past. To test activate autocompletion and try search terms for which we have answerers - statistics: type `min 1 2 3` .. in the completion list you should find an entry like `[de] min(1, 2, 3) = 1` - random: type `random uuid` .. in the completion list, the first item is a random UUID Extended Types ============== SearXNG extends e.g. the request and response types of flask and httpx, a module has been set up for type extensions: - Extended Types --> http://0.0.0.0:8000/dev/extended_types.html Unit-Tests ========== The unit tests have been completely revised. In the previous implementation, the runtime (the global variables such as `searx.settings`) was not initialized before each test, so the runtime environment with which a test ran was always determined by the tests that ran before it. This was also the reason why we sometimes had to observe non-deterministic errors in the tests in the past: - https://github.com/searxng/searxng/issues/2988 is one example for the Runtime issues, with non-deterministic behavior .. - https://github.com/searxng/searxng/pull/3650 - https://github.com/searxng/searxng/pull/3654 - https://github.com/searxng/searxng/pull/3642#issuecomment-2226884469 - https://github.com/searxng/searxng/pull/3746#issuecomment-2300965005 Why msgspec.Struct ================== We have already discussed typing based on e.g. `TypeDict` or `dataclass` in the past: - https://github.com/searxng/searxng/pull/1562/files - https://gist.github.com/dalf/972eb05e7a9bee161487132a7de244d2 - https://github.com/searxng/searxng/pull/1412/files - https://github.com/searxng/searxng/pull/1356 In my opinion, TypeDict is unsuitable because the objects are still dictionaries and not instances of classes / the `dataclass` are classes but ... The `msgspec.Struct` combine the advantages of typing, runtime behaviour and also offer the option of (fast) serializing (incl. type check) the objects. Currently not possible but conceivable with `msgspec`: Outsourcing the engines into separate processes, what possibilities this opens up in the future is left to the imagination! Internally, we have already defined that it is desirable to decouple the development of the engines from the development of the SearXNG core / The serialization of the `Result` objects is a prerequisite for this. HINT: The threads listed above were the template for this PR, even though the implementation here is based on msgspec. They should also be an inspiration for the following PRs of typification, as the models and implementations can provide a good direction. Why just one commit? ==================== I tried to create several (thematically separated) commits, but gave up at some point ... there are too many things to tackle at once / The comprehensibility of the commits would not be improved by a thematic separation. On the contrary, we would have to make multiple changes at the same places and the goal of a change would be vaguely recognizable in the fog of the commits. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2024-12-01[feat] search: add url formatting preferenceBnyro
2024-10-05[mod] Revision of the favicon solutionMarkus Heiser
All favicons implementations have been documented and moved to the Python package: searx.favicons There is a configuration (based on Pydantic) for the favicons and all its components: searx.favicons.config A solution for caching favicons has been implemented: searx.favicon.cache If the favicon is already in the cache, the returned URL is a data URL [1] (something like `data:image/png;base64,...`). By generating a data url from the FaviconCache, additional HTTP roundtripps via the favicon_proxy are saved: favicons.proxy.favicon_url The favicon proxy service now sets a HTTP header "Cache-Control: max-age=...": favicons.proxy.favicon_proxy The resolvers now also provide the mime type (data, mime): searx.favicon.resolvers [1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2024-10-05[feat] add favicons to result urlsBrock Vojkovic
2024-10-03[feat] simple theme: pure black theme styleBnyro
2024-09-21[fix] simple template: macro checkbox_onoff_reversedMarkus
In its previous implementation, the macro ``checkbox_onoff_reversed`` always created an ``aria-labelledby`` attribute, even if there was no descriptive tag with the generated ID (used as the value of the ``aria-labelledby``). Before this patch, the Nu-HTML-Checker [1] reported 255 issues of this type:: The aria-labelledby attribute must point to an element in the same document. (255) [1] https://validator.w3.org/nu/ Signed-off-by: Markus <markus@venom.fritz.box>
2024-09-21[fix] simple template: add ID to elements used for aria-labelledbyMarkus
The ``aria-labelledby`` [1] attribute identifies the element that labels the element it is applied to. The templates ``infinite_scroll.html`` and ``search_on_category_select.html`` define a ``aria-labelledby`` at the <input> tag but miss the id in the <div> with the description. [1] https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby Signed-off-by: Markus <markus@venom.fritz.box>
2024-09-21[fix] Removes ``/>`` ending tags for void HTML elementsMarkus
continuation of commit: 0b832f19b Signed-off-by: Markus <markus@venom.fritz.box>
2024-09-15[fix] Removes ``/>`` ending tags for void HTML elementsGrant Lanham
Removes ``/>`` ending tags for void elements [1] and replaces them with ``>``. Part of the larger cleanup to cleanup invalid HTML throughout the codebase [2]. [1] https://html.spec.whatwg.org/multipage/syntax.html#void-elements [2] https://github.com/searxng/searxng/issues/3793
2024-07-14[mod] UX: flush flag icon to right in language select option valuesGrant Lanham
If the flag icon is first, it prevents easily searching the select list on the keyboard. By moving the icon fully to the right, this will enable a user to search the select list. Closes: https://github.com/searxng/searxng/issues/3645
2024-04-27[feat] preferences: button to enable/disable all enginesBnyro
2024-01-29[feat] preferences: button to copy input to restore preferences hashBnyro
2023-12-23[mod] Capitalize theme names/styles in theme.html view fileJay
2023-09-19[mod] preferences: implement drop-down menu for hotkeys (default, vim)Markus Heiser
Replace the on/off checkbox of the vim-hotkeys in the preferences by a drop-down menu. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-09-18[feat] search on category select without JSBnyro
Co-authored-by: Alexandre Flament <alex@al-f.net>
2023-09-09[fix] preferences - layout of the "special queries" tabMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-08-27[feat] settings: replace boolean select preferences with checkboxesBnyro
2023-08-14[fix] preferences: change engine table category colspan to 8mrpaulblack
* this is a small fix to increase the colspan of the category in engine preferences from 7 to 8, since there was a column added => fixing a small fallout from 473129031710973e3c02e7178085b751b5e821ed
2023-08-10[mod] settings: show weight of each instanceBnyro
2023-06-02[fix] URL percent-encoding in translations fail in babelMarkus Heiser
Closes: https://github.com/searxng/searxng/issues/2482 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-06-02[mod] template preferences: split into elements (no functional change)Markus Heiser
HINT: this patch has no functional change / it is the preparation for following changes and bugfixes Over the years, the preferences template became an unmanageable beast. To make the source code more readable the monolith is splitted into elements. The splitting into elements also has the advantage that a new template can make use of them. The reversed checkbox is a quirk that is only used in the prefereces and must be eliminated in the long term. For this the macro 'checkbox_onoff_reversed' was added to the preferences.html template. The 'checkbox' macro is also a quirk of the preferences.html we don't want to use in other templates (it is an input-checkbox in a HTML form that was misused for status display). Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>