forked from GitHub/gf-core
gfse: use POST requests when parsing grammar modules after editing as text
instead of GET, to avoid the Apache httpd URI length limitation. This means that gfse can no longer use JSONP when parsing grammars, so it has to be located on the same host as the cloud service. Also clean away trailing white space in support.js.
This commit is contained in:
@@ -259,7 +259,8 @@ function gfshell(cmd,cont) {
|
||||
// Check the syntax of a source module
|
||||
function check_module(path,source,cont) {
|
||||
var enc=encodeURIComponent;
|
||||
http_get_json("/parse?"+enc(path)+"="+enc(source),cont)
|
||||
//http_get_json("/parse?"+enc(path)+"="+enc(source),cont)
|
||||
ajax_http_post_json("/parse",enc(path)+"="+enc(source),cont)
|
||||
}
|
||||
|
||||
// Check the syntax of an expression
|
||||
|
||||
@@ -116,9 +116,15 @@ function ajax_http_post(url,formdata,callback,errorcallback) {
|
||||
|
||||
// JSON via AJAX
|
||||
function ajax_http_get_json(url,cont,errorcallback) {
|
||||
ajax_http_get(url,function(txt){cont(eval("("+txt+")"));}, errorcallback);
|
||||
ajax_http_get(url, with_json(cont), errorcallback);
|
||||
}
|
||||
|
||||
function ajax_http_post_json(url,formdata,cont,errorcallback) {
|
||||
ajax_http_post(url, formdata, with_json(cont), errorcallback);
|
||||
}
|
||||
|
||||
function with_json(cont) { return function(txt){cont(eval("("+txt+")"));} }
|
||||
|
||||
function sameOrigin(url) {
|
||||
var a=empty("a");
|
||||
a.href=url; // converts to an absolute URL
|
||||
|
||||
Reference in New Issue
Block a user