Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thunderbird conversations support #3

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3f75920
Added some development info to README.
Jan 24, 2013
9f72e80
Tiny fix in prev doc.
Jan 24, 2013
c7fac7d
Version push
Jan 24, 2013
e6c08fc
Some partial notes about supporting Thunderbird Conversations
Jan 24, 2013
3b3a8b8
Factoring out update function into the two, as for conversations diff…
Jan 24, 2013
e0bf1df
In conversations view we properly detect bugzilla bugs and extract ur…
Jan 24, 2013
9ba9f27
Some more logging.
Jan 25, 2013
b60a8b6
Tabs replaced with spaces. Made most editors much happier.
Jan 25, 2013
f32555f
Some indentation fixes.
Jan 25, 2013
27df1e8
Moving initialization to onload
Jan 25, 2013
4089495
Properly loading newer conversations too.
Jan 25, 2013
4202262
We properly load bug info, still for some reason it does not appear.
Jan 25, 2013
a75dc7a
For the sake of testing rename various bugmail-* to buggmail-*
Jan 25, 2013
a1cedf2
Factoring out method which shows bug box.
Jan 25, 2013
e3ef37f
First attempts to migrate bugbox to visible pane. So far no success.
Jan 25, 2013
ffac365
Reverting buggmail names back to bugmail
Jan 25, 2013
f0d0a89
Finally bug box actually shows up. Unfortunately to the left, not to …
Jan 25, 2013
1b80a88
Almost all works except on single message view we got some failure.
Jan 25, 2013
c2fcd4b
warning about unparsable reply
Jan 25, 2013
01fce28
Bugzilla returns HTML for urls like show_bug.cgi?id=34234#c6, which w…
Jan 25, 2013
e1796b5
merging unnecessary sideline
Jan 25, 2013
8a29903
.
Jan 25, 2013
b136691
Bugzilla comment fix also for normal code.
Jan 25, 2013
9f4f3e8
Removing bugbox if not needed.
Jan 25, 2013
db81419
Fork note
Jan 25, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -1 +1,51 @@
A Thunderbird add-on to help with bugmail

This fork
=========

This fork adds preliminary support for Thunderbird Conversations
(https://addons.mozilla.org/en-US/thunderbird/addon/gmail-conversation-view/),
so far working only for Bugzilla and somewhat quick&dirty.

Development
=============

To test the development version in thunderbird:

- uninstall „normal” Bugmail if it is installed (using Thunderbird Add-ons Manager),
restart Thunderbird so it acknowledges uninstall

- in your extensions directory
(~/.thunderbird/<Profile Name>/extensions/ or similar)
create the file named
{32d96adf-23fc-403d-a1c8-e5cf6a019bee}
(yes, use this ugly name, it must match <em:id> from install.rdf)
which body is
/path/to/the/devel/bugmail/
(replace with true full path to the directory this file lies in)

- restart thunderbird again.

More details: https://developer.mozilla.org/en-US/docs/Extensions/Thunderbird/Building_a_Thunderbird_extension_7:_Installation

Some useful development tricks:

- set javascript.options.showInConsole = true in about:config

- set extensions.logging.enabled = true

- start thunderbird with

thunderbird --purgecaches

Packaging
=============

Simply zip the whole extension folder, for example

cd path/to/bugmail
zip -r ../bugmail.xpi chrome/ chrome.manifest install.rdf LICENSE README




2 changes: 0 additions & 2 deletions chrome.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ locale bugmail en-US chrome/locale/en-US/
skin bugmail default chrome/skin/
overlay chrome://messenger/content/messageWindow.xul chrome://bugmail/content/overlay.xul appversion>=3.0b3
overlay chrome://messenger/content/messenger.xul chrome://bugmail/content/overlay.xul appversion>=3.0b3
overlay chrome://messenger/content/messageWindow.xul chrome://bugmail/content/overlay-tb2.xul appversion>=2.0
overlay chrome://messenger/content/messenger.xul chrome://bugmail/content/overlay-tb2.xul appversion>=2.0
5 changes: 5 additions & 0 deletions chrome/content/binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function xsltBinding() {
xsltBinding.prototype = {

init: function(pid, psrc, pxsl, cb, params) {
console.log("bugmail/binding: init");
this.id = pid;
this.loaded = 0;
this.needed = 2;
Expand Down Expand Up @@ -59,6 +60,7 @@ xsltBinding.prototype = {
},

initWithSrc: function(pid, psrc, pxsl, cb, params) {
console.log("bugmail/binding: initWithSrc. psrc=" + psrc);
this.id = pid;
this.loaded = 0;
this.needed = 1;
Expand All @@ -79,16 +81,19 @@ xsltBinding.prototype = {
},

initWithDoc: function(doc, pid, psrc, pxsl, cb, params) {
console.log("bugmail/binding: initWithDoc");
this.doc = doc;
this.init(pid, psrc, pxsl, cb, params);
},

initSrcWithDoc: function(doc, pid, psrc, pxsl, cb, params) {
console.log("bugmail/binding: initSrcWithDoc");
this.doc = doc;
this.initWithSrc(pid, psrc, pxsl, cb, params);
},

refresh: function() {
console.log("bugmail/binding: refresh. this.src=" + this.src + ", this.srcreq=" + this.srcreq);
this.xsl = this.xslreq.responseXML;
if (!this.src)
this.src = this.srcreq.responseXML;
Expand Down
8 changes: 6 additions & 2 deletions chrome/content/bugzilla.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@ var bugzillaEngine = {
}
else { // Extract bugzilla URI from mail content
var doc = document.getElementById('messagepane').contentDocument;
uri = doc.querySelector("a[href*=show_bug]").href +
"&ctype=xml&excludefield=attachmentdata";
uri = doc.querySelector("a[href*=show_bug]").href;
// Note: on URIs containing comments (/path/to/show_bug.cgi?id=3333#c6 etc)
// bugzilla happens to ignore ctype=xml and return html.
// Therefore we drop fragment if we happened to get one
uri = uri.replace(/#.*$/, "");
uri = uri + "&ctype=xml&excludefield=attachmentdata";
}

//uri = "https://bugzilla.mozilla.org/show_bug.cgi?id=379306&ctype=xml";
Expand Down
Loading