Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: visual_studio/NativeClientVSAddIn/InstallerResources/examples/hello_nacl/hello_nacl/index.html

Issue 11191009: Add new VS AddIn examples. (Closed) Base URL: http://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <!-- 3 <!--
4 Copyright (c) 2012 The Chromium Authors. All rights reserved. 4 Copyright (c) 2012 The Chromium Authors. All rights reserved.
5 Use of this source code is governed by a BSD-style license that can be 5 Use of this source code is governed by a BSD-style license that can be
6 found in the LICENSE file. 6 found in the LICENSE file.
7 --> 7 -->
8 <head> 8 <head>
9 <meta http-equiv="Pragma" content="no-cache"> 9 <meta http-equiv="Pragma" content="no-cache">
10 <meta http-equiv="Expires" content="-1"> 10 <meta http-equiv="Expires" content="-1">
11 <script type="text/javascript"> 11 <script type="text/javascript">
12 function pageDidLoad() { 12 function pageDidLoad() {
13 appendStatus('Page loaded'); 13 appendStatus('Page loaded');
14 }
15
16 function appendStatus(opt_message) {
17 var statusField = document.getElementById('statusField');
18 if (statusField) {
19 var newElt = document.createElement("opt_message");
20 newElt.innerHTML = "<br>" + opt_message;
21 statusField.appendChild(newElt);
14 } 22 }
23 }
15 24
16 var forceRedraw = function (element) { 25 function handleMessage(message_event) {
17 26 appendStatus(message_event.data);
18 if (!element) { return; } 27 }
19
20 var n = document.createTextNode(' ');
21 var disp = element.style.display; // don't worry about previous displ ay style
22
23 element.appendChild(n);
24 element.style.display = 'none';
25
26 setTimeout(function () {
27 element.style.display = disp;
28 n.parentNode.removeChild(n);
29 }, 50);
30 }
31
32 function appendStatus(opt_message) {
33 var statusField = document.getElementById('statusField');
34 console.log("hi");
35 if (statusField) {
36 var newElt = document.createElement("opt_message");
37 newElt.innerHTML = "<br>" + opt_message;
38 statusField.appendChild(newElt);
39 forceRedraw(newElt);
40 }
41 }
42
43
44
45 function handleMessage(message_event) {
46 appendStatus(message_event.data);
47
48 }
49
50 </script> 28 </script>
51 </head> 29 </head>
52 <body onload="pageDidLoad()"> 30 <body onload="pageDidLoad()">
53 <div id="listener"> 31 <div id="listener">
54 <script type="text/javascript"> 32 <script type="text/javascript">
55 var listener = document.getElementById('listener'); 33 var listener = document.getElementById('listener');
56 listener.addEventListener('message', handleMessage, true); 34 listener.addEventListener('message', handleMessage, true);
57 </script> 35 </script>
58 <h2>NaCl Module</h2> 36 <h2>NaCl Module</h2>
59 <embed name="nacl_module" 37 <embed name="nacl_module"
60 id="nacl_module" 38 id="nacl_module"
61 style="border-style: solid;" 39 style="border-style: solid;"
62 width=200 40 width=200
63 height=200 41 height=200
64 src="hello_nacl.nmf" 42 src="newlib/hello_nacl.nmf"
65 type="application/x-nacl"/> 43 type="application/x-nacl"/>
66 </div> 44 </div>
67 <div> 45 <div>
68 <h2>Messages: <code id="statusField"></code></h2> 46 <h2>Messages: <code id="statusField"></code></h2>
69 </div> 47 </div>
70 </body> 48 </body>
71 </html> 49 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698