1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2024-11-22 07:49:38 +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", ` elCode({ id, content: code })
Flems(document.getElementById("${id}"), {
files: [{
name: ".js",
content: ${JSON.stringify(code)}
}],
toolbar: false,
})
`)
); );
} }
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(){ function register(){
if(loaded) return; if(loaded) return;
document.head.append( document.head.append(