summaryrefslogtreecommitdiff
path: root/src/editor/simple
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2011-10-10 16:16:16 +0000
committerhallgren <hallgren@chalmers.se>2011-10-10 16:16:16 +0000
commit04d2dc757c34d76711a237b583855e111e4486a7 (patch)
tree661290c488e61c36ac5c64f0efd4f54768a19fa0 /src/editor/simple
parent5b980dcb930a1fe380e28fb9905db64e1da37672 (diff)
More functionality in "gf -server" mode
"gf -server" mode now includes PGF service and the services to support example-based grammar writing. (But gf -server is not quite ready to replace pgf-http yet...) Also bumped GF version number to 3.2.10-darcs
Diffstat (limited to 'src/editor/simple')
-rw-r--r--src/editor/simple/cloud.js2
-rw-r--r--src/editor/simple/cloud2.js2
-rw-r--r--src/editor/simple/example_based.js10
-rw-r--r--src/editor/simple/index.html3
4 files changed, 10 insertions, 7 deletions
diff --git a/src/editor/simple/cloud.js b/src/editor/simple/cloud.js
index fad66e1ff..44b7d8157 100644
--- a/src/editor/simple/cloud.js
+++ b/src/editor/simple/cloud.js
@@ -137,7 +137,7 @@ function gfshell(cmd,cont) {
// Check the syntax of an expression
function check_exp(s,cont) {
function check(gf_message) {
- debug("cc "+s+" = "+gf_message);
+ //debug("cc "+s+" = "+gf_message);
cont(/parse error/.test(gf_message) ? "parse error" : null);
}
if(navigator.onLine)
diff --git a/src/editor/simple/cloud2.js b/src/editor/simple/cloud2.js
index 2331b39f2..c57922438 100644
--- a/src/editor/simple/cloud2.js
+++ b/src/editor/simple/cloud2.js
@@ -63,7 +63,7 @@ function gfshell(cmd,cont) {
// Check the syntax of an expression
function check_exp(s,cont) {
function check(gf_message) {
- debug("cc "+s+" = "+gf_message);
+ //debug("cc "+s+" = "+gf_message);
cont(/parse error/.test(gf_message) ? "parse error" : null);
}
gfshell("cc "+s,check);
diff --git a/src/editor/simple/example_based.js b/src/editor/simple/example_based.js
index 83fde0f6c..1fb13740a 100644
--- a/src/editor/simple/example_based.js
+++ b/src/editor/simple/example_based.js
@@ -31,9 +31,11 @@ function exb_state(g,ci) {
}
function exb_call(g,ci,command,args,cont) {
- var url="exb/exb.fcgi?command="+command+"&state="+exb_state(g,ci);
- for(var arg in args) url+="&"+arg+"="+encodeURIComponent(args[arg]);
- http_get_json(url,cont)
+ var url=window.exb_url || "exb/exb.fcgi";
+ var q=""
+ for(var arg in args) q+="&"+arg+"="+encodeURIComponent(args[arg]);
+ var cmd="?command="+command+"&state="+encodeURIComponent(exb_state(g,ci))+q;
+ http_get_json(url+cmd,cont)
}
function ask_possibilities(g,ci) {
@@ -126,7 +128,7 @@ function exb_linbuttons(g,ci,f) {
exb_call(g,ci,"provide_example",
{lang:g.basename+conc.example_lang,
fun:fun,
- grammar:"."+dir+"/"+g.basename+".pgf"},
+ grammar:dir+"/"+g.basename+".pgf"},
show_example)
}
}
diff --git a/src/editor/simple/index.html b/src/editor/simple/index.html
index de5efa373..27b053300 100644
--- a/src/editor/simple/index.html
+++ b/src/editor/simple/index.html
@@ -32,10 +32,11 @@ This page does not work without JavaScript.
<hr>
<div class=modtime><small>
HTML
-<!-- hhmts start --> Last modified: Tue Sep 27 15:41:36 CEST 2011 <!-- hhmts end -->
+<!-- hhmts start --> Last modified: Mon Oct 10 17:54:37 CEST 2011 <!-- hhmts end -->
</small></div>
<a href="about.html">About</a>
<pre id=debug></pre>
+<script type="text/javascript" src="config.js"></script> <!-- optional -->
<script type="text/javascript" src="support.js"></script>
<script type="text/javascript" src="localstorage.js"></script>
<script type="text/javascript" src="gf_abs.js"></script>