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

Unified Diff: native_client_sdk/src/examples/dlopen/dlopen.html

Issue 9234043: Support GLBIC example. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/examples/dlopen/dlopen.html
===================================================================
--- native_client_sdk/src/examples/dlopen/dlopen.html (revision 0)
+++ native_client_sdk/src/examples/dlopen/dlopen.html (revision 0)
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<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>Magic Eightball</title>
+ <script type="text/javascript">
+
+ function moduleDidLoad() {
+ }
+
+ function handleMessage(message_event) {
+ if(message_event.data=='Eightball loaded!')
+ {
+ document.getElementById('consolec').innerHTML =
+ " Eightball loaded, type a question below, press the button, and get a response.<br />";
+ document.getElementById('consolec').innerHTML += "<form name='form' Value='Hello Me' onsubmit='askBall()'>";
+ document.getElementById('consolec').innerHTML += " <input type='textarea' size='64' name='inputtext' />";
+ document.getElementById('consolec').innerHTML += " <input type='button' NAME='button' Value='ASK!' onClick='askBall()' />";
+ document.getElementById('consolec').innerHTML += "</form>";
+ }
+ else
+ {
+ if(message_event.data[0]=='!')
+ {
+ document.getElementById('answerlog').innerHTML +=
+ (document.form.inputtext.value + ": " + message_event.data +"<br />");
+ }
+ else
+ {
+ document.getElementById('consolec').innerHTML += message_event.data + "<br />";
+ console.log(message_event.data);
+ }
+ }
+ }
+
+ function pageDidUnload() {
+ clearInterval(paintInterval);
+ }
+
+ function askBall()
+ {
+ dlopen.postMessage('query');
+ return false;
+ }
+ </script>
+</head>
+<body id="bodyId" onunload="pageDidUnload()">
+<div id="listener">
+ <script type="text/javascript">
+ var listener = document.getElementById('listener')
+ listener.addEventListener('load', moduleDidLoad, true);
+ listener.addEventListener('message', handleMessage, true);
+ </script>
+<h1>The Magic 8 Ball </h1>
+<embed name="nacl_module"
+ id="dlopen"
+ width=1 height=1
+ src="dlopen.nmf"
+ type="application/x-nacl" />
+</div>
+ <br />
+ <div id="consolec">..loading dynamic librarires...</div>
+<div id="answerlog"></div>
+</body>
+</html>
Property changes on: native_client_sdk/src/examples/dlopen/dlopen.html
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698