From: handa Date: Thu, 11 Mar 2010 13:30:20 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: ALPHA~20 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=257904c72234d9aed6fa84bdf8af9e6ba9f5ee56;p=m17n%2Fm17n-lib-js.git *** empty log message *** --- diff --git a/global.mimx b/global.mimx index fcc5959..25c6023 100644 --- a/global.mimx +++ b/global.mimx @@ -453,4 +453,4 @@ should not be used in a map of an input method. - + \ No newline at end of file diff --git a/xex.html b/xex.html index d6e3dfd..b62260f 100644 --- a/xex.html +++ b/xex.html @@ -16,7 +16,7 @@

m17n-lib input method in Javascript

-
textarea
text
+text
debug Info
diff --git a/xex.js b/xex.js index a1d38c0..08930d8 100644 --- a/xex.js +++ b/xex.js @@ -2812,7 +2812,7 @@ MIM.im_domain.DefType (MIM.State.prototype); { this.commit (); this.keys.val.splice (0, this.key_head); - this.key_head = 0; + this.key_head = this.state_key_head = this.commit_key_head0; this.prev_state = null; } } @@ -2875,17 +2875,7 @@ MIM.im_domain.DefType (MIM.State.prototype); { this.keys.val.splice (0, this.commit_key_head); this.key_head -= this.commit_key_head; - if (this.key_head < 0) - { - Xex.Log ('RECOVER key_head'); - this.key_head = 0; - } this.state_key_head -= this.commit_key_head; - if (this.state_key_head < 0) - { - Xex.Log ('RECOVER state_key_head'); - this.state_key_head = 0; - } this.commit_key_head = 0; } if (this.key_unhandled) @@ -3138,41 +3128,39 @@ MIM.update = function (target, ic) ic.range[0] += ic.produced.length; ic.range[1] = ic.range[0] + ic.preedit.length; MIM.set_caret (target, ic); - target.wait_update = false; }; MIM.focus_in = function (event) { var target = event.target; var ic = target.mim_ic; - if (target.wait_focus_in); + if (ic.wait_update == true) { Xex.Log ("Focus in " + target.tagName + ' IGNORED'); event.preventDefault (); - return; + return false; } Xex.Log ("Focus in " + target.tagName); ic.Filter (MIM.Key.FocusIn); - //target.removeEventListener (target, 'focus', MIM.focus_in); - target.wait_update = true; - setTimeout (MIM.update (target, ic), 100); + MIM.update (target, ic); } MIM.focus_out = function (event) { var target = event.target; var ic = target.mim_ic; - if (target.wait_focus_out) + function reset_update () { ic.wait_update = false; }; + if (ic.wait_update == true) { Xex.Log ("Focus out " + target.tagName + ' IGNORED'); event.preventDefault (); - return; + return false; } Xex.Log ("Focus out " + target.tagName); ic.Filter (MIM.Key.FocusOut); - //target.removeEventListener (target, 'blur', MIM.focus_out); - target.wait_update = true; - setTimeout (MIM.update (target, ic), 100); + ic.wait_update = true; + MIM.update (target, ic, true); + setTimeout (reset_update, 1000); }; MIM.keydown = function (event) @@ -3199,7 +3187,6 @@ MIM.keydown = function (event) } else { - while (target.wait_update); if (! MIM.get_range (target, ic)) ic.reset (); }
keystatuskeycodekeymappreedit