summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/src/examples/pong/pong.html
diff options
context:
space:
mode:
Diffstat (limited to 'native_client_sdk/src/examples/pong/pong.html')
-rw-r--r--native_client_sdk/src/examples/pong/pong.html74
1 files changed, 0 insertions, 74 deletions
diff --git a/native_client_sdk/src/examples/pong/pong.html b/native_client_sdk/src/examples/pong/pong.html
deleted file mode 100644
index 19f95a9..0000000
--- a/native_client_sdk/src/examples/pong/pong.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
- <!--
- Copyright (c) 2011 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>
- <title>Pong</title>
- <script type="text/javascript">
- var pong = null;
- var paintInterval = null;
-
- // Handle a message coming from the NaCl module. The message payload is
- // assumed to contain the current game score. Update the score text
- // display with this value.
- // Note that errors are also sent to this handler. A message starting
- // with 'ERROR' is considered an error, all other strings are assumed
- // to be scores.
- function handleMessage(message_event) {
- if (message_event.data.indexOf('ERROR') == 0) {
- document.getElementById('error_log').innerHTML = message_event.data;
- } else {
- document.getElementById('score').innerHTML = message_event.data;
- }
- }
-
- function pageDidUnload() {
- clearInterval(paintInterval);
- }
- function resetScore() {
- pong = document.getElementById('pong');
- pong.postMessage("resetScore");
- }
- </script>
- </head>
- <body id="bodyId" onunload="pageDidUnload()">
- <h1>Pong</h1>
- <!-- Load the published .nexe. This includes the 'src' attribute which
- shows how to load multi-architecture modules. Each entry in the "nexes"
- object in the .nmf manifest file is a key-value pair: the key is the
- runtime ('x86-32', 'x86-64', etc.); the value is a URL for the desired NaCl
- module. To load the debug versions of your .nexes, set the 'src'
- attribute to the _dbg.nmf version of the manifest file.
-
- Note: The <EMBED> element is wrapped inside a <DIV>, which has both a 'load'
- and a 'message' event listener attached. This wrapping method is used
- instead of attaching the event listeners directly to the <EMBED> element to
- ensure that the listeners are active before the NaCl module 'load' event
- fires. This also allows you to use PPB_Messaging.PostMessage() (in C) or
- pp::Instance.PostMessage() (in C++) from within the initialization code in
- your NaCl module.
- -->
- <div id="listener">
- <script type="text/javascript">
- window.webkitStorageInfo.requestQuota(PERSISTENT, 1024);
- var listener = document.getElementById('listener')
- listener.addEventListener('message', handleMessage, true);
- </script>
-
- <embed name="nacl_module"
- id="pong"
- width=800 height=600
- src="pong.nmf"
- type="application/x-nacl" />
- </div>
- <br />
- <p id="score">
- </p>
- <button onclick="resetScore()">Reset score</button>
- <p id="error_log"></p>
- </body>
-</html>