| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
| 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| 3 <html xmlns="http://www.w3.org/1999/xhtml"> | |
| 4 <!-- | |
| 5 Copyright (c) 2009 The Native Client Authors. All rights reserved. | |
| 6 Use of this source code is governed by a BSD-style license that can be | |
| 7 found in the LICENSE file. | |
| 8 --> | |
| 9 <head> | |
| 10 <title> Pepper Plugin Demo </title> | |
| 11 <META HTTP-EQUIV="Pragma" CONTENT="no-cache" /> | |
| 12 <META HTTP-EQUIV="Expires" CONTENT="-1" /> | |
| 13 </head> | |
| 14 | |
| 15 <body style="background-image:url(nacl.png); background-repeat:repeat;" | |
| 16 onload="nacllib.waitForModulesAndRunTests();" | |
| 17 onunload="nacllib.cleanUp();"> | |
| 18 | |
| 19 <p> | |
| 20 This page embeds a NaCl module for testing Pepper. | |
| 21 </p> | |
| 22 <table summary="Pepper Plugin 2d and 3d Demo"> | |
| 23 <tr> | |
| 24 <td valign="middle" align="center" width="10%" style="background-color:Silver"> | |
| 25 2D | |
| 26 </td> | |
| 27 <td valign="top" width="45%"> | |
| 28 <embed name="nacl_module" | |
| 29 id="plugin_2d" | |
| 30 type="application/x-nacl" | |
| 31 src="pepper_plugin.nexe" | |
| 32 width="400" | |
| 33 height="400" | |
| 34 dimensions="2" /> | |
| 35 </td> | |
| 36 <td valign="top" style="background-color:Silver" width="45%"> | |
| 37 <div id="event_text_box_2d" style="width:400px; height:400px; overflow:auto"> | |
| 38 </div> | |
| 39 </td> | |
| 40 </tr> | |
| 41 <tr> | |
| 42 <td valign="middle" align="center" width="10%" style="background-color:Silver"> | |
| 43 3D | |
| 44 </td> | |
| 45 <td valign="top" width="45%"> | |
| 46 <embed name="nacl_module" | |
| 47 id="plugin_3d" | |
| 48 type="application/x-nacl" | |
| 49 src="pepper_plugin.nexe" | |
| 50 width="400" | |
| 51 height="400" | |
| 52 dimensions="3" /> | |
| 53 </td> | |
| 54 <td valign="top" style="background-color:Silver" width="45%"> | |
| 55 <div id="event_text_box_3d" style="width:400px; height:400px; overflow:auto"> | |
| 56 </div> | |
| 57 </td> | |
| 58 </tr> | |
| 59 </table> | |
| 60 | |
| 61 <div id="status">NO-STATUS</div> | |
| 62 | |
| 63 <script type="text/javascript" src="nacl_js_lib.js"></script> | |
| 64 <script type="text/javascript"> | |
| 65 //<![CDATA[ | |
| 66 var nacllib = new NaclLib("nacl_module", "status", 1000); | |
| 67 | |
| 68 // we use a custom detector for whether a module is ready or not | |
| 69 nacllib.numModulesReady = function(modules) { | |
| 70 var count = 0; | |
| 71 for (var i = 0; i < modules.length; i++) { | |
| 72 try { | |
| 73 var foo = modules[i].moduleReady(); | |
| 74 count += 1; | |
| 75 } catch(e) { | |
| 76 // do nothing | |
| 77 } | |
| 78 } | |
| 79 return count; | |
| 80 }; | |
| 81 | |
| 82 // we use a custom detector for whether a module is ready or not | |
| 83 nacllib.areTherePluginProblems = function(modules) { | |
| 84 return 0; | |
| 85 }; | |
| 86 | |
| 87 // The div where we report the events. | |
| 88 var event_box_2d = null; | |
| 89 var event_box_3d = null; | |
| 90 | |
| 91 // The javascript functions to add a line to the div. | |
| 92 var addLine2d = function(line) { | |
| 93 event_box_2d.innerHTML = line + '<br>' + event_box_2d.innerHTML; | |
| 94 } | |
| 95 | |
| 96 var addLine3d = function(line) { | |
| 97 event_box_3d.innerHTML = line + '<br>' + event_box_3d.innerHTML; | |
| 98 } | |
| 99 | |
| 100 nacllib.test = function() { | |
| 101 event_box_2d = document.getElementById("event_text_box_2d");; | |
| 102 event_box_3d = document.getElementById("event_text_box_3d");; | |
| 103 var plugin_obj_2d = document.getElementById("plugin_2d"); | |
| 104 var plugin_obj_3d = document.getElementById("plugin_3d"); | |
| 105 // Add the banner to the top of the event log. | |
| 106 addLine2d('<b>Event log</b>'); | |
| 107 addLine3d('<b>Event log</b>'); | |
| 108 // Set the plugin to report events to the event log. | |
| 109 plugin_obj_2d.setTextBox(addLine2d); | |
| 110 plugin_obj_3d.setTextBox(addLine3d); | |
| 111 // Return success. | |
| 112 return ""; | |
| 113 }; | |
| 114 //]]> | |
| 115 </script> | |
| 116 | |
| 117 </body> | |
| 118 </html> | |
| OLD | NEW |