bug 466795 - MailNews Buttons and Menu-Items are mostly greyed out, no function - fork mailWidgets.xml for SeaMonkey and restore state before the recent Thunderbird patch, r=Standard8 sr=Neil a=Standard8 for 2.0a2
--- a/mailnews/jar.mn
+++ b/mailnews/jar.mn
@@ -156,17 +156,16 @@ messenger.jar:
content/messenger/msgPrintEngine.xul (base/resources/content/msgPrintEngine.xul)
content/messenger/mailTasksOverlay.xul (base/resources/content/mailTasksOverlay.xul)
content/messenger/mailTasksOverlay.js (base/resources/content/mailTasksOverlay.js)
content/messenger/mailEditorOverlay.xul (base/resources/content/mailEditorOverlay.xul)
content/messenger/mailABOverlay.xul (base/resources/content/mailABOverlay.xul)
content/messenger/mailMessengerOverlay.xul (base/resources/content/mailMessengerOverlay.xul)
content/messenger/mailMessengerComposeOverlay.xul (base/resources/content/mailMessengerComposeOverlay.xul)
content/messenger/mailOverlay.xul (base/resources/content/mailOverlay.xul)
-* content/messenger/mailWidgets.xml (base/resources/content/mailWidgets.xml)
* content/messenger/junkMailInfo.xul (base/resources/content/junkMailInfo.xul)
content/messenger/phishingDetector.js (base/resources/content/phishingDetector.js)
content/messenger/junkCommands.js (base/resources/content/junkCommands.js)
content/messenger/SearchDialog.xul (base/search/resources/content/SearchDialog.xul)
content/messenger/ABSearchDialog.xul (base/search/resources/content/ABSearchDialog.xul)
content/messenger/SearchDialog.js (base/search/resources/content/SearchDialog.js)
content/messenger/ABSearchDialog.js (base/search/resources/content/ABSearchDialog.js)
content/messenger/searchTermOverlay.js (base/search/resources/content/searchTermOverlay.js)
--- a/suite/Makefile.in
+++ b/suite/Makefile.in
@@ -61,16 +61,20 @@ PARALLEL_DIRS += \
ifeq ($(OS_ARCH),WINNT)
PARALLEL_DIRS += shell/src
ifdef MOZ_INSTALLER
PARALLEL_DIRS += installer/windows
endif
endif
+ifdef MOZ_MAIL_NEWS
+PARALLEL_DIRS += mailnews
+endif
+
# app is always last as it packages up the built files on mac
DIRS = build app
include $(topsrcdir)/config/rules.mk
# For Windows build the uninstaller during the application build since the
# uninstaller is included with the application for mar file generation.
libs::
new file mode 100644
--- /dev/null
+++ b/suite/mailnews/Makefile.in
@@ -0,0 +1,44 @@
+#
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is mozilla.org code.
+#
+# The Initial Developer of the Original Code is
+# the mozilla.org SeaMonkey project.
+# Portions created by the Initial Developer are Copyright (C) 2008
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+# Robert Kaiser <kairo@kairo.at>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH=../..
+topsrcdir=@top_srcdir@
+srcdir=@srcdir@
+VPATH=@srcdir@
+
+include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/suite/mailnews/jar.mn
@@ -0,0 +1,2 @@
+messenger.jar:
+ content/messenger/mailWidgets.xml
copy from mailnews/base/resources/content/mailWidgets.xml
copy to suite/mailnews/mailWidgets.xml
--- a/mailnews/base/resources/content/mailWidgets.xml
+++ b/suite/mailnews/mailWidgets.xml
@@ -1,17 +1,10 @@
<?xml version="1.0"?>
-<!DOCTYPE bindings [
-<!ENTITY % msgHdrViewOverlayDTD SYSTEM "chrome://messenger/locale/msgHdrViewOverlay.dtd" >
-%msgHdrViewOverlayDTD;
-<!ENTITY % messengerDTD SYSTEM "chrome://messenger/locale/messenger.dtd" >
-%messengerDTD;
-]>
-
<bindings id="mailBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:nc="http://home.netscape.com/NC-rdf#"
xmlns:xbl="http://www.mozilla.org/xbl">
<!-- dummy widget to force this file to load -->
<binding id="dummy" extends="xul:box"/>
@@ -157,124 +150,98 @@
<xul:image class="descriptioncell-icon" xbl:inherits="src=image"/>
<xul:label class="descriptioncell-label" xbl:inherits="value=label,flex=flexlabel,crop,disabled,context" flex="1" dir="ltr" crop="center"/>
</xul:hbox>
</content>
</binding>
<!-- Message Pane Widgets -->
- <!-- mail-toggle-headerfield: Non-email addrs headers which have a toggle
- associated with them (i.e. the subject).
- Use label to set the header name.
- Use headerValue to set the header value. -->
+ <!-- mail-toggle-headerfield: non email addrss headers which have a toggle associated with them (i.e. the subject).
+ use label to set the header name.
+ use headerValue to set the header value. -->
<binding id="mail-toggle-headerfield">
<content>
- <xul:hbox class="headerNameBox" align="baseline">
+ <xul:hbox class="headerNameBox" align="start">
<xul:image class="expandHeaderViewButton" xbl:inherits="onclick=ontwistyclick"/>
<xul:spacer flex="1"/>
<xul:label class="headerName" xbl:inherits="value=label" control="headerValue"/>
</xul:hbox>
- <xul:textbox class="headerValue" anonid="headerValue" flex="1" readonly="true"/>
+ <xul:textbox class="headerValue plain" anonid="headerValue" flex="1" readonly="true"/>
</content>
<implementation>
<property name="headerValue" onset="return document.getAnonymousElementByAttribute(this, 'anonid', 'headerValue').value = val;"/>
</implementation>
</binding>
<!-- mail-headerfield: presents standard text header name & value pairs. Don't use this for email addresses.
use label to set the header name.
use headerValue to set the header value. -->
<binding id="mail-headerfield">
<content>
- <xul:hbox class="headerNameBox" align="baseline">
+ <xul:hbox class="headerNameBox" align="start">
<xul:label class="headerName" xbl:inherits="value=label" control="headerValue" flex="1"/>
</xul:hbox>
- <xul:textbox class="headerValue" anonid="headerValue" flex="1" readonly="true"/>
+ <xul:textbox class="headerValue plain" anonid="headerValue" flex="1" readonly="true"/>
</content>
<implementation>
<property name="headerValue" onset="return document.getAnonymousElementByAttribute(this, 'anonid', 'headerValue').value = val;"/>
</implementation>
</binding>
<binding id="mail-urlfield" extends="chrome://messenger/content/mailWidgets.xml#mail-headerfield">
<content>
<xul:hbox class="headerNameBox" align="start">
<xul:label class="headerName" xbl:inherits="value=label" flex="1"/>
</xul:hbox>
<xul:label onclick="if (event.button != 2) openUILink(event.target.value, event);"
- class="headerValue text-link headerValueUrl"
+ class="headerValue plain text-link headerValueUrl"
anonid="headerValue" flex="1" readonly="true" context="copyUrlPopup"/>
</content>
</binding>
<binding id="mail-emailheaderfield">
<content>
<xul:hbox class="headerNameBox" align="start">
<xul:label class="headerName" xbl:inherits="value=label" flex="1"/>
</xul:hbox>
- <xul:mail-emailaddress class="headerValue" containsEmail="true"
- anonid="emailAddressNode"/>
+ <xul:mail-emailaddress class="headerValue" anonid="emailAddressNode"/>
</content>
<implementation>
<property name="emailAddressNode" onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'emailAddressNode');"
readonly="true"/>
</implementation>
</binding>
<!-- multi-emailHeaderField: presents multiple emailheaderfields with a toggle -->
<binding id="mail-multi-emailHeaderField">
<content>
- <xul:hbox class="headerNameBox" align="baseline" pack="end">
- <xul:label class="headerName" xbl:inherits="value=label"/>
- </xul:hbox>
+ <xul:hbox class="headerNameBox" align="start" pack="end">
+ <xul:image class="addresstwisty" anonid="toggleIcon"
+ collapsed="true" onclick="toggleWrap();"/>
+ <xul:label class="headerName" xbl:inherits="value=label"/>
+ </xul:hbox>
- <xul:hbox class="headerValueBox" anonid="longEmailAddresses" flex="1"
- singleline="true"
- align="baseline"
- onoverflow="this.parentNode.overflow(event)"
- onunderflow="this.parentNode.underflow(event)">
- <xul:description class="headerValue" containsEmail="true"
- anonid="emailAddresses" flex="1"
- orient="vertical" pack="start" />
- <xul:label class="moreIndicator" value="&more.label;" anonid="more"
- collapsed="true"
- onclick="this.parentNode.parentNode.toggleWrap()"/>
- </xul:hbox>
+ <xul:hbox class="headerValueBox" anonid="longEmailAddresses" flex="1"
+ onoverflow="if (event.detail != 1) this.parentNode.toggleIcon.collapsed = false;"
+ onunderflow="if (event.detail != 1) this.parentNode.toggleIcon.collapsed = true;">
+ <xul:description class="headerValue" anonid="emailAddresses" flex="1"/>
+ </xul:hbox>
</content>
<implementation>
<constructor>
<![CDATA[
this.mAddresses = new Array;
]]>
</constructor>
-
- <method name="overflow">
- <parameter name="event"/>
- <body>
- <![CDATA[
- if (event.detail != 1) this.more.collapsed = false;
- ]]>
- </body>
- </method>
-
- <method name="underflow">
- <parameter name="event"/>
- <body>
- <![CDATA[
- if (event.detail != 1) this.more.collapsed = true;
- ]]>
- </body>
- </method>
-
<field name="mAddresses"/>
<!-- as a perf optimization we are going to keep a cache of email address nodes which we've
created around for the lifetime of the widget. mSizeOfAddressCache controls how many of these
elements we keep around -->
<field name="mSizeOfAddressCache">3</field>
<!-- addAddressView: a public method used to add an address to this widget.
aAddresses is an object with 3 properties: displayName, emailAddress and fullAddress
@@ -310,17 +277,17 @@
try
{
if ("AddExtraAddressProcessing" in top)
AddExtraAddressProcessing(aAddress.emailAddress, aEmailNode);
}
catch(ex)
{
- dump("AddExtraAddressProcessing failed: " + ex + "\n");
+ dump("AddExtraAddressProcessing failed: " + ex);
}
]]>
</body>
</method>
<!-- fillCachedAddresses: private method used to fill up any cached pre-existing
emailAddress fields without creating new email address fields. Returns a remainder
for the # of addresses which require new addresses being created.
@@ -385,34 +352,34 @@
var remainder = this.fillCachedAddresses(aAddressesNode, aNumAddressesToShow);
var index = numAddresses - remainder;
while (index < numAddresses && index < aNumAddressesToShow)
{
var newAddressNode = document.createElement("mail-emailaddress");
if (index)
{
var textNode = document.createElement("text");
- textNode.setAttribute("value", ",");
+ textNode.setAttribute("value", ", ");
textNode.setAttribute("class", "emailSeparator");
aAddressesNode.appendChild(textNode);
}
var itemInDocument = aAddressesNode.appendChild(newAddressNode);
this.updateEmailAddressNode(itemInDocument, this.mAddresses[index]);
index++;
}
]]>
</body>
</method>
<property name="emailAddresses" onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'emailAddresses');"
readonly="true"/>
<property name="longEmailAddresses" onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'longEmailAddresses');"
readonly="true"/>
- <property name="more" onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'more');"
+ <property name="toggleIcon" onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'toggleIcon');"
readonly="true"/>
<!-- buildView: public method used by callers when they are done adding all the email addresses to the widget
aNumAddressesToShow: total # of addresses to show in the short view -->
<method name="buildViews">
<body>
<![CDATA[
this.fillAddressesNode(this.emailAddresses, -1);
@@ -441,18 +408,23 @@
}
]]>
</body>
</method>
<method name="toggleWrap">
<body>
<![CDATA[
- this.more.collapsed = true;
- this.longEmailAddresses.removeAttribute("singleline");
+ if (this.toggleIcon.hasAttribute("open")) {
+ this.toggleIcon.removeAttribute("open");
+ this.longEmailAddresses.setAttribute("singleline", "true");
+ } else {
+ this.toggleIcon.setAttribute("open", "true");
+ this.longEmailAddresses.removeAttribute("singleline");
+ }
]]>
</body>
</method>
<!-- internal method used to clear both our divs -->
<method name="clearChildNodes">
<parameter name="aParentNode"/>
<body>
@@ -472,63 +444,48 @@
</body>
</method>
<method name="clearHeaderValues">
<body>
<![CDATA[
// clear out our local state
this.mAddresses = new Array;
+ if (this.toggleIcon.hasAttribute("open"))
+ // no automatic overflow tracking in this case
+ this.toggleIcon.collapsed = true;
+ this.toggleIcon.removeAttribute("open");
this.longEmailAddresses.setAttribute("singleline", "true");
// remove anything inside of each of our labels....
this.clearChildNodes(this.emailAddresses);
]]>
</body>
</method>
</implementation>
</binding>
<binding id="mail-emailaddress">
-#ifndef MOZ_THUNDERBIRD
<content popup="emailAddressPopup" context="emailAddressPopup">
- <xul:description anonid="emailValue" class="emailDisplayButton"
+ <xul:description anonid="emailValue" class="emailDisplayButton plain"
xbl:inherits="xbl:text=label,crop" flex="1"/>
<xul:image class="emailDisplayImage" anonid="emailImage"
xbl:inherits="src=image"/>
</content>
-#else
- <content>
- <xul:description anonid="emailValue" class="emailDisplayButton"
- xbl:inherits="hascard"
- context="emailAddressPopup" popup="emailAddressPopup"
- flex="1">
- <xul:label class="emaillabel" anonid="emaillabel"
- xbl:inherits="value=label,crop"/>
- <xul:image class="emailStar" anonid="emailStar"
- context="emailAddressPopup"
- onmousedown="event.preventDefault();"
- onclick="onClickEmailStar(event, this.parentNode.parentNode);"
- xbl:inherits="hascard,tooltiptext=tooltipstar"/>
- </xul:description>
- </content>
-#endif
<implementation>
<property name="label" onset="this.getPart('emailValue').setAttribute('label',val); return val;"
onget="return this.getPart('emailValue').getAttribute('label');"/>
<property name="crop" onset="this.getPart('emailValue').setAttribute('crop',val); return val;"
onget="return this.getPart('emailValue').getAttribute('crop');"/>
<property name="disabled" onset="this.getPart('emailValue').setAttribute('disabled',val); return val;"
onget="return this.getPart('emailValue').getAttribute('disabled');"/>
-#ifndef MOZ_THUNDERBIRD
<property name="src" onset="this.getPart('emailImage').setAttribute('src',val); return val;"
onget="return this.getPart('emailImage').getAttribute('src');"/>
<property name="imgalign" onset="this.getPart('emailImage').setAttribute('imgalign',val); return val;"
onget="return this.getPart('emailImage').getAttribute('imgalign');"/>
-#endif
<method name="getPart">
<parameter name="aPartId"/>
<body><![CDATA[
return document.getAnonymousElementByAttribute(this, "anonid", aPartId);
]]></body>
</method>
</implementation>
@@ -675,17 +632,17 @@
]]>
</body>
</method>
</implementation>
</binding>
<binding id="mail-messageid">
<content context="messageIdContext" onclick="MessageIdClick(this, event);">
- <xul:label anonid="messageIdValue" class="messageIdDisplayButton"
+ <xul:label anonid="messageIdValue" class="messageIdDisplayButton plain"
xbl:inherits="value=label"/>
<xul:image class="messageIdDisplayImage" anonid="messageIdImage"/>
</content>
<implementation>
<property name="label" onset="this.getPart().setAttribute('label',val); return val;"
onget="return this.getPart('messageIdValue').getAttribute('label');"/>
@@ -699,17 +656,17 @@
</binding>
<!-- Header field for showing the tags associated with a message -->
<binding id="mail-headerfield-tags">
<content>
<xul:hbox class="headerNameBox" align="start">
<xul:label class="headerName" xbl:inherits="value=label" flex="1"/>
</xul:hbox>
- <xul:label class="headerValue" anonid="headerValue" flex="1"/>
+ <xul:label class="headerValue plain" anonid="headerValue" flex="1"/>
</content>
<implementation>
<property name="headerValue" onset="return this.buildTags(val);"/>
<method name="buildTags">
<parameter name="aTags"/>
<body>
<![CDATA[
@@ -737,19 +694,17 @@
tagName = tagService.getTagForKey(tagsArray[index]);
} catch (ex) { continue; }
var color = tagService.getColorForKey(tagsArray[index]);
// now create a label for the tag name, and set the color
var label = document.createElement("label");
label.setAttribute('value', tagName);
-#ifndef MOZ_THUNDERBIRD
label.style.color = color;
-#endif
label.className = "tagvalue blc-" + color.substr(1);
headerValueNode.appendChild(label);
}
]]>
</body>
</method>
</implementation>
</binding>
@@ -1879,31 +1834,22 @@
<content>
<children>
<xul:folderSummary/>
</children>
</content>
<handlers>
<handler event="popupshowing">
<![CDATA[
- var msgFolder;
- // Allow for differences between Thunderbird and SeaMonkey folder pane
- if ("gFolderTreeView" in window) {
- msgFolder = gFolderTreeView.getFolderAtCoords(event.clientX,
- event.clientY);
- if (!msgFolder)
- return false;
- } else {
- var folderTree = GetFolderTree();
- var row = folderTree.treeBoxObject.getRowAt(event.clientX,
- event.clientY);
- if (row == -1)
- return false;
- msgFolder = GetFolderResource(folderTree, row).QueryInterface(Components.interfaces.nsIMsgFolder);
- }
+ var folderTree = GetFolderTree();
+ var row = folderTree.treeBoxObject.getRowAt(event.clientX,
+ event.clientY);
+ if (row == -1)
+ return false;
+ var msgFolder = GetFolderResource(folderTree, row).QueryInterface(Components.interfaces.nsIMsgFolder);
if (!msgFolder || msgFolder.isServer)
return false;
var asyncResults = {};
return document.getAnonymousNodes(this)[0].parseFolder(msgFolder, null, asyncResults);
]]>
</handler>
<handler event="popuphiding">
@@ -2105,49 +2051,9 @@
}
if (gAlertListener)
gAlertListener.observe(null, "alertclickcallback", "");
]]>
</handler>
</handlers>
</binding>
-
- <binding id="header-view-button-box">
- <content>
- <!-- It might be nice to allow a UI for customization of these buttons -->
- <xul:hbox align="start">
-
- <!-- XXXdmose need to move these commands to a controller, either
- on the header view, the message pane, or the default
- controller -->
-
- <!-- XXXdmose need to audit our shortcut/a11y setup and make sure
- these buttons are doing the right thing -->
-
- <xul:button anonid="hdrReplyButton" label="&replyButton.label;"
- oncommand="MsgReplyMessage(event);" observes="button_reply"
- class="msgHeaderView-button hdrReplyButton"/>
- <xul:button anonid="hdrForwardButton" label="&forwardButton.label;"
- oncommand="MsgForwardMessage(event);"
- observes="button_forward" class="msgHeaderView-button hdrForwardButton"/>
- <xul:button anonid="hdrJunkButton" label="&junkButton.label;"
- observes="button_junk" class="msgHeaderView-button hdrJunkButton"
- oncommand="goDoCommand('button_junk')"/>
- <xul:button anonid="hdrTrashButton" tooltiptext="&trashButton.tooltiptext;"
- observes="button_delete" trash="true"
- class="msgHeaderView-button hdrTrashButton"
- oncommand="goDoCommand(event.shiftKey ? 'cmd_shiftDelete' : 'cmd_delete')"/>
- </xul:hbox>
- </content>
-
- <implementation>
- <method name="getButton">
- <parameter name="id"/>
- <body>
- <![CDATA[
- return document.getAnonymousElementByAttribute(this, 'anonid', id);
- ]]>
- </body>
- </method>
- </implementation>
- </binding>
</bindings>
--- a/suite/makefiles.sh
+++ b/suite/makefiles.sh
@@ -48,16 +48,17 @@ add_makefiles "
suite/debugQA/locales/Makefile
suite/common/Makefile
suite/common/public/Makefile
suite/common/src/Makefile
suite/common/tests/Makefile
suite/installer/Makefile
suite/installer/windows/Makefile
suite/locales/Makefile
+ suite/mailnews/Makefile
suite/modules/Makefile
suite/modules/test/Makefile
suite/profile/Makefile
suite/profile/migration/public/Makefile
suite/profile/migration/src/Makefile
suite/shell/public/Makefile
suite/shell/src/Makefile
suite/themes/modern/Makefile