ménage let/const & console.log
This commit is contained in:
+19
-9
@@ -1,12 +1,20 @@
|
||||
import { getDocumentShaderSource } from './cuteTexture.js';
|
||||
|
||||
export async function loadStatus(){
|
||||
let res = await fetch('/status/index.html');
|
||||
const uri = new URL('/status', document.baseURI);
|
||||
|
||||
let html_text = await res.text()
|
||||
let html = new DOMParser().parseFromString(html_text, "text/html");
|
||||
|
||||
let shaderSource = getDocumentShaderSource(html);
|
||||
const html = await (await fetch(uri, {cache: 'no-store'})).text();
|
||||
|
||||
const remoteDoc = new DOMParser().parseFromString(html, "text/html");
|
||||
|
||||
const base = remoteDoc.createElement('base');
|
||||
base.href = uri.toString();
|
||||
remoteDoc.head.prepend(base);
|
||||
|
||||
//console.log('selected file:', remoteDoc);
|
||||
|
||||
let shaderSource = getDocumentShaderSource(remoteDoc);
|
||||
|
||||
let target = document.querySelector('#statuSection');
|
||||
|
||||
@@ -14,14 +22,16 @@ export async function loadStatus(){
|
||||
|
||||
hiddenBtn.style.visibility = 'collapse';
|
||||
|
||||
let status = html.querySelector('#lolStatus');
|
||||
console.log('current status:', status.innerText);
|
||||
let status = remoteDoc.querySelector('#lolStatus');
|
||||
//console.log('current status:', status);
|
||||
|
||||
let isOpen = status.innerText.includes('ouvert');
|
||||
|
||||
let icon = html.querySelector('link[rel="icon"]');
|
||||
let style = html.querySelector('link[data-import="status-style"]');
|
||||
//console.log("selected style: ", style);
|
||||
let icon = remoteDoc.querySelector('link[rel="icon"]');
|
||||
let style = remoteDoc.querySelector('link[data-import="status-style"]');
|
||||
let styleFile = style.href.split('/').at(-1);
|
||||
style.href = uri + '/' + styleFile;
|
||||
//console.log("selected style: ", style.href);
|
||||
|
||||
document.head.append(icon);
|
||||
document.head.append(style);
|
||||
|
||||
Reference in New Issue
Block a user