2024-08-13 16:38:02 +02:00
<!DOCTYPE html>
< html lang = "en" >
< head >
< meta charset = "UTF-8" >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
2024-08-28 21:31:27 +02:00
{{ if .IsThemeDark }}
< meta name = "darkreader-lock" >
{{ end }}
2024-10-09 21:03:53 +02:00
< title > {{ translate "site_name" }}< / title >
2024-08-13 16:38:02 +02:00
< link rel = "stylesheet" href = "/static/css/style.css" >
2024-09-27 12:13:16 +02:00
< link rel = "stylesheet" href = "/static/css/style-search.css" >
2024-08-13 16:38:02 +02:00
< link rel = "stylesheet" href = "/static/css/{{.Theme}}.css" >
2024-10-08 22:11:06 +02:00
< link rel = "search" type = "application/opensearchdescription+xml" title = "{{ translate " site_name " } } " href = "/opensearch.xml" >
2024-08-13 16:38:02 +02:00
< / head >
< body >
2024-08-21 22:36:45 +02:00
< script defer src = "/static/js/autocomplete.js" > < / script >
2024-08-13 16:38:02 +02:00
< script >
document.addEventListener('DOMContentLoaded', function () {
// Define the updateSettings function first
function updateSettings(settingKey, settingValue) {
const xhr = new XMLHttpRequest();
xhr.open('POST', '/updateSettings', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function () {
if (this.status >= 200 & & this.status < 300 ) {
console.log('Settings updated successfully!');
} else {
console.log('Failed to update settings.');
}
};
xhr.send(encodeURI(settingKey + '=' + settingValue));
}
const settingsIcon = document.querySelector('.settings-icon-link-search');
const searchMenu = document.querySelector('.search-menu');
settingsIcon.addEventListener('click', function () {
searchMenu.classList.toggle('settings-menu-hidden');
searchMenu.classList.toggle('settings-menu-visible');
});
// Theme change event listeners
document.getElementById('dark_theme').addEventListener('click', function () {
window.location.href = '/search?theme=dark';
});
document.getElementById('light_theme').addEventListener('click', function () {
window.location.href = '/search?theme=light';
});
// Event listener for Safe Search Selection
document.getElementById('safeSearchSelect').addEventListener('change', function () {
updateSettings('safe', this.value);
});
// Event listener for Language Selection
2024-09-27 17:27:16 +02:00
if (siteLanguageSelect) {
siteLanguageSelect.addEventListener('change', function () {
updateSettings('site_lang', this.value);
});
}
// if (searchLanguageSelect) {
// searchLanguageSelect.addEventListener('change', function () {
// updateSettings('search_lang', this.value);
// });
// }
2024-08-13 16:38:02 +02:00
});
< / script >
< div class = "settings-search-div settings-search-div-search" >
< button class = "material-icons-round clickable settings-icon-link settings-icon-link-search" > menu< / button >
< / div >
< div class = "search-menu settings-menu-hidden" >
2024-10-08 22:11:06 +02:00
< h2 > {{ translate "settings" }}< / h2 >
2024-08-13 16:38:02 +02:00
< div class = "settings-content" >
2024-10-08 22:11:06 +02:00
< button id = "settingsButton" onclick = "window.location.href='/settings'" > {{ translate "all_settings" }}< / button > <!-- Well its unessesary to use js here but this menu will not work without js anyway -->
2024-09-29 08:33:49 +02:00
< div class = "theme-settings theme-mini-settings" >
2024-10-09 21:03:53 +02:00
< p > < span class = "highlight" > {{ translate "theme" }}: < / span > < span id = "theme_name" > {{.Theme}}< / span > < / p >
2024-08-13 16:38:02 +02:00
< div class = "themes-settings-menu" >
2024-10-08 22:11:06 +02:00
< div > < img class = "view-image-search clickable" id = "dark_theme" alt = "{{ translate " dark_theme " } } " src = "/static/images/dark.webp" > < / div >
< div > < img class = "view-image-search clickable" id = "light_theme" alt = "{{ translate " light_theme " } } " src = "/static/images/light.webp" > < / div >
2024-08-13 16:38:02 +02:00
< / div >
< / div >
< select class = "lang" name = "safe" id = "safeSearchSelect" >
2024-10-08 22:11:06 +02:00
< option value = "disabled" { { if eq . Safe " disabled " } } selected { { end } } > {{ translate "safe_search_off" }}< / option >
< option value = "active" { { if eq . Safe " active " } } selected { { end } } > {{ translate "safe_search_on" }}< / option >
2024-08-13 16:38:02 +02:00
< / select >
2024-09-27 17:27:16 +02:00
< select class = "lang" name = "site_lang" id = "siteLanguageSelect" >
2024-08-13 16:38:02 +02:00
{{range .LanguageOptions}}
< option value = "{{.Code}}" { { if eq . Code $ . CurrentLang } } selected { { end } } > {{.Name}}< / option >
{{end}}
< / select >
< / div >
< / div >
< form action = "/search" class = "search-container" method = "post" autocomplete = "off" >
2024-09-26 21:18:52 +02:00
< div class = "search-page-content" >
2024-10-08 22:11:06 +02:00
< h1 > {{ translate "site_name" }}< / h1 >
2024-09-26 21:18:52 +02:00
< div class = "wrapper" >
2024-10-08 22:11:06 +02:00
< input type = "text" name = "q" autofocus id = "search-input" / > <!-- placeholder="{{ translate "type_to_search" }}" -->
2024-09-26 21:18:52 +02:00
< button id = "search-wrapper-ico" class = "material-icons-round" name = "t" value = "web" type = "submit" > search< / button >
< div class = "autocomplete" >
< ul > < / ul >
< / div >
< / div >
< div class = "search-type-icons" >
< input type = "hidden" name = "p" value = "1" >
< div class = "icon-button" >
< button id = "sub-search-wrapper-ico" class = "material-icons-round clickable" name = "t" value = "text" > search< / button >
2024-10-08 22:11:06 +02:00
< p > {{ translate "web" }}< / p >
2024-09-26 21:18:52 +02:00
< / div >
< div class = "icon-button" >
< button id = "sub-search-wrapper-ico" class = "material-icons-round clickable" name = "t" value = "image" > image< / button >
2024-10-08 22:11:06 +02:00
< p > {{ translate "images" }}< / p >
2024-09-26 21:18:52 +02:00
< / div >
< div class = "icon-button" >
< button id = "sub-search-wrapper-ico" class = "material-icons-round clickable" name = "t" value = "video" > movie< / button >
2024-10-08 22:11:06 +02:00
< p > {{ translate "videos" }}< / p >
2024-09-26 21:18:52 +02:00
< / div >
< div class = "icon-button" >
< button id = "sub-search-wrapper-ico" class = "material-icons-round clickable" name = "t" value = "forum" > forum< / button >
2024-10-08 22:11:06 +02:00
< p > {{ translate "forums" }}< / p >
2024-09-26 21:18:52 +02:00
< / div >
< div class = "icon-button" >
< button id = "sub-search-wrapper-ico" class = "material-icons-round clickable" name = "t" value = "map" > map< / button >
2024-10-08 22:11:06 +02:00
< p > {{ translate "maps" }}< / p >
2024-09-26 21:18:52 +02:00
< / div >
< div class = "icon-button" >
< button id = "sub-search-wrapper-ico" class = "material-icons-round clickable" name = "t" value = "file" > share< / button >
2024-10-08 22:11:06 +02:00
< p > {{ translate "torrents" }}< / p >
2024-09-26 21:18:52 +02:00
< / div >
2024-08-21 22:36:45 +02:00
< / div >
2024-08-13 16:38:02 +02:00
< / div >
< / form >
< / body >
2024-09-26 21:18:52 +02:00
< / html >