From 61e11ba94b3f127587386a6fdccbdb2b3185bb76 Mon Sep 17 00:00:00 2001 From: Henri Bergius Date: Wed, 26 Dec 2018 21:16:21 +0100 Subject: [PATCH] Make gallery selectable by URL --- 35c3-gallery/index.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/35c3-gallery/index.html b/35c3-gallery/index.html index 8099b96..55b98a3 100644 --- a/35c3-gallery/index.html +++ b/35c3-gallery/index.html @@ -85,7 +85,11 @@ next.setAttribute('src', image); } document.addEventListener('DOMContentLoaded', function () { - fetch('http://c-flo.cbrp3.c-base.org/pictures/space') + let gallery = 'space'; + if (window.location.search) { + gallery = decodeURIComponent(window.location.search.substr(1)); + } + fetch(`http://c-flo.cbrp3.c-base.org/pictures/${gallery}`) .then(res => res.json()) .then((pictures) => { const withUrl = pictures.map(p => 'http://c-flo.cbrp3.c-base.org' + p);