フォルダの名前をタブのタイトルに表示するようにした

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4528 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-06-17 16:49:18 +00:00
parent 3d2a6d450e
commit f4527db7bc
3 changed files with 24 additions and 6 deletions

View File

@ -1,7 +1,8 @@
content treestyletab jar:chrome/treestyletab.jar!/content/treestyletab/
overlay chrome://browser/content/browser.xul chrome://treestyletab/content/treestyletab.xul
overlay chrome://browser/content/browser.xul chrome://treestyletab/content/treestyletab-fx3.xul appversion>=3.0overlay chrome://browser/content/bookmarks/bookmarksPanel.xul chrome://treestyletab/content/bookmarksOverlay.xul
overlay chrome://browser/content/browser.xul chrome://treestyletab/content/treestyletab-fx3.xul appversion>=3.0
overlay chrome://browser/content/bookmarks/bookmarksPanel.xul chrome://treestyletab/content/bookmarksOverlay.xul
overlay chrome://multipletab/content/config.xul chrome://treestyletab/content/multipletabConfigOverlay.xul
style chrome://browser/content/browser.xul chrome://treestyletab/content/treestyletab-3.5.css appversion>=3.1b3pre

View File

@ -34,10 +34,12 @@ window.addEventListener('load', function() {
}
// Firefox 3
if ('PlacesUIUtils' in window || 'PlacesUtils' in window) {
var urils = 'PlacesUIUtils' in window ? PlacesUIUtils : PlacesUtils ;
eval('urils._openTabset = '+
urils._openTabset.toSource().replace(
if ('PlacesUIUtils' in window) {
eval('PlacesUIUtils._openTabset = '+
PlacesUIUtils._openTabset.toSource().replace(
/(function[^\(]*\([^\)]+)(\))/,
'$1, aFolderTitle$2'
).replace(
'browserWindow.getBrowser().loadTabs(',
<><![CDATA[
if (
@ -51,7 +53,7 @@ window.addEventListener('load', function() {
) {
TreeStyleTabService.readyToOpenNewTabGroup();
if (TreeStyleTabService.getTreePref('openGroupBookmarkAsTabSubTree.underParent'))
urls.unshift('data:text/html,'+encodeURIComponent('<title>group</title>'));
urls.unshift('data:text/html,'+encodeURIComponent(TreeStyleTabService.createFolderTabHTML(aFolderTitle)));
replaceCurrentTab = false;
}
else if (!TreeStyleTabService.getPref('browser.tabs.loadFolderAndReplace')) {
@ -60,5 +62,11 @@ window.addEventListener('load', function() {
$&]]></>
)
);
eval('PlacesUIUtils.openContainerNodeInTabs = '+
PlacesUIUtils.openContainerNodeInTabs.toSource().replace(
/(this\._openTabset\([^\)]+)(\))/,
'$1, aNode.title$2'
)
);
}
}, false);

View File

@ -716,6 +716,15 @@ var TreeStyleTabService = {
return Number(style.getPropertyValue(aProp).replace(/px$/, ''));
},
createFolderTabHTML : function(aTitle)
{
return '<title>'+
String(aTitle).replace(/&/g, '$amp;')
.replace(/</g, '$lt;')
.replace(/>/g, '$gt;')+
'</title>';
},
/* get tab(s) */
getTabById : function(aId, aTabBrowserChildren)