*** empty log message ***
authorhanda <handa>
Fri, 19 Mar 2010 13:16:48 +0000 (13:16 +0000)
committerhanda <handa>
Fri, 19 Mar 2010 13:16:48 +0000 (13:16 +0000)
Makefile
index.html
mim.js
xex.js

index 87057c3..58383c4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,20 @@
 DIST=/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
+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 \
 
 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 $$f; \
            cp $$f ${DIST}; \
            updated="1"; \
          fi; \
        done; \
        if [ -n "$$updated" ] ; then \
-         echo $$updated; \
          cd /project/web/source/m17n-lib; make; \
        fi
          cd /project/web/source/m17n-lib; make; \
        fi
index afc7707..ab298ae 100644 (file)
@@ -87,7 +87,9 @@
 </head>
 
 <body onload="MIM.init ()">
 </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>
 <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>
 <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>
 <input type="button" value="Click here to toggle logging!"
        onclick="MIM.toggle_log()">
 </body>
diff --git a/mim.js b/mim.js
index 5dac255..26c978f 100644 (file)
--- a/mim.js
+++ b/mim.js
@@ -51,6 +51,9 @@ var MIM = {
   }
 };
   
   }
 };
   
+if (window.location == 'http://localhost/mim/index.html')
+  MIM.server = 'http://localhost/mim';
+
 (function () {
   var keysyms = new Array ();
   keysyms["bs"]        = "backspace";
 (function () {
   var keysyms = new Array ();
   keysyms["bs"]        = "backspace";
@@ -1125,7 +1128,7 @@ MIM.im_domain.DefType (MIM.State.prototype);
   var proto = {
     Load: function ()
     {
   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;
       if (! node)
        {
          this.load_status = MIM.LoadStatus.Error;
@@ -1661,7 +1664,7 @@ MIM.im_domain.DefType (MIM.State.prototype);
 
   MIM.IC.prototype = proto;
 
 
   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')
       {
   for (node = node.firstChild; node; node = node.nextSibling)
     if (node.nodeName == 'input-method')
       {
@@ -2394,8 +2397,6 @@ MIM.keypress = function (event)
     MIM.add_event_listener (window, 'keydown', MIM.keydown);
     MIM.add_event_listener (window, 'keypress', MIM.keypress);
     MIM.add_event_listener (window, 'mousedown', create_menu);
     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'];
   };
 }) ();
   };
 }) ();
diff --git a/xex.js b/xex.js
index 932d240..c0ba885 100644 (file)
--- a/xex.js
+++ b/xex.js
@@ -1302,8 +1302,9 @@ Xex.Load = function (server, file)
 {
   var obj = new XMLHttpRequest ();
   var url = server ? server + '/' + file : file;
 {
   var obj = new XMLHttpRequest ();
   var url = server ? server + '/' + file : file;
+  //alert ('loading ' + url);
   obj.open ('GET', url, false);
   obj.overrideMimeType ('text/xml');
   obj.send ('');
   obj.open ('GET', url, false);
   obj.overrideMimeType ('text/xml');
   obj.send ('');
-  return obj.responseXML.firstChild;
+  return (obj.responseXML && obj.responseXML.firstChild);
 }
 }