зеркало из https://github.com/mozilla/pjs.git
Bug #329555 --> new mail notification alert is not clickable.
sr=bienvenu
This commit is contained in:
Родитель
c1cb8b2a23
Коммит
b141a2a78c
|
@ -53,8 +53,7 @@
|
|||
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
|
||||
<script type="application/x-javascript" src="chrome://messenger/content/newmailalert.js"/>
|
||||
|
||||
|
||||
<stack id="alertContainer">
|
||||
<stack id="alertContainer" mousethrough="always">
|
||||
<hbox id="alertBox">
|
||||
<hbox id ="alertImageBox" align="center" valign="center">
|
||||
<image id="alertImage"/>
|
||||
|
@ -63,14 +62,14 @@
|
|||
<vbox id="alertTextBox">
|
||||
<label id="alertTitle"/>
|
||||
<separator id="alertGroove" class="groove"/>
|
||||
<folderSummary id="folderSummaryInfo"/>
|
||||
<folderSummary id="folderSummaryInfo" mousethrough="never"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
|
||||
<hbox align="top">
|
||||
<spacer flex="1"/>
|
||||
<toolbarbutton id="closeButton" onclick="closeAlert();"/>
|
||||
</hbox>
|
||||
</hbox>
|
||||
</stack>
|
||||
<!-- This method is called inline because we want to make sure we establish the width
|
||||
and height of the alert before we fire the onload handler. -->
|
||||
|
|
|
@ -81,16 +81,24 @@
|
|||
because it controls how large the preview, subject and sender text can be
|
||||
before cropping kicks in */
|
||||
max-width: 450px;
|
||||
padding-right: 5px;
|
||||
padding: 0px 5px 0px 5px;
|
||||
}
|
||||
|
||||
.folderSummary-subject {
|
||||
padding-left: 5px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.folderSummary-sender, .folderSummary-subject {
|
||||
cursor: inherit;
|
||||
}
|
||||
|
||||
.folderSummary-previewText {
|
||||
color: grey;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.folderSummaryMessage:hover > .folderSummary-message-row {
|
||||
cursor: pointer;
|
||||
color: blue;
|
||||
}
|
||||
|
||||
#closeButton {
|
||||
|
@ -98,7 +106,7 @@
|
|||
-moz-image-region: rect(0px, 16px, 16px, 0px);
|
||||
-moz-appearance: none;
|
||||
border: none !important;
|
||||
padding: 0px;
|
||||
padding: 2px 0px 0px 0px;
|
||||
}
|
||||
|
||||
#closeButton > .toolbarbutton-icon {
|
||||
|
|
|
@ -2129,7 +2129,10 @@
|
|||
var names = {};
|
||||
var emails = {};
|
||||
var numAddresses = hdrParser.parseHeadersWithArray(msgHdr.mime2DecodedAuthor, emails, names, {});
|
||||
msgPopup.setAttribute('sender', ' - ' + (names.value[0] ? names.value[0] : emails.value[0]));
|
||||
msgPopup.setAttribute('sender', names.value[0] ? names.value[0] : emails.value[0]);
|
||||
msgPopup.messageUri = aFolder.getUriForMsg(msgHdr);
|
||||
msgPopup.folderUri = aFolder.URI;
|
||||
msgPopup.msgKey = msgHdr.messageKey;
|
||||
document.getAnonymousNodes(this)[0].appendChild(msgPopup);
|
||||
}
|
||||
if (document.getAnonymousNodes(this)[0].childNodes.length >= this.mMaxMsgHdrsInPopup)
|
||||
|
@ -2154,7 +2157,7 @@
|
|||
|
||||
<binding id="folderSummary-message">
|
||||
<content>
|
||||
<xul:vbox>
|
||||
<xul:vbox class="folderSummaryMessage">
|
||||
<xul:hbox class="folderSummary-message-row">
|
||||
<xul:label anonid="subject" flex="1" class="folderSummary-subject" xbl:inherits="value=subject" crop="right"/>
|
||||
<xul:label anonid="sender" class="folderSummary-sender" xbl:inherits="value=sender" crop="right"/>
|
||||
|
@ -2180,5 +2183,36 @@
|
|||
]]>
|
||||
</constructor>
|
||||
</implementation>
|
||||
<handlers>
|
||||
<handler event="click" button="0">
|
||||
<![CDATA[
|
||||
var mailSession = Components.classes["@mozilla.org/messenger/services/session;1"].
|
||||
getService(Components.interfaces.nsIMsgMailSession);
|
||||
var topmostMsgWindow;
|
||||
try {
|
||||
topmostMsgWindow = mailSession.topmostMsgWindow;
|
||||
} catch (ex) {}
|
||||
|
||||
if (topmostMsgWindow)
|
||||
{
|
||||
try {
|
||||
// SelectFolder throws an exception if the folder is not in the current folder view
|
||||
mailSession.topmostMsgWindow.windowCommands.selectFolder(this.folderUri);
|
||||
mailSession.topmostMsgWindow.windowCommands.selectMessage(this.messageUri);
|
||||
} catch (ex) {}
|
||||
}
|
||||
else
|
||||
{
|
||||
// open a new window
|
||||
var mailWindowService = Components.classes["@mozilla.org/messenger/windowservice;1"].
|
||||
getService(Components.interfaces.nsIMessengerWindowService);
|
||||
mailWindowService.openMessengerWindowWithUri("mail:3pane", this.folderUri, this.msgKey);
|
||||
}
|
||||
|
||||
if (gAlertListener)
|
||||
gAlertListener.observe(null, "alertclickcallback", "");
|
||||
]]>
|
||||
</handler>
|
||||
</handlers>
|
||||
</binding>
|
||||
</bindings>
|
||||
|
|
|
@ -272,12 +272,12 @@ nsresult nsMessengerUnixIntegration::AlertFinished()
|
|||
|
||||
nsresult nsMessengerUnixIntegration::AlertClicked()
|
||||
{
|
||||
// make sure we don't insert the icon in the system tray since the user clicked on the alert.
|
||||
#ifndef MOZ_THUNDERBIRD
|
||||
nsXPIDLCString folderURI;
|
||||
GetFirstFolderWithNewMail(getter_Copies(folderURI));
|
||||
|
||||
openMailWindow(NS_LITERAL_STRING("mail:3pane").get(), folderURI);
|
||||
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
#include "nsIPrefService.h"
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsNativeCharsetUtils.h"
|
||||
|
||||
// XXX test for this as long as there are still non-xul-app suite builds
|
||||
|
@ -620,14 +620,29 @@ nsresult nsMessengerWinIntegration::AlertFinished()
|
|||
|
||||
nsresult nsMessengerWinIntegration::AlertClicked()
|
||||
{
|
||||
#ifdef MOZ_THUNDERBIRD
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIMsgMailSession> mailSession = do_GetService(NS_MSGMAILSESSION_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
nsCOMPtr<nsIMsgWindow> topMostMsgWindow;
|
||||
rv = mailSession->GetTopmostMsgWindow(getter_AddRefs(topMostMsgWindow));
|
||||
if (topMostMsgWindow)
|
||||
{
|
||||
nsCOMPtr<nsIDOMWindowInternal> domWindow;
|
||||
rv = topMostMsgWindow->GetDomWindow(getter_AddRefs(domWindow));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
activateWindow(domWindow);
|
||||
}
|
||||
#else
|
||||
// make sure we don't insert the icon in the system tray since the user clicked on the alert.
|
||||
mSuppressBiffIcon = PR_TRUE;
|
||||
|
||||
|
||||
nsXPIDLCString folderURI;
|
||||
GetFirstFolderWithNewMail(getter_Copies(folderURI));
|
||||
|
||||
openMailWindow(NS_LITERAL_STRING("mail:3pane").get(), folderURI);
|
||||
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче