forked from GitHub/gf-core
Minibar: make it possible to configure a list of preferred grammars
A preferred grammar is selected when a user visits the Minibar for the first time. (Like before, Minibar remembers the selected grammar for future visits.) A preferred list of grammars can be specified in config.js in the .../minibar directory on the server, e.g. like this: preferred_grammars=["/grammars/Foods.pgf","/grammars/ResourceDemo.pgf"] The first available grammar from the list is used.
This commit is contained in:
@@ -21,6 +21,9 @@ var minibar_options= {
|
||||
try_google: true
|
||||
}
|
||||
|
||||
if(window.preferred_grammars)
|
||||
minibar_options.preferred_grammars=preferred_grammars
|
||||
|
||||
if(/^\?\/(tmp|grammars)\//.test(location.search)) {
|
||||
var args=decodeURIComponent(location.search.substr(1)).split(" ")
|
||||
if(args[0]) online_options.grammars_url=args[0];
|
||||
|
||||
Reference in New Issue
Block a user