*** empty log message ***
[m17n/m17n-lib-js.git] / index.html
index afc7707..04464e9 100644 (file)
@@ -9,8 +9,8 @@
       -->
   </style>
   <title>M17N Input Method by JavaScript</title>
-  <script src="xex.js"></script>
-  <script src="mim.js"></script>
+  <script src="xex2.js"></script>
+  <script src="mim2.js"></script>
   <script type="text/javascript">
     MIM.debug_print = function (event, ic)
     {
       MIM.debug_nodes.range1.innerHTML = ''
     }
     };
-
-    MIM.toggle_log = function ()
+    function toggle_debug (event)
     {
-    if (Xex.LogNode)
-      {
-       Xex.LogNode.parentNode.removeChild (Xex.LogNode);
-       Xex.LogNode = false;
-      }
-    else
-      {
-       Xex.LogNode = document.createElement ('div');
-       Xex.LogNode.style.border = '1px solid black';
-       Xex.LogNode.style.font = 'normal normal normal small monospace';
-       Xex.LogNode.style.width = '100%';
-       Xex.LogNode.style.minHeight = '300px';
-       Xex.LogNode.style.maxHeight = '300px';
-       Xex.LogNode.style.overflow = 'auto';
-       Xex.Log (null);
-       document.getElementsByTagName ('body')[0].appendChild (Xex.LogNode);
-      }
-  }
-
+      //event.preventDefault ();
+      Xex.LogToggle ();
+      return false;
+    }
   </script>
 </head>
 
-<body onload="MIM.init ()">
-<h4>m17n-lib input method in Javascript</h4>
+<body onload="MIM.init ();">
+<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>
-<div style="font-weight: bold;">debug Info</div>
+<div style="font-weight: bold;">debug Info<pre id="im"></pre></div>
 <table border="1">
 <tr><th>key</th><th>status</th><th>keycode</th><th>keymap</th><th>preedit</th><th>range</th></tr>
 <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/xex2.js%22;document.body.appendChild(s);s=document.createElement(%22script%22);s.src=%22http://www.m17n.org/common/mim-js/mim2.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()">
+       onmousedown="toggle_debug ()">
 </body>