hide "map" on no-js website type, fix2
This commit is contained in:
parent
424dd0adab
commit
5b77d2a03c
4 changed files with 14 additions and 11 deletions
|
@ -66,6 +66,8 @@ func fetchImageResults(query string, safe, lang string, page int) ([]ImageSearch
|
|||
lang = "en_CA"
|
||||
}
|
||||
|
||||
// Format &lang=lang_de is incorret, implement fix !
|
||||
|
||||
apiURL := fmt.Sprintf("https://api.qwant.com/v3/search/images?t=images&q=%s&count=%d&locale=%s&offset=%d&device=desktop&tgp=2&safesearch=%s",
|
||||
url.QueryEscape(query),
|
||||
resultsPerPage,
|
||||
|
@ -102,9 +104,9 @@ func fetchImageResults(query string, safe, lang string, page int) ([]ImageSearch
|
|||
results = append(results, ImageSearchResult{
|
||||
Thumbnail: item.Thumbnail, // Thumbnail URL
|
||||
Title: item.Title, // Image title
|
||||
Media: item.Media, // Direct link to the image - Ensure this field is used appropriately in your template
|
||||
Source: item.Media, // Using item.Media here ensures the direct image link is used
|
||||
ThumbProxy: "/img_proxy?url=" + url.QueryEscape(item.Media), // Proxy URL for the thumbnail, if needed
|
||||
Media: item.Media, // Direct link to the image
|
||||
Source: item.Url,
|
||||
ThumbProxy: "/img_proxy?url=" + url.QueryEscape(item.Media),
|
||||
Width: item.Width,
|
||||
Height: item.Height,
|
||||
})
|
||||
|
|
2
main.go
2
main.go
|
@ -110,7 +110,7 @@ func handleSearch(w http.ResponseWriter, r *http.Request) {
|
|||
case "video":
|
||||
videoSearchEndpointHandler(w, r)
|
||||
case "map":
|
||||
handleMapSearch(w, query, safe) // implement map results
|
||||
handleMapSearch(w, query, safe)
|
||||
default:
|
||||
http.ServeFile(w, r, "templates/search.html")
|
||||
}
|
||||
|
|
|
@ -1138,6 +1138,10 @@ p {
|
|||
text-decoration: none;
|
||||
}
|
||||
|
||||
.js-enabled {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.logomobile {
|
||||
position: absolute;
|
||||
margin-top: 0px;
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{.Query}} - Ocásek</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/style.css">
|
||||
<style>
|
||||
.js-enabled { display: none; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form action="/search" id="prev-next-form" class="results-search-container" method="GET" autocomplete="off">
|
||||
|
@ -58,7 +55,7 @@
|
|||
<option value="{{.Code}}" {{if eq .Code $.CurrentLang}}selected{{end}}>{{.Name}}</option>
|
||||
{{end}}
|
||||
</select>
|
||||
<button class="results-save" type="submit">Apply settings</button>
|
||||
<button class="results-save" name="t" value="image">Apply settings</button>
|
||||
</form>
|
||||
<div class="search-results">
|
||||
<!-- Results go here -->
|
||||
|
|
Loading…
Add table
Reference in a new issue