Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Namespace DOM elements and CSS styling.

  • Loading branch information...
commit 13ca56f9e5b2198e2ae3a0e5b9ba49cad63788b2 1 parent 92526f0
@Connorhd authored
View
16 firefox/chrome/content/ff-overlay.xul
@@ -6,18 +6,18 @@
<xul:toolbarpalette id="BrowserToolbarPalette">
<xul:toolbarbutton id="tabcloud-toolbar-button" class="toolbarbutton-1"
label="TabCloud" type="panel">
- <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()">
+ <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()">
<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);" >
- <div id="scroll">
- <div id="current">
+ <div id="tabcloud-scroll">
+ <div id="tabcloud-current">
</div>
- <div id="saved"></div>
+ <div id="tabcloud-saved"></div>
</div>
- <div class="info" style="font-size: 0.7em;">
- <div id="tips" style="position: relative; height: 1em; " class="innerfade">
- <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>
+ <div class="tabcloud-info" style="font-size: 0.7em;">
+ <div id="tabcloud-tips" style="position: relative; height: 1em; " class="innerfade">
+ <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>
</div>
- <a onclick="gBrowser.selectedTab = gBrowser.addTab('https://chrometabcloud.appspot.com/logout'); document.getElementById('tabcloudpanel').hidePopup(); return false" href="" id="logoutlink">Logout</a>
+ <a onclick="gBrowser.selectedTab = gBrowser.addTab('https://chrometabcloud.appspot.com/logout'); document.getElementById('tabcloud-panel').hidePopup(); return false" href="" id="tabcloud-logoutlink">Logout</a>
</div>
</div>
</xul:panel>
View
85 firefox/chrome/content/overlay.js
@@ -2,32 +2,41 @@ var tabcloud = {
xhr: undefined,
editing: undefined,
onLoad: function() {
- // initialization code
- this.initialized = true;
- try {
- var myId = "tabcloud-toolbar-button"; // ID of button to add
- var afterId = "urlbar-container"; // ID of element to insert after
- var navBar = document.getElementById("nav-bar");
- var curSet = navBar.currentSet.split(",");
- if (curSet.indexOf(myId) == -1 && document.getElementById(myId) === null) {
- var pos = curSet.indexOf(afterId) + 1 || curSet.length;
- var set = curSet.slice(0, pos).concat(myId).concat(curSet.slice(pos));
+ function firstRun(extensions) {
+ extension = extensions.get('tabcloud@firefox.connorhd.co.uk');
- navBar.setAttribute("currentset", set.join(","));
- navBar.currentSet = set.join(",");
- document.persist(navBar.id, "currentset");
+ if (extension.firstRun) {
try {
- BrowserToolboxCustomizeDone(true);
+ var myId = "tabcloud-toolbar-button"; // ID of button to add
+ var afterId = "urlbar-container"; // ID of element to insert after
+ var navBar = document.getElementById("nav-bar");
+ var curSet = navBar.currentSet.split(",");
+ if (curSet.indexOf(myId) == -1 && document.getElementById(myId) === null) {
+ var pos = curSet.indexOf(afterId) + 1 || curSet.length;
+ var set = curSet.slice(0, pos).concat(myId).concat(curSet.slice(pos));
+
+ navBar.setAttribute("currentset", set.join(","));
+ navBar.currentSet = set.join(",");
+ document.persist(navBar.id, "currentset");
+ try {
+ BrowserToolboxCustomizeDone(true);
+ }
+ catch (e) {}
+ }
}
- catch (e) {}
+ catch(e) {}
}
}
- catch(e) {}
+
+ if (Application.extensions)
+ firstRun(extensions);
+ else
+ Application.getExtensions(firstRun);
},
hideSaved: function () {
- while (document.getElementById('saved').hasChildNodes()) {
- document.getElementById('saved').removeChild(document.getElementById('saved').lastChild);
+ while (document.getElementById('tabcloud-saved').hasChildNodes()) {
+ document.getElementById('tabcloud-saved').removeChild(document.getElementById('tabcloud-saved').lastChild);
}
},
@@ -35,15 +44,15 @@ var tabcloud = {
var xhtmlNS = 'http://www.w3.org/1999/xhtml';
this.hideSaved();
var domInfo = document.createElementNS(xhtmlNS, 'div');
- domInfo.className = 'info';
+ domInfo.className = 'tabcloud-info';
domInfo.textContent = text;
- document.getElementById('saved').appendChild(domInfo);
+ document.getElementById('tabcloud-saved').appendChild(domInfo);
},
onHide: function() {
this.hideSaved();
- while (document.getElementById('current').hasChildNodes()) {
- document.getElementById('current').removeChild(document.getElementById('current').lastChild);
+ while (document.getElementById('tabcloud-current').hasChildNodes()) {
+ document.getElementById('tabcloud-current').removeChild(document.getElementById('tabcloud-current').lastChild);
}
if (this.xhr) {
try {
@@ -68,7 +77,7 @@ var tabcloud = {
if (data.status == 'loggedout') {
tabcloud.hideSaved();
var domInfo = document.createElementNS(xhtmlNS, 'div');
- domInfo.className = 'info';
+ domInfo.className = 'tabcloud-info';
domInfo.textContent = 'TabCloud requires you login to load your saved windows';
var domInfoLink = document.createElementNS(xhtmlNS, 'a');
@@ -77,12 +86,12 @@ var tabcloud = {
domInfoLink.style.display = 'block';
domInfoLink.onclick = function () {
gBrowser.selectedTab = gBrowser.addTab('https://chrometabcloud.appspot.com/login');
- document.getElementById('tabcloudpanel').hidePopup();
+ document.getElementById('tabcloud-panel').hidePopup();
return false;
}
domInfo.appendChild(domInfoLink);
- document.getElementById('saved').appendChild(domInfo);
+ document.getElementById('tabcloud-saved').appendChild(domInfo);
} else {
tabcloud.hideSaved();
var windowIdCounter = 0;
@@ -90,11 +99,11 @@ var tabcloud = {
var windowId = windowIdCounter++;
// Create window box
var domWindow = document.createElementNS(xhtmlNS, 'fieldset');
- domWindow.className = 'window';
+ domWindow.className = 'tabcloud-window';
// Create window box title
var domWindowLegend = document.createElementNS(xhtmlNS, 'legend');
- domWindowLegend.className = 'windowname';
+ domWindowLegend.className = 'tabcloud-windowname';
// TODO: Window name helper + escape
domWindowLegend.textContent = win.name;
domWindow.appendChild(domWindowLegend);
@@ -158,7 +167,7 @@ var tabcloud = {
// Add buttons
var domWindowButtons = document.createElementNS(xhtmlNS, 'span');
- domWindowButtons.className = 'right';
+ domWindowButtons.className = 'tabcloud-right';
domWindow.appendChild(domWindowButtons);
// Delete button
@@ -212,7 +221,7 @@ var tabcloud = {
// Tabs
var domTabs = document.createElementNS(xhtmlNS, 'div');
- domTabs.className = 'tabs';
+ domTabs.className = 'tabcloud-tabs';
domWindow.appendChild(domTabs);
win.tabs.forEach(function (tab) {
@@ -223,7 +232,7 @@ var tabcloud = {
else
domTab.src = 'chrome://tabcloud/content/images/page_white.png';
- domTab.className = 'tabimg';
+ domTab.className = 'tabcloud-tabimg';
domTab.onerror = function () {
domTab.src = 'chrome://tabcloud/content/images/page_white.png';
};
@@ -245,7 +254,7 @@ var tabcloud = {
domTabs.appendChild(domTabTooltip);
});
- document.getElementById('saved').appendChild(domWindow);
+ document.getElementById('tabcloud-saved').appendChild(domWindow);
});
}
} catch (e) {
@@ -286,11 +295,11 @@ var tabcloud = {
// Create window box
var domWindow = document.createElementNS(xhtmlNS, 'fieldset');
- domWindow.className = 'window';
+ domWindow.className = 'tabcloud-window';
// Create window box title
var domWindowLegend = document.createElementNS(xhtmlNS, 'legend');
- domWindowLegend.className = 'windowname';
+ domWindowLegend.className = 'tabcloud-windowname';
// TODO: Window name helper + escape
if (data.name)
domWindowLegend.textContent = data.name;
@@ -342,7 +351,7 @@ var tabcloud = {
// Add buttons
var domWindowButtons = document.createElementNS(xhtmlNS, 'span');
- domWindowButtons.className = 'right';
+ domWindowButtons.className = 'tabcloud-right';
domWindow.appendChild(domWindowButtons);
// Open button
@@ -382,7 +391,7 @@ var tabcloud = {
// Tabs
var domTabs = document.createElementNS(xhtmlNS, 'div');
- domTabs.className = 'tabs';
+ domTabs.className = 'tabcloud-tabs';
domWindow.appendChild(domTabs);
data.tabs = [];
@@ -403,7 +412,7 @@ var tabcloud = {
favicon: (fis.getFaviconImageForPage(uri).spec != '' && fis.getFaviconImageForPage(uri).spec !== undefined) ? fis.getFaviconImageForPage(uri).spec.substring(17) : ''
});
- domTab.className = 'tabimg';
+ domTab.className = 'tabcloud-tabimg';
domTab.onerror = function () {
domTab.src = 'chrome://tabcloud/content/images/page_white.png';
};
@@ -427,11 +436,11 @@ var tabcloud = {
} catch(e) {}
}
- document.getElementById('current').appendChild(domWindow);
+ document.getElementById('tabcloud-current').appendChild(domWindow);
})()
}
tabcloud.loadRemote();
}
};
-window.addEventListener("load", function () { tabcloud.onLoad() }, false);
+window.addEventListener("load", function () { tabcloud.onLoad() }, false);
View
29 firefox/chrome/skin/overlay.css
@@ -13,66 +13,63 @@
-moz-box-orient: horizontal;
}
-#tabcloudpanel #scroll {
+#tabcloud-panel #tabcloud-scroll {
max-height: 500px;
overflow-x: hidden;
overflow-y: scroll;
}
-#tabcloudpanel * {
+#tabcloud-panel * {
margin: 0;
padding: 0;
}
-#tabcloudpanel {
+#tabcloud-panel {
font-family: sans-serif;
font-size: 1.2em;
}
-#tabcloudpanel .window {
+#tabcloud-panel .tabcloud-window {
border: 1px solid #ccc;
-moz-border-radius: 5px;
margin: 5px;
padding: 5px;
}
-#tabcloudpanel .window legend {
+#tabcloud-panel .tabcloud-window legend {
padding: 0 2px;
background-color: white;
}
-#tabcloudpanel .tabs img {
+#tabcloud-panel .tabcloud-tabs img {
margin: 2px;
width: 16px;
height: 16px;
}
-#tabcloudpanel .tabs deck {
+#tabcloud-panel .tabcloud-tabs deck {
width: 20px;
height: 20px;
}
-#tabcloudpanel #current {
+#tabcloud-panel #tabcloud-current {
border-bottom: 1px solid black;
}
-#tabcloudpanel .info {
+#tabcloud-panel .tabcloud-info {
border: 1px solid #ccc;
-moz-border-radius: 5px;
margin: 5px;
text-align: center;
padding: 10px;
}
-#tabcloudpanel .right {
+#tabcloud-panel .tabcloud-right {
float: right;
margin-top: -22px;
background-color: white;
padding: 2px;
cursor: pointer;
}
-#tabcloudpanel .decryptpass {
- width: 150px !important;
-}
-#tabcloudpanel #tips span {
+#tabcloud-panel #tabcloud-tips span {
width: 100%;
}
-#tabcloudpanel #tips {
+#tabcloud-panel #tabcloud-tips {
margin-bottom: 3px;
}
-#tabcloudpanel a {
+#tabcloud-panel a {
text-decoration: underline;
color: #0000ee;
}
View
2  firefox/install.rdf
@@ -6,7 +6,7 @@
<em:name>TabCloud</em:name>
<em:iconURL>chrome://tabcloud/content/icon.png</em:iconURL>
<em:icon64URL>chrome://tabcloud/content/icon64.png</em:icon64URL>
- <em:version>0.5</em:version>
+ <em:version>0.6</em:version>
<em:creator>Connor Dunn</em:creator>
<em:contributor></em:contributor>
<em:description>Save and restore window sessions over time and across multiple computers.</em:description>
Please sign in to comment.
Something went wrong with that request. Please try again.