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);
+ (this.name != 'nil'
? this.name : this.extra_id),
MIM.im_domain, null);
- }
+ };
- var proto = {
- 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;
- }
+ function load_im (node)
+ {
+ 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;
}
- MIM.IM.prototype = proto;
+ MIM.IM.prototype.Load = function ()
+ {
+ this.load_status = MIM.LoadStatus.Loading;
+ Xex.Load (MIM.server, this.file, load_im);
+ }
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);
}
node = undefined;
MIM.current = MIM.imlist['t']['latn-post'];
+ MIM.current.Load ();
}
}) ();
if (target.im)
{
MIM.current = target.im;
+ MIM.current.Load ();
destroy ();
}
event.preventDefault ();
var iframe = document.createElement ('iframe');
function receiver (event)
{
- alert ('receiver called:'+event.data);
+ //alert ('receiver called:'+event.data);
var parser = new DOMParser ();
var xml = parser.parseFromString (event.data, 'text/xml');
+ //alert ('parsed:'+xml);
window.removeEventListener ('message', receiver, false);
body.removeChild (iframe);
- callback (xml);
+ callback (xml.firstElement ());
};
Xex.xml = undefined;
window.addEventListener ('message', receiver, false);
iframe.src = server + '/loadxml.html#' + file;
- alert ('iframe created');
+ //alert ('iframe created');
body.appendChild (iframe);
};