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

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

Issue 11150028: 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
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <!--
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
6 found in the LICENSE file.
7 -->
8 <head>
9 <meta http-equiv="Pragma" content="no-cache">
10 <meta http-equiv="Expires" content="-1">
11 <script type="text/javascript">
12 function pageDidLoad() {
binji 2012/10/15 22:15:46 indent 2
Sam Clegg 2012/10/15 22:54:52 Done.
13 appendStatus('Page loaded');
14 }
15
16 var forceRedraw = function (element) {
binji 2012/10/15 22:15:46 kill this function
Sam Clegg 2012/10/15 22:54:52 I'd rather leave that to Mark. He seems to think
Sam Clegg 2012/10/15 22:54:52 Done.
17
18 if (!element) { return; }
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) {
binji 2012/10/15 22:15:46 replace this with implementation from SDK examples
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
binji 2012/10/15 22:15:46 remove all extra newlines
Sam Clegg 2012/10/15 22:54:52 Done.
43
44
45 function handleMessage(message_event) {
46 appendStatus(message_event.data);
47
48 }
49
50 </script>
51 </head>
52 <body onload="pageDidLoad()">
53 <div id="listener">
54 <script type="text/javascript">
55 var listener = document.getElementById('listener');
56 listener.addEventListener('message', handleMessage, true);
57 </script>
58 <h2>NaCl Module</h2>
59 <embed name="nacl_module"
60 id="nacl_module"
61 style="border-style: solid;"
62 width=200
63 height=200
64 src="hello_nacl.nmf"
65 type="application/x-nacl"/>
66 </div>
67 <div>
68 <h2>Messages: <code id="statusField"></code></h2>
69 </div>
70 </body>
71 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698