1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2024-11-21 23:39:37 +01:00
This commit is contained in:
Jan Andrle 2023-10-09 13:51:55 +02:00
parent 102d1af6a4
commit 7bbc58e3cc
Signed by: jaandrle
GPG Key ID: B3A25AED155AFFAB

View File

@ -24,17 +24,16 @@ export function example({ src, language= "javascript" }){
})
)
),
el("script", `
Flems(document.getElementById("${id}"), {
files: [{
name: ".js",
content: ${JSON.stringify(code)}
}],
toolbar: false,
})
`)
elCode({ id, content: code })
);
}
function elCode({ id, content }){
const options= JSON.stringify({
files: [{ name: ".js", content }],
toolbar: false
});
return el("script", `Flems(document.getElementById("${id}"), JSON.parse(${options}));`);
}
function register(){
if(loaded) return;
document.head.append(