Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Namespace DOM elements and CSS styling.

  • Loading branch information...
commit 13ca56f9e5b2198e2ae3a0e5b9ba49cad63788b2 1 parent 92526f0
Connor Dunn authored
16 firefox/chrome/content/ff-overlay.xul
@@ -6,18 +6,18 @@
6 6 <xul:toolbarpalette id="BrowserToolbarPalette">
7 7 <xul:toolbarbutton id="tabcloud-toolbar-button" class="toolbarbutton-1"
8 8 label="TabCloud" type="panel">
9   - <xul:panel id="tabcloudpanel" style="width: 314px; background-color: rgba(0,0,0,0); border: 0; margin-left: -250px;" onpopuphidden="tabcloud.onHide()" onpopupshowing="tabcloud.onShow()">
  9 + <xul:panel id="tabcloud-panel" style="width: 314px; background-color: rgba(0,0,0,0); border: 0; margin-left: -250px;" onpopuphidden="tabcloud.onHide()" onpopupshowing="tabcloud.onShow()">
10 10 <div style="-moz-border-radius: 5px; border: 1px solid #b2b2b2; background-color: white; margin: 5px; padding: 2px; -moz-box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.15);" >
11   - <div id="scroll">
12   - <div id="current">
  11 + <div id="tabcloud-scroll">
  12 + <div id="tabcloud-current">
13 13 </div>
14   - <div id="saved"></div>
  14 + <div id="tabcloud-saved"></div>
15 15 </div>
16   - <div class="info" style="font-size: 0.7em;">
17   - <div id="tips" style="position: relative; height: 1em; " class="innerfade">
18   - <span style="z-index: 4; position: absolute; display: block;">TabCloud FireFox Beta, <a onclick="gBrowser.selectedTab = gBrowser.addTab('http://chrometabcloud.appspot.com/'); document.getElementById('tabcloudpanel').hidePopup(); return false" href="" id="logoutlink">click to give feedback</a>.</span>
  16 + <div class="tabcloud-info" style="font-size: 0.7em;">
  17 + <div id="tabcloud-tips" style="position: relative; height: 1em; " class="innerfade">
  18 + <span style="z-index: 4; position: absolute; display: block;">TabCloud FireFox Beta, <a onclick="gBrowser.selectedTab = gBrowser.addTab('http://chrometabcloud.appspot.com/'); document.getElementById('tabcloud-panel').hidePopup(); return false" href="" id="tabcloud-logoutlink">click to give feedback</a>.</span>
19 19 </div>
20   - <a onclick="gBrowser.selectedTab = gBrowser.addTab('https://chrometabcloud.appspot.com/logout'); document.getElementById('tabcloudpanel').hidePopup(); return false" href="" id="logoutlink">Logout</a>
  20 + <a onclick="gBrowser.selectedTab = gBrowser.addTab('https://chrometabcloud.appspot.com/logout'); document.getElementById('tabcloud-panel').hidePopup(); return false" href="" id="tabcloud-logoutlink">Logout</a>
