summaryrefslogtreecommitdiff
path: root/searx/static/themes/simple/src/js/head
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2022-05-07 18:05:31 +0200
committerGitHub <noreply@github.com>2022-05-07 18:05:31 +0200
commit30756d5cfc517f63a0778a54799ab6431e062e56 (patch)
tree91c9db421b6215bbfd188aae97b846dd71e9cfe7 /searx/static/themes/simple/src/js/head
parent9177172ea21852e16f00896806bf1b573fd9bb8f (diff)
parent8175290867f6425226d87377512d2ce20fd72a26 (diff)
Merge pull request #1091 from return42/client-settings
[mod] client_settings: pass settings from server to JS client
Diffstat (limited to 'searx/static/themes/simple/src/js/head')
-rw-r--r--searx/static/themes/simple/src/js/head/00_init.js23
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);