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