summaryrefslogtreecommitdiff
path: root/web/source/frontend
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-12-17 05:38:56 +0100
committerLibravatar GitHub <noreply@github.com>2022-12-17 04:38:56 +0000
commit2bbc64be4317166d3abb7aa177d4913f166a53e8 (patch)
tree88c3d613eb986b18894f311afa4291987a0e26c4 /web/source/frontend
parent[chore] fix some little config whoopsies (#1272) (diff)
downloadgotosocial-2bbc64be4317166d3abb7aa177d4913f166a53e8.tar.xz
[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 <f0x@cthu.lu>
Diffstat (limited to 'web/source/frontend')
-rw-r--r--web/source/frontend/index.js8
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); });
}
});