[Pkg-mozext-commits] [compactheader] 361/441: Version 2.0.6beta1: Added preference for double click to toggle header mode

David Prévot taffit at moszumanska.debian.org
Wed Mar 18 12:29:17 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository compactheader.

commit b230e650aeca198d4cb9ae918e867843df8e7d66
Author: Joachim Herb <Joachim.Herb at gmx.de>
Date:   Fri Jun 1 00:21:20 2012 +0200

    Version 2.0.6beta1: Added preference for double click to toggle header mode
    
    --HG--
    branch : cleanup_locales
---
 .../content/compactHeaderOverlay-9.xul             |  3 ++-
 .../CompactHeader/content/compactHeaderOverlay.js  | 18 +++++++++----
 .../CompactHeader/content/compactHeaderOverlay.xul |  3 ++-
 chrome/CompactHeader/content/preferences-old.xul   |  6 -----
 chrome/CompactHeader/content/preferences.xul       |  5 ++++
 chrome/CompactHeader/locale/cs/preferences.dtd     |  1 +
 chrome/CompactHeader/locale/da/preferences.dtd     |  3 +--
 chrome/CompactHeader/locale/de/preferences.dtd     |  2 +-
 chrome/CompactHeader/locale/en-US/preferences.dtd  |  1 +
 chrome/CompactHeader/locale/es-ES/preferences.dtd  |  3 ++-
 chrome/CompactHeader/locale/fr/preferences.dtd     |  1 +
 chrome/CompactHeader/locale/it/preferences.dtd     |  1 +
 chrome/CompactHeader/locale/ja/preferences.dtd     |  3 ++-
 chrome/CompactHeader/locale/pl/preferences.dtd     |  3 ++-
 chrome/CompactHeader/locale/ru/preferences.dtd     |  1 +
 chrome/CompactHeader/locale/sr/preferences.dtd     |  1 +
 chrome/CompactHeader/locale/zh-CN/preferences.dtd  |  1 +
 defaults/preferences/prefs.js                      |  2 ++
 install.rdf                                        |  2 +-
 .../test-compactheader-preferences.js              | 30 +++++++++++++++++++++-
 test/shared-modules/test-compactheader-helpers.js  | 25 +++++++++++++++++-
 21 files changed, 93 insertions(+), 22 deletions(-)

diff --git a/chrome/CompactHeader/content/compactHeaderOverlay-9.xul b/chrome/CompactHeader/content/compactHeaderOverlay-9.xul
index d66b21f..a479afd 100644
--- a/chrome/CompactHeader/content/compactHeaderOverlay-9.xul
+++ b/chrome/CompactHeader/content/compactHeaderOverlay-9.xul
@@ -112,7 +112,8 @@
               <menuseparator id="CompactHeader_otherActionPopupAfterViewSource"/>
               <menuitem id="CompactHeader_hideDetailsMenu"
                         label="&CompactHeader_hideDetailsButton.label;"
-                        oncommand="org.mozdev.compactHeader.pane.coheToggleHeaderView();"/>
+                        oncommand="org.mozdev.compactHeader.pane.coheToggleHeaderView();"
+                        key="CompactHeader_hideDetailsKey"/>
               <menuitem id="CompactHeader_hidecohePreferencesButton"
                         label="&CompactHeader_dialog.title;"
                         oncommand="openDialog('chrome://CompactHeader/content/preferences.xul', 'prefs', 'chrome,centerscreen,dependent,all,resizable=no');"/>
diff --git a/chrome/CompactHeader/content/compactHeaderOverlay.js b/chrome/CompactHeader/content/compactHeaderOverlay.js
index c4746e7..02f4a83 100644
--- a/chrome/CompactHeader/content/compactHeaderOverlay.js
+++ b/chrome/CompactHeader/content/compactHeaderOverlay.js
@@ -682,6 +682,8 @@ org.mozdev.compactHeader.pane = function() {
           ||(aData == "toolbox.position")
           ) {
         preferencesUpdate();
+      } else if (aData == "header.doubleclick") {
+        setDblClickHeaderEventHandler();
       }
 
       org.mozdev.compactHeader.debug.log("prefObserver stop");
