From 51108f6900ee8b81f4ab506bdfc34ff2d42674dc Mon Sep 17 00:00:00 2001 From: Piro / SHIMODA Hiroshi Date: Mon, 10 Jan 2011 16:00:00 +0900 Subject: [PATCH] add configuration UI for auto-hide feature in fullscreen mode --- content/treestyletab/config.js | 32 +++----------------- content/treestyletab/config.xul | 35 ++++++++++++++-------- locale/de-DE/treestyletab/treestyletab.dtd | 7 ++--- locale/en-US/treestyletab/treestyletab.dtd | 9 +++--- locale/es-ES/treestyletab/treestyletab.dtd | 9 +++--- locale/fr-FR/treestyletab/treestyletab.dtd | 9 +++--- locale/it-IT/treestyletab/treestyletab.dtd | 9 +++--- locale/ja/treestyletab/treestyletab.dtd | 9 +++--- locale/pl/treestyletab/treestyletab.dtd | 9 +++--- locale/ru-RU/treestyletab/treestyletab.dtd | 9 +++--- locale/zh-CN/treestyletab/treestyletab.dtd | 4 +++ locale/zh-TW/treestyletab/treestyletab.dtd | 4 +++ 12 files changed, 65 insertions(+), 80 deletions(-) diff --git a/content/treestyletab/config.js b/content/treestyletab/config.js index ee845b21..ce21569c 100644 --- a/content/treestyletab/config.js +++ b/content/treestyletab/config.js @@ -296,18 +296,13 @@ function onSyncMaxTreeLevelPrefToUI(aTarget) } -var gAutoHideModeRadio, - gAutoHideModeToggle, - gTabbarTransparencyScale, +var gTabbarTransparencyScale, gTabbarTransparencyLabels; function initAutoHidePane() { - gAutoHideModeRadio = document.getElementById('extensions.treestyletab.tabbar.autoHide.mode-radio'); - gAutoHideModeToggle = document.getElementById('extensions.treestyletab.tabbar.autoHide.mode.toggle'); gTabbarTransparencyScale = document.getElementById('tabbarTransparency-scale'); gTabbarTransparencyLabels = document.getElementById('tabbarTransparency-labels'); - updateAutoHideModeLabel(); onTabbarTransparencyScaleChange(); syncEnabledState('extensions.treestyletab.tabbar.autoShow.mousemove-check', 'this.checked'); @@ -315,29 +310,10 @@ function initAutoHidePane() syncEnabledState('extensions.treestyletab.tabbar.autoShow.feedback-check', 'this.checked'); } -function onChangeAutoHideMode() +function onChangeAutoHideMode(aRadioGroup, aTogglePref) { - if (!gAutoHideModeRadio) return; - var mode = gAutoHideModeRadio.value; - if (!mode) return; - if (gAutoHideModeRadio.value != 0) { - gAutoHideModeToggle.value = mode; - updateAutoHideModeLabel(); - } -} - -function updateAutoHideModeLabel() -{ - if (!gAutoHideModeRadio) return; - var mode = gAutoHideModeRadio.value; - var nodes = document.getElementsByAttribute('label-mode'+mode, '*'); - if (nodes && nodes.length) - Array.slice(nodes).forEach(function(aNode) { - var label = aNode.getAttribute('label-mode'+mode); - var node = document.getElementById(aNode.getAttribute('target')); - var attr = node.localName == 'label' ? 'value' : 'label' ; - node.setAttribute(attr, label); - }); + if (aRadioGroup.value != 0) + document.getElementById(aTogglePref).value = aRadioGroup.value; } function onTabbarTransparencyScaleChange() diff --git a/content/treestyletab/config.xul b/content/treestyletab/config.xul index 7ee22a40..755e2d6e 100644 --- a/content/treestyletab/config.xul +++ b/content/treestyletab/config.xul @@ -446,9 +446,15 @@ + + @@ -481,10 +487,22 @@ + + onselect="onChangeAutoHideMode(this, 'extensions.treestyletab.tabbar.autoHide.mode.toggle')"> + + + + + + + + @@ -495,7 +513,7 @@