index.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <html>
  2. <!--
  3. Copyright 2010 The Closure Library Authors. All Rights Reserved.
  4. Use of this source code is governed by the Apache License, Version 2.0.
  5. See the COPYING file for details.
  6. -->
  7. <head>
  8. <script src="../../base.js"></script>
  9. <script src="xpcdemo.js"></script>
  10. <script>
  11. if (!window.location.href.match(/suppressinit/)) {
  12. initOuter();
  13. }
  14. </script>
  15. <style type="text/css">
  16. body, td {
  17. background-color: #eeeeff;
  18. font-family: arial,verdana,sans-serif;
  19. font-size: 12px;
  20. }
  21. </style>
  22. </head>
  23. <body>
  24. <table border=0 width="100%" height="100%"><tr><td width="50%" valign="top">
  25. <p>
  26. this page: <b><script type="text/javascript">document.write(location.href)</script></b>
  27. </p>
  28. <p>
  29. select transport:<br/>
  30. <a href="?">Auto</a> |
  31. <a href="?tp=1">Native messaging</a> |
  32. <a href="?tp=2">Frame element method</a> |
  33. <a href="?tp=3">Iframe relay</a> |
  34. <a href="?tp=4">Iframe polling</a> |
  35. <!--a href="?tp=5">Flash</a-->
  36. <a href="?tp=6">Fragment URL</a>
  37. <p/>
  38. <div id="inactive">
  39. <input type="button" onclick="xpcdemo.initOuter();" value="create peer"/><br/>
  40. </div>
  41. <div id="active" style="display:none";>
  42. <input type="button" onclick="xpcdemo.teardown();" value="destroy peer"/><br/>
  43. <input type="button" onclick="xpcdemo.peerIframe.parentNode.removeChild(xpcdemo.peerIframe);" value="remove iframe"/> (without letting the channel know!)<br/>
  44. <br/>
  45. <input type="button" value="ping" onclick="xpcdemo.ping();"/><br/>
  46. <input type="button" value="send n msgs" onclick="numMsgs = parseInt(document.getElementById('num').value); xpcdemo.sendN(isNaN(numMsgs) ? 10 : numMsgs);"/>
  47. (n = <input type="text" size=3 value=10 id="num" />)<br/>
  48. mousemove-forwarding:
  49. <input type="button" onclick="xpcdemo.startMousemoveForwarding();" value="start"/>
  50. <input type="button" onclick="xpcdemo.stopMousemoveForwarding();" value="stop"/>
  51. <div id="clickfwd" style="padding:5px; width:200px; cursor:pointer; border: 1px #000000 solid;">Click me!</div>
  52. <br/>
  53. <input id="msgtext" type="text" value="Hello from outer frame." style="width:200px"/>
  54. <input type="button" value="Send" onclick="xpcdemo.channel.send('log', document.getElementById('msgtext').value);"/>
  55. </div>
  56. <br/><br/>
  57. Out [<a href="#" onclick="document.getElementById('console').innerHTML = ''; return false;">clear</a>]: <br/>
  58. <div id="console" style="border:1px #000000 solid;"></div>
  59. </td><td width="50%" valign="top" id="iframeContainer">
  60. </td></tr></table>
  61. </body>
  62. </html>