}
};
-MIM.ignore_focus = false;
-
MIM.update = function (target, ic)
{
var text = target.value;
MIM.set_caret (target, ic);
};
+(function () {
+ var style_props = {
+ width: 'width',
+ height: 'height',
+ padingLeft: 'padding-left',
+ paddingRight: 'padding-right',
+ paddingTop: 'padding-top',
+ paddintBottom: 'padding-bottom',
+ borderLeftStyle: 'border-left-style',
+ borderRightStyle: 'border-right-style',
+ borderTopStyle: 'border-top-style',
+ borderBottomStyle: 'border-bottom-style',
+ borderLeftWidth: 'border-left-width',
+ borderRightWidth: 'border-right-width',
+ borderTopWidth: 'border-top-width',
+ borderBottomWidth: 'border-bottom-width',
+ fontFamily: 'font-family',
+ fontSize: 'font-size',
+ lineHeight: 'line-height',
+ letterSpacing: 'letter-spacing',
+ wordSpacing: 'word-spacing' };
+
+ function copy_style (from, to)
+ {
+ var from_style = getComputedStyle(from,'');
+
+ for(var name in style_props)
+ to.style[name] = from_style.getPropertyValue (style_props[name]);
+
+ to.style.left = from.offsetLeft + 'px';
+ to.style.top = from.offsetTop + 'px';
+ to.style.width = from.offsetWidth;
+ to.style.height = from.offsetHeight;
+ to.scrollLeft = from.scrollLeft;
+ to.scrollTop = from.scrollTop;
+ }
+
+ MIM.show = function (target, ic)
+ {
+ if (! ic.can_node)
+ {
+ var elm = document.createTextNode ('');
+
+ ic.can_node = document.createElement ('div');
+ ic.can_node.style.visibility="hidden";
+ ic.can_node.style.position = "absolute";
+ ic.can_node.appendChild (elm)
+ elm = document.createElement('span');
+ elm.innerHTML = '.';
+ ic.can_node.appendChild (elm)
+ document.getElementsByTagName ('body')[0].appendChild (ic.can_node);
+ }
+
+ copy_style (target, ic.can_node);
+ ic.can_node.firstChild.value = target.value.substr (0, ic.range[0]);
+ var x = target.offsetLeft + ic.can_node.lastChild.offsetLeft +2;
+ var y = target.offsetTop + ic.can_node.lastChild.offsetTop -2;
+
+ Xex.Log ("x:" + x + "px y:" + y + "px");
+ }
+}) ();
+
MIM.focus_in = function (event)
{
var target = event.target;
return;
if (! (target.type == "text" || target.type == "textarea"))
return;
- document.akey = event;
var ic = target.mim_ic;
if (! ic || ic.im != MIM.current)
if (! MIM.get_range (target, ic))
ic.reset ();
}
+ MIM.show (target, ic);
MIM.debug_print (event, ic);
ic.key = MIM.decode_key_event (event);
if (ic.key)
} finally {
MIM.debug_print (event, ic);
}
+
return;
};
sk: { name: 'Slovak' },
sr: { name: 'Serbian' },
sv: { name: 'Swedish' },
- vi: { name: 'Vietnamese' },
yi: { name: 'Yiddish' } },
MiddleEast: {
ar: { name: 'Arabic' },
li.appendChild (sub);
menu.appendChild (li);
}
- document.mimmenu = menu;
lang_category = null;
}
menu.style.left = (event.clientX - 10) + "px";