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