From 8a77d791c749dde9f79a17d559b2b020927719f9 Mon Sep 17 00:00:00 2001 From: Piro / SHIMODA Hiroshi Date: Sun, 23 Jan 2011 16:01:26 +0900 Subject: [PATCH] indicate which toolbar becomes the tab bar, by tooltip --- content/treestyletab/treestyletabbrowser.js | 44 +++++++++++++++++-- .../treestyletab/treestyletab.properties | 3 ++ .../treestyletab/treestyletab.properties | 3 ++ .../treestyletab/treestyletab.properties | 3 ++ .../treestyletab/treestyletab.properties | 3 ++ .../treestyletab/treestyletab.properties | 3 ++ .../ja/treestyletab/treestyletab.properties | 3 ++ .../pl/treestyletab/treestyletab.properties | 3 ++ .../treestyletab/treestyletab.properties | 3 ++ .../treestyletab/treestyletab.properties | 3 ++ .../treestyletab/treestyletab.properties | 3 ++ modules/utils.js | 25 ++++++----- skin/classic/treestyletab/ui.css | 2 +- 13 files changed, 85 insertions(+), 16 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 500f3b94..909c81ed 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -1743,7 +1743,9 @@ TreeStyleTabBrowser.prototype = { this.tabbarDNDObserver.endListenEvents(); - this.updateCustomizedTabsToolbar(); + window.setTimeout(function(aSelf) { + aSelf.updateCustomizedTabsToolbar(); + }, 100, this); this.startRendering(); }, @@ -1763,6 +1765,10 @@ TreeStyleTabBrowser.prototype = { this.ownerToolbar.classList.remove(this.kTABBAR_TOOLBAR_READY); this.ownerToolbar.classList.add(this.kTABBAR_TOOLBAR); + Array.slice(document.querySelectorAll('.'+this.kTABBAR_TOOLBAR_READY_POPUP)) + .forEach(function(aPanel) { + this.safeRemovePopup(aPanel); + }, this); var position = this._lastTabbarPositionBeforeDestroyed || this.position; delete this._lastTabbarPositionBeforeDestroyed; @@ -1789,10 +1795,42 @@ TreeStyleTabBrowser.prototype = { updateCustomizedTabsToolbar : function TSTBrowser_updateCustomizedTabsToolbar() { var oldToolbar = document.querySelector('.'+this.kTABBAR_TOOLBAR_READY); - if (oldToolbar) + if (oldToolbar) { + this.safeRemovePopup(document.getElementById(oldToolbar.id+'-'+this.kTABBAR_TOOLBAR_READY_POPUP)); oldToolbar.classList.remove(this.kTABBAR_TOOLBAR_READY); + } - this.ownerToolbar.classList.remove(this.kTABBAR_TOOLBAR_READY); + this.ownerToolbar.classList.add(this.kTABBAR_TOOLBAR_READY); + + var id = this.ownerToolbar.id+'-'+this.kTABBAR_TOOLBAR_READY_POPUP; + var panel = document.getElementById(id); + if (!panel) { + panel = document.createElement('panel'); + panel.setAttribute('id', id); + panel.setAttribute('class', this.kTABBAR_TOOLBAR_READY_POPUP); + panel.setAttribute('noautohide', true); + panel.appendChild(document.createElement('label')); + let position = this._lastTabbarPositionBeforeDestroyed || this.position; + let label = this.treeBundle.getString('toolbarCustomizing_tabbar_'+(position == 'left' || position == 'right' ? 'vertical' : 'horizontal' )); + panel.firstChild.setAttribute('value', label); + document.getElementById('mainPopupSet').appendChild(panel); + } + panel.openPopup(this.ownerToolbar, 'end_after', 0, 0, false, false); + }, + safeRemovePopup : function TSTBrowser_safeRemovePopup(aPopup) + { + if (!aPopup) + return; + if (aPopup.state == 'open') { + aPopup.addEventListener('popuphidden', function(aEvent) { + aPopup.removeEventListener(aEvent.type, arguments.callee, false); + aPopup.parentNode.removeChild(aPopup); + }, false); + aPopup.hidePopup(); + } + else { + aPopup.parentNode.removeChild(aPopup); + } }, /* nsIObserver */ diff --git a/locale/de-DE/treestyletab/treestyletab.properties b/locale/de-DE/treestyletab/treestyletab.properties index 71a1c0a6..921225cb 100644 --- a/locale/de-DE/treestyletab/treestyletab.properties +++ b/locale/de-DE/treestyletab/treestyletab.properties @@ -43,6 +43,9 @@ bookmarkProperty.parent.current.label=[ %S ] undo_changeTabbarPosition_label=Position der Tableiste ändern +toolbarCustomizing_tabbar_horizontal=This toolbar becomes a tab bar. +toolbarCustomizing_tabbar_vertical=This toolbar becomes a vertical tab bar. + compatibility_STM_warning_title=Super Tab Mode steht mit Tree Style Tab in Konflikt compatibility_STM_warning_text=Durch Links geöffnete Tabs werden dem aktiven Tab nich untergeordnet, weil die Position des neuen Tabs von Super Tab Mode kontrolliert wird. Welche Funktion soll aktiviert sein?\n(*Diese Einstellung kann manuell in der Konfiguration von Super Tab Mode vorgenommen werden.) diff --git a/locale/en-US/treestyletab/treestyletab.properties b/locale/en-US/treestyletab/treestyletab.properties index 826713df..192e788b 100644 --- a/locale/en-US/treestyletab/treestyletab.properties +++ b/locale/en-US/treestyletab/treestyletab.properties @@ -38,6 +38,9 @@ bookmarkProperty.parent.current.label=[ %S ] undo_changeTabbarPosition_label=Change the position of the tab bar +toolbarCustomizing_tabbar_horizontal=This toolbar becomes a tab bar. +toolbarCustomizing_tabbar_vertical=This toolbar becomes a vertical tab bar. + compatibility_STM_warning_title=Super Tab Mode collides with Tree Style Tab compatibility_STM_warning_text=New tabs opened from links (or others) don't become child of the current tab, because the position of new tabs is controlled by Super Tab Mode. Which feature do you want to be enabled?\n(*You can change those settings manually by the configuration dialog of Super Tab Mode.) diff --git a/locale/es-ES/treestyletab/treestyletab.properties b/locale/es-ES/treestyletab/treestyletab.properties index c9270a88..daa6d0e6 100644 --- a/locale/es-ES/treestyletab/treestyletab.properties +++ b/locale/es-ES/treestyletab/treestyletab.properties @@ -43,6 +43,9 @@ bookmarkProperty.parent.current.label=[ %S ] undo_changeTabbarPosition_label=Change the position of the tab bar +toolbarCustomizing_tabbar_horizontal=This toolbar becomes a tab bar. +toolbarCustomizing_tabbar_vertical=This toolbar becomes a vertical tab bar. + compatibility_STM_warning_title=Super Tab Mode collides with Tree Style Tab compatibility_STM_warning_text=New tabs opened from links (or others) don't become child of the current tab, because the position of new tabs is controlled by Super Tab Mode. Which feature do you want to be enabled?\n(*You can change those settings manually by the configuration dialog of Super Tab Mode.) diff --git a/locale/fr-FR/treestyletab/treestyletab.properties b/locale/fr-FR/treestyletab/treestyletab.properties index d1002743..9da388a6 100644 --- a/locale/fr-FR/treestyletab/treestyletab.properties +++ b/locale/fr-FR/treestyletab/treestyletab.properties @@ -43,6 +43,9 @@ bookmarkProperty.parent.current.label=[ %S ] undo_changeTabbarPosition_label=Changer l'emplacement du panneau des onglets +toolbarCustomizing_tabbar_horizontal=This toolbar becomes a tab bar. +toolbarCustomizing_tabbar_vertical=This toolbar becomes a vertical tab bar. + compatibility_STM_warning_title=Super Tab Mode est en conflit avec Tree Style Tab compatibility_STM_warning_text=Les nouveaux onglets ouverts à partir de liens (ou autre) ne deviennent pas des onglets enfants de l'onglet actuel, car la position des nouveaux onglets est controlée par Super Tab Mode. Quelle fonctionnalité voulez-vous autoriser ?\n(Vous pouvez changer ces réglages manuellement dans le dialogue de configuration de Super Tab Mode.) diff --git a/locale/it-IT/treestyletab/treestyletab.properties b/locale/it-IT/treestyletab/treestyletab.properties index 43fa8c22..78429b7b 100644 --- a/locale/it-IT/treestyletab/treestyletab.properties +++ b/locale/it-IT/treestyletab/treestyletab.properties @@ -43,6 +43,9 @@ bookmarkProperty.parent.current.label=[ %S ] undo_changeTabbarPosition_label=Change the position of the tab bar +toolbarCustomizing_tabbar_horizontal=This toolbar becomes a tab bar. +toolbarCustomizing_tabbar_vertical=This toolbar becomes a vertical tab bar. + compatibility_STM_warning_title=Super Tab Mode collides with Tree Style Tab compatibility_STM_warning_text=New tabs opened from links (or others) don't become child of the current tab, because the position of new tabs is controlled by Super Tab Mode. Which feature do you want to be enabled?\n(*You can change those settings manually by the configuration dialog of Super Tab Mode.) diff --git a/locale/ja/treestyletab/treestyletab.properties b/locale/ja/treestyletab/treestyletab.properties index 4b437d8d..8bc9b1c9 100644 --- a/locale/ja/treestyletab/treestyletab.properties +++ b/locale/ja/treestyletab/treestyletab.properties @@ -38,6 +38,9 @@ bookmarkProperty.parent.current.label=[ %S ] undo_changeTabbarPosition_label=タブバーの位置を変更 +toolbarCustomizing_tabbar_horizontal=このツールバーはタブバーになります +toolbarCustomizing_tabbar_vertical=このツールバーは縦型のタブバーになります + compatibility_STM_warning_title=ツリー型タブとSuper Tab Modeの機能が衝突しています compatibility_STM_warning_text=Super Tab Modeによって新しいタブを開く位置が変更されているため、リンクなどから新しくタブを開いた場合に、自動的には現在のタブの子になりません。どうしますか?\n(※Super Tab Modeの設定ダイアログで後から設定を変更することもできます) diff --git a/locale/pl/treestyletab/treestyletab.properties b/locale/pl/treestyletab/treestyletab.properties index ade26eca..cf32649a 100644 --- a/locale/pl/treestyletab/treestyletab.properties +++ b/locale/pl/treestyletab/treestyletab.properties @@ -43,6 +43,9 @@ bookmarkProperty.parent.current.label=[ %S ] undo_changeTabbarPosition_label=Zmień położenie paska kart +toolbarCustomizing_tabbar_horizontal=This toolbar becomes a tab bar. +toolbarCustomizing_tabbar_vertical=This toolbar becomes a vertical tab bar. + compatibility_STM_warning_title=Super Tab Mode collides with Tree Style Tab compatibility_STM_warning_text=New tabs opened from links (or others) don't become child of the current tab, because the position of new tabs is controlled by Super Tab Mode. Which feature do you want to be enabled?\n(*You can change those settings manually by the configuration dialog of Super Tab Mode.) diff --git a/locale/ru-RU/treestyletab/treestyletab.properties b/locale/ru-RU/treestyletab/treestyletab.properties index 6a0fa0a7..57741dab 100755 --- a/locale/ru-RU/treestyletab/treestyletab.properties +++ b/locale/ru-RU/treestyletab/treestyletab.properties @@ -43,6 +43,9 @@ bookmarkProperty.parent.current.label=[ %S ] undo_changeTabbarPosition_label=Сменить позицию панели вкладок +toolbarCustomizing_tabbar_horizontal=This toolbar becomes a tab bar. +toolbarCustomizing_tabbar_vertical=This toolbar becomes a vertical tab bar. + compatibility_STM_warning_title=Совместная работа Super Tab Mode и Tree Style Tab compatibility_STM_warning_text=Новые вкладки, открываемые из ссылок (или по другому), не могут быть дочерними для текущей вкладки, так как позиция новых вкладок определяется в Super Tab Mode. Какие уставки включить?\n(*Можно вручную сменить эти уставки в окне конфигурации Super Tab Mode.) diff --git a/locale/zh-CN/treestyletab/treestyletab.properties b/locale/zh-CN/treestyletab/treestyletab.properties index 9c6cf735..ec4ee48a 100644 --- a/locale/zh-CN/treestyletab/treestyletab.properties +++ b/locale/zh-CN/treestyletab/treestyletab.properties @@ -43,6 +43,9 @@ bookmarkProperty.parent.current.label=[ %S ] undo_changeTabbarPosition_label=改变标签栏的位置 +toolbarCustomizing_tabbar_horizontal=This toolbar becomes a tab bar. +toolbarCustomizing_tabbar_vertical=This toolbar becomes a vertical tab bar. + compatibility_STM_warning_title=Super Tab Mode 跟 Tree Style Tab 不兼容 compatibility_STM_warning_text=打开自链接(或其他)的新标签不会成为当前标签的子标签,因为 Super Tab Mode 会控制新标签的位置。你想保留哪种功能特性?\n(你可以手动在 Super Tab Mode 的选项对话框中更改那些设置。) diff --git a/locale/zh-TW/treestyletab/treestyletab.properties b/locale/zh-TW/treestyletab/treestyletab.properties index e01b9b61..26a290cf 100644 --- a/locale/zh-TW/treestyletab/treestyletab.properties +++ b/locale/zh-TW/treestyletab/treestyletab.properties @@ -38,6 +38,9 @@ bookmarkProperty.parent.current.label=[ %S ] undo_changeTabbarPosition_label=Change the position of the tab bar +toolbarCustomizing_tabbar_horizontal=This toolbar becomes a tab bar. +toolbarCustomizing_tabbar_vertical=This toolbar becomes a vertical tab bar. + compatibility_STM_warning_title=Super Tab Mode collides with Tree Style Tab compatibility_STM_warning_text=New tabs opened from links (or others) don't become child of the current tab, because the position of new tabs is controlled by Super Tab Mode. Which feature do you want to be enabled?\n(*You can change those settings manually by the configuration dialog of Super Tab Mode.) diff --git a/modules/utils.js b/modules/utils.js index 07d74dc2..544d81df 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -109,18 +109,19 @@ var TreeStyleTabUtils = { kTABBAR_MOVE_NORMAL : 'normal', /* classes */ - kTWISTY : 'treestyletab-twisty', - kTWISTY_CONTAINER : 'treestyletab-twisty-container', - kDROP_MARKER : 'treestyletab-drop-marker', - kDROP_MARKER_CONTAINER : 'treestyletab-drop-marker-container', - kCOUNTER : 'treestyletab-counter', - kCOUNTER_CONTAINER : 'treestyletab-counter-container', - kCOUNTER_PAREN : 'treestyletab-counter-paren', - kSPLITTER : 'treestyletab-splitter', - kTABBAR_TOGGLER : 'treestyletab-tabbar-toggler', - kTABBAR_PLACEHOLDER : 'treestyletab-tabbar-placeholder', - kTABBAR_TOOLBAR : 'treestyletab-tabbar-toolbar', - kTABBAR_TOOLBAR_READY : 'treestyletab-tabbar-toolbar-ready', + kTWISTY : 'treestyletab-twisty', + kTWISTY_CONTAINER : 'treestyletab-twisty-container', + kDROP_MARKER : 'treestyletab-drop-marker', + kDROP_MARKER_CONTAINER : 'treestyletab-drop-marker-container', + kCOUNTER : 'treestyletab-counter', + kCOUNTER_CONTAINER : 'treestyletab-counter-container', + kCOUNTER_PAREN : 'treestyletab-counter-paren', + kSPLITTER : 'treestyletab-splitter', + kTABBAR_TOGGLER : 'treestyletab-tabbar-toggler', + kTABBAR_PLACEHOLDER : 'treestyletab-tabbar-placeholder', + kTABBAR_TOOLBAR : 'treestyletab-tabbar-toolbar', + kTABBAR_TOOLBAR_READY : 'treestyletab-tabbar-toolbar-ready', + kTABBAR_TOOLBAR_READY_POPUP : 'treestyletab-tabbar-toolbar-ready-popup', /* event types, topics */ kEVENT_TYPE_TAB_FOCUS_SWITCHING_KEY_DOWN : 'nsDOMTreeStyleTabFocusSwitchingKeyDown', diff --git a/skin/classic/treestyletab/ui.css b/skin/classic/treestyletab/ui.css index b8f796b4..7cc72092 100644 --- a/skin/classic/treestyletab/ui.css +++ b/skin/classic/treestyletab/ui.css @@ -288,5 +288,5 @@ tabbrowser[treestyletab-tabbar-position="bottom"] /* toolbar customization */ .treestyletab-tabbar-toolbar-ready { - border: 2px solid red !important; + border: 2px solid -moz-fieldtext !important; }