|
- <DOCTYPE html>
- <html>
-
- <!--
- Copyright (c) 2012 The Native Client Authors. All rights reserved.
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
- <head>
-
- <style type="text/css">
- body
- {
- font:12px Consolas;
- }
- button
- {
- font:14px Consolas;
- }
- textarea
- {
- font:14px Consolas;
- }
- #id_div_progress_status
- {
- font:12px Consolas;
- }
- #id_div_progress
- {
- position: absolute;
- top: 20%;
- left: 30%;
- right: 30%;
- z-index: 3;
- background-color:white;
- border:1px solid #000000;
- }
- progress
- {
- background-color: #f3f3f3;
- border: 0;
- height: 18px;
- width: 200px;
- border-radius: 9px;
- }
- progress::-webkit-progress-bar
- {
- background-color: #f3f3f3;
- border: 1px solid #000000;
- padding: 2px 2px;
- height: 20px;
- border-radius: 0px;
- }
- progress::-webkit-progress-value
- {
- background-color: #22BB22;
- border: 0px;
- height: 14px;
- border-radius: 0px;
- }
- #id_div_listener
- {
- position: relative;
- }
- #id_div_frame_embed
- {
- position: absolute;
- top: 2px;
- left: 2px;
- z-index: -1;
- }
- #BGCanvas
- {
- border:1px solid #000000;
- }
- #id_div_helper_cmd_0
- {
- margin-left: 5px;
- }
- </style>
-
- <title>Mesh Viewer NaCl</title>
-
- </head>
-
- <script type="text/javascript">
- //Base data Setup
- g_div_frame_embed_save = '';
- g_div_frame_embed = null; // Global application object.
- g_embed_nacl_module = null; // Global application object.
- g_txtarea_code_src = null;
- g_div_helper_cmd = [null, null];
- g_div_helper_args = null;
- g_div_helper_cmnt = null;
- g_div_helper_vars = null;
- g_div_alphabet = null;
- g_div_progress = null;
- g_div_progress_status = null;
- g_progress_bar = null;
- g_var_progress_bar = -1;
- g_frame_embed = null;
-
- function GetNaClListenerDiv() { return g_frame_embed.contentDocument.getElementById('id_div_embed_data'); }
- function GetNaClModuleVar() { return g_embed_nacl_module; }
- function InitNaClModuleVar() { g_embed_nacl_module = g_frame_embed.contentDocument.getElementById('id_embed_nacl_module'); }
- function GetTextAreaCodeSrc() { return g_txtarea_code_src; }
- function GetDivProgress() { return g_div_progress; }
- function GetProgressBar() { return g_progress_bar; }
- function GetDivProgressStatus() { return g_div_progress_status; }
- function GetDivEmbedData() { return g_div_frame_embed; }
- function GetDivEmbedDataSave() { return g_div_frame_embed_save; }
- function GetFrameData() { return g_frame_embed; }
- function IsUsingNaCl() { return true; }
- </script>
-
- <script src="./type_dictionnary.js"></script>
- <script type="text/javascript">
- var EasyMeshDict = new TypeDictionnary("EasyMesh");
- function GetCmdDictionnary() { return EasyMeshDict; }
- </script>
- <script src="./easy_mesh_dictionnary.js"></script>
- <script src="./nacl_loading.js"></script>
-
- <script type="text/javascript">
- //Base init for all datas
- function Init()
- {
- alert('INIT PROUT');
- //Init frame variable first.
- g_frame_embed = document.getElementById('id_frame_embed');
- //This is in an iframe.
- g_div_frame_embed = g_frame_embed.contentDocument.getElementById('id_div_frame_embed');
- //The rest of these are in this page.
- g_txtarea_code_src = document.getElementById('id_txtarea_code_src');
- g_div_helper_cmd[0] = document.getElementById('id_div_helper_cmd_0');
- g_div_helper_cmd[1] = document.getElementById('id_div_helper_cmd_1');
- g_div_helper_args = document.getElementById('id_div_helper_args');
- g_div_helper_cmnt = document.getElementById('id_div_helper_cmnt');
- g_div_helper_vars = document.getElementById('id_div_helper_vars');
- g_div_alphabet = document.getElementById('id_div_alphabet');
- g_div_progress = document.getElementById('id_div_progress');
- g_div_progress_status = document.getElementById('id_div_progress_status');
- g_progress_bar = document.getElementById('id_progress_bar');
-
- //Pulg here any cookie update
- if (!g_txtarea_code_src.value)
- g_txtarea_code_src.value = "//This is a comment\nsc#f8f afcb 1 1 1 0";
-
- //Fill the TOC
- if (!g_div_alphabet.innerHTML)
- {
- g_div_alphabet.innerHTML = ' Table of content<br> [';
- var new_toc = BuildTOC(true);
- var pattern = new RegExp("^[a-zA-Z\.]");
- while (pattern.test(new_toc))
- new_toc = new_toc.replace(pattern, "<b>$&");
- pattern = new RegExp("[a-zA-Z\.]$");
- while (pattern.test(new_toc))
- new_toc = new_toc.replace(pattern, "$&</b>");
- pattern = new RegExp("([a-zA-Z])([\.])");
- while (pattern.test(new_toc))
- new_toc = new_toc.replace(pattern, "$1</b>$2");
- pattern = new RegExp("([\.])([a-zA-Z])");
- while (pattern.test(new_toc))
- new_toc = new_toc.replace(pattern, "$1<b>$2");
- g_div_alphabet.innerHTML += new_toc + '] <br> ';
- }
-
- //Tick has been done, start Tick
- window.setTimeout("Tick()", 200);
- }
-
- function Tick()
- {
- window.setTimeout("Tick()", 100);
- var text_src = g_txtarea_code_src;
- var div_cmds = g_div_helper_cmd;
- var div_args = g_div_helper_args;
- var div_cmnt = g_div_helper_cmnt;
- var div_vars = g_div_helper_vars;
- CmdLookup(div_cmds, div_args, div_cmnt, div_vars, text_src);
- }
- </script>
-
- <body>
-
- <h1>Mesh Viewer : Native Client version.</h1>
-
- <p>
- <div id="final_div">
- <div id="id_div_listener" align="center" style="width:770px;height:200px">
- <canvas id="BGCanvas" width="772" height="202"></canvas>
- <div id="id_div_progress">
- <br>
- <progress id="id_progress_bar" align="left"></progress>
- <div id="id_div_progress_status">....</div>
- </div>
- <div id="id_div_frame_embed">
- <iframe onload="Init(); PageDidLoad();" id="id_frame_embed" src="meshviewer_nacl.html" width=770 height=200 frameborder=0 scrolling=no></iframe>
- </div>
- </div>
- </div>
- </p>
-
- <div><button onclick="SendMessageToModule()">Send Mesh Command !</button></div>
-
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td>
- <div id="bouton">
- <textarea autofocus id="id_txtarea_code_src" rows="6" cols="94" style="font: 14px Consolas; resize: none;"></textarea>
- </div>
- </td>
- <td valign="top" rowspan="3"> </td>
- <td valign="top" rowspan="3">
- <div><b><u>Variable Types usage :</u></b></div>
- <div id="id_div_helper_vars"></div>
- </td>
- </tr>
- <tr>
- <td>
- <div id="id_div_alphabet"></div>
- </td>
- </tr>
- <tr>
- <td valign="top">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td valign="top"><div id="id_div_helper_cmd_0"></div></td>
- <td valign="top"><div id="id_div_helper_cmd_1"></div></td>
- <td valign="top"><div id="id_div_helper_args" ></div></td>
- <td valign="top"><div id="id_div_helper_cmnt" ></div></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
-
- </body>
- </html>
|