Reduce use of e4x <![CDATA[ ... ]]>

This commit is contained in:
YUKI Hiroshi 2012-10-12 16:28:46 +09:00
parent 8affaa2939
commit 4a3f96c945

View File

@ -45,38 +45,37 @@ TreeStyleTabWindowHelper.overrideExtensionsPreInit = function TSTWH_overrideExte
eval('permaTabs.showPermaTab = '+ eval('permaTabs.showPermaTab = '+
permaTabs.showPermaTab.toSource().replace( permaTabs.showPermaTab.toSource().replace(
/(\}\)?)$/, /(\}\)?)$/,
<![CDATA[ '(function(tab, id) {' +
(function(tab, id) { ' if (this.ssWillRestore) return;' +
if (this.ssWillRestore) return; ' var TST = TreeStyleTabService;' +
var TST = TreeStyleTabService; ' if (this.TSTRestoredPermaTabsInfo === void(0)) {' +
if (this.TSTRestoredPermaTabsInfo === void(0)) { ' try {' +
try { ' eval("this.TSTRestoredPermaTabsInfo = "+(TST.getTreePref("permaTabsInfo") || "null"));' +
eval('this.TSTRestoredPermaTabsInfo = '+(TST.getTreePref('permaTabsInfo') || 'null')); ' }' +
} ' catch(e) {' +
catch(e) { ' }' +
} ' }' +
} ' if (!this.TSTRestoredPermaTabsInfo) return;' +
if (!this.TSTRestoredPermaTabsInfo) return;
var info = this.TSTRestoredPermaTabsInfo[id]; ' var info = this.TSTRestoredPermaTabsInfo[id];' +
if (!info) return; ' if (!info) return;' +
for (var i in info) ' for (var i in info)' +
{ ' {' +
TST.SessionStore.setTabValue(tab, i, info[i]); ' TST.SessionStore.setTabValue(tab, i, info[i]);' +
} ' }' +
var count = 0; ' var count = 0;' +
window.setTimeout(function() { ' window.setTimeout(function() {' +
var b = TST.getTabBrowserFromChild(tab); ' var b = TST.getTabBrowserFromChild(tab);' +
if (!b.treeStyleTab) { ' if (!b.treeStyleTab) {' +
if (++count < 50) ' if (++count < 50)' +
window.setTimeout(arguments.callee, 100); ' window.setTimeout(arguments.callee, 100);' +
return; ' return;' +
} ' }' +
b.treeStyleTab.handleRestoredTab(tab); ' b.treeStyleTab.handleRestoredTab(tab);' +
}, 0); ' }, 0);' +
}).call(this, tab, id) '}).call(this, tab, id)' +
$1]]> '$1'
) )
); );
} }
@ -84,27 +83,26 @@ TreeStyleTabWindowHelper.overrideExtensionsPreInit = function TSTWH_overrideExte
eval('permaTabs.savePermaTabs = '+ eval('permaTabs.savePermaTabs = '+
permaTabs.savePermaTabs.toSource().replace( permaTabs.savePermaTabs.toSource().replace(
'{', '{',
<![CDATA[$& '{' +
(function() { '(function() {' +
var tabsInfo = {}; ' var tabsInfo = {};' +
var TST = TreeStyleTabService; ' var TST = TreeStyleTabService;' +
var allTabs = getBrowser().mTabContainer.childNodes; ' var allTabs = getBrowser().mTabContainer.childNodes;' +
for (let i = 0, maxi = allTabs.length; i < maxi; i++) ' for (let i = 0, maxi = allTabs.length; i < maxi; i++)' +
{ ' {' +
let tab = allTabs[i]; ' let tab = allTabs[i];' +
let index = this.getPermaTabLocalIndex(tab); ' let index = this.getPermaTabLocalIndex(tab);' +
if (index < 0) continue; ' if (index < 0) continue;' +
let info = {}; ' let info = {};' +
for (let i = 0, maxi = TST.extraProperties.length; i < maxi; i++) ' for (let i = 0, maxi = TST.extraProperties.length; i < maxi; i++)' +
{ ' {' +
let property = TST.extraProperties[i]; ' let property = TST.extraProperties[i];' +
info[property] = TST.getTabValue(tab, property); ' info[property] = TST.getTabValue(tab, property);' +
} ' }' +
tabsInfo[this.permaTabs[index].id] = info; ' tabsInfo[this.permaTabs[index].id] = info;' +
} ' }' +
TST.setTreePref('permaTabsInfo', tabsInfo.toSource()); ' TST.setTreePref('permaTabsInfo', tabsInfo.toSource());' +
}).call(this); '}).call(this);'
]]>
) )
); );
} }
@ -129,58 +127,53 @@ TreeStyleTabWindowHelper.overrideExtensionsPreInit = function TSTWH_overrideExte
eval('sessionData.getTabProperties = '+ eval('sessionData.getTabProperties = '+
sessionData.getTabProperties.toSource().replace( sessionData.getTabProperties.toSource().replace(
'return tabProperties;', 'return tabProperties;',
<![CDATA[ ' for (let i = 0, maxi = this.tabTSTProperties.length; i < maxi; i++)' +
for (let i = 0, maxi = this.tabTSTProperties.length; i < maxi; i++) ' {' +
{ ' let property = this.tabTSTProperties[i];' +
let property = this.tabTSTProperties[i]; ' tabProperties += "|" + property + "=" + encodeURIComponent(aTab.getAttribute(property));' +
tabProperties += '|' + property + '=' + encodeURIComponent(aTab.getAttribute(property)); ' }' +
} '$&'
$&]]>
) )
); );
eval('sessionData.setTabProperties = '+ eval('sessionData.setTabProperties = '+
sessionData.setTabProperties.toSource().replace( sessionData.setTabProperties.toSource().replace(
'{', '{',
<![CDATA[$& '$&' +
var TSTProps = tabProperties.split('|'); ' var TSTProps = tabProperties.split("|");' +
tabProperties = TSTProps.shift(); ' tabProperties = TSTProps.shift();' +
for (let i = 0, maxi = TSTProps.length; i < maxi; i++) ' for (let i = 0, maxi = TSTProps.length; i < maxi; i++)' +
{ ' {' +
let property = TSTProps[i]; ' let property = TSTProps[i];' +
let index = property.indexOf('='); ' let index = property.indexOf("=");' +
let name = property.substring(0, index); ' let name = property.substring(0, index);' +
let value = decodeURIComponent(property.substring(index+1)); ' let value = decodeURIComponent(property.substring(index+1));' +
if (name && value) ' if (name && value)' +
aTab.setAttribute(name, value); ' aTab.setAttribute(name, value);' +
} ' }'
]]>
) )
); );
eval('sessionManager.loadOneTab = '+ eval('sessionManager.loadOneTab = '+
sessionManager.loadOneTab.toSource().replace( sessionManager.loadOneTab.toSource().replace(
/(\}\))?$/, /(\}\))?$/,
<![CDATA[ ' if (gBrowser.treeStyleTab.useTMPSessionAPI)' +
if (gBrowser.treeStyleTab.useTMPSessionAPI) ' gBrowser.treeStyleTab.handleRestoredTab(aTab);' +
gBrowser.treeStyleTab.handleRestoredTab(aTab); '$1'
$1]]>
) )
); );
let source = tablib.init.toSource().split('gBrowser.restoreTab = '); let source = tablib.init.toSource().split('gBrowser.restoreTab = ');
source[1] = source[1].replace( source[1] = source[1].replace(
'return newTab;', 'return newTab;',
<![CDATA[ ' if (this.treeStyleTab.useTMPSessionAPI)' +
if (this.treeStyleTab.useTMPSessionAPI) ' this.treeStyleTab.handleRestoredTab(newTab);' +
this.treeStyleTab.handleRestoredTab(newTab); '$&'
$&]]>
); );
eval('tablib.init = '+source.join('gBrowser.restoreTab = ')); eval('tablib.init = '+source.join('gBrowser.restoreTab = '));
eval('sessionManager.loadOneWindow = '+ eval('sessionManager.loadOneWindow = '+
sessionManager.loadOneWindow.toSource().replace( sessionManager.loadOneWindow.toSource().replace(
'gBrowser.tabsToLoad = ', 'gBrowser.tabsToLoad = ',
<![CDATA[ ' gBrowser.treeStyleTab.resetAllTabs(true, true);' +
gBrowser.treeStyleTab.resetAllTabs(true, true); ' TreeStyleTabService.restoringTree = true;' +
TreeStyleTabService.restoringTree = true; '$&'
$&]]>
).replace( ).replace(
/(\}\))?$/, /(\}\))?$/,
'TreeStyleTabService.restoringTree = false; $1' 'TreeStyleTabService.restoringTree = false; $1'
@ -205,17 +198,16 @@ TreeStyleTabWindowHelper.overrideExtensionsPreInit = function TSTWH_overrideExte
if ('load' in gSessionManager) { if ('load' in gSessionManager) {
eval('gSessionManager.load = '+gSessionManager.load.toSource().replace( eval('gSessionManager.load = '+gSessionManager.load.toSource().replace(
'var tabcount = ', 'var tabcount = ',
<![CDATA[ ' gBrowser.treeStyleTab.collapseExpandAllSubtree(false, true);' +
gBrowser.treeStyleTab.collapseExpandAllSubtree(false, true); ' let (tabs = gBrowser.treeStyleTab.getTabs(gBrowser).slice(1).reverse()) {' +
let (tabs = gBrowser.treeStyleTab.getTabs(gBrowser).slice(1).reverse()) { ' for (let i = 0, maxi = tabs.length; i < maxi; i++)' +
for (let i = 0, maxi = tabs.length; i < maxi; i++) ' {' +
{ ' let tab = tabs[i];' +
let tab = tabs[i]; ' gBrowser.removeTab(tab);' +
gBrowser.removeTab(tab); ' }' +
} ' }' +
} ' TreeStyleTabService.restoringTree = true;' +
TreeStyleTabService.restoringTree = true; '$&'
$&]]>
)); ));
} }
} }
@ -289,24 +281,21 @@ TreeStyleTabWindowHelper.overrideExtensionsPreInit = function TSTWH_overrideExte
sv.getTreePref('compatibility.OptimozTweaks')) { sv.getTreePref('compatibility.OptimozTweaks')) {
eval('window.mtSidebarStartup = '+window.mtSidebarStartup.toSource().replace( eval('window.mtSidebarStartup = '+window.mtSidebarStartup.toSource().replace(
'{', '{',
<![CDATA[{ '{' +
document.getElementById('TabsToolbar') ' document.getElementById("TabsToolbar")' +
.addEventListener('mousemove', mtMouseMoveListener, false); ' .addEventListener("mousemove", mtMouseMoveListener, false);'
]]>.toString()
)); ));
eval('window.mtSidebarShutdown = '+window.mtSidebarShutdown.toSource().replace( eval('window.mtSidebarShutdown = '+window.mtSidebarShutdown.toSource().replace(
'{', '{',
<![CDATA[{ '{' +
document.getElementById('TabsToolbar') ' document.getElementById("TabsToolbar")' +
.removeEventListener('mousemove', mtMouseMoveListener, false); ' .removeEventListener("mousemove", mtMouseMoveListener, false);'
]]>.toString()
)); ));
eval('window.mtPreventHiding = '+window.mtPreventHiding.toSource().replace( eval('window.mtPreventHiding = '+window.mtPreventHiding.toSource().replace(
'{', '{',
<![CDATA[{ '{' +
if (TreeStyleTabService.getTabbarFromEvent(arguments[0])) ' if (TreeStyleTabService.getTabbarFromEvent(arguments[0]))' +
return; ' return;'
]]>.toString()
)); ));
} }
@ -318,10 +307,8 @@ TreeStyleTabWindowHelper.overrideExtensionsPreInit = function TSTWH_overrideExte
'do_alter' in HideCaption) { 'do_alter' in HideCaption) {
eval('HideCaption.do_alter = '+HideCaption.do_alter.toSource().replace( eval('HideCaption.do_alter = '+HideCaption.do_alter.toSource().replace(
'if (!theSettings) {', 'if (!theSettings) {',
<![CDATA[ ' if (!theSettings ||' +
if (!theSettings || ' gBrowser.treeStyleTab.isVertical) {'
gBrowser.treeStyleTab.isVertical) {
]]>
)); ));
} }
}; };
@ -350,11 +337,10 @@ TreeStyleTabWindowHelper.overrideExtensionsBeforeBrowserInit = function TSTWH_ov
'boxObject[sizeProp]' 'boxObject[sizeProp]'
).replace( ).replace(
'{', '{',
<![CDATA[$& '{' +
var posProp = gBrowser.treeStyleTab.isVertical ? 'y' : 'x' ; ' var posProp = gBrowser.treeStyleTab.isVertical ? "y" : "x" ;' +
var screenPosProp = gBrowser.treeStyleTab.isVertical ? 'screenY' : 'screenX' ; ' var screenPosProp = gBrowser.treeStyleTab.isVertical ? "screenY" : "screenX" ;' +
var sizeProp = gBrowser.treeStyleTab.isVertical ? 'height' : 'width' ; ' var sizeProp = gBrowser.treeStyleTab.isVertical ? "height" : "width" ;'
]]>
) )
} }
eval('gBrowser.mTabContainer.ensureTabIsVisible = '+ eval('gBrowser.mTabContainer.ensureTabIsVisible = '+
@ -397,14 +383,12 @@ TreeStyleTabWindowHelper.overrideExtensionsBeforeBrowserInit = function TSTWH_ov
eval('tabberwocky.openSelectedLinks = '+ eval('tabberwocky.openSelectedLinks = '+
tabberwocky.openSelectedLinks.toSource().replace( tabberwocky.openSelectedLinks.toSource().replace(
'links.forEach(', 'links.forEach(',
<![CDATA[ ' TreeStyleTabService.readyToOpenChildTab(aFrame, true)' +
TreeStyleTabService.readyToOpenChildTab(aFrame, true) '$&'
$&]]>
).replace( ).replace(
/(\}\)?)$/, /(\}\)?)$/,
<![CDATA[ ' TreeStyleTabService.stopToOpenChildTab(aFrame)' +
TreeStyleTabService.stopToOpenChildTab(aFrame) '$1'
$1]]>
) )
); );
} }
@ -422,10 +406,9 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
eval('selectionlinks.parseSelection = '+ eval('selectionlinks.parseSelection = '+
selectionlinks.parseSelection.toSource().replace( selectionlinks.parseSelection.toSource().replace(
/((?:[^\s:;]+.selectedTab\s*=\s*)?([^\s:;]+).addTab\()/g, /((?:[^\s:;]+.selectedTab\s*=\s*)?([^\s:;]+).addTab\()/g,
<![CDATA[ ' if ($2.treeStyleTab)' +
if ($2.treeStyleTab) ' $2.treeStyleTab.readyToOpenChildTab(focusedWindow);' +
$2.treeStyleTab.readyToOpenChildTab(focusedWindow); '$1'
$1]]>
) )
); );
} }
@ -447,10 +430,8 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
eval('DNDObserver.onDragStart = '+ eval('DNDObserver.onDragStart = '+
DNDObserver.onDragStart.toSource().replace( DNDObserver.onDragStart.toSource().replace(
'event.target.localName != "tab"', 'event.target.localName != "tab"',
<![CDATA[ ' gBrowser.treeStyleTab.tabbarDNDObserver.canDragTabbar(event) ||' +
gBrowser.treeStyleTab.tabbarDNDObserver.canDragTabbar(event) || ' $&'
$&
]]>
) )
); );
@ -510,12 +491,10 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
eval('superDrag.onDrop = '+ eval('superDrag.onDrop = '+
superDrag.onDrop.toSource().replace( superDrag.onDrop.toSource().replace(
/(var newTab = getBrowser\(\).addTab\([^\)]+\);)/g, /(var newTab = getBrowser\(\).addTab\([^\)]+\);)/g,
<![CDATA[ ' if (aDragSession.sourceNode &&' +
if (aDragSession.sourceNode && ' aDragSession.sourceNode.ownerDocument.defaultView.top == getBrowser().contentWindow)' +
aDragSession.sourceNode.ownerDocument.defaultView.top == getBrowser().contentWindow) ' TreeStyleTabService.readyToOpenChildTab(getBrowser());' +
TreeStyleTabService.readyToOpenChildTab(getBrowser()); ' $1'
$1
]]>
) )
); );
} }
@ -527,18 +506,16 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
eval('ddg_ges.Open = '+ eval('ddg_ges.Open = '+
ddg_ges.Open.toSource().replace( ddg_ges.Open.toSource().replace(
'if (mode[1] == "h" || mode[1] == "f") {', 'if (mode[1] == "h" || mode[1] == "f") {',
<![CDATA[$& '$&' +
if ('sourceNode' in aData) // only for dragging from the content tarea. ' if ("sourceNode" in aData) // only for dragging from the content tarea.' +
TreeStyleTabService.readyToOpenChildTab(getBrowser()); ' TreeStyleTabService.readyToOpenChildTab(getBrowser());'
]]>
) )
); );
eval('ddg_ges.Search = '+ eval('ddg_ges.Search = '+
ddg_ges.Search.toSource().replace( ddg_ges.Search.toSource().replace(
'if (mode[1] == "h" || mode[1] == "f") {', 'if (mode[1] == "h" || mode[1] == "f") {',
<![CDATA[$& '$&' +
TreeStyleTabService.readyToOpenChildTab(getBrowser()); ' TreeStyleTabService.readyToOpenChildTab(getBrowser());'
]]>
) )
); );
} }
@ -630,45 +607,39 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
eval('FireGestures.onExtraGesture = '+ eval('FireGestures.onExtraGesture = '+
FireGestures.onExtraGesture.toSource().replace( FireGestures.onExtraGesture.toSource().replace(
'case "keypress-stop":', 'case "keypress-stop":',
<![CDATA[$& '$&' +
TreeStyleTabService.readyToOpenChildTab(gBrowser, true); ' TreeStyleTabService.readyToOpenChildTab(gBrowser, true);'
]]>
).replace( ).replace(
'break;case "gesture-timeout":', 'break;case "gesture-timeout":',
<![CDATA[ ' TreeStyleTabService.stopToOpenChildTab(gBrowser);' +
TreeStyleTabService.stopToOpenChildTab(gBrowser); '$&'
$&]]>
) )
); );
eval('FireGestures._performAction = '+ eval('FireGestures._performAction = '+
FireGestures._performAction.toSource().replace( FireGestures._performAction.toSource().replace(
'gBrowser.loadOneTab(', 'gBrowser.loadOneTab(',
<![CDATA[ ' TreeStyleTabService.readyToOpenChildTab(gBrowser);' +
TreeStyleTabService.readyToOpenChildTab(gBrowser); '$&'
$&]]>
) )
); );
eval('FireGestures.openURLsInSelection = '+ eval('FireGestures.openURLsInSelection = '+
FireGestures.openURLsInSelection.toSource().replace( FireGestures.openURLsInSelection.toSource().replace(
'var tab =', 'var tab =',
<![CDATA[ ' if (!TreeStyleTabService.checkToOpenChildTab(gBrowser))' +
if (!TreeStyleTabService.checkToOpenChildTab(gBrowser)) ' TreeStyleTabService.readyToOpenChildTab(gBrowser, true);' +
TreeStyleTabService.readyToOpenChildTab(gBrowser, true); '$&'
$&]]>
).replace( ).replace(
'if (!flag)', 'if (!flag)',
<![CDATA[ ' if (TreeStyleTabService.checkToOpenChildTab(gBrowser))' +
if (TreeStyleTabService.checkToOpenChildTab(gBrowser)) ' TreeStyleTabService.stopToOpenChildTab(gBrowser);' +
TreeStyleTabService.stopToOpenChildTab(gBrowser); '$&'
$&]]>
) )
); );
eval('FireGestures.handleEvent = '+ eval('FireGestures.handleEvent = '+
FireGestures.handleEvent.toSource().replace( FireGestures.handleEvent.toSource().replace(
'gBrowser.loadOneTab(', 'gBrowser.loadOneTab(',
<![CDATA[ ' TreeStyleTabService.readyToOpenChildTab(gBrowser);' +
TreeStyleTabService.readyToOpenChildTab(gBrowser); '$&'
$&]]>
) )
); );
} }
@ -920,30 +891,28 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
if ('MoveContent' in autoHIDE) { if ('MoveContent' in autoHIDE) {
eval('autoHIDE.MoveContent = '+autoHIDE.MoveContent.toSource().replace( eval('autoHIDE.MoveContent = '+autoHIDE.MoveContent.toSource().replace(
/(;)([^;]*\.setPosition\(0, -\s*ah\.delta\);)/, /(;)([^;]*\.setPosition\(0, -\s*ah\.delta\);)/,
<![CDATA[$1 '$1' +
if (autoHIDE.winUtil) ' if (autoHIDE.winUtil)' +
autoHIDE.winUtil.setRedraw(false, false); ' autoHIDE.winUtil.setRedraw(false, false);' +
$2 ' $2' +
gBrowser.treeStyleTab.autoHide.extraYOffset = ah.delta; ' gBrowser.treeStyleTab.autoHide.extraYOffset = ah.delta;' +
window.setTimeout(function() { ' window.setTimeout(function() {' +
gBrowser.treeStyleTab.autoHide.redrawContentArea(); ' gBrowser.treeStyleTab.autoHide.redrawContentArea();' +
if (autoHIDE.winUtil) ' if (autoHIDE.winUtil)' +
autoHIDE.winUtil.setRedraw(true, false); ' autoHIDE.winUtil.setRedraw(true, false);' +
}, 0); ' }, 0);'
]]>.toString()
).replace( ).replace(
/(;)([^;]*\.setPosition\(0, 0\);)/, /(;)([^;]*\.setPosition\(0, 0\);)/,
<![CDATA[$1 '$1' +
if (autoHIDE.winUtil) ' if (autoHIDE.winUtil)' +
autoHIDE.winUtil.setRedraw(false, false); ' autoHIDE.winUtil.setRedraw(false, false);' +
$2 ' $2' +
gBrowser.treeStyleTab.autoHide.extraYOffset = 0; ' gBrowser.treeStyleTab.autoHide.extraYOffset = 0;' +
window.setTimeout(function() { ' window.setTimeout(function() {' +
gBrowser.treeStyleTab.autoHide.redrawContentArea(); ' gBrowser.treeStyleTab.autoHide.redrawContentArea();' +
if (autoHIDE.winUtil) ' if (autoHIDE.winUtil)' +
autoHIDE.winUtil.setRedraw(true, false); ' autoHIDE.winUtil.setRedraw(true, false);' +
}, 0); ' }, 0);'
]]>.toString()
)); ));
} }
} }
@ -960,20 +929,19 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
if (func.indexOf('treeStyleTab') < 0) { if (func.indexOf('treeStyleTab') < 0) {
eval('sidewikiWindowHandler.barsContainer_.geometry_.__proto__.getWindowSizeForDrawers = '+func.replace( eval('sidewikiWindowHandler.barsContainer_.geometry_.__proto__.getWindowSizeForDrawers = '+func.replace(
'return {', 'return {',
<![CDATA[ ' if ("treeStyleTab" in this.topLevelDocument_.getElementById("content")) {' +
if ('treeStyleTab' in this.topLevelDocument_.getElementById('content')) { ' let b = this.topLevelDocument_.getElementById("content");' +
let b = this.topLevelDocument_.getElementById('content'); ' let box = b.mPanelContainer.boxObject;' +
let box = b.mPanelContainer.boxObject; ' return {' +
return { ' height : box.height,' +
height : box.height, ' width : box.width,' +
width : box.width, ' top : box.y,' +
top : box.y, ' left : box.x,' +
left : box.x, ' right : this.topLevelWindow_.innerWidth - box.x - box.width,' +
right : this.topLevelWindow_.innerWidth - box.x - box.width, ' tabBoxHeight : 0' +
tabBoxHeight : 0 ' };' +
}; ' }' +
} '$&'
$&]]>
)); ));
} }
} }
@ -995,11 +963,10 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
'[maxSizeProp]' '[maxSizeProp]'
).replace( ).replace(
'{', '{',
<![CDATA[$& '{' +
var scrollProp = gBrowser.treeStyleTab.isVertical ? 'scrollHeight' : 'scrollWidth' ; ' var scrollProp = gBrowser.treeStyleTab.isVertical ? "scrollHeight" : "scrollWidth" ;' +
var sizeProp = gBrowser.treeStyleTab.isVertical ? 'height' : 'width' ; ' var sizeProp = gBrowser.treeStyleTab.isVertical ? "height" : "width" ;' +
var maxSizeProp = gBrowser.treeStyleTab.isVertical ? 'maxHeight' : 'maxWidth' ; ' var maxSizeProp = gBrowser.treeStyleTab.isVertical ? "maxHeight" : "maxWidth" ;'
]]>
) )
} }
eval('SMOOTHLYCLOSETABS.shrinkTab = '+ eval('SMOOTHLYCLOSETABS.shrinkTab = '+
@ -1214,21 +1181,19 @@ TreeStyleTabWindowHelper.overrideExtensionsDelayed = function TSTWH_overrideExte
eval('gBrowser.TMP_openTabNext = '+ eval('gBrowser.TMP_openTabNext = '+
gBrowser.TMP_openTabNext.toSource().replace( gBrowser.TMP_openTabNext.toSource().replace(
'this.mCurrentTab._tPos + this.tabContainer.nextTab', 'this.mCurrentTab._tPos + this.tabContainer.nextTab',
<![CDATA[ ' (function() {' +
(function() { ' var tabs = this.treeStyleTab.getDescendantTabs(this.mCurrentTab);' +
var tabs = this.treeStyleTab.getDescendantTabs(this.mCurrentTab); ' if (tabs.length) {' +
if (tabs.length) { ' var index = this.treeStyleTab.getPref("extensions.tabmix.openTabNextInverse") ?' +
var index = this.treeStyleTab.getPref("extensions.tabmix.openTabNextInverse") ? ' tabs[tabs.length - 1]._tPos :' +
tabs[tabs.length - 1]._tPos : ' this.mCurrentTab._tPos ;' +
this.mCurrentTab._tPos ; ' if (index < aTab._tPos) index++;' +
if (index < aTab._tPos) index++; ' return index;' +
return index; ' }' +
} ' else {' +
else { ' return ($&);' +
return ($&); ' }' +
} ' }).call(this)'
}).call(this)
]]>
) )
); );
@ -1244,16 +1209,14 @@ TreeStyleTabWindowHelper.overrideExtensionsDelayed = function TSTWH_overrideExte
eval('MultiLinks_Wrapper.LinksManager.OpenInNewTabs = '+ eval('MultiLinks_Wrapper.LinksManager.OpenInNewTabs = '+
MultiLinks_Wrapper.LinksManager.OpenInNewTabs.toSource().replace( MultiLinks_Wrapper.LinksManager.OpenInNewTabs.toSource().replace(
'{', '{',
<![CDATA[{ '{' +
if (!TreeStyleTabService.checkToOpenChildTab(getBrowser())) ' if (!TreeStyleTabService.checkToOpenChildTab(getBrowser()))' +
TreeStyleTabService.readyToOpenChildTab(getBrowser(), true); ' TreeStyleTabService.readyToOpenChildTab(getBrowser(), true);'
]]>
).replace( ).replace(
/(\}\)?)$/, /(\}\)?)$/,
<![CDATA[ ' if (TreeStyleTabService.checkToOpenChildTab(getBrowser()))' +
if (TreeStyleTabService.checkToOpenChildTab(getBrowser())) ' TreeStyleTabService.stopToOpenChildTab(getBrowser());' +
TreeStyleTabService.stopToOpenChildTab(getBrowser()); '$1'
$1]]>
) )
); );
} }