-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathsidebar.htm
102 lines (90 loc) · 4.7 KB
/
sidebar.htm
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!DOCTYPE html>
<html x-manifest="appcache.manifest">
<head>
<title>DemoSocialService</title>
<link id="siteicon" rel="icon" href="firefox.png"/>
<link rel="stylesheet" href="sidebar.css"/>
<script src="js/jquery-1.11.1.min.js" type="application/javascript"></script>
<script src="sidebar.js" type="application/javascript"></script>
<script>
function goTo(url) { window.open(url, "shareWindow"); }
function doSettings() {
var win = window.open("/settings.html", "settingsWindow", "dialog=yes, width=300px, height=200px");
win.addEventListener("unload", function() {
dump("data: ["+win.results+"]\n");
});
}
function doShare() {
navigator.mozSocial.share({
url: "https://www.mozilla.org",
image: "https://mozorg.cdn.mozilla.net/media/img/home/firefox.png",
title: "Doing good is part of our code",
description: "Producers of awesome stuff!"
});
}
</script>
</head>
<body onload="onLoad()" contextmenu="mymenu">
<menu type="context" id="mymenu">
<menu label="Share on...">
<menuitem label="Twitter" icon="http://www.twitter.com/favicons/favicon.png"
onclick="goTo('//twitter.com/intent/tweet?text=' + document.title + ': ' + window.location.href);"></menuitem>
<menuitem label="Facebook" icon="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAAX0lEQVQ4jWP4%2F%2F8%2FAyUYTFhHzjgDxP9JxGeQDSBVMxgTbUBCxer%2Fr999%2BQ8DJBuArJksA9A10s8AXIBoA0B%2BR%2FY%2FjD%2BEwoBoA1yT5v3PbdmCE8MAshhID%2FUMoDgzUYIBj0Cgi7ar4coAAAAASUVORK5CYII%3D"
onclick="goTo('//facebook.com/sharer/sharer.php?u=' + window.location.href);"></menuitem>
</menu>
<menuitem label="Settings" onclick="doSettings();"></menuitem>
</menu>
<div id="header">
<div id="signin">
<img src="https://developer.mozilla.org/files/3967/plain_sign_in_black.png" onclick="signin()"/>
<div id="signin_error"></div>
</div>
<div id="useridbox" style="display:none">Signed in as <div id="userid"></div>
</div>
<div id="usericonbox" style="display:none">
<img id="usericon">
</div>
<div id="usernotifbox" style="display:none">
<img id="usernotif">
</div>
</div>
<div id="content" style="display:none">
<p>SocialAPI Feature Demo/Testing.</p>
<button onclick="signout()">signout</button>
<ul id="testbuttons">
<li><button onclick="doSettings()">Popup Window</button></li>
<li><button onclick="updateManifest()">Update Manifest</button> <span id="version"></span></li>
<li><button onclick="changeusers()">Change User</button></li>
<li><button onclick="openChat(event)" title="open a chat window">Chat Panel</button></li>
<li><button onclick="doShare()">Share something</button></li>
<li><button onclick="notify('link')">Notify Link</button></li>
<li><button onclick="notify('chat-request')">Request Chat via Worker</button></li>
<li><button onclick="location.reload()">reload sidebar</button></li>
<li><button onclick="workerReload()">reload the worker</button></li>
<li><button onclick="testPermissionPrompt()">test permission prompt</button></li>
</ul>
<div id="hovertest" style="margin: 4px; border: 1px solid grey; height: 75px; overflow: hidden; overflow-y: scroll">
Flyout Hover Test
<ul>
<li><button onmouseover="openPanel(this)" value="Today!">Open</button><button onmouseover="closePanel()">Close</button></li>
<li><button onmouseover="openPanel(this)" value="Tomorrow!">Open</button><button onmouseover="closePanel()">Close</button></li>
<li><button onmouseover="openPanel(this)" value="Yesterday!">Open</button><button onmouseover="closePanel()">Close</button></li>
<li><button onmouseover="openPanel(this)" value="no">Open</button><button onmouseover="closePanel()">Close</button></li>
<li><button onmouseover="openPanel(this)" value="yes">Open</button><button onmouseover="closePanel()">Close</button></li>
<li><button onmouseover="openPanel(this)" value="maybe">Open</button><button onmouseover="closePanel()">Close</button></li>
<li><button onmouseover="openPanel(this)" value="try again">Open</button><button onmouseover="closePanel()">Close</button></li>
<li><button onmouseover="openPanel(this)" value="whatever">Open</button><button onmouseover="closePanel()">Close</button></li>
</ul>
</div>
<ul>These links should open in tabs:
<li><a href="http://www.mozilla.org" target="_blank">external _blank</a></li>
<li><a href="http://www.mozilla.org" target="_content">external social</a></li>
<li><a href="http://www.mozilla.org">external none</a></li>
<li><a href="http://www.mozilla.org" onclick="window.open(this.getAttribute('href'),'socialtab').focus(); return false;">external onclick</a></li>
</ul>
<div>Shared: <div id="shared" class="textbox"></div></div>
<div>Host: <div id="domain" class="textbox"></div></div>
<input />
</div>
</body>
</html>