diff --git a/content/treestyletab/config.xul b/content/treestyletab/config.xul index 1dfa7216..fbcf111e 100644 --- a/content/treestyletab/config.xul +++ b/content/treestyletab/config.xul @@ -174,6 +174,9 @@ + @@ -207,6 +210,11 @@ preference="extensions.treestyletab.show.context-menu-tabbarPosition" label="&context.tabbarPosition.label;"/> + + + + + + diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index d9807773..9103b1ef 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -18,6 +18,7 @@ TreeStyleTabBrowser.prototype = { kMENUITEM_AUTOHIDE : 'context-item-toggleAutoHide', kMENUITEM_FIXED : 'context-item-toggleFixed', kMENUITEM_POSITION : 'context-menu-tabbarPosition', + kMENUITEM_BOOKMARKSUBTREE : 'context-item-bookmarkTabSubTree', mTabBrowser : null, @@ -445,6 +446,14 @@ TreeStyleTabBrowser.prototype = { item.setAttribute('id', item.getAttribute('id')+suffix); tabContext.appendChild(item); }); + + var item = document.getElementById(aSelf.kMENUITEM_BOOKMARKSUBTREE).cloneNode(true); + item.setAttribute('id', item.getAttribute('id')+suffix); + var refNodes = tabContext.getElementsByAttribute('command', 'Browser:BookmarkAllTabs'); + if (refNodes && refNodes.length) + tabContext.insertBefore(item, refNodes[0].nextSibling || refNodes[0]); + else + tabContext.appendChild(item); }, 0, this); var allTabPopup = document.getAnonymousElementByAttribute(b.mTabContainer, 'anonid', 'alltabs-popup'); @@ -1662,7 +1671,7 @@ TreeStyleTabBrowser.prototype = { item.removeAttribute('hidden'); else item.setAttribute('hidden', true); - this.showHideRemoveSubTreeMenuItem(item, [b.mContextTab]); + this.showHideSubTreeMenuItem(item, [b.mContextTab]); item = this.evaluateXPath( 'descendant::xul:menuitem[starts-with(@id, "'+this.kMENUITEM_REMOVECHILDREN+'")]', @@ -1673,7 +1682,7 @@ TreeStyleTabBrowser.prototype = { item.removeAttribute('hidden'); else item.setAttribute('hidden', true); - this.showHideRemoveSubTreeMenuItem(item, [b.mContextTab]); + this.showHideSubTreeMenuItem(item, [b.mContextTab]); // collapse/expand all sep = this.evaluateXPath( @@ -1803,6 +1812,18 @@ TreeStyleTabBrowser.prototype = { else { sep.setAttribute('hidden', true); } + + // bookmark + item = this.evaluateXPath( + 'descendant::xul:menuitem[starts-with(@id, "'+this.kMENUITEM_BOOKMARKSUBTREE+'")]', + aEvent.currentTarget, + XPathResult.FIRST_ORDERED_NODE_TYPE + ).singleNodeValue; + if (this.getTreePref('show.'+this.kMENUITEM_BOOKMARKSUBTREE)) + item.removeAttribute('hidden'); + else + item.setAttribute('hidden', true); + this.showHideSubTreeMenuItem(item, [b.mContextTab]); }, initAllTabsPopup : function(aEvent) diff --git a/defaults/preferences/treestyletab.js b/defaults/preferences/treestyletab.js index 039f53e8..9e8d6bd3 100644 --- a/defaults/preferences/treestyletab.js +++ b/defaults/preferences/treestyletab.js @@ -47,6 +47,7 @@ pref("extensions.treestyletab.show.context-item-expandAllSubtree", true); pref("extensions.treestyletab.show.context-item-toggleAutoHide", true); pref("extensions.treestyletab.show.context-item-toggleFixed", true); pref("extensions.treestyletab.show.context-menu-tabbarPosition", true); +pref("extensions.treestyletab.show.context-item-bookmarkTabSubTree", true); pref("extensions.treestyletab.openOuterLinkInNewTab", false); pref("extensions.treestyletab.openAnyLinkInNewTab", false); diff --git a/locale/de-DE/treestyletab/treestyletab.dtd b/locale/de-DE/treestyletab/treestyletab.dtd index f6b8a645..bf96c8b8 100644 --- a/locale/de-DE/treestyletab/treestyletab.dtd +++ b/locale/de-DE/treestyletab/treestyletab.dtd @@ -135,3 +135,5 @@ + + diff --git a/locale/en-US/treestyletab/treestyletab.dtd b/locale/en-US/treestyletab/treestyletab.dtd index 13b03bc7..d997ba1b 100644 --- a/locale/en-US/treestyletab/treestyletab.dtd +++ b/locale/en-US/treestyletab/treestyletab.dtd @@ -135,3 +135,5 @@ + + diff --git a/locale/es-ES/treestyletab/treestyletab.dtd b/locale/es-ES/treestyletab/treestyletab.dtd index 188a8569..cf7a116e 100644 --- a/locale/es-ES/treestyletab/treestyletab.dtd +++ b/locale/es-ES/treestyletab/treestyletab.dtd @@ -135,3 +135,5 @@ + + diff --git a/locale/it-IT/treestyletab/treestyletab.dtd b/locale/it-IT/treestyletab/treestyletab.dtd index 7e29444c..ce7edfc2 100644 --- a/locale/it-IT/treestyletab/treestyletab.dtd +++ b/locale/it-IT/treestyletab/treestyletab.dtd @@ -135,3 +135,5 @@ + + diff --git a/locale/ja/treestyletab/treestyletab.dtd b/locale/ja/treestyletab/treestyletab.dtd index a3cdad6c..d59bb792 100644 --- a/locale/ja/treestyletab/treestyletab.dtd +++ b/locale/ja/treestyletab/treestyletab.dtd @@ -133,3 +133,5 @@ + + diff --git a/locale/zh-CN/treestyletab/treestyletab.dtd b/locale/zh-CN/treestyletab/treestyletab.dtd index 7b8a608c..c6bff90e 100644 --- a/locale/zh-CN/treestyletab/treestyletab.dtd +++ b/locale/zh-CN/treestyletab/treestyletab.dtd @@ -135,3 +135,5 @@ + + diff --git a/locale/zh-TW/treestyletab/treestyletab.dtd b/locale/zh-TW/treestyletab/treestyletab.dtd index 74409d02..a7e94324 100644 --- a/locale/zh-TW/treestyletab/treestyletab.dtd +++ b/locale/zh-TW/treestyletab/treestyletab.dtd @@ -130,3 +130,5 @@ + +