From 2bbc64be4317166d3abb7aa177d4913f166a53e8 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sat, 17 Dec 2022 05:38:56 +0100 Subject: [feature] Enable basic video support (mp4 only) (#1274) * [feature] basic video support * fix missing semicolon * replace text shadow with stacked icons Co-authored-by: f0x --- web/source/frontend/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'web/source/frontend/index.js') 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); }); } }); -- cgit v1.2.3