OLD | NEW |
1 <body style="background-image:url(http://www.google.com/intl/en_ALL/images/logo.
gif); | 1 <body style="background-image:url(http://www.google.com/intl/en_ALL/images/logo.
gif); |
2 background-repeat:repeat"> | 2 background-repeat:repeat" |
| 3 onload="SetPluginSize(400, 400)"> |
3 | 4 |
4 <script type="text/javascript"> | 5 <script type="text/javascript"> |
| 6 isPluginDefaultSize = true; |
| 7 |
5 function Test() { | 8 function Test() { |
6 plugin = document.getElementById('plugin'); | 9 plugin = document.getElementById('plugin'); |
7 // Confirm that this no longer segfaults. | 10 // Confirm that this no longer segfaults. |
8 alert(plugin.toString(new Array(10))); | 11 alert(plugin.toString(new Array(10))); |
9 } | 12 } |
10 | 13 |
| 14 function SetPluginSize(width, height) { |
| 15 plugin = document.getElementById('plugin'); |
| 16 size = document.getElementById('size'); |
| 17 plugin.width = width; |
| 18 plugin.height = height; |
| 19 size.innerHTML = "Height: " + plugin.width + ' Width: ' + plugin.height; |
| 20 } |
| 21 |
| 22 function ToggleSize() { |
| 23 if (!isPluginDefaultSize) { |
| 24 SetPluginSize(400, 400); |
| 25 isPluginDefaultSize = true; |
| 26 } else { |
| 27 SetPluginSize(1000, 800); |
| 28 isPluginDefaultSize = false; |
| 29 } |
| 30 } |
11 </script> | 31 </script> |
12 | 32 |
13 <button onclick='Test()'>Test</button> | 33 <button onclick='Test()'>Test</button> |
14 <div id="fps" style="background-color:white; font-weight:bold; padding:4px;">F
PS GOES HERE</div> | 34 <button onclick='ToggleSize()'>Toggle Size</button> |
15 <object id="plugin" type="application/x-ppapi-example" width="400" height="400
" /> | 35 <div id="fps" style="background-color:white; font-weight:bold; padding:4px; wi
dth:200px;">FPS GOES HERE</div> |
| 36 <div id="size" style="background-color:white; font-weight:bold; padding:4px; w
idth:200px;"></div> |
| 37 <object id="plugin" type="application/x-ppapi-example" width="400" height="400
" border="2px"></object> |
16 <hr> | 38 <hr> |
17 </body> | 39 </body> |
OLD | NEW |