Chromium Code Reviews| Index: visual_studio/NativeClientVSAddIn/InstallerResources/examples/hello_nacl_cpp/hello_nacl_cpp/index.html |
| diff --git a/visual_studio/NativeClientVSAddIn/InstallerResources/examples/hello_nacl_cpp/hello_nacl_cpp/index.html b/visual_studio/NativeClientVSAddIn/InstallerResources/examples/hello_nacl_cpp/hello_nacl_cpp/index.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5f595a4011339c923b4ff126a3fe70bfc74b22bc |
| --- /dev/null |
| +++ b/visual_studio/NativeClientVSAddIn/InstallerResources/examples/hello_nacl_cpp/hello_nacl_cpp/index.html |
| @@ -0,0 +1,68 @@ |
| +<!DOCTYPE html> |
| +<html> |
| + <!-- |
| + Copyright (c) 2012 The Chromium 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> |
| + <meta http-equiv="Pragma" content="no-cache"> |
|
binji
2012/10/15 22:15:46
same fixes from C version?
|
| + <meta http-equiv="Expires" content="-1"> |
| + <script type="text/javascript"> |
| + function pageDidLoad() { |
| + appendStatus('Page loaded'); |
| + } |
| + |
| + var forceRedraw = function (element) { |
| + |
| + if (!element) { return; } |
| + |
| + var n = document.createTextNode(' '); |
| + var disp = element.style.display; // don't worry about previous display style |
| + |
| + element.appendChild(n); |
| + element.style.display = 'none'; |
| + |
| + setTimeout(function () { |
| + element.style.display = disp; |
| + n.parentNode.removeChild(n); |
| + }, 50); |
| + } |
| + |
| + function appendStatus(opt_message) { |
| + var statusField = document.getElementById('statusField'); |
| + if (statusField) { |
| + var newElt = document.createElement("opt_message"); |
| + newElt.innerHTML = "<br>" + opt_message; |
| + statusField.appendChild(newElt); |
| + forceRedraw(newElt); |
| + } |
| + } |
| + |
| + |
| + function handleMessage(message_event) { |
| + appendStatus(message_event.data); |
| + } |
| + |
| + </script> |
| +</head> |
| +<body onload="pageDidLoad()"> |
| + <div id="listener"> |
| + <script type="text/javascript"> |
| + var listener = document.getElementById('listener'); |
| + listener.addEventListener('message', handleMessage, true); |
| + </script> |
| + <h2>NaCl Module</h2> |
| + <embed name="nacl_module" |
| + id="nacl_module" |
| + style="border-style: solid;" |
| + width=200 |
| + height=200 |
| + src="hello_nacl_cpp.nmf" |
| + type="application/x-nacl"/> |
| + </div> |
| + <div> |
| + <h2>Messages: <code id="statusField"></code></h2> |
| + </div> |
| +</body> |
| +</html> |