您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

241 行
7.4 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_frame_embed
  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. </head>
  81. <script type="text/javascript">
  82. //Base data Setup
  83. g_div_frame_embed_save = '';
  84. g_div_frame_embed = null; // Global application object.
  85. g_embed_nacl_module = null; // Global application object.
  86. g_txtarea_code_src = null;
  87. g_div_helper_cmd = [null, null];
  88. g_div_helper_args = null;
  89. g_div_helper_cmnt = null;
  90. g_div_helper_vars = null;
  91. g_div_alphabet = null;
  92. g_div_progress = null;
  93. g_div_progress_status = null;
  94. g_progress_bar = null;
  95. g_var_progress_bar = -1;
  96. g_frame_embed = null;
  97. function GetNaClListenerDiv() { return g_frame_embed.contentDocument.getElementById('id_div_embed_data'); }
  98. function GetNaClModuleVar() { return g_embed_nacl_module; }
  99. function InitNaClModuleVar() { g_embed_nacl_module = g_frame_embed.contentDocument.getElementById('id_embed_nacl_module'); }
  100. function GetTextAreaCodeSrc() { return g_txtarea_code_src; }
  101. function GetDivProgress() { return g_div_progress; }
  102. function GetProgressBar() { return g_progress_bar; }
  103. function GetDivProgressStatus() { return g_div_progress_status; }
  104. function GetDivEmbedData() { return g_div_frame_embed; }
  105. function GetDivEmbedDataSave() { return g_div_frame_embed_save; }
  106. function GetFrameData() { return g_frame_embed; }
  107. function IsUsingNaCl() { return true; }
  108. </script>
  109. <script src="./type_dictionnary.js"></script>
  110. <script type="text/javascript">
  111. var EasyMeshDict = new TypeDictionnary("EasyMesh");
  112. function GetCmdDictionnary() { return EasyMeshDict; }
  113. </script>
  114. <script src="./easy_mesh_dictionnary.js"></script>
  115. <script src="./nacl_loading.js"></script>
  116. <script type="text/javascript">
  117. //Base init for all datas
  118. function Init()
  119. {
  120. //Init frame variable first.
  121. g_frame_embed = document.getElementById('id_frame_embed');
  122. //This is in an iframe.
  123. g_div_frame_embed = g_frame_embed.contentDocument.getElementById('id_div_frame_embed');
  124. //The rest of these are in this page.
  125. g_txtarea_code_src = document.getElementById('id_txtarea_code_src');
  126. g_div_helper_cmd[0] = document.getElementById('id_div_helper_cmd_0');
  127. g_div_helper_cmd[1] = document.getElementById('id_div_helper_cmd_1');
  128. g_div_helper_args = document.getElementById('id_div_helper_args');
  129. g_div_helper_cmnt = document.getElementById('id_div_helper_cmnt');
  130. g_div_helper_vars = document.getElementById('id_div_helper_vars');
  131. g_div_alphabet = document.getElementById('id_div_alphabet');
  132. g_div_progress = document.getElementById('id_div_progress');
  133. g_div_progress_status = document.getElementById('id_div_progress_status');
  134. g_progress_bar = document.getElementById('id_progress_bar');
  135. //Pulg here any cookie update
  136. if (!g_txtarea_code_src.value)
  137. g_txtarea_code_src.value = "//This is a comment\nsc#f8f afcb 1 1 1 0";
  138. //Fill the TOC
  139. if (!g_div_alphabet.innerHTML)
  140. {
  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. //Tick has been done, start Tick
  158. window.setTimeout("Tick()", 200);
  159. }
  160. function Tick()
  161. {
  162. window.setTimeout("Tick()", 100);
  163. var text_src = g_txtarea_code_src;
  164. var div_cmds = g_div_helper_cmd;
  165. var div_args = g_div_helper_args;
  166. var div_cmnt = g_div_helper_cmnt;
  167. var div_vars = g_div_helper_vars;
  168. CmdLookup(div_cmds, div_args, div_cmnt, div_vars, text_src);
  169. }
  170. </script>
  171. <body>
  172. <h1>Mesh Viewer : Native Client version.</h1>
  173. <p>
  174. <div id="final_div">
  175. <div id="id_div_listener" align="center" style="width:770px;height:200px">
  176. <canvas id="BGCanvas" width="772" height="202"></canvas>
  177. <div id="id_div_progress">
  178. <br>&nbsp;
  179. <progress id="id_progress_bar" align="left"></progress>
  180. <div id="id_div_progress_status">....</div>&nbsp;
  181. </div>
  182. <div id="id_div_frame_embed">
  183. <iframe onload="Init(); PageDidLoad();" id="id_frame_embed" src="meshviewer_nacl.html" width=770 height=200 frameborder=0 scrolling=no></iframe>
  184. </div>
  185. </div>
  186. </div>
  187. </p>
  188. <div><button onclick="SendMessageToModule()">Send Mesh Command !</button></div>
  189. <table border="0" cellpadding="0" cellspacing="0">
  190. <tr>
  191. <td>
  192. <div id="bouton">
  193. <textarea autofocus id="id_txtarea_code_src" rows="6" cols="94" style="font: 14px Consolas; resize: none;"></textarea>
  194. </div>
  195. </td>
  196. <td valign="top" rowspan="3">&nbsp;</td>
  197. <td valign="top" rowspan="3">
  198. <div><b><u>Variable Types usage :</u></b></div>
  199. <div id="id_div_helper_vars"></div>
  200. </td>
  201. </tr>
  202. <tr>
  203. <td>
  204. <div id="id_div_alphabet"></div>
  205. </td>
  206. </tr>
  207. <tr>
  208. <td valign="top">
  209. <table border="0" cellpadding="0" cellspacing="0">
  210. <tr>
  211. <td valign="top"><div id="id_div_helper_cmd_0"></div></td>
  212. <td valign="top"><div id="id_div_helper_cmd_1"></div></td>
  213. <td valign="top"><div id="id_div_helper_args" ></div></td>
  214. <td valign="top"><div id="id_div_helper_cmnt" ></div></td>
  215. </tr>
  216. </table>
  217. </td>
  218. </tr>
  219. </table>
  220. </body>
  221. </html>