diff options
Diffstat (limited to 'web/source/frontend/index.js')
-rw-r--r-- | web/source/frontend/index.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/web/source/frontend/index.js b/web/source/frontend/index.js index b1187f515..7cf396035 100644 --- a/web/source/frontend/index.js +++ b/web/source/frontend/index.js @@ -21,6 +21,7 @@ const Photoswipe = require("photoswipe/dist/umd/photoswipe.umd.min.js"); const PhotoswipeLightbox = require("photoswipe/dist/umd/photoswipe-lightbox.umd.min.js"); const PhotoswipeCaptionPlugin = require("photoswipe-dynamic-caption-plugin").default; +const PhotoswipeVideoPlugin = require("photoswipe-video-plugin").default; let [_, _user, type, id] = window.location.pathname.split("/"); if (type == "statuses") { @@ -39,6 +40,7 @@ const lightbox = new PhotoswipeLightbox({ new PhotoswipeCaptionPlugin(lightbox, { type: 'auto', }); +new PhotoswipeVideoPlugin(lightbox, {}); lightbox.init(); @@ -46,14 +48,14 @@ Array.from(document.getElementsByClassName("spoiler-label")).forEach((label) => let checkbox = document.getElementById(label.htmlFor); if (checkbox != undefined) { function update() { - if(checkbox.checked) { + if (checkbox.checked) { label.innerHTML = "Show more"; } else { label.innerHTML = "Show less"; } } update(); - - label.addEventListener("click", () => {setTimeout(update, 1);}); + + label.addEventListener("click", () => { setTimeout(update, 1); }); } }); |