[mod] preferences: implement drop-down menu for hotkeys (default, vim)

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>
This commit is contained in:
Markus Heiser 2023-09-16 17:14:18 +02:00 committed by Markus Heiser
parent 09935e2897
commit 317db5b04f
6 changed files with 30 additions and 12 deletions

View file

@ -200,6 +200,7 @@
{%- if 'search_on_category_select' not in locked_preferences -%}
{%- include 'simple/preferences/search_on_category_select.html' -%}
{%- endif -%}
{%- include 'simple/preferences/hotkeys.html' -%}
{{- plugin_preferences('ui') -}}
{{- tab_footer() -}}

View file

@ -0,0 +1,23 @@
<fieldset>{{- '' -}}
<legend id="pref_hotkeys">{{- _('Hotkeys') -}}</legend>{{- '' -}}
<div class="value">{{- '' -}}
<select name="hotkeys" aria-labelledby="pref_hotkeys">{{- '' -}}
<option value="default"
{%- if hotkeys == 'default' %} selected="selected"
{%- endif -%}>
SearXNG{{- '' -}}
</option>{{- '' -}}
<option value="vim"
{%- if hotkeys == 'vim' %} selected="selected"
{%- endif -%}>
{{- _('Vim-like') -}}
</option>{{- '' -}}
</select>{{- '' -}}
</div>{{- '' -}}
<div class="description">
{{- _(
'Navigate search results with hotkeys (JavaScript required). '
'Press "h" key on main or result page to get help.'
) -}}
</div>{{- '' -}}
</fieldset>{{- '' -}}