X-Git-Url: http://git.chise.org/gitweb/?p=m17n%2Fm17n-lib-js.git;a=blobdiff_plain;f=mim2.js;fp=mim2.js;h=2bb2370baa69cd3484fa91611b5fe8093b4b83cd;hp=3df31e331d3ba53253b22d596310edc3804668c0;hb=0eb9adf6e42434704f52f04a5d79ea5219da118e;hpb=74f5ef5f5a1c7e1a1bb94a94883f85cd4ac43765 diff --git a/mim2.js b/mim2.js index 3df31e3..2bb2370 100644 --- a/mim2.js +++ b/mim2.js @@ -1051,7 +1051,6 @@ MIM.im_domain.DefType (MIM.State.prototype); var vname = node.attributes['vname'].nodeValue; if (this != MIM.im_global) { - alert ("getting global var of vname:"+vname); var vari = get_global_var (vname); if (vari != null) this.domain.Defvar (vname, vari.desc, vari.val, vari.range); @@ -1152,26 +1151,31 @@ MIM.im_domain.DefType (MIM.State.prototype); MIM.im_domain, null); }; - function load_im (node) + function load_im (node, im) { - this.map_list = {}; - this.initial_state = null; - this.state_list = {}; + //alert ('Loading IM (' + im + ':' + im.lang + '-' + im.name + ')'); + im.map_list = {}; + im.initial_state = null; + im.state_list = {}; for (node = node.firstElement (); node; node = node.nextElement ()) { var name = node.nodeName; + //Xex.Log ('parsing ' + name); var parser = parsers[name]; if (parser) - parser.call (this, node); + parser.call (im, node); } - this.load_status = MIM.LoadStatus.Loaded; + //alert ('initial state = ' + im.initial_state); + im.load_status = MIM.LoadStatus.Loaded; } - MIM.IM.prototype.Load = function () - { - this.load_status = MIM.LoadStatus.Loading; - Xex.Load (MIM.server, this.file, load_im); - } + MIM.IM.prototype = { + Load: function () + { + this.load_status = MIM.LoadStatus.Loading; + Xex.Load (MIM.server, this.file, load_im, this); + } + }; MIM.IC = function (im, target) { @@ -1729,7 +1733,6 @@ MIM.im_domain.DefType (MIM.State.prototype); MIM.im_global = new MIM.IM ('t', 'nil', 'global', null); MIM.im_global.load_status = MIM.LoadStatus.Error; } - node = undefined; MIM.current = MIM.imlist['t']['latn-post']; MIM.current.Load (); } @@ -2116,7 +2119,7 @@ MIM.keydown = function (event) if (! ic || ic.im != MIM.current) { target.mim_ic = null; - Xex.Log ('creating IC'); + Xex.Log ('creating IC for ' + MIM.current.lang + '-' + MIM.current.name); ic = new MIM.IC (MIM.current, target); if (ic.im.load_status != MIM.LoadStatus.Loaded) return true;