Skip to content

Commit

Permalink
Merge branch 'nightly' into develop
Browse files Browse the repository at this point in the history
Conflicts:
	chrome/content/tabutils-st.js
	chrome/content/tabutils.js
  • Loading branch information
ithinc committed Feb 22, 2014
2 parents 02abaa4 + 3a283b8 commit 7275279
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
36 changes: 20 additions & 16 deletions chrome/content/tabutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ tabutils._tabOpeningOptions = function() {

if (TU_getPref("extensions.tabutils.openTabNext.keepOrder", true)) {
let tab = lastRelatedTab.nextSibling;
let panelId = this.mCurrentTab.linkedPanel;
let panelId = this.mCurrentTab.linkedPanel + "#";
for (; tab && tab.pinned; tab = tab.nextSibling);
for (; tab && tab.getAttribute("opener") == panelId && tab != t && (!willStack || shouldStack(tab)); tab = tab.nextSibling)
lastRelatedTab = tab;
Expand All @@ -627,7 +627,7 @@ tabutils._tabOpeningOptions = function() {
default: return false; //None
}
})()) {
aTab.setAttribute("opener", this.mCurrentTab.linkedPanel);
aTab.setAttribute("opener", this.mCurrentTab.linkedPanel + "#");
}
});

Expand Down Expand Up @@ -770,7 +770,7 @@ tabutils._tabClosingOptions = function() {

//关闭标签页时选择亲属标签
TU_hookCode("gBrowser.onTabSelect", "}", function() {
var panelId = aTab.linkedPanel;
var panelId = aTab.linkedPanel + "#";
Array.forEach(this.visibleTabs, function(aTab) {
if (aTab.getAttribute("opener").startsWith(panelId))
aTab.setAttribute("opener", panelId + (+aTab.getAttribute("opener").slice(panelId.length) + 1));
Expand All @@ -780,7 +780,7 @@ tabutils._tabClosingOptions = function() {
TU_hookCode("gBrowser.onTabClose", "}", function() {
if (aTab.hasAttribute("opener")) {
let opener = aTab.getAttribute("opener");
let panelId = aTab.linkedPanel;
let panelId = aTab.linkedPanel + "#";
Array.forEach(this.visibleTabs, function(aTab) {
if (aTab.getAttribute("opener").startsWith(panelId))
aTab.setAttribute("opener", opener);
Expand All @@ -798,8 +798,8 @@ tabutils._tabClosingOptions = function() {
bTab = this.mCurrentTab;

return aTab.hasAttribute("opener") && aTab.getAttribute("opener") == bTab.getAttribute("opener")
|| aTab.getAttribute("opener").startsWith(bTab.linkedPanel)
|| bTab.getAttribute("opener").startsWith(aTab.linkedPanel);
|| aTab.getAttribute("opener").startsWith(bTab.linkedPanel + "#")
|| bTab.getAttribute("opener").startsWith(aTab.linkedPanel + "#");
};

//关闭标签页时选择上次浏览的标签
Expand Down Expand Up @@ -2429,17 +2429,11 @@ tabutils._miscFeatures = function() {
switch (sheet.href) {
case "chrome://browser/skin/browser.css":
for (let cssRule of Array.slice(sheet.cssRules)) {
if (/> .tabbrowser-tab/.test(cssRule.selectorText)) {
tabutils.insertRule(cssRule.cssText.replace(RegExp.lastMatch, ".tabbrowser-tab"));
continue;
}

if (/> .tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox/.test(cssRule.selectorText)) {
tabutils.insertRule(cssRule.cssText.replace(RegExp.lastMatch, "#PinnedTabsBarItems"));
continue;
}

switch (cssRule.selectorText) {
case "#tabbrowser-tabs[positionpinnedtabs] > .tabbrowser-tab[pinned]:before": // Bug 877368 [Fx29]
case "#tabbrowser-tabs[positionpinnedtabs] > .tabbrowser-tab[pinned]::before":
tabutils.insertRule(cssRule.cssText.replace("#tabbrowser-tabs[positionpinnedtabs] >", ""));
break;
case ".tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox":
tabutils.insertRule(cssRule.cssText.replace(cssRule.selectorText, ".tabbrowser-tabs[orient='horizontal']:not([overflow]):not([multirow]) $&"))
.style.MozMarginStart = "-" + cssRule.style.MozPaddingStart;
Expand All @@ -2451,6 +2445,16 @@ tabutils._miscFeatures = function() {
case ".tab-throbber[pinned], .tab-icon-image[pinned], .tabs-newtab-button > .toolbarbutton-icon":
tabutils.insertRule(cssRule.cssText.replace(cssRule.selectorText, '.tabbrowser-tabs[orient="horizontal"] > .tabbrowser-tab[faviconized] :-moz-any(.tab-throbber, .tab-icon-image)'));
break;
default:
if (/> .tabbrowser-tab/.test(cssRule.selectorText)) {
tabutils.insertRule(cssRule.cssText.replace(RegExp.lastMatch, ".tabbrowser-tab"));
continue;
}

if (/> .tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox/.test(cssRule.selectorText)) {
tabutils.insertRule(cssRule.cssText.replace(RegExp.lastMatch, "#PinnedTabsBarItems"));
continue;
}
}
}
break;
Expand Down
4 changes: 2 additions & 2 deletions chrome/skin/tabutils.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ menuseparator:last-child {
}

.tabbrowser-tab[locked] .tab-throbber:not([busy]) {
-moz-margin-end: -8px;
-moz-margin-end: -8px !important;
}

.tabbrowser-tab[locked] .tab-throbber:not([busy]) + .tab-icon-image {
-moz-margin-start: -8px;
-moz-margin-start: -8px !important;
position: relative;
z-index: -1;
}
Expand Down

0 comments on commit 7275279

Please sign in to comment.