reaktor2: fix agenda.r webinterface custom styling
This commit is contained in:
parent
b19cfab1f3
commit
ba6a5456e8
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user