diff --git a/website/presentation.html b/website/presentation.html index 2bba54e..c2e7d97 100644 --- a/website/presentation.html +++ b/website/presentation.html @@ -1,17 +1,16 @@ - My Awesome Presentation + Kraken Quals Presentation @@ -42,14 +41,17 @@ HEre's some test code:
; Of course (println "Hello World") ; Just print 3 -(println "Math works:" (+ 1 2)) +(println "Math workssss:" (+ 1 2 4))
-
] -- +.rerun_container[
output here...
+
+] --- + # Another slideo boro @@ -64,22 +66,27 @@ import {CodeJar} from './codejar.js' window.loadEverything = function() { var slideshow = remark.create(); document.querySelectorAll('.editor').forEach((editor_div) => { - window[editor_div.id + "_jar"] = CodeJar(editor_div, hljs.highlightElement) + if (window[editor_div.id + "_jar"] == undefined) { + window[editor_div.id + "_jar"] = [] + } + window[editor_div.id + "_jar"].push(CodeJar(editor_div, hljs.highlightElement)) }); slideshow.on('showSlide', function (slide) { - console.log('Navigated to', slide) - if (slide.properties.continued == "true") { - let editor = null - for (const c of slide.content) { - if (c.class == "run_container") { - console.log("found run_container", c) - const re = /class="editor" id="([^"]+)"/; - let id = c.content[0].match(re)[1] - let editor = window[id + "_jar"] - console.log("Got editor", editor, "running kraken") - executeKraken(editor.toString(), id + "_output") - } - } + //console.log('Navigated to', slide) + for (const c of slide.content) { + if (c.class == "run_container") { + //console.log("found editor", c) + const re = /class="editor" id="([^"]+)"/; + let id = c.content[0].match(re)[1] + let editors = window[id + "_jar"] + if (slide.properties.continued == "true") { + editors[1].updateCode(editors[0].toString()) + //console.log("Got editors", editors, "running kraken") + executeKraken(editors[1].toString(), id + "_output") + } else { + editors[0].updateCode(editors[1].toString()) + } + } } }) } @@ -99,13 +106,11 @@ window.loadEverything = function() { }; function executeKraken(code, new_output_name) { output_name = new_output_name - document.getElementById(new_output_name).innerHTML = "running...\n"; + document.getElementById(new_output_name).innerHTML = ""; Module.callMain(["-C", code]); } - +