Change search box text when enabling advanced search.

This commit is contained in:
Ryan
2025-04-12 15:36:23 -04:00
committed by GitHub
parent 90439022e3
commit fb537b1d61
3 changed files with 9 additions and 2 deletions

View File

@@ -4,6 +4,7 @@
- Moved Gallery view toggle button into header.
- Removed css entries that are not needed anymore for Gallery View Toggle.
- Change search box text when enabling advanced search.
### Advanced Search Implementation

View File

@@ -90,6 +90,11 @@ export function showToast(message, duration = 3000) {
export function buildSearchAndPaginationControls({ currentPage, totalPages, searchTerm }) {
const safeSearchTerm = escapeHTML(searchTerm);
// Choose the placeholder text based on advanced search mode
const placeholderText = window.advancedSearchEnabled
? t("search_placeholder_advanced")
: t("search_placeholder");
return `
<div class="row align-items-center mb-3">
<div class="col-12 col-md-8 mb-2 mb-md-0">
@@ -99,7 +104,7 @@ export function buildSearchAndPaginationControls({ currentPage, totalPages, sear
<i class="material-icons">search</i>
</span>
</div>
<input type="text" id="searchInput" class="form-control" placeholder="${t("search_placeholder")}" value="${safeSearchTerm}" aria-describedby="searchIcon">
<input type="text" id="searchInput" class="form-control" placeholder="${placeholderText}" value="${safeSearchTerm}" aria-describedby="searchIcon">
</div>
</div>
<div class="col-12 col-md-4 text-left">

View File

@@ -5,7 +5,8 @@ const translations = {
"no_files_selected": "No files selected.",
"confirm_delete_files": "Are you sure you want to delete {count} selected file(s)?",
"element_not_found": "Element with id \"{id}\" not found.",
"search_placeholder": "Search files, tags, or uploader...",
"search_placeholder": "Search files, tags, & uploader...",
"search_placeholder_advanced": "Advanced Search: files, tags, uploader & content...",
"file_name": "File Name",
"date_modified": "Date Modified",
"upload_date": "Upload Date",