選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

237 行
7.2 KiB

  1. <DOCTYPE html>
  2. <html>
  3. <!--
  4. Copyright (c) 2012 The Native Client Authors. All rights reserved.
  5. Use of this source code is governed by a BSD-style license that can be
  6. found in the LICENSE file.
  7. -->
  8. <head>
  9. <style type="text/css">
  10. body
  11. {
  12. font:12px Consolas;
  13. }
  14. button
  15. {
  16. font:14px Consolas;
  17. }
  18. textarea
  19. {
  20. font:14px Consolas;
  21. }
  22. #id_div_progress_status
  23. {
  24. font:12px Consolas;
  25. }
  26. #id_div_progress
  27. {
  28. position: absolute;
  29. top: 20%;
  30. left: 30%;
  31. right: 30%;
  32. z-index: 3;
  33. background-color:white;
  34. border:1px solid #000000;
  35. }
  36. progress
  37. {
  38. background-color: #f3f3f3;
  39. border: 0;
  40. height: 18px;
  41. width: 200px;
  42. border-radius: 9px;
  43. }
  44. progress::-webkit-progress-bar
  45. {
  46. background-color: #f3f3f3;
  47. border: 1px solid #000000;
  48. padding: 2px 2px;
  49. height: 20px;
  50. border-radius: 0px;
  51. }
  52. progress::-webkit-progress-value
  53. {
  54. background-color: #22BB22;
  55. border: 0px;
  56. height: 14px;
  57. border-radius: 0px;
  58. }
  59. #id_div_listener
  60. {
  61. position: relative;
  62. }
  63. #id_div_embed_data
  64. {
  65. position: absolute;
  66. top: 2px;
  67. left: 2px;
  68. z-index: -1;
  69. }
  70. #BGCanvas
  71. {
  72. border:1px solid #000000;
  73. }
  74. #id_div_helper_cmd_0
  75. {
  76. margin-left: 5px;
  77. }
  78. </style>
  79. <title>Mesh Viewer NaCl</title>
  80. <script type="text/javascript">
  81. //Base data Setup
  82. g_div_embed_data_save = '';
  83. g_div_embed_data = null; // Global application object.
  84. g_embed_nacl_module = null; // Global application object.
  85. g_txtarea_code_src = null;
  86. g_div_helper_cmd = [null, null];
  87. g_div_helper_args = null;
  88. g_div_helper_cmnt = null;
  89. g_div_helper_vars = null;
  90. g_div_alphabet = null;
  91. g_div_progress = null;
  92. g_div_progress_status = null;
  93. g_progress_bar = null;
  94. g_var_progress_bar = -1;
  95. g_frame_embed = null;
  96. function GetNaClListenerDiv() { return document.getElementById('id_div_listener'); }
  97. function GetNaClModuleVar() { return g_embed_nacl_module; }
  98. function InitNaClModuleVar() { g_embed_nacl_module = document.getElementById('id_embed_nacl_module'); }
  99. function GetTextAreaCodeSrc() { return g_txtarea_code_src; }
  100. function GetDivProgress() { return g_div_progress; }
  101. function GetProgressBar() { return g_progress_bar; }
  102. function GetDivProgressStatus() { return g_div_progress_status; }
  103. function GetDivEmbedData() { return g_div_embed_data; }
  104. function GetDivEmbedDataSave() { return g_div_embed_data_save; }
  105. function GetFrameData() { return g_frame_embed; }
  106. function IsUsingNaCl() { return true; }
  107. </script>
  108. <script src="./type_dictionnary.js"></script>
  109. <script type="text/javascript">
  110. var EasyMeshDict = new TypeDictionnary("EasyMesh");
  111. function GetCmdDictionnary() { return EasyMeshDict; }
  112. </script>
  113. <script src="./easy_mesh_dictionnary.js"></script>
  114. <script src="./nacl_loading.js"></script>
  115. <script type="text/javascript">
  116. //Init should always start before the first tick
  117. window.setTimeout("Init()", 100);
  118. window.setTimeout("Tick()", 200);
  119. window.setTimeout("UpdateEmbed()", 2000);
  120. function UpdateEmbed()
  121. {
  122. window.setTimeout("UpdateEmbed()", 2000);
  123. g_frame_embed.contentDocument.location.reload(true);
  124. }
  125. //Base init for all datas
  126. function Init()
  127. {
  128. g_div_embed_data = document.getElementById('id_div_embed_data');
  129. g_frame_embed = document.getElementById('id_frame_embed');
  130. g_txtarea_code_src = document.getElementById('id_txtarea_code_src');
  131. g_div_helper_cmd[0] = document.getElementById('id_div_helper_cmd_0');
  132. g_div_helper_cmd[1] = document.getElementById('id_div_helper_cmd_1');
  133. g_div_helper_args = document.getElementById('id_div_helper_args');
  134. g_div_helper_cmnt = document.getElementById('id_div_helper_cmnt');
  135. g_div_helper_vars = document.getElementById('id_div_helper_vars');
  136. g_div_alphabet = document.getElementById('id_div_alphabet');
  137. g_div_progress = document.getElementById('id_div_progress');
  138. g_div_progress_status = document.getElementById('id_div_progress_status');
  139. g_progress_bar = document.getElementById('id_progress_bar');
  140. //Fill the TOC
  141. g_div_alphabet.innerHTML = '&nbsp;Table of content<br>&nbsp;[';
  142. var new_toc = BuildTOC(true);
  143. var pattern = new RegExp("^[a-zA-Z\.]");
  144. while (pattern.test(new_toc))
  145. new_toc = new_toc.replace(pattern, "<b>$&");
  146. pattern = new RegExp("[a-zA-Z\.]$");
  147. while (pattern.test(new_toc))
  148. new_toc = new_toc.replace(pattern, "$&</b>");
  149. pattern = new RegExp("([a-zA-Z])([\.])");
  150. while (pattern.test(new_toc))
  151. new_toc = new_toc.replace(pattern, "$1</b>$2");
  152. pattern = new RegExp("([\.])([a-zA-Z])");
  153. while (pattern.test(new_toc))
  154. new_toc = new_toc.replace(pattern, "$1<b>$2");
  155. g_div_alphabet.innerHTML += new_toc + ']&nbsp;<br>&nbsp;';
  156. }
  157. function Tick()
  158. {
  159. window.setTimeout("Tick()", 100);
  160. var text_src = g_txtarea_code_src;
  161. var div_cmds = g_div_helper_cmd;
  162. var div_args = g_div_helper_args;
  163. var div_cmnt = g_div_helper_cmnt;
  164. var div_vars = g_div_helper_vars;
  165. CmdLookup(div_cmds, div_args, div_cmnt, div_vars, text_src);
  166. }
  167. </script>
  168. </head>
  169. <body onload="PageDidLoad()">
  170. <h1>Mesh Viewer : Native Client version.</h1>
  171. <p>
  172. <div id="final_div">
  173. <div id="id_div_listener" align="center" style="width:770px;height:200px">
  174. <canvas id="BGCanvas" width="772" height="202"></canvas>
  175. <div id="id_div_progress">
  176. <br>&nbsp;
  177. <progress id="id_progress_bar" align="left"></progress>
  178. <div id="id_div_progress_status">....</div>&nbsp;
  179. </div>
  180. <div id="id_div_embed_data">
  181. <iframe id="id_frame_embed" src="meshviewer_nacl.html" width=770 height=200 frameborder=0 scrolling=no></iframe>
  182. </div>
  183. </div>
  184. </div>
  185. </p>
  186. <div><button onclick="SendMessageToModule()">Send Mesh Command !</button></div>
  187. <table border="0" cellpadding="0" cellspacing="0">
  188. <tr>
  189. <td>
  190. <div id="bouton">
  191. <textarea autofocus id="id_txtarea_code_src" rows="6" cols="94" style="font: 14px Consolas; resize: none;">//This is a comment
  192. sc#f8f afcb 1 1 1 0</textarea>
  193. </div>
  194. </td>
  195. <td valign="top" rowspan="3">&nbsp;</td>
  196. <td valign="top" rowspan="3">
  197. <div><b><u>Variable Types usage :</u></b></div>
  198. <div id="id_div_helper_vars"></div>
  199. </td>
  200. </tr>
  201. <tr>
  202. <td>
  203. <div id="id_div_alphabet"></div>
  204. </td>
  205. </tr>
  206. <tr>
  207. <td valign="top">
  208. <table border="0" cellpadding="0" cellspacing="0">
  209. <tr>
  210. <td valign="top"><div id="id_div_helper_cmd_0"></div></td>
  211. <td valign="top"><div id="id_div_helper_cmd_1"></div></td>
  212. <td valign="top"><div id="id_div_helper_args" ></div></td>
  213. <td valign="top"><div id="id_div_helper_cmnt" ></div></td>
  214. </tr>
  215. </table>
  216. </td>
  217. </tr>
  218. </table>
  219. </body>
  220. </html>