]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Should now run programs in the browser, just need to compile the examples and load...
authorDale Weiler <killfieldengine@gmail.com>
Tue, 13 Nov 2012 04:04:31 +0000 (04:04 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Tue, 13 Nov 2012 04:04:31 +0000 (04:04 +0000)
javascripts/compiler.js
test.html

index 2c4abcfc38681e9e75da064d535e7b8bf2cb67c6..457b700d4ef82252d86e0df08cdd6c8bd2c80e9b 100644 (file)
@@ -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 */
index 8fdd98ea7d0fd5bf649896a6d091eef0add36d9b..557baa745c29881d6213f28851fd30dff9603f13 100644 (file)
--- a/test.html
+++ b/test.html
@@ -48,6 +48,7 @@
                 <textarea id="input" rows="25" cols="100%" disabled="disabled"></textarea>
                 <br>
                 <button onclick="compile()">Execute</button>
+                <textarea id="args">Test</textarea>
                 <h4>Execution Output:</h4>
                 <textarea id="output" rows="25", cols="100%"></textarea>
             </section>