Minefield 3.7a5preでタブの一覧の項目がインデントされなくなっていた(Bug 457187 – Make the tabs toolbar customizable https://bugzilla.mozilla.org/show_bug.cgi?id=457187 )
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6627 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
e477eadacb
commit
db5506a02a
@ -861,11 +861,11 @@ catch(e) {
|
|||||||
|
|
||||||
overrideGlobalFunctions : function TSTService_overrideGlobalFunctions()
|
overrideGlobalFunctions : function TSTService_overrideGlobalFunctions()
|
||||||
{
|
{
|
||||||
// window.__treestyletab__BrowserCustomizeToolbar = window.BrowserCustomizeToolbar;
|
window.__treestyletab__BrowserCustomizeToolbar = window.BrowserCustomizeToolbar;
|
||||||
// window.BrowserCustomizeToolbar = function() {
|
window.BrowserCustomizeToolbar = function() {
|
||||||
// TreeStyleTabService.destroyBar();
|
TreeStyleTabService.destroyToolbarItems();
|
||||||
// window.__treestyletab__BrowserCustomizeToolbar.call(window);
|
window.__treestyletab__BrowserCustomizeToolbar.call(window);
|
||||||
// };
|
};
|
||||||
|
|
||||||
let (toolbox) {
|
let (toolbox) {
|
||||||
toolbox = document.getElementById('navigator-toolbox');
|
toolbox = document.getElementById('navigator-toolbox');
|
||||||
@ -873,17 +873,17 @@ catch(e) {
|
|||||||
toolbox.__treestyletab__customizeDone = toolbox.customizeDone;
|
toolbox.__treestyletab__customizeDone = toolbox.customizeDone;
|
||||||
toolbox.customizeDone = function(aChanged) {
|
toolbox.customizeDone = function(aChanged) {
|
||||||
this.__treestyletab__customizeDone(aChanged);
|
this.__treestyletab__customizeDone(aChanged);
|
||||||
TreeStyleTabService.initBar();
|
TreeStyleTabService.initToolbarItems();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if ('BrowserToolboxCustomizeDone' in window) {
|
if ('BrowserToolboxCustomizeDone' in window) {
|
||||||
window.__treestyletab__BrowserToolboxCustomizeDone = window.BrowserToolboxCustomizeDone;
|
window.__treestyletab__BrowserToolboxCustomizeDone = window.BrowserToolboxCustomizeDone;
|
||||||
window.BrowserToolboxCustomizeDone = function(aChanged) {
|
window.BrowserToolboxCustomizeDone = function(aChanged) {
|
||||||
window.__treestyletab__BrowserToolboxCustomizeDone.apply(window, arguments);
|
window.__treestyletab__BrowserToolboxCustomizeDone.apply(window, arguments);
|
||||||
TreeStyleTabService.initBar();
|
TreeStyleTabService.initToolbarItems();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
this.initBar();
|
this.initToolbarItems();
|
||||||
toolbox = null;
|
toolbox = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1159,7 +1159,7 @@ catch(e) {
|
|||||||
return func ? func.toSource() : null ;
|
return func ? func.toSource() : null ;
|
||||||
},
|
},
|
||||||
|
|
||||||
initBar : function TSTService_initBar()
|
initToolbarItems : function TSTService_initToolbarItems()
|
||||||
{
|
{
|
||||||
var bar = document.getElementById('urlbar');
|
var bar = document.getElementById('urlbar');
|
||||||
if (!bar) return;
|
if (!bar) return;
|
||||||
@ -1177,6 +1177,42 @@ catch(e) {
|
|||||||
}
|
}
|
||||||
bar = null;
|
bar = null;
|
||||||
source = null;
|
source = null;
|
||||||
|
|
||||||
|
// for Firefox 3.7 or later
|
||||||
|
this.updateAllTabsButton(gBrowser);
|
||||||
|
},
|
||||||
|
|
||||||
|
destroyToolbarItems : function TSTService_destroyToolbarItems()
|
||||||
|
{
|
||||||
|
// Firefox 3.7 or later (restore original position)
|
||||||
|
var allTabsButton = document.getElementById('alltabs-button');
|
||||||
|
if (allTabsButton && allTabsButton.hasChildNodes())
|
||||||
|
allTabsButton.firstChild.setAttribute('position', 'after_end');
|
||||||
|
},
|
||||||
|
|
||||||
|
updateAllTabsButton : function TSTService_updateAllTabsButton(aTabBrowser)
|
||||||
|
{
|
||||||
|
aTabBrowser = aTabBrowser || this.browser;
|
||||||
|
var allTabsButton = document.getElementById('alltabs-button') || // Firefox 3.7 or later
|
||||||
|
document.getAnonymousElementByAttribute(aTabBrowser.mTabContainer, 'class', 'tabs-alltabs-button') || // Firefox 3.6 or older
|
||||||
|
( // Tab Mix Plus
|
||||||
|
this.getTreePref('compatibility.TMP') &&
|
||||||
|
document.getAnonymousElementByAttribute(aTabBrowser.mTabContainer, 'anonid', 'alltabs-button')
|
||||||
|
);
|
||||||
|
|
||||||
|
if (allTabsButton && allTabsButton.hasChildNodes() && aTabBrowser.treeStyleTab)
|
||||||
|
allTabsButton.firstChild.setAttribute('position', aTabBrowser.treeStyleTab.isVertical ? 'before_start' : 'after_end' );
|
||||||
|
},
|
||||||
|
|
||||||
|
updateAllTabsPopup : function TSTService_updateAllTabsPopup(aEvent)
|
||||||
|
{
|
||||||
|
if (!this.getTreePref('enableSubtreeIndent.allTabsPopup')) return;
|
||||||
|
|
||||||
|
var items = Array.slice(aEvent.originalTarget.childNodes);
|
||||||
|
var b = this.getTabBrowserFromChild(aEvent.originalTarget) || gBrowser;
|
||||||
|
this.getTabsArray(b).forEach(function(aTab, aIndex) {
|
||||||
|
items[aIndex].style.paddingLeft = aTab.getAttribute(this.kNEST)+'em';
|
||||||
|
}, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
destroy : function TSTService_destroy()
|
destroy : function TSTService_destroy()
|
||||||
@ -1247,6 +1283,8 @@ catch(e) {
|
|||||||
aSelf.popupMenuShown = false;
|
aSelf.popupMenuShown = false;
|
||||||
}, 10, this, aEvent.originalTarget);
|
}, 10, this, aEvent.originalTarget);
|
||||||
}
|
}
|
||||||
|
if ((aEvent.originalTarget.getAttribute('anonid') || aEvent.originalTarget.id) == 'alltabs-popup')
|
||||||
|
this.updateAllTabsPopup(aEvent);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case 'popuphiding':
|
case 'popuphiding':
|
||||||
|
@ -628,11 +628,6 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let (allTabPopup = document.getAnonymousElementByAttribute(b.mTabContainer, 'anonid', 'alltabs-popup')) {
|
|
||||||
if (allTabPopup)
|
|
||||||
allTabPopup.addEventListener('popupshowing', this, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* To move up content area on the tab bar, switch tab.
|
/* To move up content area on the tab bar, switch tab.
|
||||||
If we don't do it, a gray space appears on the content area
|
If we don't do it, a gray space appears on the content area
|
||||||
by negative margin of it. */
|
by negative margin of it. */
|
||||||
@ -877,11 +872,6 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
var scrollInnerBox = b.mTabContainer.mTabstrip._scrollbox ?
|
var scrollInnerBox = b.mTabContainer.mTabstrip._scrollbox ?
|
||||||
document.getAnonymousNodes(b.mTabContainer.mTabstrip._scrollbox)[0] :
|
document.getAnonymousNodes(b.mTabContainer.mTabstrip._scrollbox)[0] :
|
||||||
scrollFrame; // Tab Mix Plus
|
scrollFrame; // Tab Mix Plus
|
||||||
var allTabsButton = document.getAnonymousElementByAttribute(b.mTabContainer, 'class', 'tabs-alltabs-button') ||
|
|
||||||
( // Tab Mix Plus
|
|
||||||
this.getTreePref('compatibility.TMP') &&
|
|
||||||
document.getAnonymousElementByAttribute(b.mTabContainer, 'anonid', 'alltabs-button')
|
|
||||||
);
|
|
||||||
|
|
||||||
this.removeTabbrowserAttribute(this.kRESIZING, b);
|
this.removeTabbrowserAttribute(this.kRESIZING, b);
|
||||||
|
|
||||||
@ -905,9 +895,6 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
b.mTabContainer.orient =
|
b.mTabContainer.orient =
|
||||||
b.mTabContainer.mTabstrip.orient =
|
b.mTabContainer.mTabstrip.orient =
|
||||||
b.mTabContainer.mTabstrip.parentNode.orient = 'vertical';
|
b.mTabContainer.mTabstrip.parentNode.orient = 'vertical';
|
||||||
if (allTabsButton && allTabsButton.hasChildNodes()) {
|
|
||||||
allTabsButton.firstChild.setAttribute('position', 'before_start');
|
|
||||||
}
|
|
||||||
b.mTabContainer.setAttribute('align', 'stretch'); // for Mac OS X
|
b.mTabContainer.setAttribute('align', 'stretch'); // for Mac OS X
|
||||||
if (scrollInnerBox)
|
if (scrollInnerBox)
|
||||||
scrollInnerBox.removeAttribute('flex');
|
scrollInnerBox.removeAttribute('flex');
|
||||||
@ -982,9 +969,6 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
b.mTabContainer.orient =
|
b.mTabContainer.orient =
|
||||||
b.mTabContainer.mTabstrip.orient =
|
b.mTabContainer.mTabstrip.orient =
|
||||||
b.mTabContainer.mTabstrip.parentNode.orient = 'horizontal';
|
b.mTabContainer.mTabstrip.parentNode.orient = 'horizontal';
|
||||||
if (allTabsButton && allTabsButton.hasChildNodes()) {
|
|
||||||
allTabsButton.firstChild.setAttribute('position', 'after_end');
|
|
||||||
}
|
|
||||||
b.mTabContainer.removeAttribute('align'); // for Mac OS X
|
b.mTabContainer.removeAttribute('align'); // for Mac OS X
|
||||||
if (scrollInnerBox)
|
if (scrollInnerBox)
|
||||||
scrollInnerBox.setAttribute('flex', 1);
|
scrollInnerBox.setAttribute('flex', 1);
|
||||||
@ -1036,6 +1020,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
window.setTimeout(function(aSelf, aTabBrowser, aSplitter, aToggler) {
|
window.setTimeout(function(aSelf, aTabBrowser, aSplitter, aToggler) {
|
||||||
delayedPostProcess(aSelf, aTabBrowser, aSplitter, aToggler);
|
delayedPostProcess(aSelf, aTabBrowser, aSplitter, aToggler);
|
||||||
aSelf.updateTabbarOverflow();
|
aSelf.updateTabbarOverflow();
|
||||||
|
aSelf.updateAllTabsButton(aTabBrowser);
|
||||||
delayedPostProcess = null;
|
delayedPostProcess = null;
|
||||||
aSelf.mTabBrowser.style.visibility = '';
|
aSelf.mTabBrowser.style.visibility = '';
|
||||||
aSelf.startRendering();
|
aSelf.startRendering();
|
||||||
@ -1051,7 +1036,6 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
toolboxContainer = null;
|
toolboxContainer = null;
|
||||||
scrollInnerBox = null;
|
scrollInnerBox = null;
|
||||||
scrollInnerBox = null;
|
scrollInnerBox = null;
|
||||||
allTabsButton = null;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_ensureNewSplitter : function TSTBrowser__ensureNewSplitter()
|
_ensureNewSplitter : function TSTBrowser__ensureNewSplitter()
|
||||||
@ -1353,11 +1337,6 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
document.getAnonymousElementByAttribute(b, 'anonid', 'tabContextMenu');
|
document.getAnonymousElementByAttribute(b, 'anonid', 'tabContextMenu');
|
||||||
tabContextMenu.removeEventListener('popupshowing', this, false);
|
tabContextMenu.removeEventListener('popupshowing', this, false);
|
||||||
|
|
||||||
var allTabPopup = document.getAnonymousElementByAttribute(b.mTabContainer, 'anonid', 'alltabs-popup');
|
|
||||||
if (allTabPopup) {
|
|
||||||
allTabPopup.removeEventListener('popupshowing', this, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.tabbarCanvas) {
|
if (this.tabbarCanvas) {
|
||||||
this.tabbarCanvas.parentNode.removeChild(this.tabbarCanvas);
|
this.tabbarCanvas.parentNode.removeChild(this.tabbarCanvas);
|
||||||
this.tabbarCanvas = null;
|
this.tabbarCanvas = null;
|
||||||
@ -2745,16 +2724,8 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
|
|
||||||
onPopupShowing : function TSTBrowser_onPopupShowing(aEvent)
|
onPopupShowing : function TSTBrowser_onPopupShowing(aEvent)
|
||||||
{
|
{
|
||||||
if (aEvent.target != aEvent.currentTarget) return;
|
if (aEvent.target == aEvent.currentTarget)
|
||||||
switch (aEvent.target.getAttribute('anonid') || aEvent.target.id)
|
|
||||||
{
|
|
||||||
case 'tabContextMenu':
|
|
||||||
this.initTabContextMenu(aEvent);
|
this.initTabContextMenu(aEvent);
|
||||||
break;
|
|
||||||
case 'alltabs-popup':
|
|
||||||
this.initAllTabsPopup(aEvent);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
initTabContextMenu : function TSTBrowser_initTabContextMenu(aEvent)
|
initTabContextMenu : function TSTBrowser_initTabContextMenu(aEvent)
|
||||||
@ -2876,17 +2847,6 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
initAllTabsPopup : function TSTBrowser_initAllTabsPopup(aEvent)
|
|
||||||
{
|
|
||||||
if (!this.getTreePref('enableSubtreeIndent.allTabsPopup')) return;
|
|
||||||
var items = aEvent.target.childNodes;
|
|
||||||
var tabs = this.getTabsArray(this.mTabBrowser);
|
|
||||||
for (var i = 0, maxi = items.length; i < maxi; i++)
|
|
||||||
{
|
|
||||||
items[i].style.paddingLeft = tabs[i].getAttribute(this.kNEST)+'em';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onTreeStyleTabPrintPreviewEntered : function TSTBrowser_onTreeStyleTabPrintPreviewEntered(aEvent)
|
onTreeStyleTabPrintPreviewEntered : function TSTBrowser_onTreeStyleTabPrintPreviewEntered(aEvent)
|
||||||
{
|
{
|
||||||
this.setTabbrowserAttribute(this.kPRINT_PREVIEW, true);
|
this.setTabbrowserAttribute(this.kPRINT_PREVIEW, true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user