From 0d57b9fa091c13fcfc5e2779dab23734435c0341 Mon Sep 17 00:00:00 2001 From: hallgren Date: Mon, 19 Mar 2012 15:24:35 +0000 Subject: [PATCH] minibar: word-for-word replacement fix Turn off the highlighting that indicates that word-for-word replacement is enabled when it is no longer available (e.g if a word is deleted and there no longer is a complete parse). --- src/www/minibar/minibar_input.js | 41 +++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/src/www/minibar/minibar_input.js b/src/www/minibar/minibar_input.js index a1f4a3aec..a2f72bde1 100644 --- a/src/www/minibar/minibar_input.js +++ b/src/www/minibar/minibar_input.js @@ -73,12 +73,20 @@ Input.prototype.change_language=function () { } +Input.prototype.clear_all2=function() { + with(this) { + current.input=""; + previous=null; + clear(surface) + if(surface.typed) surface.appendChild(surface.typed) + } +} + + Input.prototype.clear_all1=function() { with(this) { remove_typed_input(); - current.input=""; - previous=null; - surface.innerHTML=""; + clear_all2(); translations.clear(); } } @@ -224,12 +232,14 @@ Input.prototype.generate_random=function() { } Input.prototype.add_words=function(s) { - with(this) { - var ws=s.split(" "); - for(var i=0;i