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

Side by Side Diff: visual_studio/NativeClientVSAddIn/InstallerResources/examples/hello_nacl_cpp/hello_nacl_cpp/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 if (statusField) {
35 var newElt = document.createElement("opt_message");
36 newElt.innerHTML = "<br>" + opt_message;
37 statusField.appendChild(newElt);
38 forceRedraw(newElt);
39 }
40 }
41
42
43 function handleMessage(message_event) {
44 appendStatus(message_event.data);
45 }
46
47 </script> 28 </script>
48 </head> 29 </head>
49 <body onload="pageDidLoad()"> 30 <body onload="pageDidLoad()">
50 <div id="listener"> 31 <div id="listener">
51 <script type="text/javascript"> 32 <script type="text/javascript">
52 var listener = document.getElementById('listener'); 33 var listener = document.getElementById('listener');
53 listener.addEventListener('message', handleMessage, true); 34 listener.addEventListener('message', handleMessage, true);
54 </script> 35 </script>
55 <h2>NaCl Module</h2> 36 <h2>NaCl Module</h2>
56 <embed name="nacl_module" 37 <embed name="nacl_module"
57 id="nacl_module" 38 id="nacl_module"
58 style="border-style: solid;" 39 style="border-style: solid;"
59 width=200 40 width=200
60 height=200 41 height=200
61 src="hello_nacl_cpp.nmf" 42 src="newlib/hello_nacl_cpp.nmf"
62 type="application/x-nacl"/> 43 type="application/x-nacl"/>
63 </div> 44 </div>
64 <div> 45 <div>
65 <h2>Messages: <code id="statusField"></code></h2> 46 <h2>Messages: <code id="statusField"></code></h2>
66 </div> 47 </div>
67 </body> 48 </body>
68 </html> 49 </html>
OLDNEW
« no previous file with comments | « visual_studio/NativeClientVSAddIn/InstallerResources/examples/hello_nacl_cpp/hello_nacl_cpp/hello_nacl_cpp.vcxproj.user ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698