diff options
| author | Markus Heiser <markus.heiser@darmarit.de> | 2022-04-13 17:08:19 +0200 |
|---|---|---|
| committer | Markus Heiser <markus.heiser@darmarit.de> | 2022-05-07 17:58:30 +0200 |
| commit | ed2a4c80879d2d3741514ea1117ab672b8f55d54 (patch) | |
| tree | 6a1cb65e74ceade9372f65e2cfb7cb9e04322d3e /searx/static/themes/simple/src/js/head | |
| parent | 9177172ea21852e16f00896806bf1b573fd9bb8f (diff) | |
[mod] client_settings: pass settings from server to JS client
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/static/themes/simple/src/js/head')
| -rw-r--r-- | searx/static/themes/simple/src/js/head/00_init.js | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/searx/static/themes/simple/src/js/head/00_init.js b/searx/static/themes/simple/src/js/head/00_init.js index acd437f39..4aeece8c2 100644 --- a/searx/static/themes/simple/src/js/head/00_init.js +++ b/searx/static/themes/simple/src/js/head/00_init.js @@ -1,9 +1,4 @@ -/** - * @license - * (C) Copyright Contributors to the SearXNG project. - * (C) Copyright Contributors to the searx project (2014 - 2021). - * SPDX-License-Identifier: AGPL-3.0-or-later - */ +/* SPDX-License-Identifier: AGPL-3.0-or-later */ (function (w, d) { 'use strict'; @@ -13,23 +8,13 @@ return scripts[scripts.length - 1]; })(); - // try to detect touch screen w.searxng = { - method: script.getAttribute('data-method'), - autocompleter: script.getAttribute('data-autocompleter') === 'true', - search_on_category_select: script.getAttribute('data-search-on-category-select') === 'true', - infinite_scroll: script.getAttribute('data-infinite-scroll') === 'true', - hotkeys: script.getAttribute('data-hotkeys') === 'true', - static_path: script.getAttribute('data-static-path'), - translations: JSON.parse(script.getAttribute('data-translations')), - theme: { - // image that is displayed if load of <img src='...'> failed - img_load_error: 'img/img_load_error.svg' - } + settings: JSON.parse(atob(script.getAttribute('client_settings'))) }; // update the css var hmtlElement = d.getElementsByTagName("html")[0]; hmtlElement.classList.remove('no-js'); hmtlElement.classList.add('js'); -})(window, document);
\ No newline at end of file + +})(window, document); |