gfse&minibar: select the right grammar in minibar when invoked from gfse

The grammar that the user is currently working is now the one shown initially
in minibar, instead of the first grammar in alphabetical order.
Also GFServer.hs now removes absolute paths to the grammar files on the server in error messages from GF returned to to gfse.
This commit is contained in:
hallgren
2012-02-10 15:24:59 +00:00
parent d8958ed68d
commit 6b29296060
4 changed files with 34 additions and 15 deletions

View File

@@ -32,7 +32,8 @@ function Minibar(server,opts) {
target: "minibar",
try_google: true,
feedback_url: null,
help_url: null
help_url: null,
initial_grammar: null
}
// Apply supplied options
@@ -81,7 +82,9 @@ Minibar.prototype.show_grammarlist=function(grammars) {
}
if(options.help_url)
menubar.appendChild(button("Help",bind(open_help,this)));
select_grammar(grammars[0]);
var grammar0=options.initial_grammar || grammars[0];
grammar_menu.value=grammar0;
select_grammar(grammar0);
}
}