-DIST1=/var/www/mim
-DIST2=/project/web/extra/m17n-lib/mim-js/
+DIST=/project/web/extra/m17n-lib/mim-js/
FILES=index.html latn-post.js mim.js th-kesmanee.js
upload:
+ @updated=""; \
for f in ${FILES}; do \
- if [ ! -f ${DIST1}/$$f -o $$f -nt ${DIST1}/$$f ] ; then \
+ if [ ! -f ${DIST}/$$f -o $$f -nt ${DIST}/$$f ] ; then \
echo $$f; \
- cp $$f ${DIST1}; \
- cp $$f ${DIST2}; \
+ cp $$f ${DIST}; \
+ updated="1"; \
fi; \
- done
- cd /project/web/source/m17n-lib; make
+ done; \
+ if [ -n "$$updated" ] ; then \
+ echo $$updated; \
+ cd /project/web/source/m17n-lib; make; \
+ fi
<script src="mim.js"></script>
</head>
-<body onload="MIM_init ()">
-
+<body onload="MIM_init_debug ()">
+<h1>m17n-lib input method in Javascript</h1>
+<h3>textarea</h3>
<textarea name="TEXTAREA"></textarea>
+<h3>text</h3>
+<form><input type="text"></form>
<br>
+<h3>debug Info</h3>
<table border="1">
<tr><th>down</th><th>press</th><th>status</th><th>keyseq</th><th>range</th></tr>
<tr><td id="keydown">0</td><td id="keypress">0</td><td id="status"><td id="keyseq"></td><td id="range"></td></tr>
</table>
<br>
-<form><input type="text" id="text"></form>
<form><input type="text" name="TEXT"></form>
</body>
/* Boolean flag to tell if MIM is active or not. */
var MIM_enabled = true;
+var MIM_debug = false;
+
var MIM_current_im;
var MIM_list = new Array ();
s.charset = 'UTF-8';
s.src = filename;
document.body.appendChild (s);
- alert (s.innerText);
- //document.body.removeChild (s);
+ document.body.removeChild (s);
im.status = 2;
return im;
}
function debug_print (event, ic)
{
+ if (! MIM_debug)
+ return;
var target = event.target;
var code = event.keyCode;
- var char = event.type == 'keydown' ? "?" : event.charCode;
+ var ch = event.type == 'keydown' ? "-none-" : event.charCode;
var key = MIM_decode_key (event);
- document.getElementById (event.type).innerHTML = "" + code + "/" + char + " : " + key;
+ document.getElementById (event.type).innerHTML = "" + code + "/" + ch + " : " + key;
document.getElementById ('status').innerHTML = ic.im.status;
var keyseq = "";
for (var i = 0; i < ic.keyseq.length; i++)
ic.reset ();
event.preventDefault ();
//document.getElementById ('text').value
- //= keyseq_string (ic.keyseq) + " handled";
+ //= keyseq_string (ic.keyseq) + " handled";
}
else if (map > 0)
{
else
{
ic.reset ();
- document.getElementById ('text').value
- = keyseq_string (ic.keyseq) + " unhandled";
+ //document.getElementById ('text').value
+ //= keyseq_string (ic.keyseq) + " unhandled";
}
}
MIM_add_event_listener (window, 'keydown', MIM_keydown);
MIM_add_event_listener (window, 'keypress', MIM_keypress);
MIM_add_event_listener (window, 'mousedown', MIM_select_menu);
+ if (window.location == 'http://localhost/mim/index.html')
+ MIM_url = 'http://localhost/mim';
MIM_load (MIM_current_im);
}
+
+function MIM_init_debug ()
+{
+ MIM_debug = true;
+ MIM_init ();
+}