fix (search): add option to disable search entirely

This commit is contained in:
MickaelK
2026-03-17 13:37:04 +11:00
parent e8b0a6a857
commit 4f0e7ae555
2 changed files with 4 additions and 2 deletions
@@ -237,7 +237,7 @@ function componentRight(render, { getSelectionLength$ }) {
<form style="display: inline-block;" onsubmit="event.preventDefault()">
<input value="${safe(search)}" class="hidden" placeholder="${t("search")}" name="q" id="searchInput" aria-label="${t("search")}" tabindex="-1" autocapitalize="none" />
</form>
<button data-action="search" title="${t("Search")}" aria-controls="searchInput">
<button data-action="search" title="${t("Search")}" aria-controls="searchInput" class=${getConfig("enable_search") ? "" : "hidden"}>
<img class="component_icon" draggable="false" src="data:image/svg+xml;base64,${ICONS.MAGNIFYING_GLASS}" alt="search" />
</button>
<button data-action="view" title="${t("Layout")}">
+3 -1
View File
@@ -303,6 +303,7 @@ func (this *Configuration) Export() interface{} {
Origin string `json:"origin"`
Version string `json:"version"`
EnableChromecast bool `json:"enable_chromecast"`
EnableSearch bool `json:"enable_search"`
EnableShare bool `json:"enable_share"`
EnableTags bool `json:"enable_tags"`
}{
@@ -350,8 +351,9 @@ func (this *Configuration) Export() interface{} {
}(),
Version: BUILD_REF,
EnableChromecast: this.Get("features.protection.enable_chromecast").Bool(),
EnableSearch: Hooks.Get.SearchEngine() != nil,
EnableShare: this.Get("features.share.enable").Bool(),
EnableTags: Hooks.Get.Metadata() != nil,
EnableTags: Hooks.Get.Metadata() != nil,
}
}