21 21 </div>
22 22 </div>
23 23 </xul:panel>
85 firefox/chrome/content/overlay.js
@@ -2,32 +2,41 @@ var tabcloud = {
2 2 xhr: undefined,
3 3 editing: undefined,
4 4 onLoad: function() {
5   - // initialization code
6   - this.initialized = true;
7   - try {
8   - var myId = "tabcloud-toolbar-button"; // ID of button to add
9   - var afterId = "urlbar-container"; // ID of element to insert after
10   - var navBar = document.getElementById("nav-bar");
11   - var curSet = navBar.currentSet.split(",");
12   - if (curSet.indexOf(myId) == -1 && document.getElementById(myId) === null) {
13   - var pos = curSet.indexOf(afterId) + 1 || curSet.length;
14   - var set = curSet.slice(0, pos).concat(myId).concat(curSet.slice(pos));
  5 + function firstRun(extensions) {
  6 + extension = extensions.get('tabcloud@firefox.connorhd.co.uk');
15 7
16   - navBar.setAttribute("currentset", set.join(","));
17   - navBar.currentSet = set.join(",");
18   - document.persist(navBar.id, "currentset");
  8 + if (extension.firstRun) {
19 9 try {
20   - BrowserToolboxCustomizeDone(true);
  10 + var myId = "tabcloud-toolbar-button"; // ID of button to add
  11 + var afterId = "urlbar-container"; // ID of element to insert after
  12 + var navBar = document.getElementById("nav-bar");
  13 + var curSet = navBar.currentSet.split(",");
  14 + if (curSet.indexOf(myId) == -1 && document.getElementById(myId) === null) {
  15 + var pos = curSet.indexOf(afterId) + 1 || curSet.length;
  16 + var set = curSet.slice(0, pos).concat(myId).concat(curSet.slice(pos));
  17 +
  18 + navBar.setAttribute("currentset", set.join(","));
  19 + navBar.currentSet = set.join(",");
  20 + document.persist(navBar.id, "currentset");
  21 + try {
  22 + BrowserToolboxCustomizeDone(true);
  23 + }
  24 + catch (e) {}
  25 + }
21 26 }
22   - catch (e) {}
  27 + catch(e) {}
23 28 }
24 29 }
25   - catch(e) {}
  30 +
  31 + if (Application.extensions)
  32 + firstRun(extensions);
  33 + else
  34 + Application.getExtensions(firstRun);
26 35 },
27 36
28 37 hideSaved: function () {
29   - while (document.getElementById('saved').hasChildNodes()) {
30   - document.getElementById('saved').removeChild(document.getElementById('saved').lastChild);
  38 + while (document.getElementById('tabcloud-saved').hasChildNodes()) {
  39 + document.getElementById('tabcloud-saved').removeChild(document.getElementById('tabcloud-saved').lastChild);
31 40 }
32 41 },
33 42
@@ -35,15 +44,15 @@ var tabcloud = {
35 44 var xhtmlNS = 'http://www.w3.org/1999/xhtml';
36 45 this.hideSaved();
37 46 var domInfo = document.createElementNS(xhtmlNS, 'div');
38   - domInfo.className = 'info';
  47 + domInfo.className = 'tabcloud-info';
39 48 domInfo.textContent = text;
40   - document.getElementById('saved').appendChild(domInfo);
  49 + document.getElementById('tabcloud-saved').appendChild(domInfo);
41 50 },
42 51
43 52 onHide: function() {
44 53 this.hideSaved();
45   - while (document.getElementById('current').hasChildNodes()) {
46   - document.getElementById('current').removeChild(document.getElementById('current').lastChild);
  54 + while (document.getElementById('tabcloud-current').hasChildNodes()) {
  55 + document.getElementById('tabcloud-current').removeChild(document.getElementById('tabcloud-current').lastChild);
47 56 }
48 57 if (this.xhr) {
49 58 try {
@@ -68,7 +77,7 @@ var tabcloud = {
68 77 if (data.status == 'loggedout') {
69 78 tabcloud.hideSaved();
70 79 var domInfo = document.createElementNS(xhtmlNS, 'div');
71   - domInfo.className = 'info';
  80 + domInfo.className = 'tabcloud-info';
72 81 domInfo.textContent = 'TabCloud requires you login to load your saved windows';
73 82
74 83 var domInfoLink = document.createElementNS(xhtmlNS, 'a');
@@ -77,12 +86,12 @@ var tabcloud = {
77 86 domInfoLink.style.display = 'block';
78 87 domInfoLink.onclick = function () {
79 88 gBrowser.selectedTab = gBrowser.addTab('https://chrometabcloud.appspot.com/login');
80   - document.getElementById('tabcloudpanel').hidePopup();
  89 + document.getElementById('tabcloud-panel').hidePopup();
81 90 return false;
82 91 }
83 92 domInfo.appendChild(domInfoLink);
84 93
85   - document.getElementById('saved').appendChild(domInfo);
  94 + document.getElementById('tabcloud-saved').appendChild(domInfo);
86 95 } else {
87 96 tabcloud.hideSaved();
88 97 var windowIdCounter = 0;
@@ -90,11 +99,11 @@ var tabcloud = {
90 99 var windowId = windowIdCounter++;
91 100 // Create window box
92 101 var domWindow = document.createElementNS(xhtmlNS, 'fieldset');
93   - domWindow.className = 'window';
  102 + domWindow.className = 'tabcloud-window';
94 103
95 104 // Create window box title
96 105 var domWindowLegend = document.createElementNS(xhtmlNS, 'legend');
97   - domWindowLegend.className = 'windowname';
  106 + domWindowLegend.className = 'tabcloud-windowname';
98 107 // TODO: Window name helper + escape
99 108 domWindowLegend.textContent = win.name;
100 109 domWindow.appendChild(domWindowLegend);
@@ -158,7 +167,7 @@ var tabcloud = {
158 167
159 168 // Add buttons
160 169 var domWindowButtons = document.createElementNS(xhtmlNS, 'span');
161   - domWindowButtons.className = 'right';
  170 + domWindowButtons.className = 'tabcloud-right';
162 171 domWindow.appendChild(domWindowButtons);
163 172
164 173 // Delete button
@@ -212,7 +221,7 @@ var tabcloud = {
212 221
213 222 // Tabs
214 223 var domTabs = document.createElementNS(xhtmlNS, 'div');
215   - domTabs.className = 'tabs';
  224 + domTabs.className = 'tabcloud-tabs';
216 225 domWindow.appendChild(domTabs);
217 226
218 227 win.tabs.forEach(function (tab) {
@@ -223,7 +232,7 @@ var tabcloud = {
223 232 else
224 233 domTab.src = 'chrome://tabcloud/content/images/page_white.png';
225 234
226   - domTab.className = 'tabimg';
  235 + domTab.className = 'tabcloud-tabimg';
227 236 domTab.onerror = function () {
228 237 domTab.src = 'chrome://tabcloud/content/images/page_white.png';
229 238 };
@@ -245,7 +254,7 @@ var tabcloud = {
245 254 domTabs.appendChild(domTabTooltip);
246 255 });
247 256
248   - document.getElementById('saved').appendChild(domWindow);
  257 + document.getElementById('tabcloud-saved').appendChild(domWindow);
249 258 });
250 259 }
251 260 } catch (e) {
@@ -286,11 +295,11 @@ var tabcloud = {
286 295
287 296 // Create window box
288 297 var domWindow = document.createElementNS(xhtmlNS, 'fieldset');
289   - domWindow.className = 'window';
  298 + domWindow.className = 'tabcloud-window';
290 299
291 300 // Create window box title
292 301 var domWindowLegend = document.createElementNS(xhtmlNS, 'legend');
293   - domWindowLegend.className = 'windowname';
  302 + domWindowLegend.className = 'tabcloud-windowname';
294 303 // TODO: Window name helper + escape
295 304 if (data.name)
296 305 domWindowLegend.textContent = data.name;
@@ -342,7 +351,7 @@ var tabcloud = {
342 351
343 352 // Add buttons
344 353 var domWindowButtons = document.createElementNS(xhtmlNS, 'span');
345   - domWindowButtons.className = 'right';
  354 + domWindowButtons.className = 'tabcloud-right';
346 355 domWindow.appendChild(domWindowButtons);
347 356
348 357 // Open button
@@ -382,7 +391,7 @@ var tabcloud = {
382 391
383 392 // Tabs
384 393 var domTabs = document.createElementNS(xhtmlNS, 'div');
385   - domTabs.className = 'tabs';
  394 + domTabs.className = 'tabcloud-tabs';
386 395 domWindow.appendChild(domTabs);
387 396
388 397 data.tabs = [];
@@ -403,7 +412,7 @@ var tabcloud = {
403 412 favicon: (fis.getFaviconImageForPage(uri).spec != '' && fis.getFaviconImageForPage(uri).spec !== undefined) ? fis.getFaviconImageForPage(uri).spec.substring(17) : ''
404 413 });
405 414
406   - domTab.className = 'tabimg';
  415 + domTab.className = 'tabcloud-tabimg';
407 416 domTab.onerror = function () {
408 417 domTab.src = 'chrome://tabcloud/content/images/page_white.png';
409 418 };
@@ -427,11 +436,11 @@ var tabcloud = {
427 436 } catch(e) {}
428 437 }
429 438
430   - document.getElementById('current').appendChild(domWindow);
  439 + document.getElementById('tabcloud-current').appendChild(domWindow);
431 440 })()
432 441 }
433 442 tabcloud.loadRemote();
434 443 }
435 444 };
436 445
437   -window.addEventListener("load", function () { tabcloud.onLoad() }, false);
  446 +window.addEventListener("load", function () { tabcloud.onLoad() }, false);
29 firefox/chrome/skin/overlay.css
@@ -13,66 +13,63 @@
13 13 -moz-box-orient: horizontal;
14 14 }
15 15
16   -#tabcloudpanel #scroll {
  16 +#tabcloud-panel #tabcloud-scroll {
17 17 max-height: 500px;
18 18 overflow-x: hidden;
19 19 overflow-y: scroll;
20 20 }
21   -#tabcloudpanel * {
  21 +#tabcloud-panel * {
22 22 margin: 0;
23 23 padding: 0;
24 24 }
25   -#tabcloudpanel {
  25 +#tabcloud-panel {
26 26 font-family: sans-serif;
27 27 font-size: 1.2em;
28 28 }
29   -#tabcloudpanel .window {
  29 +#tabcloud-panel .tabcloud-window {
30 30 border: 1px solid #ccc;
31 31 -moz-border-radius: 5px;
32 32 margin: 5px;
33 33 padding: 5px;
34 34 }
35   -#tabcloudpanel .window legend {
  35 +#tabcloud-panel .tabcloud-window legend {
36 36 padding: 0 2px;
37 37 background-color: white;
38 38 }
39   -#tabcloudpanel .tabs img {
  39 +#tabcloud-panel .tabcloud-tabs img {
40 40 margin: 2px;
41 41 width: 16px;
42 42 height: 16px;
43 43 }
44   -#tabcloudpanel .tabs deck {
  44 +#tabcloud-panel .tabcloud-tabs deck {
45 45 width: 20px;
46 46 height: 20px;
47 47 }
48   -#tabcloudpanel #current {
  48 +#tabcloud-panel #tabcloud-current {
49 49 border-bottom: 1px solid black;
50 50 }
51   -#tabcloudpanel .info {
  51 +#tabcloud-panel .tabcloud-info {
