minibar&gfse: first working grammar extension interface in minibar

There are still some user interface wrinkles to iron out.
This commit is contained in:
hallgren
2012-04-04 17:00:25 +00:00
parent 13aa9a9dbc
commit be89ed18b3
4 changed files with 93 additions and 37 deletions

View File

@@ -390,9 +390,15 @@ Input.prototype.show_replacements=function(brackets,parent,tree) {
}
var ps=cat_info.producers;
clear(t.words);
if(t.options.extend_grammar) {
var extf=t.options.extend_grammar;
if(extf) {
function update() {
console.log("update minibar")
t.grammar.browse={}; // clear cache
t.show_replacements(brackets,parent,tree)
}
extb=button("New "+cat+"...",
function() { t.options.extend_grammar(cat,fun_type)})
function() { extf(cat,fun_type,update)})
t.words.appendChild(extb)
}
if(ps)