mirror of
https://gitdab.com/cadence/breezewiki.git
synced 2026-03-05 13:40:27 -05:00
also update document head
This commit is contained in:
@@ -25,9 +25,6 @@ async function cont() {
|
|||||||
xhr.upload.addEventListener("progress", event => {
|
xhr.upload.addEventListener("progress", event => {
|
||||||
if (event.lengthComputable) {
|
if (event.lengthComputable) {
|
||||||
progress.value = (event.loaded / event.total) * uploadFraction
|
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 => {
|
xhr.addEventListener("progress", event => {
|
||||||
if (event.lengthComputable) {
|
if (event.lengthComputable) {
|
||||||
progress.value = (event.loaded / event.total) * (1 - uploadFraction) + uploadFraction
|
progress.value = (event.loaded / event.total) * (1 - uploadFraction) + uploadFraction
|
||||||
console.log(
|
|
||||||
`Downloaded ${((event.loaded / event.total) * 100).toFixed(2)}%`,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
xhr.addEventListener("load", () => {
|
xhr.addEventListener("load", () => {
|
||||||
console.log(xhr)
|
console.log(xhr)
|
||||||
document.body = xhr.responseXML.body
|
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")
|
xhr.open("POST", "/api/render/wiki")
|
||||||
|
|||||||
Reference in New Issue
Block a user