# Changelog ## Changes 4/14/2025 - Fix Gallery View: medium screen devices get 3 max columns and small screen devices 2 max columns. ## Changes 4/13/2025 v1.1.3 - Decreased header height some more and clickable logo. - authModals.js fully updated with i18n.js keys. - main.js added Dark & Light mode i18n.js keys. - New Admin section Header Settings to change Header Title. - Admin Panel confirm unsaved changes. - Added translations and data attributes for almost all user-facing text - Extend i18n support: Add new translation keys for Download and Share modals - **Slider Integration:** - Added a slider UI (range input, label, and value display) directly above the gallery grid. - The slider allows users to adjust the number of columns in the gallery from 1 to 6. - **Dynamic Grid Updates:** - The gallery grid’s CSS is updated in real time via the slider’s value by setting the grid-template-columns property. - As the slider value changes, the layout instantly reflects the new column count. - **Dynamic Image Resizing:** - Introduced a helper function (getMaxImageHeight) that calculates the maximum image height based on the current column count. - The max height of each image is updated immediately when the slider is adjusted to create a more dynamic display. - **Image Caching:** - Implemented an image caching mechanism using a global window.imageCache object. - Images are cached on load (via an onload event) to prevent unnecessary reloading, improving performance. - **Event Handling:** - The slider’s event listener is set up to update both the gallery grid layout and the dimensions of the thumbnails dynamically. - Share button event listeners remain attached for proper functionality across the updated gallery view. - **Input Validation & Security:** - Used `filter_input()` to sanitize and validate incoming GET parameters (token, pass, page). - Validated file system paths using `realpath()` and ensured the shared folder lies within `UPLOAD_DIR`. - Escaped all dynamic outputs with `htmlspecialchars()` to prevent XSS. - **Share Link Verification:** - Loaded and validated share records from the JSON file. - Handled expiration and password protection (with proper HTTP status codes for errors). - **Pagination:** - Implemented pagination by slicing the full file list into a limited number of files per page (default of 10). - Calculated total pages and current page to create navigation links. - **View Toggle (List vs. Gallery):** - Added a toggle button that switches between a traditional list view and a gallery view. - Maintained two separate view containers (`#listViewContainer` and `#galleryViewContainer`) to support this switching. - **Gallery View with Image Caching:** - For the gallery view, implemented a JavaScript function that creates a grid of image thumbnails. - Each image uses a cache-busting query string on first load and caches its URL in a global `window.imageCache` for subsequent renders. - **Persistent Pagination Controls:** - Moved the pagination controls outside the individual view containers so that they remain visible regardless of the selected view. --- ## Changes 4/12/2025 - 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/Basic search button as material icon on same row as search bar. ### Advanced Search Implementation - **Advanced Search Toggle:** - Added a global toggle (`window.advancedSearchEnabled`) and a UI button to switch between basic and advanced search modes. - The toggle button label changes between "Advanced Search" and "Basic Search" to reflect the active mode. - **Fuse.js Integration Updates:** - Modified the `searchFiles()` function to conditionally include the `"content"` key in the Fuse.js keys only when advanced search mode is enabled. - Adjusted Fuse.js options by adding `ignoreLocation: true`, adjusting the `threshold`, and optionally assigning weights (e.g., a lower weight for `name` and a higher weight for `content`) to prioritize matches in file content. - **Backend (PHP) Enhancements:** - Updated **getFileList.php** to read the content of text-based files (e.g., `.txt`, `.html`, `.md`, etc.) using `file_get_contents()`. - Added a `"content"` property to the JSON response for eligible files to allow for full-text search in advanced mode. ### Fuse.js Integration for Indexed Real-Time Searching** - **Added Fuse.js Library:** Included Fuse.js via a CDN `