MozillaZine

Message Headers

User Help for Mozilla Thunderbird
mad.engineer
 
Posts: 314
Joined: August 8th, 2006, 4:08 pm

Post Posted March 8th, 2010, 11:04 am

Sorry if this may be a side question.

Currently in TB 3.0.3 (IMAP), when viewing/reading a message, the Message Headers show up in the following order:

From:
Subject:
To:
Cc:
Date -> shows up in the right-hand side under the Reply/Reply All buttons

Every other mail client that I've used in the past show the same in the following order instead:

Date:
From:
To:
Cc:
Subject:

Do you know if there is a way via userChrome.css or userChrome.xml to make TB show the headers as shown above (Subject: being the last header)?. Thanks

Lee_Dailey

User avatar
 
Posts: 14194
Joined: July 27th, 2004, 4:33 pm
Location: milky way galaxy, sol system, terra, north america, usa, tx, bedford

Post Posted March 8th, 2010, 2:38 pm

howdy mad.engineer,

lookee ...
Re: New addon to compact header pane in Thunderbird 3.0

take care,
lee

Rod Whiteley

User avatar
 
Posts: 11480
Joined: December 6th, 2004, 3:41 am
Location: UK

Post Posted March 8th, 2010, 2:53 pm

You can do it with a Binding. The CSS is:
Code: Select all
#expandedHeadersBox {-moz-binding: url(chrome://userchrome/content/userChrome.xml#headers);}
and the XBL is:
Code: Select all
<binding id="headers">
  <implementation>
    <constructor><![CDATA[
      var from = document.getElementById("expandedfromRow")
      var subj = document.getElementById("expandedsubjectRow")
      var date = document.getElementById("dateLabel")
     
      // new row for date...
      with (from.parentNode.appendChild(document.createElement("row"))) {
        with (appendChild(document.createElement("label")))
          appendChild(document.createTextNode("Date:")),
          className = "headerName"
        appendChild(date.parentNode.removeChild(date))
        }
       
      // mess with sequence...
      with (subj.parentNode)
        insertBefore(from.parentNode.removeChild(from), firstChild),
        appendChild(removeChild(subj))
      ]]></constructor>
    </implementation>
   </binding>
Rod

Guest
Guest
 

Post Posted March 8th, 2010, 3:31 pm

Lee, Thanks for pointing to the Compact Header add-on. I am aware of it, not something that I was looking for.

Rod: As always, you are the master when it comes to spinning up the xml/css magic !. I just tried your code above and it worked great. Thank you once again for sharing your expertise. I really appreciate it. I'd like to make a suggestion that if you can make these xml/css steps above and in other threads (showing attachment at the top, auto-expand attachment window in compose window and this one) as KB articles, I'm sure it would benefit others in the future, where you could simply point them to the KB links. Thanks again.

Rod Whiteley

User avatar
 
Posts: 11480
Joined: December 6th, 2004, 3:41 am
Location: UK

Post Posted March 8th, 2010, 3:34 pm

Yes, the Bindings article is the first stage of that kind of thing.
Rod

Lee_Dailey

User avatar
 
Posts: 14194
Joined: July 27th, 2004, 4:33 pm
Location: milky way galaxy, sol system, terra, north america, usa, tx, bedford

Post Posted March 8th, 2010, 3:51 pm

howdy guest whom i presume is mad.engineer,

you're welcome. [*grin*] and rod _is_ a truly nifty resource ...

take care,
lee

Guest
Guest
 

Post Posted March 10th, 2010, 10:48 pm

Rod, quick question related to your code that your provided above. It works great, but unfortunately won't expand the header pane to accommodate the extra lines. Instead, I'm getting the scroll bar and have to go up and down in the header window. Do you know if there's any way to auto-expand the header pane by tweaking your code above somehow?. Thanks

Rod Whiteley

User avatar
 
Posts: 11480
Joined: December 6th, 2004, 3:41 am
Location: UK

Post Posted March 11th, 2010, 2:10 am

I don't see that myself. A scroll bar appears when I click "more" to expand a long list of addresses, with or without the binding.
Rod

Guest
Guest
 

Post Posted March 11th, 2010, 11:16 am

