This commit is contained in:
Bnyro 2024-04-26 21:15:53 +02:00 committed by GitHub
commit 7bc2ae109b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 33 additions and 6 deletions

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -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();

View file

@ -185,6 +185,11 @@ table {
}
}
#toggle-all-engines-container {
width: max-content;
margin-left: auto;
}
div.selectable_url {
pre {
width: 100%;

View file

@ -10,6 +10,12 @@
{{- ' ' -}}<a href="{{ url_for('info', pagename='search-syntax') }}">&#9432;</a>
</p>
{%- endif -%}
<div class="hide_if_nojs" id="toggle-all-engines-container">
<button type="button" class="button enable-all-engines">{{ _("Enable all") }}</button>
<button type="button" class="button disable-all-engines">{{ _("Disable all") }}</button>
</div>
<div class="scrollx">{{- '' -}}
<table class="striped table_engines">{{- '' -}}