+ (this.name != 'nil'
? this.name : this.extra_id),
MIM.im_domain, null);
+ };
+
+ function load_im (node, im)
+ {
+ //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 (im, node);
+ }
+ //alert ('initial state = ' + im.initial_state);
+ im.load_status = MIM.LoadStatus.Loaded;
}
- var proto = {
+ MIM.IM.prototype = {
Load: function ()
{
- var node = Xex.Load (MIM.server, this.file);
- if (! node)
- {
- this.load_status = MIM.LoadStatus.Error;
- return false;
- }
- this.map_list = {};
- this.initial_state = null;
- this.state_list = {};
- for (node = node.firstElement (); node; node = node.nextElement ())
- {
- var name = node.nodeName;
- var parser = parsers[name];
- if (parser)
- parser.call (this, node);
- }
- this.load_status = MIM.LoadStatus.Loaded;
- return true;
+ this.load_status = MIM.LoadStatus.Loading;
+ Xex.Load (MIM.server, this.file, load_im, this);
}
- }
-
- MIM.IM.prototype = proto;
+ };
MIM.IC = function (im, target)
{
}
};
- MIM.create_list = function (node) {
+ MIM.create_list = function (node)
+ {
// Load the list of input methods.
- MIM.A = node;
- alert ('create-list called: node=' + MIM.A);
- var node = node.firstElement;
for (node = node.firstChild; node; node = node.nextSibling)
if (node.nodeName == 'input-method')
{
}
}
if (MIM.imextra.t && MIM.imextra.t.global)
- MIM.im_global = MIM.imextra.t.global;
+ {
+ MIM.im_global = MIM.imextra.t.global;
+ MIM.im_global.Load ();
+ }
else
{
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 ();
}
}) ();
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;
if (target.im)
{
MIM.current = target.im;
+ MIM.current.Load ();
destroy ();
}
event.preventDefault ();