code review

This commit is contained in:
2026-02-11 12:58:23 -06:00
parent 68e9facdc7
commit d54aa6009a
6 changed files with 78 additions and 80 deletions

View File

@@ -29,9 +29,14 @@ async function goto(location, { push = true } = {}) {
const content = response[1];
let root = document.getElementById("root");
root.innerHTML = content;
root.querySelectorAll("script").forEach((x) => {
eval(x.innerHTML);
});
root.querySelectorAll("script").forEach((oldScript) => {
const newScript = document.createElement("script");
Array.from(oldScript.attributes).forEach(attr => {
newScript.setAttribute(attr.name, attr.value);
});
newScript.textContent = oldScript.textContent;
oldScript.parentNode.replaceChild(newScript, oldScript);
});
toggleMenu(collapse=true);
document.querySelector("title").textContent = metadata["title"];
if (push) {