Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

264 строки
7.9 KiB

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