mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
minibar/support.js: added function encodeArgs.
This commit is contained in:
@@ -17,10 +17,7 @@ function pgf_online(options) {
|
|||||||
http_get_json(this.grammars_url+"grammars.cgi",cont);
|
http_get_json(this.grammars_url+"grammars.cgi",cont);
|
||||||
},
|
},
|
||||||
pgf_call: function(cmd,args,cont) {
|
pgf_call: function(cmd,args,cont) {
|
||||||
var url=this.current_grammar_url+"?command="+cmd;
|
var url=this.current_grammar_url+"?command="+cmd+encodeArgs(args)
|
||||||
for(var arg in args)
|
|
||||||
if(args[arg]!=undefined)
|
|
||||||
url+="&"+arg+"="+encodeURIComponent(args[arg]);
|
|
||||||
http_get_json(url,cont);
|
http_get_json(url,cont);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -112,6 +112,15 @@ function http_get_json(url,cont) {
|
|||||||
else jsonpf(url,cont);
|
else jsonpf(url,cont);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --- URL construction ----------------------------------------------------- */
|
||||||
|
|
||||||
|
function encodeArgs(args) {
|
||||||
|
var q=""
|
||||||
|
for(var arg in args)
|
||||||
|
if(args[arg]!=undefined)
|
||||||
|
q+="&"+arg+"="+encodeURIComponent(args[arg]);
|
||||||
|
return q;
|
||||||
|
}
|
||||||
|
|
||||||
/* --- HTML construction ---------------------------------------------------- */
|
/* --- HTML construction ---------------------------------------------------- */
|
||||||
function text(s) { return document.createTextNode(s); }
|
function text(s) { return document.createTextNode(s); }
|
||||||
|
|||||||
Reference in New Issue
Block a user