зеркало из https://github.com/mozilla/gecko-dev.git
fix js warnings. #68525. thanks to hwaara for the patch. r=timeless, sr=alecf,sspitzer
This commit is contained in:
Родитель
c45959de9b
Коммит
ff95dba345
|
@ -30,7 +30,9 @@ function fillThreadPaneContextMenu()
|
|||
if(numSelected >= 0)
|
||||
{
|
||||
selectedMessage = selectedMessages[0];
|
||||
isNewsgroup = GetMessageType(selectedMessage) == "news";
|
||||
if (selectedMessage) {
|
||||
isNewsgroup = GetMessageType(selectedMessage) == "news";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -61,36 +63,16 @@ function fillThreadPaneContextMenu()
|
|||
return(true);
|
||||
}
|
||||
|
||||
function GetMessageType(message)
|
||||
{
|
||||
var compositeDataSource = GetCompositeDataSource("MessageProperty");
|
||||
var messageResource = message.QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
if(messageResource && compositeDataSource)
|
||||
{
|
||||
var property =
|
||||
RDF.GetResource('http://home.netscape.com/NC-rdf#MessageType');
|
||||
if (!property) return null;
|
||||
var result = compositeDataSource.GetTarget(messageResource, property , true);
|
||||
if (!result) return null;
|
||||
result = result.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (!result) return null;
|
||||
return result.Value;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
function SetupNewMessageWindowMenuItem(menuID, numSelected, forceHide)
|
||||
{
|
||||
ShowMenuItem(menuID, (numSelected <= 1) && !forceHide);
|
||||
EnableMenuItem(menuID, true);
|
||||
EnableMenuItem(menuID, (numSelected == 1));
|
||||
}
|
||||
|
||||
function SetupEditAsNewMenuItem(menuID, numSelected, forceHide)
|
||||
{
|
||||
ShowMenuItem(menuID, (numSelected <= 1)&& !forceHide);
|
||||
EnableMenuItem(menuID, true);
|
||||
EnableMenuItem(menuID, (numSelected == 1));
|
||||
}
|
||||
|
||||
function SetupReplyToSenderMenuItem(menuID, numSelected, forceHide)
|
||||
|
@ -334,7 +316,7 @@ function fillMessagePaneContextMenu(contextMenu)
|
|||
|
||||
var isNewsgroup = false;
|
||||
|
||||
if(numSelected == 1)
|
||||
if ((numSelected == 1) && message)
|
||||
isNewsgroup = GetMessageType(message) == "news";
|
||||
|
||||
var hideMailItems = AreBrowserItemsShowing();
|
||||
|
|
|
@ -124,13 +124,11 @@ function InitMessageMenu()
|
|||
|
||||
function GetMessageType(message)
|
||||
{
|
||||
|
||||
var compositeDS = GetCompositeDataSource("MessageProperty");
|
||||
var property = RDF.GetResource('http://home.netscape.com/NC-rdf#MessageType');
|
||||
var result = compositeDS.GetTarget(message, property, true);
|
||||
result = result.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
return result.Value;
|
||||
|
||||
}
|
||||
|
||||
function InitMessageMark()
|
||||
|
@ -157,7 +155,6 @@ function InitMarkFlaggedItem(id)
|
|||
item.setAttribute("checked", areMessagesFlagged);
|
||||
}
|
||||
|
||||
|
||||
function SelectedMessagesAreRead()
|
||||
{
|
||||
var aMessage = GetSelectedMessage(0);
|
||||
|
@ -361,9 +358,9 @@ function MsgDeleteMessage(reallyDelete, fromToolbar)
|
|||
function MsgCopyMessage(destFolder)
|
||||
{
|
||||
// Get the id for the folder we're copying into
|
||||
destUri = destFolder.getAttribute('id');
|
||||
destResource = RDF.GetResource(destUri);
|
||||
destMsgFolder = destResource.QueryInterface(Components.interfaces.nsIMsgFolder);
|
||||
var destUri = destFolder.getAttribute('id');
|
||||
var destResource = RDF.GetResource(destUri);
|
||||
var destMsgFolder = destResource.QueryInterface(Components.interfaces.nsIMsgFolder);
|
||||
|
||||
var srcFolder = GetLoadedMsgFolder();
|
||||
if(srcFolder)
|
||||
|
@ -378,9 +375,9 @@ function MsgCopyMessage(destFolder)
|
|||
function MsgMoveMessage(destFolder)
|
||||
{
|
||||
// Get the id for the folder we're copying into
|
||||
destUri = destFolder.getAttribute('id');
|
||||
destResource = RDF.GetResource(destUri);
|
||||
destMsgFolder = destResource.QueryInterface(Components.interfaces.nsIMsgFolder);
|
||||
var destUri = destFolder.getAttribute('id');
|
||||
var destResource = RDF.GetResource(destUri);
|
||||
var destMsgFolder = destResource.QueryInterface(Components.interfaces.nsIMsgFolder);
|
||||
|
||||
var srcFolder = GetLoadedMsgFolder();
|
||||
if(srcFolder)
|
||||
|
@ -731,7 +728,6 @@ function MsgMarkAsFlagged(markFlagged)
|
|||
MarkMessagesFlagged(compositeDataSource, selectedMessages, markFlagged);
|
||||
}
|
||||
|
||||
|
||||
function MsgMarkAllRead()
|
||||
{
|
||||
var compositeDataSource = GetCompositeDataSource("MarkAllMessagesRead");
|
||||
|
@ -760,7 +756,6 @@ function MsgDownloadSelected()
|
|||
|
||||
function MsgMarkThreadAsRead()
|
||||
{
|
||||
|
||||
var messageList = GetSelectedMessages();
|
||||
if(messageList.length == 1)
|
||||
{
|
||||
|
@ -769,30 +764,33 @@ function MsgMarkThreadAsRead()
|
|||
|
||||
MarkThreadAsRead(compositeDataSource, message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function MsgViewPageSource()
|
||||
{
|
||||
dump("MsgViewPageSource(); \n ");
|
||||
|
||||
//dump("MsgViewPageSource(); \n ");
|
||||
var messages = GetSelectedMessages();
|
||||
ViewPageSource(messages);
|
||||
}
|
||||
|
||||
function MsgFind() {
|
||||
function MsgFind()
|
||||
{
|
||||
messenger.find();
|
||||
}
|
||||
function MsgFindAgain() {
|
||||
|
||||
function MsgFindAgain()
|
||||
{
|
||||
messenger.findAgain();
|
||||
}
|
||||
|
||||
function MsgSearchMessages() {
|
||||
function MsgSearchMessages()
|
||||
{
|
||||
var preselectedFolder = GetFirstSelectedMsgFolder();
|
||||
window.openDialog("chrome://messenger/content/SearchDialog.xul", "SearchMail", "chrome,resizable", { folder: preselectedFolder });
|
||||
}
|
||||
|
||||
function MsgFilters() {
|
||||
function MsgFilters()
|
||||
{
|
||||
var preselectedFolder = GetFirstSelectedMsgFolder();
|
||||
window.openDialog("chrome://messenger/content/FilterListDialog.xul", "FilterDialog", "chrome,resizable", { folder: preselectedFolder });
|
||||
}
|
||||
|
@ -803,12 +801,14 @@ function MsgViewAllHeaders()
|
|||
MsgReload();
|
||||
return true;
|
||||
}
|
||||
|
||||
function MsgViewNormalHeaders()
|
||||
{
|
||||
pref.SetIntPref("mail.show_headers",1);
|
||||
MsgReload();
|
||||
return true;
|
||||
}
|
||||
|
||||
function MsgViewBriefHeaders()
|
||||
{
|
||||
pref.SetIntPref("mail.show_headers",0);
|
||||
|
@ -837,7 +837,6 @@ function MsgSendUnsentMsg()
|
|||
|
||||
function PrintEnginePrint()
|
||||
{
|
||||
|
||||
var messageList = GetSelectedMessages();
|
||||
numMessages = messageList.length;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче