From: Dale Weiler Date: Tue, 13 Nov 2012 04:04:31 +0000 (+0000) Subject: Should now run programs in the browser, just need to compile the examples and load... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ef80c6da7e0063067459cd2ca2ec295d4918560b;p=xonotic%2Fgmqcc.git Should now run programs in the browser, just need to compile the examples and load them up --- diff --git a/javascripts/compiler.js b/javascripts/compiler.js index 2c4abcf..457b700 100644 --- a/javascripts/compiler.js +++ b/javascripts/compiler.js @@ -189,14 +189,12 @@ function update() { doc.value = examples[sel[sel.selectedIndex].value - 1]; } - function compile() { - //run ([ - // document.getElementById("eg").selectedIndex.toString(), - // document.getElementById("args") - //]); - //document.write("Hello World\n"); - run (["hello.dat"]); + var args = [ + 'dat/' + document.getElementById("eg").selectedIndex.toString() + '.dat' + ].concat(document.getElementById("args").value.split()); + document.getElementById("output").value = "Executing " + args.toString().replace(',', ' '); + run (args); } /* set initial */ diff --git a/test.html b/test.html index 8fdd98e..557baa7 100644 --- a/test.html +++ b/test.html @@ -48,6 +48,7 @@
+

Execution Output: