This repository has been archived by the owner on Dec 4, 2017. It is now read-only.
forked from mixedpuppy/socialapi-demo
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathflyout.html
45 lines (41 loc) · 1.46 KB
/
flyout.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html>
<head>
<link id="siteicon" rel="icon" href="/icon.png"/>
<title>Something Interesting</title>
<script>
function onLoad() {
var worker = navigator.mozSocial.getWorker();
if (worker) {
document.body.style.background = "green";
} else {
document.body.style.background = "red";
}
}
window.addEventListener("DOMWindowClose", function(e) {
dump("DOMWindowClose in panel...\n");
}, false);
window.addEventListener("close", function(e) {
dump("onclose in panel...\n");
}, false);
window.addEventListener("scroll", function(e) {
dump("scrolling flyout...\n");
}, false);
window.addEventListener("socialFrameShow", function(e) {
dump("flyout window has been shown, visibility is "+document.visibilityState+" or "+navigator.mozSocial.isVisible+"\n");
}, false);
window.addEventListener("socialFrameHide", function(e) {
dump("flyout window has been hidden, visibility is "+document.visibilityState+" or "+navigator.mozSocial.isVisible+"\n");
}, false);
function doClose() {
dump("trying to close myself with "+window.close+"\n");
window.close();
}
</script>
</head>
<body onload="onLoad()" style="background: white">
<h3>This is a flyout window</h3>
<button onclick="doClose()">close panel</button>
<a href="http://www.caraveo.com">test link</a>
</body>
</html>