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.

259 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 false; /*window.chrome;*/ }
  108. </script>
  109. <script src="./utils.js"></script>
  110. <script src="./type_dictionnary.js"></script>
  111. <script type="text/javascript">
  112. var EasyMeshDict = new TypeDictionnary("EasyMesh");
  113. function GetCmdDictionnary() { return EasyMeshDict; }
  114. </script>
  115. <script src="./easy_mesh_dictionnary.js"></script>
  116. <script type="text/javascript">
  117. //Base init for all datas
  118. function VarInit()
  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. }
  136. //Base init
  137. function Init()
  138. {
  139. VarInit();
  140. //Put here any cookie update
  141. if (!g_txtarea_code_src.value)
  142. g_txtarea_code_src.value = "//This is a comment\nsc#f8f afcb 1 1 1 0";
  143. //Fill the TOC
  144. if (!g_div_alphabet.innerHTML)
  145. {
  146. g_div_alphabet.innerHTML = '&nbsp;Table of content<br>&nbsp;[';
  147. var new_toc = BuildTOC(true);
  148. var pattern = new RegExp("^[a-zA-Z\.]");
  149. while (pattern.test(new_toc))
  150. new_toc = new_toc.replace(pattern, "<b>$&");
  151. pattern = new RegExp("[a-zA-Z\.]$");
  152. while (pattern.test(new_toc))
  153. new_toc = new_toc.replace(pattern, "$&</b>");
  154. pattern = new RegExp("([a-zA-Z])([\.])");
  155. while (pattern.test(new_toc))
  156. new_toc = new_toc.replace(pattern, "$1</b>$2");
  157. pattern = new RegExp("([\.])([a-zA-Z])");
  158. while (pattern.test(new_toc))
  159. new_toc = new_toc.replace(pattern, "$1<b>$2");
  160. g_div_alphabet.innerHTML += new_toc + ']&nbsp;<br>&nbsp;';
  161. }
  162. //NaCl Specific
  163. if (IsUsingNaCl())
  164. {
  165. DynLoadFile("nacl_loading.js");
  166. g_frame_embed.src = 'meshviewer_nacl.html';
  167. }
  168. else
  169. g_frame_embed.src = 'meshviewer_em.html';
  170. g_frame_embed.onload = function() { VarInit(); }
  171. //Tick has been done, start Tick
  172. window.setTimeout("Tick()", 200);
  173. }
  174. function Tick()
  175. {
  176. window.setTimeout("Tick()", 100);
  177. var text_src = g_txtarea_code_src;
  178. var div_cmds = g_div_helper_cmd;
  179. var div_args = g_div_helper_args;
  180. var div_cmnt = g_div_helper_cmnt;
  181. var div_vars = g_div_helper_vars;
  182. CmdLookup(div_cmds, div_args, div_cmnt, div_vars, text_src);
  183. }
  184. </script>
  185. <body>
  186. <h1>Mesh Viewer : Web version.</h1>
  187. <p>
  188. <div id="final_div">
  189. <div id="id_div_listener" align="center" style="width:770px;height:200px">
  190. <canvas id="BGCanvas" width="772" height="202"></canvas>
  191. <div id="id_div_progress">
  192. <br>&nbsp;
  193. <progress id="id_progress_bar" align="left"></progress>
  194. <div id="id_div_progress_status">....</div>&nbsp;
  195. </div>
  196. <div id="id_div_frame_embed">
  197. <iframe onload="Init();" id="id_frame_embed" src="empty.html" width=770 height=200 frameborder=0 scrolling=no></iframe>
  198. </div>
  199. </div>
  200. </div>
  201. </p>
  202. <div><button onclick="SendMessageToModule()">Send Mesh Command !</button></div>
  203. <table border="0" cellpadding="0" cellspacing="0">
  204. <tr>
  205. <td>
  206. <div id="bouton">
  207. <textarea autofocus id="id_txtarea_code_src" rows="6" cols="94" style="font: 14px Consolas; resize: none;"></textarea>
  208. </div>
  209. </td>
  210. <td valign="top" rowspan="3">&nbsp;</td>
  211. <td valign="top" rowspan="3">
  212. <div><b><u>Variable Types usage :</u></b></div>
  213. <div id="id_div_helper_vars"></div>
  214. </td>
  215. </tr>
  216. <tr>
  217. <td>
  218. <div id="id_div_alphabet"></div>
  219. </td>
  220. </tr>
  221. <tr>
  222. <td valign="top">
  223. <table border="0" cellpadding="0" cellspacing="0">
  224. <tr>
  225. <td valign="top"><div id="id_div_helper_cmd_0"></div></td>
  226. <td valign="top"><div id="id_div_helper_cmd_1"></div></td>
  227. <td valign="top"><div id="id_div_helper_args" ></div></td>
  228. <td valign="top"><div id="id_div_helper_cmnt" ></div></td>
  229. </tr>
  230. </table>
  231. </td>
  232. </tr>
  233. </table>
  234. </body>
  235. </html>