mirror of
https://github.com/jaandrle/deka-dom-el
synced 2024-11-21 23:39:37 +01:00
elCode
This commit is contained in:
parent
102d1af6a4
commit
7bbc58e3cc
@ -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(
|
||||||
|
Loading…
Reference in New Issue
Block a user