Correct. That is what I was referring to as well earlier. I was under the impression that the bindings would also take care of auto-expanding the header pane when you click on "more".
But I applied that temp workaround to fix the "more" issue: viewtopic.php?f=39&t=546398&p=8898795#p8898795 and it took care of the scroll bar issue as well.

Firinde
 
Posts: 2
Joined: June 19th, 2010, 2:30 am

Post Posted June 19th, 2010, 4:22 am

Hi,

I have read your post on March 8th, 2010 concerning changing Thunderbird header order using Bindings.

I am trying to change thundrebird header order. I have dome the following:

Created the userChrome.css file in the user chrome directory. This file contains one line:

#expandedHeadersBox {-moz-binding: url(chrome://userchrome/content/userChrome.xml#headers);}


Created the userChrome.xml file that contains:

<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl">
<binding id="headers">
<implementation>
<constructor><![CDATA[
var from = document.getElementById("expandedfromRow")
var subj = document.getElementById("expandedsubjectRow")
var date = document.getElementById("dateLabel")

// new row for date...
with (from.parentNode.appendChild(document.createElement("row"))) {
with (appendChild(document.createElement("label")))
appendChild(document.createTextNode("Date:")),
className = "headerName"
appendChild(date.parentNode.removeChild(date))
}

// mess with sequence...
with (subj.parentNode)
insertBefore(from.parentNode.removeChild(from), firstChild),
appendChild(removeChild(subj))
]]></constructor>
</implementation>
</binding>
</bindings>

I have put this file in the same directory as UserChrome.css file (the user chrome directory:
C:\Users\"user"\AppData\Roaming\Thunderbird\Profiles\080ixqbf.default\chrome). This is in Widnows 7.

I am expecting the message header order to be changed like:

Date:
From:
To:
Cc:
Subject:

The header order is not changed.

What am I doing wrong ?

Firinde
 
Posts: 2
Joined: June 19th, 2010, 2:30 am

Post Posted June 19th, 2010, 4:30 am

Forgot to mention that my final goal is to print message with the header order changed. I don't mind about the order when viewing the message.

rsx11m
Moderator
 
Posts: 14430
Joined: May 3rd, 2007, 7:40 am
Location: US

Post Posted June 19th, 2010, 4:57 am

Printing is a totally different part of the program and won't be affected by that binding, as you noticed. I don't know where to tweak that, but klades has written a PrintingTools extension to modify a couple of print settings. Even if it won't do the job right away, you could check with him where you have to modify the code to rearrange the header-printing order.

jrostosk
Guest
 

Post Posted February 23rd, 2011, 5:23 pm

I have tried this in TB 3.1.7, and it doesn't affect the order of the headers, but I do have the "date" header on the left side now. The original post says this works for 3.1.6, but may not work for more recent releases. Any word on if it works with 3.1.7?

Guest
Guest
 

Post Posted March 20th, 2011, 5:56 pm

Unfortunately, this whole bindings method do not work with the upcoming TB 3.3. Not sure if this is due to the new omni.jar or else?. Do anyone know how to make this bindings work with 3.3?. Thanks

adoxa
Guest
 

Post Posted June 23rd, 2011, 7:01 am

Here's an alternative way to add the date and move the subject line to the bottom (making the order from-to-date-subject), that works for 3.1.11. These instructions assume you've followed this (and one thing it didn't tell you was to follow the Bindings link and get the User Chrome extension). First, remove the #dateValueBox section from the css and remove date from the extra headers config. Replace the binding with this:
Code: Select all
<binding id="headers">
  <implementation>
    <constructor><![CDATA[
      var subj = document.getElementById("expandedsubjectRow");
      gExpandedHeaderView['date'] = new createHeaderEntry('expanded', {name:"date"});
      let topViewNode = document.getElementById('expandedHeader2Rows');
      topViewNode.appendChild(subj);
    ]]></constructor>
  </implementation>
</binding>

To put the date on top (date-from-to-subject), add this after the append:
Code: Select all
      var from = document.getElementById("expandedfromRow");
      var date = document.getElementById("expandeddateRow");
      from.parentNode.insertBefore(date, from);

Return to Thunderbird Support


Who is online

Users browsing this forum: Google [Bot] and 5 guests