From fc897a909af265b11be606ae1149aff5e3beea28 Mon Sep 17 00:00:00 2001 From: hallgren Date: Mon, 13 Feb 2012 15:24:05 +0000 Subject: gfse: added a button to go directly from the editor to the minibar If there is an error in the grammar, the error message is shown below the grammar instead. Also: GFServer.hs now returns compiler output in a JSON structure instead of as a HTML page. --- src/www/gfse/cloud2.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/www/gfse/cloud2.js') diff --git a/src/www/gfse/cloud2.js b/src/www/gfse/cloud2.js index c9e59a21d..8cfaa077d 100644 --- a/src/www/gfse/cloud2.js +++ b/src/www/gfse/cloud2.js @@ -49,7 +49,7 @@ function old_upload(g) { } // Upload the grammar to the server and check it for errors -function upload(g) { +function upload(g,cont) { function upload2(dir) { var pre="dir="+encodeURIComponent(dir) var form= {command:"make"} @@ -61,10 +61,10 @@ function upload(g) { ajax_http_post("/cloud",pre+encodeArgs(form),upload3) } - function upload3(message) { - var dst=element("compiler_output") - if(dst) dst.innerHTML=message; - else alert(message); + function upload3(json) { + var res=JSON.parse(json) + if(cont) cont(res) + else alert(res.errorcode+"\n"+res.command+"\n\n"+res.output); } with_dir(upload2) -- cgit v1.2.3