DIST=/project/web/extra/m17n-lib/mim-js/
-FILES=index.html latn-post.js mim.js th-kesmanee.js
+FILES=index.html test.html imlist.xml xex.js mim.js /usr/local/work/m17n-db-xml/MIM/*.mimx
upload:
@updated=""; \
for f in ${FILES}; do \
- if [ ! -f ${DIST}/$$f -o $$f -nt ${DIST}/$$f ] ; then \
+ base=`basename $$f`; \
+ if [ ! -f "${DIST}/$$base" ] ; then \
+ echo $$f; \
+ cp $$f ${DIST}; \
+ updated="1"; \
+ elif [ "$$f" -nt "${DIST}/$$base" ] ; then \
echo $$f; \
cp $$f ${DIST}; \
updated="1"; \
fi; \
done; \
if [ -n "$$updated" ] ; then \
- echo $$updated; \
cd /project/web/source/m17n-lib; make; \
fi
</head>
<body onload="MIM.init ()">
-<h4>m17n-lib input method in Javascript</h4>
+<h4>m17n-lib input method in Javascript (tested only on Chrome)</h4>
+The default input method is latn-post.
+Click an input area by Control-Mouse-1 to select any other input method.<br>
<table>
<tr><th>textarea</th><td><textarea id="TEXTAREA" name="TEXTAREA"></textarea></td></tr>
<tr><th>text</th><td><form><input type="text" id="TEXT"></form></td></tr></table>
<tr><th>down</th><td id="status0"></td><td id="keydown">0</td><td id="keymap0"></td><td id="preedit0"></td><td id="range0"></td></tr>
<tr><th>press</th><td id="status1"></td><td id="keypress">0</td><td id="keymap1"></td><td id="preedit1"></td><td id="range1"></td></tr>
</table>
+<!--
+<br>
+Please add this link
+<a href="javascript:(function(){var%20s=document.createElement(%22script%22);s.src=%22http://www.m17n.org/common/mim-js/xex.js%22;document.body.appendChild(s);s=document.createElement(%22script%22);s.src=%22http://www.m17n.org/common/mim-js/mim.js%22;document.body.appendChild(s);setTimeout(function(){MIM.init();},2000);})();">MIM-JS</a>
+to the bookmark. Then, you can activate the MIM input method on any page
+when you access the bookmarked link.<br>
+-->
<input type="button" value="Click here to toggle logging!"
onclick="MIM.toggle_log()">
</body>
}
};
+if (window.location == 'http://localhost/mim/index.html')
+ MIM.server = 'http://localhost/mim';
+
(function () {
var keysyms = new Array ();
keysyms["bs"] = "backspace";
var proto = {
Load: function ()
{
- var node = Xex.Load (null, this.file);
+ var node = Xex.Load (MIM.server, this.file);
if (! node)
{
this.load_status = MIM.LoadStatus.Error;
MIM.IC.prototype = proto;
- var node = Xex.Load (null, "imlist.xml");
+ var node = Xex.Load (MIM.server, "imlist.xml");
for (node = node.firstChild; node; node = node.nextSibling)
if (node.nodeName == 'input-method')
{
MIM.add_event_listener (window, 'keydown', MIM.keydown);
MIM.add_event_listener (window, 'keypress', MIM.keypress);
MIM.add_event_listener (window, 'mousedown', create_menu);
- if (window.location == 'http://localhost/mim/index.html')
- MIM.server = 'http://localhost/mim';
- MIM.current = MIM.imlist['zh']['py-gb'];
+ MIM.current = MIM.imlist['t']['latn-post'];
};
}) ();
{
var obj = new XMLHttpRequest ();
var url = server ? server + '/' + file : file;
+ //alert ('loading ' + url);
obj.open ('GET', url, false);
obj.overrideMimeType ('text/xml');
obj.send ('');
- return obj.responseXML.firstChild;
+ return (obj.responseXML && obj.responseXML.firstChild);
}