Enhance the file browser media viewer with additional features:
- Add audio file support (mp3, m4a, aac, flac, wav, wma, midi, cda)
- Add touch swipe navigation for mobile devices (swipe left/right to navigate)
- Refactor code style to match original template conventions (use var instead of const/let)
- Add CSP media-src policy for video/audio playback support
- Audio player width set to 80vw for better visibility
All media types (images, videos, audio) now support:
- Modal overlay viewing with navigation controls
- Keyboard shortcuts (ESC, ←, →)
- Touch gestures on mobile devices
- File info display with position counter
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add interactive media viewer (lightbox) for images and videos in the file browser template:
- Images and videos now open in a modal overlay instead of navigating to a new page
- Navigation controls: left/right arrow buttons and keyboard shortcuts (←/→)
- Keyboard support: ESC to close, arrow keys to navigate
- Auto-play support for videos with playback controls
- Display file information and current position (e.g., "3 / 10")
- Responsive design for both desktop and mobile devices
Supported formats:
- Images: jpg, jpeg, png, gif, webp, tiff, bmp, heif, heic, svg, avif
- Videos: mp4, mov, m4v, mpeg, mpg, avi, ogg, webm, mkv, vob, gifv, 3gp
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit adds support for LibreJS (https://en.wikipedia.org/wiki/GNU_LibreJS).
LibreJS would block this embedded JavaScript because its license is not stated in a machine-readable format.
Signed-off-by: Cédric Félizard <cedric@felizard.fr>
* fileserver: Exclude symlink target size from total, show arrow on size
* Keep both totals
* Linter doesn't like my spelling :(
* Stop parallelizing tests for now
* Update modules/caddyhttp/fileserver/browse.html
* Minor renamings
---------
Co-authored-by: Matthew Holt <mholt@users.noreply.github.com>
* use url.PathEscape in file-server browse template
- add `pathEscape` to c.tpl.Funcs, using `url.PathEscape`
- use `pathEscape` in browse.html in place of `replace`
* document `pathEscape`
* Remove unnecessary pipe of img src to `html`
* browse: Add total file size to directory listing
* Apply suggestion to remove "in "
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
---------
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
* Browse.html: Add canonical URL and home-link
When contents are equal, but maybe just a sort order is different, it is good to add `<link rel="canonical" href="base-path/" />`. This helps search engines propeely index the page.
I also added a link to the home page with the name of `{{.Host}}` just above the bread crumbs to make the page clearer.
https://paste.tnonline.net/files/28Wun5CQZiqA_Screenshot_20231007_134435_Opera.png
* Update browse.html
* Make grid entries take up full width on mobile and fix breadcrumb color issue in dark mode
Signed-off-by: Pistasj <odyssey346@disroot.org>
* Do mholt's suggestions
Signed-off-by: Pistasj <odyssey346@disroot.org>
---------
Signed-off-by: Pistasj <odyssey346@disroot.org>
PR #4066 added a dark color scheme to the file_server browse template.
PR #4356 later set the links for the `:visited` pseudo-class, but did
not set anything for the dark mode, resulting in poor contrast. I
selected some new colors by feel.
This commit also adds an `a:visited:hover` for both, to go along with
the normal blue hover colors.
This makes it easier for users to find the default browse template if they
want to create a custom template based on that. It also makes it easier to
view the template with proper syntax highlighting.
2021-11-15 11:53:54 -07:00
Renamed from modules/caddyhttp/fileserver/browsetpl.go (Browse further)