diff options
author | KierĂ¡n Meinhardt <kmein@posteo.de> | 2021-07-29 17:05:39 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2021-07-30 09:15:48 +0200 |
commit | ba6a5456e8d76b9c1eae7cd81dca3f2b16359ba2 (patch) | |
tree | 35de964565cb80a13e0f0de265b470a70c802a64 /krebs/2configs | |
parent | b19cfab1f372278950f70c2992cf62de93156c03 (diff) |
reaktor2: fix agenda.r webinterface custom styling
Diffstat (limited to 'krebs/2configs')
-rw-r--r-- | krebs/2configs/reaktor2.nix | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/krebs/2configs/reaktor2.nix b/krebs/2configs/reaktor2.nix index e9837ff7c..4a33c33ec 100644 --- a/krebs/2configs/reaktor2.nix +++ b/krebs/2configs/reaktor2.nix @@ -187,16 +187,18 @@ in { const params = Object.fromEntries(urlSearchParams.entries()); if (params.hasOwnProperty("style")) { - fetch(params["style"]) - .then((response) => - response.text().then((css) => { - const title = document.getElementsByTagName("title")[0]; - const style = document.createElement("style"); - style.appendChild(document.createTextNode(css)); - title.appendChild(style); - }) - ) - .catch(console.log); + const cssUrls = params["style"].split(" ").filter((x) => x.length > 0); + for (const cssUrl of cssUrls) + fetch(cssUrl) + .then((response) => + response.text().then((css) => { + const title = document.getElementsByTagName("head")[0]; + const style = document.createElement("style"); + style.appendChild(document.createTextNode(css)); + title.appendChild(style); + }) + ) + .catch(console.log); } fetch("/agenda.json") |