(function() { 'use strict'; // Support for Mobile Devices document.querySelector("#navigation-toggle").addEventListener("click", (ev) => { document.querySelector("#header #navigation").classList.toggle("open"); }); { // Lazily load Media let info = {} new Promise((resolve, reject) => { // Figure out what to load. info.elements = document.querySelectorAll(".block-media > [data-lazyload]"); info.stack = Array.from(info.elements); console.debug("Lazily loading " + info.stack.length + " elements..."); // Begin processing at 1ms intervals. info.cbid = 0; info.cbid = window.setInterval(() => { let el = info.stack.pop(); if (el === undefined) { reject(); return; } let lazycontent = el.querySelector("noscript"); if (lazycontent === undefined) { reject(); return; } el.innerHTML = lazycontent.innerHTML; if (info.stack.length == 0) { window.clearInterval(info.cbid); resolve(); return; } }, 1); }).then(() => { window.clearInterval(info.cbid); }).catch(() => { }).finally(() => { console.debug("Lazy loading complete."); }); } })();