From 257904c72234d9aed6fa84bdf8af9e6ba9f5ee56 Mon Sep 17 00:00:00 2001 From: handa Date: Thu, 11 Mar 2010 13:30:20 +0000 Subject: [PATCH] *** empty log message *** --- global.mimx | 2 +- xex.html | 2 +- xex.js | 33 ++++++++++----------------------- 3 files changed, 12 insertions(+), 25 deletions(-) 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 (); } -- 1.7.10.4
keystatuskeycodekeymappreedit