[Pkg-mozext-commits] [compactheader] 302/441: New version 1.4.6beta2: Fix toolbar position bug with Thunderbird >= 8.0

David Prévot taffit at moszumanska.debian.org
Wed Mar 18 12:29:12 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 eaf5bb9863b9322678e7fcde674a7e739ecc3a09
Author: joachim <none at none>
Date:   Fri Nov 11 00:44:35 2011 +0100

    New version 1.4.6beta2: Fix toolbar position bug with Thunderbird >= 8.0
    
    --HG--
    branch : fix_toolbar_position
---
 .../content/compactHeaderOverlay-9.xul             |  6 ++--
 chrome/CompactHeader/content/toolbar.js            | 19 ++++++++++--
 install.rdf                                        |  4 +--
 test/compactheader/test-compactheader-collapse.js  | 34 ++++++++++++++++++++++
 test/shared-modules/test-compactheader-helpers.js  | 12 ++++++++
 5 files changed, 69 insertions(+), 6 deletions(-)

diff --git a/chrome/CompactHeader/content/compactHeaderOverlay-9.xul b/chrome/CompactHeader/content/compactHeaderOverlay-9.xul
index 26bf8a2..4cc7e8c 100644
--- a/chrome/CompactHeader/content/compactHeaderOverlay-9.xul
+++ b/chrome/CompactHeader/content/compactHeaderOverlay-9.xul
@@ -56,7 +56,8 @@
     </hbox>
 
     <vbox id="expandedHeadersBox">
-      <hbox id="expandedHeadersTopBox" flex="1">
+      <html:div xmlns:html="http://www.w3.org/1999/xhtml" id="expandedHeadersTopBox" flex="1">
+      <!-- <hbox id="expandedHeadersTopBox" flex="1"> -->
         <toolbox id="header-view-toolbox"
                  mode="icons"
                  defaultmode="icons">
@@ -72,7 +73,8 @@
                    defaultset="hdrReplyToSenderButton,hdrForwardButton,button-reply,button-forward,hdrArchiveButton,hdrJunkButton,hdrTrashButton,CompactHeader_hdrOtherActionsButton">
           </toolbar>
         </toolbox>
-      </hbox>
+      <!-- </hbox> -->
+      </html:div>
 
 
       <hbox id="expandedHeadersBottomBox">
