Chromium Code Reviews| 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,61 @@ |
| +<html> |
|
Brad Chen
2012/01/28 01:00:52
Please ask an HTML person to review this.
|
| + <head> |
| + <title>dlopen test</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'><input type='textarea' size='64' name='inputtext' /><INPUT TYPE='button' NAME='button' Value='ASK!' onClick='askBall()'></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'); |
| + |
| + } |
| + </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 |