mirror of
https://github.com/Xevion/glance.git
synced 2025-12-15 18:11:57 -06:00
feat: add possibility to set search input placeholder
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<input class="search-input" type="text" placeholder="Type here to search…" autocomplete="off"{{ if .Autofocus }} autofocus{{ end }}>
|
||||
<input class="search-input" type="text" placeholder="{{ .Placeholder }}" autocomplete="off"{{ if .Autofocus }} autofocus{{ end }}>
|
||||
|
||||
<div class="search-bang"></div>
|
||||
<kbd class="hide-on-mobile" title="Press [S] to focus the search input">S</kbd>
|
||||
|
||||
@@ -21,6 +21,7 @@ type searchWidget struct {
|
||||
Bangs []SearchBang `yaml:"bangs"`
|
||||
NewTab bool `yaml:"new-tab"`
|
||||
Autofocus bool `yaml:"autofocus"`
|
||||
Placeholder string `yaml:"placeholder"`
|
||||
}
|
||||
|
||||
func convertSearchUrl(url string) string {
|
||||
@@ -41,6 +42,10 @@ func (widget *searchWidget) initialize() error {
|
||||
widget.SearchEngine = "duckduckgo"
|
||||
}
|
||||
|
||||
if widget.Placeholder == "" {
|
||||
widget.Placeholder = "Type here to search…"
|
||||
}
|
||||
|
||||
if url, ok := searchEngines[widget.SearchEngine]; ok {
|
||||
widget.SearchEngine = url
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user