1
0
forked from GitHub/gf-core

minibar: support for adding grammars from several servers to the grammar menu

You can also add grammars from several directories on the same server of course.
The included minibar configuration file adds the user's own grammars from the
grammar editor.
This commit is contained in:
hallgren
2012-03-26 17:17:54 +00:00
parent 833f72b2e1
commit 3f1f9211db
4 changed files with 53 additions and 33 deletions

View File

@@ -27,12 +27,13 @@ function pgf_online(options) {
else http_get_json(this.grammars_url+"grammars.cgi",cont,err);
},
get_grammarlists: function(cont,err) { // May call cont several times!
var ds=this.other_grammars_urls;
var n=1+ds.length;
function pair(dir) {
return function(grammar_list){cont(dir,grammar_list)}
return function(grammar_list){cont(dir,grammar_list,n)}
}
function ignore_error(err) { console.log(err) }
this.get_grammarlist(pair(this.grammars_url),err)
var ds=this.other_grammars_urls;
for(var i in ds)
http_get_json(ds[i]+"grammars.cgi",pair(ds[i]),ignore_error);
},