~technomancy/fennel-lang.org

1b6288652ba9399d9210b7a8d86fdc0287aeb732 — Phil Hagelberg 2 months ago 62d6c8b main
Add script to select videos from URL fragment; thanks ndegruchy

based on https://gist.github.com/ndegruchy/6ef8804cc0d8c21d9d6b8b7dd2d6be98
2 files changed, 4 insertions(+), 7 deletions(-)

M Makefile
M conf/videos.js
M Makefile => Makefile +1 -1
@@ 112,7 112,7 @@ conf/signup.cgi: conf/signup.fnl fennel/fennel

uploadconf: conf/2020.html conf/2021.html conf/2022.html conf/2023.html \
		conf/2019.html conf/2018.html conf/all.html \
		conf/*.jpg conf/.htaccess conf/signup.cgi
		conf/*.jpg conf/.htaccess conf/signup.cgi conf/videos.js
	rsync -Av $^ fenneler@fennel-lang.org:conf.fennel-lang.org/

uploadv: conf/v

M conf/videos.js => conf/videos.js +3 -6
@@ 1,12 1,9 @@
function loadVideo() {
    var hash = new URL(document.URL).hash;
    if (!hash) return false;
    var videos = document.querySelectorAll("a[href$='webm']");

    for (var i=0; i<videos.length; i++) {
        var element = videos[i];
        if ("#"+element.id == hash) {
            document.getElementById("v").setAttribute('src', element);
    for (a of document.querySelectorAll("a[href$='webm']")) {
        if ("#"+a.id == hash) {
            document.getElementById("v").setAttribute('src', a.href);
            break;
        }
    }