From 3acb6a2bfc899780c3704647c4df356b0f411d12 Mon Sep 17 00:00:00 2001 From: SHIMODA Hiroshi Date: Wed, 8 Dec 2010 20:34:42 +0900 Subject: [PATCH] add "close other tabs except this tree" context menu item --- content/treestyletab/config.xul | 9 +++++++++ content/treestyletab/treestyletab.js | 20 ++++++++++++++++++++ content/treestyletab/treestyletab.xul | 7 +++++++ content/treestyletab/treestyletabbrowser.js | 12 ++++++++++++ defaults/preferences/treestyletab.js | 1 + locale/de-DE/treestyletab/treestyletab.dtd | 2 ++ locale/en-US/treestyletab/treestyletab.dtd | 2 ++ locale/es-ES/treestyletab/treestyletab.dtd | 2 ++ locale/fr-FR/treestyletab/treestyletab.dtd | 2 ++ locale/it-IT/treestyletab/treestyletab.dtd | 2 ++ locale/ja/treestyletab/treestyletab.dtd | 2 ++ locale/pl/treestyletab/treestyletab.dtd | 2 ++ locale/ru-RU/treestyletab/treestyletab.dtd | 2 ++ locale/zh-CN/treestyletab/treestyletab.dtd | 2 ++ locale/zh-TW/treestyletab/treestyletab.dtd | 2 ++ modules/utils.js | 12 ++++++++++++ 16 files changed, 81 insertions(+) diff --git a/content/treestyletab/config.xul b/content/treestyletab/config.xul index 583b8250..da6255d7 100644 --- a/content/treestyletab/config.xul +++ b/content/treestyletab/config.xul @@ -245,6 +245,9 @@ + @@ -282,9 +285,15 @@ preference="extensions.treestyletab.show.context-item-removeTabSubtree" label="&context.removeTabSubtree.label;"/> + + + + + + diff --git a/locale/en-US/treestyletab/treestyletab.dtd b/locale/en-US/treestyletab/treestyletab.dtd index 1f47d995..82005e23 100644 --- a/locale/en-US/treestyletab/treestyletab.dtd +++ b/locale/en-US/treestyletab/treestyletab.dtd @@ -146,6 +146,8 @@ + + diff --git a/locale/es-ES/treestyletab/treestyletab.dtd b/locale/es-ES/treestyletab/treestyletab.dtd index 7abf2263..274ff278 100644 --- a/locale/es-ES/treestyletab/treestyletab.dtd +++ b/locale/es-ES/treestyletab/treestyletab.dtd @@ -151,6 +151,8 @@ + + diff --git a/locale/fr-FR/treestyletab/treestyletab.dtd b/locale/fr-FR/treestyletab/treestyletab.dtd index 89a9d86f..30360198 100644 --- a/locale/fr-FR/treestyletab/treestyletab.dtd +++ b/locale/fr-FR/treestyletab/treestyletab.dtd @@ -145,6 +145,8 @@ + + diff --git a/locale/it-IT/treestyletab/treestyletab.dtd b/locale/it-IT/treestyletab/treestyletab.dtd index 535ac683..734ca194 100644 --- a/locale/it-IT/treestyletab/treestyletab.dtd +++ b/locale/it-IT/treestyletab/treestyletab.dtd @@ -149,6 +149,8 @@ + + diff --git a/locale/ja/treestyletab/treestyletab.dtd b/locale/ja/treestyletab/treestyletab.dtd index 9c6dc931..584fc9aa 100644 --- a/locale/ja/treestyletab/treestyletab.dtd +++ b/locale/ja/treestyletab/treestyletab.dtd @@ -145,6 +145,8 @@ + + diff --git a/locale/pl/treestyletab/treestyletab.dtd b/locale/pl/treestyletab/treestyletab.dtd index f5499e84..b187bc3b 100644 --- a/locale/pl/treestyletab/treestyletab.dtd +++ b/locale/pl/treestyletab/treestyletab.dtd @@ -139,6 +139,8 @@ + + diff --git a/locale/ru-RU/treestyletab/treestyletab.dtd b/locale/ru-RU/treestyletab/treestyletab.dtd index c382ae33..78c8a686 100755 --- a/locale/ru-RU/treestyletab/treestyletab.dtd +++ b/locale/ru-RU/treestyletab/treestyletab.dtd @@ -145,6 +145,8 @@ + + diff --git a/locale/zh-CN/treestyletab/treestyletab.dtd b/locale/zh-CN/treestyletab/treestyletab.dtd index aebb5833..1e06761c 100644 --- a/locale/zh-CN/treestyletab/treestyletab.dtd +++ b/locale/zh-CN/treestyletab/treestyletab.dtd @@ -145,6 +145,8 @@ + + diff --git a/locale/zh-TW/treestyletab/treestyletab.dtd b/locale/zh-TW/treestyletab/treestyletab.dtd index 9f589bd3..f0754a61 100644 --- a/locale/zh-TW/treestyletab/treestyletab.dtd +++ b/locale/zh-TW/treestyletab/treestyletab.dtd @@ -147,6 +147,8 @@ + + diff --git a/modules/utils.js b/modules/utils.js index 6fab4988..a2eda1fc 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -1384,6 +1384,18 @@ var TreeStyleTabUtils = { ); }, + get allRootTabs() /* PUBLIC API */ + { + return this.rootTabs; + }, + + get visibleRootTabs() /* PUBLIC API */ + { + return this.rootTabs.filter(function(aTab) { + return !aTab.hidden; + }); + }, + canCollapseSubtree : function TSTUtils_canCollapseSubtree(aTabOrTabBrowser) /* PUBLIC API */ { if (aTabOrTabBrowser &&