minibar: can now switch back to the minibar after switching to the syntax editor

This is done by including a lin_action when starting the syntax editor from
the minibar.
Also: added some minibar options in the syntax editor for consistency...
This commit is contained in:
hallgren
2012-11-22 16:42:39 +00:00
parent 78a2a90903
commit 8c9b90cc90
3 changed files with 36 additions and 8 deletions

View File

@@ -39,11 +39,8 @@ function Input(server,translations,opts) { // Input object constructor
buttons.appendChild(button("Random",bind(generate_random,t),"R"));
var o=options;
if(o.initial_grammar && o.initial && o.initial.from && o.initial.input){
t.local=mi_local(o.initial_grammar)
t.local.put("from",o.initial.from)
t.local.put("current",o.initial)
}
if(o.initial_grammar && o.initial && o.initial.from && o.initial.input)
t.set_input_for(o.initial_grammar,o.initial.from,o.initial.input)
}
/* --- Input client state initialization --- */
@@ -92,6 +89,13 @@ Input.prototype.change_language=function () {
this.add_words(new_input)
}
Input.prototype.set_input_for=function(grammar_url,from,new_input) {
var t=this
var local=mi_local(grammar_url)
local.put("from",from)
local.put("current",{from:from,input:new_input})
}
Input.prototype.clear_all2=function() {
with(this) {
current.input=[];