mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-30 06:52:49 -06:00
minibar: add buttons to use generated translations as input
This functionality was available in the origial Fridge Poetry app, but has been missing in minibar until now.
This commit is contained in:
@@ -119,13 +119,19 @@ Input.prototype.get_completions=function() {
|
||||
}
|
||||
|
||||
Input.prototype.show_completions=function(complete_output) {
|
||||
with(this) {
|
||||
var self=this;
|
||||
function switch_input(lin) {
|
||||
with(self) {
|
||||
local.put("current",{from:lin.to,input:lin.text.split(" ")})
|
||||
from_menu.value=lin.to;
|
||||
change_language()
|
||||
}
|
||||
}
|
||||
with(self) {
|
||||
//debug("show_completions ");
|
||||
var completions=complete_output[0].completions;
|
||||
var emptycnt=add_completions(completions)
|
||||
if(true/*emptycnt>0*/)
|
||||
translations.translateFrom(current,startcat_menu.value);
|
||||
else translations.clear();
|
||||
translations.translateFrom(current,startcat_menu.value,switch_input);
|
||||
if(surface.typed && emptycnt==completions.length) {
|
||||
if(surface.typed.value=="") remove_typed_input();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user