Improved compatibility with Tab Utilities. (If TU is installed, TST failed to open trees of tabs from bookmark folders.)

This commit is contained in:
Piro / SHIMODA Hiroshi 2011-10-30 01:45:02 +09:00
parent 401b83b92f
commit 2e28ffe4c2

View File

@ -211,10 +211,14 @@ var TreeStyleTabBookmarksService = {
catch(e) { // Firefox 3.6 or older
ns = window;
}
var sv = this;
with (ns) {
eval('PlacesUIUtils._openTabset = '+
PlacesUIUtils._openTabset.toSource().replace(
let (method = (sv.getTreePref('compatibility.TabUtilities') && PlacesUIUtils.TU__openTabset) ?
'TU__openTabset' :
'_openTabset') {
eval('PlacesUIUtils.'+method+' = '+
PlacesUIUtils[method].toSource().replace(
/(function[^\(]*\([^\)]+)(\))/,
'$1, aFolderTitle$2'
).replace(
@ -246,9 +250,15 @@ var TreeStyleTabBookmarksService = {
$1]]>
)
);
if (sv.getTreePref('compatibility.TabUtilities') && method.indexOf('TU_') > -1)
window[method] = PlacesUIUtils[method];
}
eval('PlacesUIUtils.openContainerNodeInTabs = '+
PlacesUIUtils.openContainerNodeInTabs.toSource().replace(
let (method = (sv.getTreePref('compatibility.TabUtilities') && PlacesUIUtils.TU_openContainerNodeInTabs) ?
'TU_openContainerNodeInTabs' :
'openContainerNodeInTabs') {
eval('PlacesUIUtils.'+method+' = '+
PlacesUIUtils[method].toSource().replace(
/(this\._openTabset\([^\)]+)(\))/,
<![CDATA[
let (w = '_getTopBrowserWin' in this ?
@ -265,9 +275,15 @@ var TreeStyleTabBookmarksService = {
]]>
)
);
if (sv.getTreePref('compatibility.TabUtilities') && method.indexOf('TU_') > -1)
window[method] = PlacesUIUtils[method];
}
eval('PlacesUIUtils.openURINodesInTabs = '+
PlacesUIUtils.openURINodesInTabs.toSource().replace(
let (method = (sv.getTreePref('compatibility.TabUtilities') && PlacesUIUtils.TU_openURINodesInTabs) ?
'TU_openURINodesInTabs' :
'openURINodesInTabs') {
eval('PlacesUIUtils.'+method+' = '+
PlacesUIUtils[method].toSource().replace(
'{',
<![CDATA[{
var TSTBS;
@ -295,6 +311,9 @@ var TreeStyleTabBookmarksService = {
$2]]>
)
);
if (sv.getTreePref('compatibility.TabUtilities') && method.indexOf('TU_') > -1)
window[method] = PlacesUIUtils[method];
}
PlacesUIUtils.__treestyletab__done = true;