Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

260 righe
7.7 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. visibility: hidden;
  36. }
  37. progress
  38. {
  39. background-color: #f3f3f3;
  40. border: 0;
  41. height: 18px;
  42. width: 200px;
  43. border-radius: 9px;
  44. }
  45. progress::-webkit-progress-bar
  46. {
  47. background-color: #f3f3f3;
  48. border: 1px solid #000000;
  49. padding: 2px 2px;
  50. height: 20px;
  51. border-radius: 0px;
  52. }
  53. progress::-webkit-progress-value
  54. {
  55. background-color: #22BB22;
  56. border: 0px;
  57. height: 14px;
  58. border-radius: 0px;
  59. }
  60. #id_div_listener
  61. {
  62. position: relative;
  63. }
  64. #id_div_frame_embed
  65. {
  66. position: absolute;
  67. top: 2px;
  68. left: 2px;
  69. z-index: -1;
  70. }
  71. #BGCanvas
  72. {
  73. border:1px solid #000000;
  74. }
  75. #id_div_helper_cmd_0
  76. {
  77. margin-left: 5px;
  78. }
  79. </style>
  80. <title>Mesh Viewer Web Edition</title>
  81. </head>
  82. <script type="text/javascript">
  83. //Base data Setup : GLOBAL STYLE
  84. g_div_frame_embed_save = '';
  85. g_div_frame_embed = null;
  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 GetTextAreaCodeSrc() { return g_txtarea_code_src; }
  98. function GetDivProgress() { return g_div_progress; }
  99. function GetProgressBar() { return g_progress_bar; }
  100. function GetDivProgressStatus() { return g_div_progress_status; }
  101. function GetDivEmbedData() { return g_div_frame_embed; }
  102. function GetDivEmbedDataSave() { return g_div_frame_embed_save; }
  103. function GetFrameData() { return g_frame_embed; }
  104. function GetiFrameDivEmbed() { return g_frame_embed.contentDocument.getElementById('id_div_embed_data'); }
  105. //NaCl Specific
  106. function GetiFrameModuleVar() { return g_frame_embed.contentDocument.getElementById('id_embed_nacl_module'); }
  107. function IsUsingNaCl() { return window.chrome; }
  108. </script>
  109. <script src="./utils.js"></script>
  110. <script src="./progress_status.js"></script>
  111. <script src="./type_dictionnary.js"></script>
  112. <script type="text/javascript">
  113. var EasyMeshDict = new TypeDictionnary("EasyMesh");
  114. function GetCmdDictionnary() { return EasyMeshDict; }
  115. </script>
  116. <script src="./easy_mesh_dictionnary.js"></script>
  117. <script type="text/javascript">
  118. //Base init for all datas
  119. function VarInit()
  120. {
  121. //Init frame variable first.
  122. g_frame_embed = document.getElementById('id_frame_embed');
  123. //This is in an iframe.
  124. g_div_frame_embed = g_frame_embed.contentDocument.getElementById('id_div_frame_embed');
  125. //The rest of these are in this page.
  126. g_txtarea_code_src = document.getElementById('id_txtarea_code_src');
  127. g_div_helper_cmd[0] = document.getElementById('id_div_helper_cmd_0');
  128. g_div_helper_cmd[1] = document.getElementById('id_div_helper_cmd_1');
  129. g_div_helper_args = document.getElementById('id_div_helper_args');
  130. g_div_helper_cmnt = document.getElementById('id_div_helper_cmnt');
  131. g_div_helper_vars = document.getElementById('id_div_helper_vars');
  132. g_div_alphabet = document.getElementById('id_div_alphabet');
  133. g_div_progress = document.getElementById('id_div_progress');
  134. g_div_progress_status = document.getElementById('id_div_progress_status');
  135. g_progress_bar = document.getElementById('id_progress_bar');
  136. }
  137. //Base init
  138. function Init()
  139. {
  140. VarInit();
  141. //Put here any cookie update
  142. if (!g_txtarea_code_src.value)
  143. g_txtarea_code_src.value = "//This is a comment\nsc#f8f afcb 1 1 1 0";
  144. //Fill the TOC
  145. if (!g_div_alphabet.innerHTML)
  146. {
  147. g_div_alphabet.innerHTML = '&nbsp;Table of content<br>&nbsp;[';
  148. var new_toc = BuildTOC(true);
  149. var pattern = new RegExp("^[a-zA-Z\.]");
  150. while (pattern.test(new_toc))
  151. new_toc = new_toc.replace(pattern, "<b>$&");
  152. pattern = new RegExp("[a-zA-Z\.]$");
  153. while (pattern.test(new_toc))
  154. new_toc = new_toc.replace(pattern, "$&</b>");
  155. pattern = new RegExp("([a-zA-Z])([\.])");
  156. while (pattern.test(new_toc))
  157. new_toc = new_toc.replace(pattern, "$1</b>$2");
  158. pattern = new RegExp("([\.])([a-zA-Z])");
  159. while (pattern.test(new_toc))
  160. new_toc = new_toc.replace(pattern, "$1<b>$2");
  161. g_div_alphabet.innerHTML += new_toc + ']&nbsp;<br>&nbsp;';
  162. }
  163. //NaCl Specific
  164. if (IsUsingNaCl())
  165. {
  166. DynLoadFile("nacl_loading.js");
  167. g_frame_embed.src = 'meshviewer_nacl.html';
  168. }
  169. else
  170. g_frame_embed.src = 'meshviewer_em.html';
  171. g_frame_embed.onload = function() { VarInit(); }
  172. //Tick has been done, start Tick
  173. window.setTimeout("Tick()", 200);
  174. }
  175. function Tick()
  176. {
  177. window.setTimeout("Tick()", 100);
  178. var text_src = g_txtarea_code_src;
  179. var div_cmds = g_div_helper_cmd;
  180. var div_args = g_div_helper_args;
  181. var div_cmnt = g_div_helper_cmnt;
  182. var div_vars = g_div_helper_vars;
  183. CmdLookup(div_cmds, div_args, div_cmnt, div_vars, text_src);
  184. }
  185. </script>
  186. <body>
  187. <h1>Mesh Viewer : Web version.</h1>
  188. <p>
  189. <div id="final_div">
  190. <div id="id_div_listener" align="center" style="width:770px;height:200px">
  191. <canvas id="BGCanvas" width="772" height="202"></canvas>
  192. <div id="id_div_progress">
  193. <br>&nbsp;
  194. <progress id="id_progress_bar" align="left"></progress>
  195. <div id="id_div_progress_status">....</div>&nbsp;
  196. </div>
  197. <div id="id_div_frame_embed">
  198. <iframe onload="Init();" id="id_frame_embed" src="empty.html" width=770 height=200 frameborder=0 scrolling=no></iframe>
  199. </div>
  200. </div>
  201. </div>
  202. </p>
  203. <div><button onclick="SendMessageToModule()">Send Mesh Command !</button></div>
  204. <table border="0" cellpadding="0" cellspacing="0">
  205. <tr>
  206. <td>
  207. <div id="bouton">
  208. <textarea autofocus id="id_txtarea_code_src" rows="6" cols="94" style="font: 14px Consolas; resize: none;"></textarea>
  209. </div>
  210. </td>
  211. <td valign="top" rowspan="3">&nbsp;</td>
  212. <td valign="top" rowspan="3">
  213. <div><b><u>Variable Types usage :</u></b></div>
  214. <div id="id_div_helper_vars"></div>
  215. </td>
  216. </tr>
  217. <tr>
  218. <td>
  219. <div id="id_div_alphabet"></div>
  220. </td>
  221. </tr>
  222. <tr>
  223. <td valign="top">
  224. <table border="0" cellpadding="0" cellspacing="0">
  225. <tr>
  226. <td valign="top"><div id="id_div_helper_cmd_0"></div></td>
  227. <td valign="top"><div id="id_div_helper_cmd_1"></div></td>
  228. <td valign="top"><div id="id_div_helper_args" ></div></td>
  229. <td valign="top"><div id="id_div_helper_cmnt" ></div></td>
  230. </tr>
  231. </table>
  232. </td>
  233. </tr>
  234. </table>
  235. </body>
  236. </html>