2024-03-27 21:30:19 +01:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
2024-04-08 13:15:23 +02:00
|
|
|
<title>{{.Query}} - Ocásek</title>
|
2024-03-30 18:00:43 +01:00
|
|
|
<link rel="stylesheet" type="text/css" href="/static/css/style.css">
|
2024-03-27 21:30:19 +01:00
|
|
|
</head>
|
|
|
|
<body>
|
2024-04-08 13:15:23 +02:00
|
|
|
<form action="/search" id="prev-next-form" class="results-search-container" method="GET" autocomplete="off">
|
|
|
|
<h1 class="logomobile"><a class="no-decoration" href="./">Ocásek</a></h1>
|
|
|
|
<div class="wrapper-results">
|
2024-05-19 22:57:23 +02:00
|
|
|
<input type="text" name="q" value="{{ .Query }}" id="search-input" placeholder="Type to search..." />
|
|
|
|
<button id="search-wrapper-ico" class="material-icons-round" name="t" value="text">search</button>
|
|
|
|
<input type="submit" class="hide" name="t" value="text" />
|
|
|
|
</div>
|
2024-04-08 13:15:23 +02:00
|
|
|
<div class="sub-search-button-wrapper">
|
|
|
|
<div class="search-container-results-btn">
|
|
|
|
<button id="sub-search-wrapper-ico" class="material-icons-round clickable search-active" name="t" value="text">search</button>
|
|
|
|
<button name="t" value="text" class="clickable search-active">Web</button>
|
2024-05-19 22:57:23 +02:00
|
|
|
</div>
|
2024-04-08 13:15:23 +02:00
|
|
|
<div class="search-container-results-btn">
|
|
|
|
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="image">image</button>
|
|
|
|
<button name="t" value="image" class="clickable">Images</button>
|
|
|
|
</div>
|
|
|
|
<div class="search-container-results-btn">
|
|
|
|
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="video">movie</button>
|
|
|
|
<button name="t" value="video" class="clickable">Videos</button>
|
|
|
|
</div>
|
|
|
|
<div class="search-container-results-btn">
|
2024-05-21 21:22:36 +02:00
|
|
|
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="forum">forum</button>
|
2024-04-08 13:15:23 +02:00
|
|
|
<button name="t" value="forum" class="clickable">Forums</button>
|
|
|
|
</div>
|
2024-04-17 14:39:30 +02:00
|
|
|
<div id="content" class="js-enabled">
|
2024-04-15 22:34:50 +02:00
|
|
|
<div class="search-container-results-btn">
|
|
|
|
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="map">map</button>
|
2024-05-21 21:22:36 +02:00
|
|
|
<button name="t" value="map" class="clickable">Maps</button>
|
2024-04-15 22:34:50 +02:00
|
|
|
</div>
|
2024-04-17 14:39:30 +02:00
|
|
|
</div>
|
2024-04-08 13:15:23 +02:00
|
|
|
<div class="search-container-results-btn">
|
2024-05-23 10:56:26 +02:00
|
|
|
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="file">share</button>
|
|
|
|
<button name="t" value="file" class="clickable">Torrents</button>
|
2024-04-08 13:15:23 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
2024-03-30 21:59:16 +01:00
|
|
|
<form class="results_settings" action="/search" method="get">
|
|
|
|
<input type="hidden" name="q" value="{{ .Query }}">
|
|
|
|
<select class="results-settings" name="safe" id="safeSearchSelect">
|
|
|
|
<option value="">Safe Search Off</option>
|
2024-03-30 23:29:14 +01:00
|
|
|
<option value="active">Safe Search On</option>
|
2024-03-30 21:59:16 +01:00
|
|
|
</select>
|
|
|
|
<select class="results-settings" name="lang" id="languageSelect">
|
2024-03-30 23:29:14 +01:00
|
|
|
{{range .LanguageOptions}}
|
|
|
|
<option value="{{.Code}}" {{if eq .Code $.CurrentLang}}selected{{end}}>{{.Name}}</option>
|
|
|
|
{{end}}
|
|
|
|
</select>
|
2024-04-15 22:34:50 +02:00
|
|
|
<button class="results-save" name="t" value="text">Apply settings</button>
|
2024-03-30 21:59:16 +01:00
|
|
|
</form>
|
2024-06-09 21:59:29 +02:00
|
|
|
<div class="results" id="results">
|
2024-04-14 09:26:03 +02:00
|
|
|
{{if .Results}}
|
|
|
|
{{range .Results}}
|
|
|
|
<div class="result_item">
|
|
|
|
<a href="{{.URL}}">{{.URL}}</a>
|
|
|
|
<a href="{{.URL}}"><h3>{{.Header}}</h3></a>
|
|
|
|
<p>{{.Description}}</p>
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
{{end}}
|
|
|
|
{{else}}
|
|
|
|
<div class="no-results">No results found for '{{ .Query }}'. Try different keywords.</div>
|
2024-03-30 18:00:43 +01:00
|
|
|
{{end}}
|
|
|
|
</div>
|
2024-06-09 21:59:29 +02:00
|
|
|
<div class="prev-next prev-img" id="prev-next">
|
2024-05-19 22:57:23 +02:00
|
|
|
<form action="/search" method="get">
|
|
|
|
<input type="hidden" name="q" value="{{ .Query }}">
|
|
|
|
<input type="hidden" name="t" value="text">
|
|
|
|
{{ if .HasPrevPage }}
|
|
|
|
<button type="submit" name="p" value="{{ sub .Page 1 }}">Previous</button>
|
|
|
|
{{ end }}
|
|
|
|
{{ if .HasNextPage }}
|
|
|
|
<button type="submit" name="p" value="{{ add .Page 1 }}">Next</button>
|
|
|
|
{{ end }}
|
|
|
|
</form>
|
|
|
|
</div>
|
2024-04-17 14:39:30 +02:00
|
|
|
<script>
|
|
|
|
document.getElementById('content').classList.remove('js-enabled');
|
2024-06-09 21:59:29 +02:00
|
|
|
|
|
|
|
document.addEventListener("DOMContentLoaded", function() {
|
|
|
|
if (document.getElementById('prev-next')) {
|
|
|
|
document.getElementById('prev-next').style.display = 'none';
|
|
|
|
|
|
|
|
let page = {{ .Page }};
|
|
|
|
const query = "{{ .Query }}";
|
|
|
|
|
|
|
|
function loadResults(newPage) {
|
|
|
|
fetch(`/search?q=${encodeURIComponent(query)}&t=text&p=${newPage}`)
|
|
|
|
.then(response => response.text())
|
|
|
|
.then(data => {
|
|
|
|
const parser = new DOMParser();
|
|
|
|
const doc = parser.parseFromString(data, 'text/html');
|
|
|
|
const newResults = doc.getElementById('results').innerHTML;
|
|
|
|
document.getElementById('results').innerHTML += newResults;
|
|
|
|
page = newPage;
|
|
|
|
})
|
|
|
|
.catch(error => console.error('Error loading results:', error));
|
|
|
|
}
|
|
|
|
|
|
|
|
window.addEventListener('scroll', () => {
|
|
|
|
if (window.innerHeight + window.scrollY >= document.body.offsetHeight) {
|
|
|
|
loadResults(page + 1);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
2024-04-17 14:39:30 +02:00
|
|
|
</script>
|
2024-03-27 21:30:19 +01:00
|
|
|
</body>
|
|
|
|
</html>
|