@@ -786,15 +788,21 @@ org.mozdev.compactHeader.pane = function() {
       multiMessage.addEventListener("DOMContentLoaded", multiMessageLoaded, true);
     }
 
-    var msgHeaderViewDeck = document.getElementById("msgHeaderViewDeck");
-    if (msgHeaderViewDeck){
-      org.mozdev.compactHeader.debug.log("msgHeaderViewDeck " + msgHeaderViewDeck);
-      msgHeaderViewDeck.addEventListener("dblclick", org.mozdev.compactHeader.pane.coheToggleHeaderView, true);
-    }
 
+    setDblClickHeaderEventHandler();
     org.mozdev.compactHeader.debug.log("coheInitializeOverlay stop");
   };
 
+  function setDblClickHeaderEventHandler() {
+    var msgHeaderViewDeck = document.getElementById("msgHeaderViewDeck");
+    if (msgHeaderViewDeck){
+      org.mozdev.compactHeader.debug.log("msgHeaderViewDeck " + msgHeaderViewDeck);
+      if (cohePrefBranch.getBoolPref("header.doubleclick"))
+        msgHeaderViewDeck.addEventListener("dblclick", org.mozdev.compactHeader.pane.coheToggleHeaderView, true);
+      else
+        msgHeaderViewDeck.removeEventListener("dblclick", org.mozdev.compactHeader.pane.coheToggleHeaderView, true);
+    }
+  }
   function multiMessageLoaded() {
     org.mozdev.compactHeader.debug.log("multiMessageLoaded start");
     org.mozdev.compactHeader.toolbar.setCurrentToolboxPosition(gCoheCollapsedHeaderViewMode);
diff --git a/chrome/CompactHeader/content/compactHeaderOverlay.xul b/chrome/CompactHeader/content/compactHeaderOverlay.xul
index e7f911f..0444738 100644
--- a/chrome/CompactHeader/content/compactHeaderOverlay.xul
+++ b/chrome/CompactHeader/content/compactHeaderOverlay.xul
@@ -109,7 +109,8 @@
               <menuseparator id="CompactHeader_otherActionPopupAfterViewSource"/>
               <menuitem id="CompactHeader_hideDetailsMenu"
                         label="&CompactHeader_hideDetailsButton.label;"
-                        oncommand="org.mozdev.compactHeader.pane.coheToggleHeaderView();"/>
+                        oncommand="org.mozdev.compactHeader.pane.coheToggleHeaderView();"
+                        key="CompactHeader_hideDetailsKey"/>
               <menuitem id="CompactHeader_hidecohePreferencesButton"
                         label="&CompactHeader_dialog.title;"
                         oncommand="openDialog('chrome://CompactHeader/content/preferences.xul', 'prefs', 'chrome,centerscreen,dependent,all,resizable=no');"/>
diff --git a/chrome/CompactHeader/content/preferences-old.xul b/chrome/CompactHeader/content/preferences-old.xul
deleted file mode 100644
index f889ef6..0000000
--- a/chrome/CompactHeader/content/preferences-old.xul
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?>
-
-<overlay id="CompactHeader_customizeToolbarOverlay"
-         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <groupbox id="CompactHeader_radiobox.ToolbarPosition" hidden="true"/>
-</overlay>
\ No newline at end of file
diff --git a/chrome/CompactHeader/content/preferences.xul b/chrome/CompactHeader/content/preferences.xul
index 09f119e..d59ba3b 100644
--- a/chrome/CompactHeader/content/preferences.xul
+++ b/chrome/CompactHeader/content/preferences.xul
@@ -32,6 +32,8 @@
                   name="extensions.CompactHeader.headersize.addressstyle" type="bool"/>
       <preference id="CompactHeader_flatButtons"
                   name="extensions.CompactHeader.headersize.flatButtons" type="bool"/>
+      <preference id="CompactHeader_dblclick_header"
+                  name="extensions.CompactHeader.header.doubleclick" type="bool"/>
       <preference id="CompactHeader_position"
                   name="extensions.CompactHeader.toolbox.position" type="string"/>
     </preferences>
@@ -48,6 +50,9 @@
     <checkbox id="CompactHeader_checkboxflatButtons"
               preference="CompactHeader_flatButtons"
               label="&CompactHeader_menu.flatButtons.caption;"/>
+    <checkbox id="CompactHeader_checkbox_dblclick_header"
+              preference="CompactHeader_dblclick_header"
+              label="&CompactHeader_menu.dblclick_header.caption;"/>
     <groupbox id="CompactHeader_radiobox.ToolbarPosition">
       <caption label="&CompactHeader_radiobox.ToolbarPosition.caption;"/>
       <radiogroup id="CompactHeader_hdrToolbox.pos"
diff --git a/chrome/CompactHeader/locale/cs/preferences.dtd b/chrome/CompactHeader/locale/cs/preferences.dtd
index f49f92b..758674c 100644
--- a/chrome/CompactHeader/locale/cs/preferences.dtd
+++ b/chrome/CompactHeader/locale/cs/preferences.dtd
@@ -45,3 +45,4 @@
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.top "střed">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.left "vlevo">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.none "neviditelný">
+<!ENTITY CompactHeader_menu.dblclick_header.caption "Toggle header by double click">
\ No newline at end of file
diff --git a/chrome/CompactHeader/locale/da/preferences.dtd b/chrome/CompactHeader/locale/da/preferences.dtd
index b28c11c..431e2ee 100644
--- a/chrome/CompactHeader/locale/da/preferences.dtd
+++ b/chrome/CompactHeader/locale/da/preferences.dtd
@@ -45,5 +45,4 @@
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.top   "øverst">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.left  "venstre">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.none  "usynlig">
-
-
+<!ENTITY CompactHeader_menu.dblclick_header.caption "Toggle header by double click">
\ No newline at end of file
diff --git a/chrome/CompactHeader/locale/de/preferences.dtd b/chrome/CompactHeader/locale/de/preferences.dtd
index 73214e5..f780410 100644
--- a/chrome/CompactHeader/locale/de/preferences.dtd
+++ b/chrome/CompactHeader/locale/de/preferences.dtd
@@ -45,4 +45,4 @@
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.top   "oben">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.left  "links">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.none  "unsichtbar">
-
+<!ENTITY CompactHeader_menu.dblclick_header.caption "Umschalten der Kopfzeilen mit Doppelklick">
\ No newline at end of file
diff --git a/chrome/CompactHeader/locale/en-US/preferences.dtd b/chrome/CompactHeader/locale/en-US/preferences.dtd
index 3376a0a..f059356 100644
--- a/chrome/CompactHeader/locale/en-US/preferences.dtd
+++ b/chrome/CompactHeader/locale/en-US/preferences.dtd
@@ -45,3 +45,4 @@
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.top   "top">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.left  "left">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.none  "invisible">
+<!ENTITY CompactHeader_menu.dblclick_header.caption "Toggle header by double click">
\ No newline at end of file
diff --git a/chrome/CompactHeader/locale/es-ES/preferences.dtd b/chrome/CompactHeader/locale/es-ES/preferences.dtd
index 54a223b..57e3244 100644
--- a/chrome/CompactHeader/locale/es-ES/preferences.dtd
+++ b/chrome/CompactHeader/locale/es-ES/preferences.dtd
@@ -44,4 +44,5 @@
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.right "Derecha">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.top   "Arriba">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.left  "Izquierda">
-<!ENTITY CompactHeader_radiobox.ToolbarPosition.none  "Invisible">
\ No newline at end of file
+<!ENTITY CompactHeader_radiobox.ToolbarPosition.none  "Invisible">
+<!ENTITY CompactHeader_menu.dblclick_header.caption "Toggle header by double click">
\ No newline at end of file
diff --git a/chrome/CompactHeader/locale/fr/preferences.dtd b/chrome/CompactHeader/locale/fr/preferences.dtd
index 23b0b74..e9469a0 100644
--- a/chrome/CompactHeader/locale/fr/preferences.dtd
+++ b/chrome/CompactHeader/locale/fr/preferences.dtd
@@ -45,3 +45,4 @@
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.top   "haut">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.left  "gauche">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.none  "invisible">
+<!ENTITY CompactHeader_menu.dblclick_header.caption "Toggle header by double click">
\ No newline at end of file
diff --git a/chrome/CompactHeader/locale/it/preferences.dtd b/chrome/CompactHeader/locale/it/preferences.dtd
index 57a28af..dcbe392 100644
--- a/chrome/CompactHeader/locale/it/preferences.dtd
+++ b/chrome/CompactHeader/locale/it/preferences.dtd
@@ -45,3 +45,4 @@
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.top   "alto">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.left  "sinistra">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.none  "invisibile">
+<!ENTITY CompactHeader_menu.dblclick_header.caption "Toggle header by double click">
\ No newline at end of file
diff --git a/chrome/CompactHeader/locale/ja/preferences.dtd b/chrome/CompactHeader/locale/ja/preferences.dtd
index 7beb5b9..8ad88bc 100644
--- a/chrome/CompactHeader/locale/ja/preferences.dtd
+++ b/chrome/CompactHeader/locale/ja/preferences.dtd
@@ -45,4 +45,5 @@
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.right "右">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.top   "上">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.left  "左">
-<!ENTITY CompactHeader_radiobox.ToolbarPosition.none  "非表示">
\ No newline at end of file
+<!ENTITY CompactHeader_radiobox.ToolbarPosition.none  "非表示">
+<!ENTITY CompactHeader_menu.dblclick_header.caption "Toggle header by double click">
\ No newline at end of file
diff --git a/chrome/CompactHeader/locale/pl/preferences.dtd b/chrome/CompactHeader/locale/pl/preferences.dtd
index af99a97..c65e794 100644
--- a/chrome/CompactHeader/locale/pl/preferences.dtd
+++ b/chrome/CompactHeader/locale/pl/preferences.dtd
@@ -44,4 +44,5 @@
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.right "po prawej">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.top   "na górze">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.left  "po lewej">
-<!ENTITY CompactHeader_radiobox.ToolbarPosition.none  "niewidoczny">
\ No newline at end of file
+<!ENTITY CompactHeader_radiobox.ToolbarPosition.none  "niewidoczny">
+<!ENTITY CompactHeader_menu.dblclick_header.caption "Toggle header by double click">
\ No newline at end of file
diff --git a/chrome/CompactHeader/locale/ru/preferences.dtd b/chrome/CompactHeader/locale/ru/preferences.dtd
index fd7bb3e..0fc9edb 100644
--- a/chrome/CompactHeader/locale/ru/preferences.dtd
+++ b/chrome/CompactHeader/locale/ru/preferences.dtd
@@ -45,3 +45,4 @@
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.top "сверху">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.left "слева">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.none "невидимa">
+<!ENTITY CompactHeader_menu.dblclick_header.caption "Toggle header by double click">
\ No newline at end of file
diff --git a/chrome/CompactHeader/locale/sr/preferences.dtd b/chrome/CompactHeader/locale/sr/preferences.dtd
index 0448a93..9259c11 100644
--- a/chrome/CompactHeader/locale/sr/preferences.dtd
+++ b/chrome/CompactHeader/locale/sr/preferences.dtd
@@ -45,3 +45,4 @@
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.top "врх">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.left "лево">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.none "невидљива">
+<!ENTITY CompactHeader_menu.dblclick_header.caption "Toggle header by double click">
\ No newline at end of file
diff --git a/chrome/CompactHeader/locale/zh-CN/preferences.dtd b/chrome/CompactHeader/locale/zh-CN/preferences.dtd
index 0ea751f..2121552 100644
--- a/chrome/CompactHeader/locale/zh-CN/preferences.dtd
+++ b/chrome/CompactHeader/locale/zh-CN/preferences.dtd
@@ -45,3 +45,4 @@
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.top "上">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.left "左">
 <!ENTITY CompactHeader_radiobox.ToolbarPosition.none "不可见">
+<!ENTITY CompactHeader_menu.dblclick_header.caption "Toggle header by double click">
\ No newline at end of file
diff --git a/defaults/preferences/prefs.js b/defaults/preferences/prefs.js
index fae29ba..75baead 100644
--- a/defaults/preferences/prefs.js
+++ b/defaults/preferences/prefs.js
@@ -7,6 +7,8 @@ pref("extensions.CompactHeader.headersize.flatButtons", false);
 
 pref("extensions.CompactHeader.toolbox.position", "top");
 
+pref("extensions.CompactHeader.header.doubleclick", true);
+
 pref("extensions.CompactHeader.version", "0");
 pref("extensions.CompactHeader.firstrun", true);
 pref("extensions.CompactHeader.debugLevel", 1);
diff --git a/install.rdf b/install.rdf
index 55e9c32..7b7dc76 100644
--- a/install.rdf
+++ b/install.rdf
@@ -6,7 +6,7 @@
 
 	<RDF:Description about="urn:mozilla:install-manifest">
 		<em:name>CompactHeader</em:name>
-		<em:version>2.0.5</em:version>
+		<em:version>2.0.6beta1</em:version>
 		<em:description>Add ability to reduce header size to one or two lines. Linkify subjects in RSS feeds.</em:description>
 		<em:creator>Joachim Herb</em:creator>
 		<em:contributor>Zamula</em:contributor>
diff --git a/test/compactheader/test-compactheader-preferences.js b/test/compactheader/test-compactheader-preferences.js
index dc11904..6f135af 100644
--- a/test/compactheader/test-compactheader-preferences.js
+++ b/test/compactheader/test-compactheader-preferences.js
@@ -194,4 +194,32 @@ function assert_browser_text_present(aBrowser, aText) {
   if (html.indexOf(aText) == -1) {
     throw new Error("Unable to find string \"" + escape(aText) + "\" on the message pane");
   }
-}
\ No newline at end of file
+}
+
+function subtest_change_twoline_dblclick(aController) {
+  let dblClick = aController.eid("CompactHeader_checkbox_dblclick_header");
+  let dblClickNode = dblClick.node;
+
+  if (!dblClickNode.hasAttribute("checked")) {
+    aController.click(dblClick);
+  }
+  let checkboxCompactTwolineView = aController.eid("CompactHeader_checkboxCompactTwolineView");
+  if (!checkboxCompactTwolineView.node.getAttribute("checked")) {
+    aController.click(checkboxCompactTwolineView);
+  }
+
+  close_preferences_dialog(aController);
+}
+
+function test_dblclick_header(){
+  select_message_in_folder(folder1, 3, mc);
+  open_preferences_dialog(mc, subtest_change_oneline);
+  open_preferences_dialog(mc, subtest_change_no_dblclick);
+  collapse_and_assert_header(mc);
+  mc.doubleClick(mc.eid("msgHeaderViewDeck"))
+  assert_collapsed(mc);
+  open_preferences_dialog(mc, subtest_change_twoline_dblclick);
+  collapse_and_assert_header(mc);
+  mc.doubleClick(mc.eid("msgHeaderViewDeck"))
+  assert_expanded(mc);
+}
diff --git a/test/shared-modules/test-compactheader-helpers.js b/test/shared-modules/test-compactheader-helpers.js
index a22d80d..114913a 100644
--- a/test/shared-modules/test-compactheader-helpers.js
+++ b/test/shared-modules/test-compactheader-helpers.js
@@ -85,6 +85,8 @@ function installInto(module) {
   module.subtest_change_twoline = subtest_change_twoline;
   module.set_preferences_twoline = set_preferences_twoline;
   module.set_preferences_oneline = set_preferences_oneline;
+  module.subtest_change_dblclick = subtest_change_dblclick;
+  module.subtest_change_no_dblclick = subtest_change_no_dblclick;
   module.assert_collapsed = assert_collapsed;
   module.assert_expanded = assert_expanded;
   module.isVisible = isVisible;
@@ -426,4 +428,25 @@ function isVisible(aElem) {
       parent.selectedPanel != aElem)
     return false;
   return isVisible(parent);
-}
\ No newline at end of file
+}
+
+function subtest_change_no_dblclick(aController) {
+  let dblClick = aController.eid("CompactHeader_checkbox_dblclick_header");
+  let dblClickNode = dblClick.node;
+
+  if (dblClickNode.hasAttribute("checked")) {
+    aController.click(dblClick);
+  }
+  
+  close_preferences_dialog(aController);
+}
+
+function subtest_change_dblclick(aController) {
+  let dblClick = aController.eid("CompactHeader_checkbox_dblclick_header");
+  let dblClickNode = dblClick.node;
+
+  if (!dblClickNode.hasAttribute("checked")) {
+    aController.click(dblClick);
+  }
+  close_preferences_dialog(aController);
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/compactheader.git



More information about the Pkg-mozext-commits mailing list