Skip to content

Commit

Permalink
try button js
Browse files Browse the repository at this point in the history
  • Loading branch information
thradams committed Mar 25, 2024
1 parent 82bee4c commit 5f72a43
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/web/emscriptem_build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,27 @@ call emcc -DMOCKFILES -Wno-multichar "lib.c" -o "Web\cake.js" -s WASM=0 -s EXPOR


This will generate Web\cake.js




This can be used in html to open the sample in playground


//Button Try after the sample
<button onclick="Try(this)">try</button>

<script>
function Try(elm)
{
//collect the text previous sample
var source = elm.previousElementSibling.innerText;

var link = "http://thradams.com/cake/playground.html?code=" + encodeURIComponent(btoa(source)) +
"&to=" + encodeURI("1") +
"&options=" + encodeURI("");

window.open(link);
}

</script>

0 comments on commit 5f72a43

Please sign in to comment.