summaryrefslogtreecommitdiff
path: root/templates/scripts/slideshow.js
diff options
context:
space:
mode:
authorgrothedev <grothedev@gmail.com>2025-12-28 21:41:07 -0500
committergrothedev <grothedev@gmail.com>2025-12-28 21:41:07 -0500
commitbd6c3a07a82ba11cf7b0423307229891675e7ed3 (patch)
treefce602bc4038f0f79e12f9fb296e3d220915da23 /templates/scripts/slideshow.js
parentf978ad7db04ced4cbcf04a82bf6f0cc3f4ce66a3 (diff)
phase 1 complete i guessHEADmain
Diffstat (limited to 'templates/scripts/slideshow.js')
-rw-r--r--templates/scripts/slideshow.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/templates/scripts/slideshow.js b/templates/scripts/slideshow.js
index ccf7c32..3ab2ada 100644
--- a/templates/scripts/slideshow.js
+++ b/templates/scripts/slideshow.js
@@ -33,11 +33,12 @@ function changeSlide(direction) {
function showSlide(index) {
const file = mediaFiles[index];
const container = document.getElementById('slideshow-media-container');
+ const encodedName = encodeURIComponent(file.name);
if (file.isVideo) {
- container.innerHTML = `<video src="/download/${file.name}" controls autoplay style="max-width: 100%; max-height: 80vh;"></video>`;
+ container.innerHTML = `<video src="/download/${encodedName}" controls autoplay style="max-width: 100%; max-height: 80vh;"></video>`;
} else {
- container.innerHTML = `<img src="/download/${file.name}" alt="${file.name}" style="max-width: 100%; max-height: 80vh;">`;
+ container.innerHTML = `<img src="/download/${encodedName}" alt="${file.name}" style="max-width: 100%; max-height: 80vh;">`;
}
document.getElementById('slideshow-filename').textContent = file.name;