[Pkg-mozext-commits] [compactheader] 25/441: New version: 0.4.2 Use event structure to update header plane.
David Prévot
taffit at moszumanska.debian.org
Wed Mar 18 12:28:40 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 034628795b118ecf68a7638662085f632e4cfaaa
Author: joachim.herb <none at none>
Date: Sun Aug 23 12:22:37 2009 +0000
New version: 0.4.2
Use event structure to update header plane.
---
.../CompactHeader/content/compactHeaderOverlay.js | 73 ++++++++++++++++++----
install.rdf | 5 +-
2 files changed, 65 insertions(+), 13 deletions(-)
diff --git a/chrome/CompactHeader/content/compactHeaderOverlay.js b/chrome/CompactHeader/content/compactHeaderOverlay.js
index f11940c..5a2103f 100644
--- a/chrome/CompactHeader/content/compactHeaderOverlay.js
+++ b/chrome/CompactHeader/content/compactHeaderOverlay.js
@@ -70,7 +70,17 @@ var gCoheCollapsedHeaderList = [
.getService(Components.interfaces.nsIPrefService)
.getBranch("extensions.CompactHeader.");
+var coheIntegrateRSSLinkify = false;
+if (coheIntegrateRSSLinkify) {
+ var RSSLinkify = {
+ oldSubject: null,
+ newSubject: null
+ };
+}
+
+var coheFirstTime = true;
+
function cleanupHeaderXUL(){
var xularray = ["collapsedfromBox", "collapsedtoCcBccBox",
"collapsedButtonBox", "collapsedsubjectBox",
@@ -253,6 +263,7 @@ function create1LHeaderXUL() {
// we find in the DOM based on properties in the header lists.
var gCoheCollapsedHeaderView = {};
+/*
function coheReInitializeHeaderViewTables()
{
// iterate over each header in our header list array, create a header entry
@@ -263,16 +274,18 @@ function coheReInitializeHeaderViewTables()
create1LHeaderXUL();
}
- var tb = document.getElementById("collapsedsubjectValue");
+ // var tb = document.getElementById("collapsedsubjectValue");
gCoheCollapsedHeaderView = {};
var index;
for (index = 0; index < gCoheCollapsedHeaderList.length; index++) {
gCoheCollapsedHeaderView[gCoheCollapsedHeaderList[index].name] =
new createHeaderEntry('collapsed', gCoheCollapsedHeaderList[index]);
}
+
updateHdrButtons();
updateHdrIconText();
}
+*/
function coheInitializeHeaderViewTables()
{
@@ -285,13 +298,27 @@ function coheInitializeHeaderViewTables()
create1LHeaderXUL();
}
- var tb = document.getElementById("collapsedsubjectValue");
+ //var tb = document.getElementById("collapsedsubjectValue");
gCoheCollapsedHeaderView = {};
var index;
for (index = 0; index < gCoheCollapsedHeaderList.length; index++) {
gCoheCollapsedHeaderView[gCoheCollapsedHeaderList[index].name] =
new createHeaderEntry('collapsed', gCoheCollapsedHeaderList[index]);
}
+ if (coheIntegrateRSSLinkify) {
+ RSSLinkify.newSubject = document.createElement("label");
+ RSSLinkify.newSubject.setAttribute("id", "collapsedsubjectlinkValue");
+ RSSLinkify.newSubject.setAttribute("class", "headerValue plain headerValueUrl");
+ RSSLinkify.newSubject.setAttribute("originalclass", "headerValue plain headerValueUrl");
+ RSSLinkify.newSubject.setAttribute("context", "copyUrlPopup");
+ RSSLinkify.newSubject.setAttribute("keywordrelated", "true");
+ RSSLinkify.newSubject.setAttribute("readonly", "true");
+ RSSLinkify.newSubject.setAttribute("appendoriginalclass", "true");
+ RSSLinkify.newSubject.setAttribute("flex", "1");
+
+ RSSLinkify.oldSubject = document.getElementById("collapsedsubjectValue");
+ RSSLinkify.oldSubject.parentNode.insertBefore(RSSLinkify.newSubject, RSSLinkify.oldSubject);
+ }
updateHdrButtons();
updateHdrIconText();
}
@@ -320,7 +347,11 @@ function coheOnLoadMsgHeaderPane()
else
document.getElementById('collapsedHeaderView').collapsed = true;
- gMessageListeners.push(coheMessageListener);
+ if (coheFirstTime)
+ {
+ gMessageListeners.push(coheMessageListener);
+ coheFirstTime = false;
+ }
}
var coheMessageListener =
@@ -390,10 +421,24 @@ function coheUpdateHeaderView()
{
if (gCoheCollapsedHeaderViewMode)
showHeaderView(gCoheCollapsedHeaderView);
-
- UpdateJunkButton();
- updateMyReplyButtons();
- updateHdrButtons();
+
+ if (coheIntegrateRSSLinkify) {
+ var url = currentHeaderData["content-base"];
+ if(url) {
+ RSSLinkify.newSubject.setAttribute("onclick", "if (!event.button) messenger.launchExternalURL('" +
+ url.headerValue + "');");
+ RSSLinkify.newSubject.setAttribute("value", currentHeaderData["subject"].headerValue);
+ RSSLinkify.newSubject.setAttribute("collapsed", "false");
+ RSSLinkify.oldSubject.setAttribute("collapsed", "true");
+ } else {
+ RSSLinkify.newSubject.setAttribute("collapsed", "true");
+ RSSLinkify.oldSubject.setAttribute("collapsed", "false");
+ }
+ }
+
+ UpdateJunkButton();
+ updateMyReplyButtons();
+ updateHdrButtons();
}
function coheToggleHeaderView ()
@@ -558,8 +603,7 @@ var myPrefObserverView =
updateMyReplyButtons();
updateHdrButtons();
-
- }
+ }
}
var myPrefObserverHeaderSize =
@@ -593,10 +637,17 @@ var myPrefObserverHeaderSize =
// aSubject is the nsIPrefBranch we're observing (after appropriate QI)
// aData is the name of the pref that's been changed (relative to aSubject)
- coheReInitializeHeaderViewTables();
+/* coheOnLoadMsgHeaderPane();
+ coheInitializeHeaderViewTables(); */
+
+ var event = document.createEvent('Events');
+ event.initEvent('messagepane-loaded', false, true);
+ var headerViewElement = document.getElementById("msgHeaderView");
+ headerViewElement.dispatchEvent(event);
+
updateMyReplyButtons();
+ /*updateHdrButtons();*/
gDBView.reloadMessage();
-
}
}
diff --git a/install.rdf b/install.rdf
index 3cf2c82..df4103b 100644
--- a/install.rdf
+++ b/install.rdf
@@ -6,10 +6,11 @@
<RDF:Description about="urn:mozilla:install-manifest">
<em:name>CompactHeader</em:name>
- <em:version>0.4.1</em:version>
- <em:description>Add ability to reduce header size to one or two lines.</em:description>
+ <em:version>0.4.2</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>
+ <em:contributor>Alex Dedul</em:contributor>
<em:optionsURL>chrome://CompactHeader/content/preferences.xul</em:optionsURL>
<em:homepageURL>http://compactheader.mozdev.org/</em:homepageURL>
<em:id>{58D4392A-842E-11DE-B51A-C7B855D89593}</em:id>
--
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