diff --git a/chrome/CompactHeader/content/toolbar.js b/chrome/CompactHeader/content/toolbar.js
index dcef686..3f37e52 100644
--- a/chrome/CompactHeader/content/toolbar.js
+++ b/chrome/CompactHeader/content/toolbar.js
@@ -223,7 +223,17 @@ org.mozdev.compactHeader.toolbar = function() {
         hdrToolbar.lastPermanentChild = lastPermanentChild;
       }
     } else {
-      var cBox = document.getElementById("expandedHeaders");
+      var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
+                              .getService(Components.interfaces.nsIXULAppInfo);
+      var versionChecker = Components.classes["@mozilla.org/xpcom/version-comparator;1"]
+                                     .getService(Components.interfaces.nsIVersionComparator);
+      var cBox;
+      if(versionChecker.compare(appInfo.version, "8.0") >= 0) {
+        cBox = document.getElementById("expandedBoxSpacer");
+      }
+      else {
+        cBox = document.getElementById("expandedHeaders");
+      }
       if (cBox.parentNode.id != hdrToolbox.parentNode.id) {
         var cloneToolboxPalette;
         var cloneToolbarset;
@@ -233,7 +243,12 @@ org.mozdev.compactHeader.toolbar = function() {
         if (hdrToolbox.toolbarset) {
           cloneToolbarset = hdrToolbox.toolbarset.cloneNode(true);
         }
-        cBox.parentNode.appendChild(hdrToolbox);
+        if(versionChecker.compare(appInfo.version, "8.0") >= 0) {
+          cBox.parentNode.insertBefore(hdrToolbox, cBox);
+        }
+        else { // versions before 8.0
+          cBox.parentNode.appendChild(hdrToolbox);
+        }
         hdrToolbox.palette = cloneToolboxPalette;
         hdrToolbox.toolbarset = cloneToolbarset;
         hdrToolbar = document.getElementById("header-view-toolbar");
diff --git a/install.rdf b/install.rdf
index 42154f6..d1e63e1 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>1.4.6beta1</em:version>
+		<em:version>1.4.6beta2</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>
@@ -24,7 +24,7 @@
 			<RDF:Description>
 				<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
 				<em:minVersion>5.0</em:minVersion>
-				<em:maxVersion>10.0a1</em:maxVersion>
+				<em:maxVersion>11.0a1</em:maxVersion>
 			</RDF:Description>
 		</em:targetApplication>
 	</RDF:Description>
diff --git a/test/compactheader/test-compactheader-collapse.js b/test/compactheader/test-compactheader-collapse.js
index de58062..9732972 100644
--- a/test/compactheader/test-compactheader-collapse.js
+++ b/test/compactheader/test-compactheader-collapse.js
@@ -189,6 +189,40 @@ function test_date_format_collapsed(){
   assert_equals(expandedValue, mc.e("CompactHeader_collapsed1LdateBox").textContent);
 }
 
+function test_neighbours_of_header_view_toolbox(){
+  expand_and_assert_header(mc);
+  mc = reopen_3pane_window();
+
+  be_in_folder(folder1);
+
+  // select the first message, which will display it
+  let curMessage = select_click_row(0);
+  assert_selected_and_displayed(mc, curMessage);
+
+  let oldPreviousSibling = mc.e("header-view-toolbox").previousSibling;
+  if (oldPreviousSibling) {
+    oldPreviousSibling = oldPreviousSibling.id;
+  }
+  let oldNextSibling = mc.e("header-view-toolbox").nextSibling;
+  if (oldNextSibling) {
+    oldNextSibling = oldNextSibling.id;
+  }
+
+  collapse_and_assert_header(mc);
+  expand_and_assert_header(mc);
+
+  let newPreviousSibling = mc.e("header-view-toolbox").previousSibling;
+  if (newPreviousSibling) {
+    newPreviousSibling = newPreviousSibling.id;
+  }
+  let newNextSibling = mc.e("header-view-toolbox").nextSibling;
+  if (newNextSibling) {
+    newNextSibling = newNextSibling.id;
+  }
+
+  assert_equals(oldPreviousSibling, newPreviousSibling);
+  assert_equals(oldNextSibling, newNextSibling);
+}
 
 function set_preferences_twoline(aController) {
   let checkboxCompactTwolineView = aController.eid("CompactHeader_checkboxCompactTwolineView");
diff --git a/test/shared-modules/test-compactheader-helpers.js b/test/shared-modules/test-compactheader-helpers.js
index c737820..c016f06 100644
--- a/test/shared-modules/test-compactheader-helpers.js
+++ b/test/shared-modules/test-compactheader-helpers.js
@@ -64,6 +64,7 @@ function installInto(module) {
   setupModule();
 
   // Now copy helper functions
+  module.reopen_3pane_window = reopen_3pane_window;
   module.close3PaneWindow = close3PaneWindow;
   module.open3PaneWindow = open3PaneWindow;
   module.openAddressBook = openAddressBook;
@@ -74,6 +75,17 @@ function installInto(module) {
   module.expand_and_assert_header = expand_and_assert_header;
 }
 
+function reopen_3pane_window() {
+  // Close the 3PaneWindow to reset margin to start values
+  // Make sure we have a different window open, so that we don't start shutting
+  // down just because the last window was closed
+  let abwc = openAddressBook();
+  // The 3pane window is closed and opened again.
+  close3PaneWindow
+  mc = open3PaneWindow();
+  abwc.window.close();
+  return mc;
+}
 
 /**
  *  Helper function to open an extra window, so that the 3pane

-- 
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