From 4f4c939631fa17b1bf140a76db712ba61994bb11 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Tue, 4 Nov 2025 23:35:58 +1300 Subject: [PATCH] also update document head --- static/jsonp.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/static/jsonp.js b/static/jsonp.js index 36140d9..3dde75b 100644 --- a/static/jsonp.js +++ b/static/jsonp.js @@ -25,9 +25,6 @@ async function cont() { xhr.upload.addEventListener("progress", event => { if (event.lengthComputable) { progress.value = (event.loaded / event.total) * uploadFraction - console.log( - `Uploaded ${((event.loaded / event.total) * 100).toFixed(2)}%`, - ) } }) @@ -35,15 +32,19 @@ async function cont() { xhr.addEventListener("progress", event => { if (event.lengthComputable) { progress.value = (event.loaded / event.total) * (1 - uploadFraction) + uploadFraction - console.log( - `Downloaded ${((event.loaded / event.total) * 100).toFixed(2)}%`, - ) } }) xhr.addEventListener("load", () => { console.log(xhr) document.body = xhr.responseXML.body + document.title = xhr.responseXML.title + for (const e of xhr.responseXML.head.children) { + if (["LINK"].includes(e.tagName)) { + const imported = document.importNode(e, true) + document.head.appendChild(imported) + } + } }) xhr.open("POST", "/api/render/wiki")