52 52 border: 1px solid #ccc;
53 53 -moz-border-radius: 5px;
54 54 margin: 5px;
55 55 text-align: center;
56 56 padding: 10px;
57 57 }
58   -#tabcloudpanel .right {
  58 +#tabcloud-panel .tabcloud-right {
59 59 float: right;
60 60 margin-top: -22px;
61 61 background-color: white;
62 62 padding: 2px;
63 63 cursor: pointer;
64 64 }
65   -#tabcloudpanel .decryptpass {
66   - width: 150px !important;
67   -}
68 65
69   -#tabcloudpanel #tips span {
  66 +#tabcloud-panel #tabcloud-tips span {
70 67 width: 100%;
71 68 }
72   -#tabcloudpanel #tips {
  69 +#tabcloud-panel #tabcloud-tips {
73 70 margin-bottom: 3px;
74 71 }
75   -#tabcloudpanel a {
  72 +#tabcloud-panel a {
76 73 text-decoration: underline;
77 74 color: #0000ee;
78 75 }
2  firefox/install.rdf
@@ -6,7 +6,7 @@
6 6 <em:name>TabCloud</em:name>
7 7 <em:iconURL>chrome://tabcloud/content/icon.png</em:iconURL>
8 8 <em:icon64URL>chrome://tabcloud/content/icon64.png</em:icon64URL>
9   - <em:version>0.5</em:version>
  9 + <em:version>0.6</em:version>
10 10 <em:creator>Connor Dunn</em:creator>
11 11 <em:contributor></em:contributor>
12 12 <em:description>Save and restore window sessions over time and across multiple computers.</em:description>

0 comments on commit 13ca56f

Please sign in to comment.
Something went wrong with that request. Please try again.