summaryrefslogtreecommitdiff
path: root/searx/static
diff options
context:
space:
mode:
authorBnyro <bnyro@tutanota.com>2024-04-06 12:52:03 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2024-04-27 18:26:23 +0200
commit3ea278aff4692e037ffff4db0f7ac665598e1fc2 (patch)
tree7999aa3b18bb4b4637db7b6327fba8926ca2616c /searx/static
parent46efb2f36d327e618c5cd6af702b96fa9143fc27 (diff)
downloadsearxng-3ea278aff4692e037ffff4db0f7ac665598e1fc2.tar.gz
searxng-3ea278aff4692e037ffff4db0f7ac665598e1fc2.zip
[feat] preferences: button to enable/disable all engines
Diffstat (limited to 'searx/static')
-rw-r--r--searx/static/themes/simple/src/js/main/preferences.js16
-rw-r--r--searx/static/themes/simple/src/less/preferences.less5
2 files changed, 21 insertions, 0 deletions
diff --git a/searx/static/themes/simple/src/js/main/preferences.js b/searx/static/themes/simple/src/js/main/preferences.js
index e9dc7c85c..a0b853d61 100644
--- a/searx/static/themes/simple/src/js/main/preferences.js
+++ b/searx/static/themes/simple/src/js/main/preferences.js
@@ -27,6 +27,22 @@
searxng.on(el, 'mouseenter', load_engine_descriptions);
}
+ const enableAllEngines = d.querySelectorAll(".enable-all-engines");
+ const disableAllEngines = d.querySelectorAll(".disable-all-engines");
+ const engineToggles = d.querySelectorAll('tbody input[type=checkbox][class~=checkbox-onoff]');
+ const toggleEngines = (enable) => {
+ for (const el of engineToggles) {
+ // check if element visible, so that only engines of the current category are modified
+ if (el.offsetParent !== null) el.checked = !enable;
+ }
+ };
+ for (const el of enableAllEngines) {
+ searxng.on(el, 'click', () => toggleEngines(true));
+ }
+ for (const el of disableAllEngines) {
+ searxng.on(el, 'click', () => toggleEngines(false));
+ }
+
const copyHashButton = d.querySelector("#copy-hash");
searxng.on(copyHashButton, 'click', (e) => {
e.preventDefault();
diff --git a/searx/static/themes/simple/src/less/preferences.less b/searx/static/themes/simple/src/less/preferences.less
index 88543e03b..ecbcceee7 100644
--- a/searx/static/themes/simple/src/less/preferences.less
+++ b/searx/static/themes/simple/src/less/preferences.less
@@ -185,6 +185,11 @@ table {
}
}
+ #toggle-all-engines-container {
+ width: max-content;
+ margin-left: auto;
+ }
+
div.selectable_url {
pre {
width: 100%;