Skip to content

Commit

Permalink
Merge branch 'nightly' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ithinc committed Feb 10, 2014
2 parents 59f938d + 8a88461 commit d3180c6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 16 deletions.
16 changes: 9 additions & 7 deletions chrome/content/tabutils-vt.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,26 @@ tabutils._verticalTabs = function() {
]);

// Hide tabs toolbar in Print Preview mode
TU_hookCode("PrintPreviewListener._hideChrome", /(?=.*addonBar.*)/, function() {
TU_hookCode("PrintPreviewListener._hideChrome", "}", function() {
this._chromeState.tabsToolbarOpen = gBrowser.mTabContainer.visible;
gBrowser.mTabContainer.visible = false;
});

TU_hookCode("PrintPreviewListener._showChrome", /(?=.*addonBarOpen.*)/, function() {
TU_hookCode("PrintPreviewListener._showChrome", "}", function() {
if (this._chromeState.tabsToolbarOpen)
gBrowser.mTabContainer.visible = true;
});

tabutils._tabPrefObserver.tabBarPosition = function() {
let tabsToolbar = document.getElementById("TabsToolbar");
let addonBar = document.getElementById("addon-bar");
let appcontent = document.getElementById("appcontent");
let allTabsPopup = gBrowser.mTabContainer.mAllTabsPopup;
let bottombox = document.getElementById("browser-bottombox");

switch (TU_getPref("extensions.tabutils.tabBarPosition")) {
case 1: //Bottom
if (tabsToolbar.nextSibling != addonBar) {
if (tabsToolbar.parentNode != bottombox) {
gBrowser.mTabContainer.mTabstrip._stopSmoothScroll();
addonBar.parentNode.insertBefore(tabsToolbar, addonBar);
bottombox.insertBefore(tabsToolbar, bottombox.firstChild);
tabsToolbar.orient = gBrowser.mTabContainer.orient = gBrowser.mTabContainer.mTabstrip.orient = "horizontal";
TabsInTitlebar.allowedBy("tabbarposition", false);
}
Expand All @@ -121,7 +120,10 @@ tabutils._verticalTabs = function() {
default:
if (tabsToolbar.parentNode != gNavToolbox) {
gBrowser.mTabContainer.mTabstrip._stopSmoothScroll();
gNavToolbox.appendChild(tabsToolbar);
if ("TabsOnTop" in window) // Bug 755593 [Fx28]
gNavToolbox.appendChild(tabsToolbar);
else
gNavToolbox.insertBefore(tabsToolbar, document.getElementById("nav-bar"));
tabsToolbar.orient = gBrowser.mTabContainer.orient = gBrowser.mTabContainer.mTabstrip.orient = "horizontal";
TabsInTitlebar.allowedBy("tabbarposition", true);
}
Expand Down
20 changes: 12 additions & 8 deletions chrome/content/tabutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1310,8 +1310,10 @@ tabutils._renameTab = function() {
// Restart Tab
tabutils._restartTab = function() {
gBrowser.restartTab = function restartTab(aTab) {
if (aTab.hasAttribute("pending") || // Bug 817947 [Fx20]
aTab.hasAttribute("locked") ||
if (aTab.hasAttribute("pending")) // Bug 817947 [Fx20]
return;

if (aTab.hasAttribute("locked") ||
aTab.pinned && TU_getPref("extensions.tabutils.pinTab.autoLock", false))
return;

Expand All @@ -1325,9 +1327,10 @@ tabutils._restartTab = function() {
};

gBrowser.autoRestartTab = function autoRestartTab(aTab) {
if (aTab.selected || aTab._restartTimer ||
["busy", "pending"].some(function(aAttr) aTab.hasAttribute(aAttr)) ||
isBlankPageURL(aTab.linkedBrowser.currentURI.spec))
if (aTab.selected || aTab._restartTimer || ["busy", "pending"].some(function(aAttr) aTab.hasAttribute(aAttr)))
return;

if (isBlankPageURL(aTab.linkedBrowser.currentURI.spec))
return;

let restartAfter = TU_getPref("extensions.tabutils.restartAfter", 0);
Expand Down Expand Up @@ -2422,6 +2425,7 @@ tabutils._miscFeatures = function() {
document.documentElement.setAttribute("v6", version >= 6.0);
document.documentElement.setAttribute("v14", version >= 14.0);
document.documentElement.setAttribute("v21", version >= 21.0);
document.documentElement.setAttribute("v29", version >= 29.0);

for (let sheet of Array.slice(document.styleSheets)) {
switch (sheet.href) {
Expand Down Expand Up @@ -2772,7 +2776,7 @@ tabutils._allTabsPopup = function() {

tabutils._hideTabBar = function() {
if (onViewToolbarsPopupShowing.name == "onViewToolbarsPopupShowing") //Compa. with Omnibar
TU_hookCode("onViewToolbarsPopupShowing", /(?=.*addon-bar.*)/, function() {
TU_hookCode("onViewToolbarsPopupShowing", /(?=.*addon-bar.*)/, function() { // Bug 749804 [Fx29]
let tabsToolbar = document.getElementById("TabsToolbar");
if (toolbarNodes.indexOf(tabsToolbar) == -1)
toolbarNodes.push(tabsToolbar);
Expand Down Expand Up @@ -2862,8 +2866,8 @@ tabutils._firstRun = function() {
TU_setPref("extensions.tabutils.firstRun", true);

let navbar = document.getElementById("nav-bar");
navbar.currentSet = navbar.currentSet.replace(/undoclosetab-button|button_tuOptions/g, "")
.replace("urlbar-container", "undoclosetab-button,button_tuOptions,$&");
navbar.currentSet = navbar.currentSet.replace(/closetab-button|undoclosetab-button|button_tuOptions/g, "")
.replace("urlbar-container", "closetab-button,undoclosetab-button,button_tuOptions,$&");
navbar.setAttribute("currentset", navbar.currentSet);
document.persist(navbar.id, "currentset");
};
Expand Down
1 change: 1 addition & 0 deletions chrome/content/tabutils.xul
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<?xml-stylesheet href="chrome://tabutils/skin/tabutils_fx6.css" type="text/css"?>
<?xml-stylesheet href="chrome://tabutils/skin/tabutils_fx14.css" type="text/css"?>
<?xml-stylesheet href="chrome://tabutils/skin/tabutils_fx21.css" type="text/css"?>
<?xml-stylesheet href="chrome://tabutils/skin/tabutils_fx29.css" type="text/css"?>
<?xml-stylesheet href="chrome://tabutils/skin/tabutils_mac.css" type="text/css"?>
<?xml-stylesheet href="chrome://tabutils/skin/tabutils_linux.css" type="text/css"?>

Expand Down
6 changes: 6 additions & 0 deletions chrome/skin/tabutils_fx29.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* Toolbar buttons */
window[v29="true"]:not([OS="Linux"]) #nav-bar #button_tuOptions .toolbarbutton-icon,
window[v29="true"]:not([OS="Linux"]) #nav-bar #closetab-button .toolbarbutton-icon {
width: 32px;
height: 24px;
}
2 changes: 1 addition & 1 deletion defaults/preferences/prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ pref("extensions.tabutils.autoPin", true);
pref("extensions.tabutils.autoRename", true);
pref("extensions.tabutils.autoEnableAutoReload", true);
pref("extensions.tabutils.pinTab.autoProtect", false);
pref("extensions.tabutils.pinTab.autoLock", true);
pref("extensions.tabutils.pinTab.autoLock", false);
pref("extensions.tabutils.pinTab.autoFaviconize", true);
pref("extensions.tabutils.pinTab.autoRevert", false);
pref("extensions.tabutils.pinTab.showPhantom", true);
Expand Down

0 comments on commit d3180c6

Please sign in to comment.