GT2/GT2-Android/node_modules/winchan/example/index.html

58 lines
1.2 KiB
HTML

<!DOCTYPE html>
<html>
<body>
<p>
hi! this is a simple webpage that uses winchan to open a window with
parameters. There are a couple different features of the library you can
manually excercise here:
<br/>
<button id="open">open the window</button>
<br/>
<button id="close">close the window programatically</button>
<br/>
<button id="focus">re-focus the window programatically</button>
</p>
<p>Here&apos;s the response from the window:</p>
<pre>
</pre>
</body>
<script src="../winchan.js"></script>
<script src="jquery.js"></script>
<script>
var w;
$("#open").click(function(e) {
$("pre").text("");
e.preventDefault();
w = WinChan.open({
url: "http://127.0.0.1:8200/example/child.html",
relay_url: "http://127.0.0.1:8200/relay.html",
window_features: "menubar=0,location=0,resizable=0,scrollbars=0,status=0,dialog=1,width=700,height=375",
params: {
these: "things",
are: "input parameters",
the: "interface",
is_beautiful: true,
timestamp: new Date().toString()
}
},
function(err, r) {
$("pre").text("error: " + err + "\n\nresponse: " + JSON.stringify(r, null, " "));
});
});
$("#close").click(function(e) {
w.close();
});
$("#focus").click(function(e) {
w.focus();
});
</script>
</html>