mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
minibar: add a button to show some grammar info
This commit is contained in:
@@ -75,6 +75,7 @@ Minibar.prototype.show_grammarlist=function(grammars) {
|
|||||||
appendChildren(grammar_menu,map(opt,grammars));
|
appendChildren(grammar_menu,map(opt,grammars));
|
||||||
grammar_menu.onchange=
|
grammar_menu.onchange=
|
||||||
bind(function() { select_grammar(grammar_menu.value); },this);
|
bind(function() { select_grammar(grammar_menu.value); },this);
|
||||||
|
insertFirst(menubar,button("i",bind(show_grammarinfo,this)))
|
||||||
insertFirst(menubar,grammar_menu);
|
insertFirst(menubar,grammar_menu);
|
||||||
insertFirst(menubar,text("Grammar: "));
|
insertFirst(menubar,text("Grammar: "));
|
||||||
}
|
}
|
||||||
@@ -104,6 +105,20 @@ Minibar.prototype.change_grammar=function(grammar_info) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Minibar.prototype.show_grammarinfo=function() {
|
||||||
|
this.translations.main.innerHTML=""
|
||||||
|
var g=this.grammar;
|
||||||
|
appendChildren(this.translations.main,
|
||||||
|
[wrap("h3",text(g.name)),
|
||||||
|
node("dl",{},
|
||||||
|
[dt(text("Start category")),
|
||||||
|
dd(text(g.startcat || "")),
|
||||||
|
dt(text("Categories")),
|
||||||
|
dd(text(g.categories.join(", "))),
|
||||||
|
dt(text("Functions")),
|
||||||
|
dd(text(g.functions.join(", ")))])])
|
||||||
|
}
|
||||||
|
|
||||||
Minibar.prototype.append_extra_buttons=function(extra,options) {
|
Minibar.prototype.append_extra_buttons=function(extra,options) {
|
||||||
with(this) {
|
with(this) {
|
||||||
if(options.try_google)
|
if(options.try_google)
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ function div_class(cls,contents) { return wrap_class("div",cls,contents); }
|
|||||||
|
|
||||||
function p(contents) { return wrap("p",contents); }
|
function p(contents) { return wrap("p",contents); }
|
||||||
function dt(contents) { return wrap("dt",contents); }
|
function dt(contents) { return wrap("dt",contents); }
|
||||||
|
function dd(contents) { return wrap("dd",contents); }
|
||||||
function li(contents) { return wrap("li",contents); }
|
function li(contents) { return wrap("li",contents); }
|
||||||
|
|
||||||
function th(contents) { return wrap("th",contents); }
|
function th(contents) { return wrap("th",contents); }
|
||||||
|
|||||||
Reference in New Issue
Block a user