Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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