Add a standalone message window and make multiple 3 pane configurations work. r=mscott, sspitzer.

This commit is contained in:
putterman%netscape.com 2000-04-11 20:19:32 +00:00
Родитель 1a915ed08b
Коммит 8cbb6c9e43
23 изменённых файлов: 2626 добавлений и 1695 удалений

Просмотреть файл

@ -46,8 +46,6 @@ interface nsIMessenger : nsISupports {
readonly attribute nsITransactionManager transactionManager;
void GetNewMessages(in nsIRDFCompositeDataSource database,
in nsIRDFResource folder);
void SetWindow(in nsIDOMWindow ptr, in nsIMsgWindow msgWindow);
void DoPrint();
void DoPrintPreview();
@ -83,10 +81,6 @@ interface nsIMessenger : nsISupports {
void markThreadRead(in nsIRDFCompositeDataSource database,
in nsIMsgFolder folder,
in nsIMsgThread thread);
void NewFolder(in nsIRDFCompositeDataSource database,
in nsIRDFResource parentFolder,
in wstring name);
void RenameFolder(in nsIRDFCompositeDataSource db,
in nsIRDFResource folder, in wstring name);
void CompactFolder(in nsIRDFCompositeDataSource db,

Просмотреть файл

@ -23,11 +23,18 @@
messenger.xul
folderPane.xul
threadPane.xul
mailWindowOverlay.xul
mail3PaneWindowVertLayout.xul
mailWindowOverlay.js
mailWindow.js
messageWindow.xul
messageWindow.js
msgHdrViewAddresses.js
msgHdrViewOverlay.js
msgHdrViewOverlay.xul
widgetglue.js
commandglue.js
mailCommands.js
shareglue.js
subscribe.js
subscribe.xul

Просмотреть файл

@ -32,6 +32,12 @@ SAMPLES_DIR = $(DIST)/bin/chrome/messenger/content/default
EXPORT_RESOURCE_SAMPLES = \
messenger.xul \
mail3PaneWindowVertLayout.xul \
mailWindowOverlay.xul \
mailWindowOverlay.js \
mailWindow.js \
messageWindow.xul \
messageWindow.js \
folderPane.xul \
threadPane.xul \
msgHdrViewOverlay.xul \
@ -39,6 +45,7 @@ EXPORT_RESOURCE_SAMPLES = \
msgHdrViewAddresses.js \
widgetglue.js \
commandglue.js \
mailCommands.js \
shareglue.js \
subscribe.js \
subscribe.xul \

Просмотреть файл

@ -23,6 +23,8 @@
* Command-specific code. This stuff should be called by the widgets
*/
//The eventual goal is for this file to go away and for the functions to either be brought into
//mailCommands.js or into 3pane specific code.
var gBeforeFolderLoadTime;
@ -33,187 +35,8 @@ function OpenURL(url)
messenger.OpenURL(url);
}
function FindIncomingServer(uri)
{
//dump("FindIncomingServer("+uri+")\n");
var server=null;
if (!uri) return server;
try {
var resource = RDF.GetResource(uri);
var msgfolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder);
server = msgfolder.server;
//dump("server = " + server + "\n");
return server;
}
catch (ex) {
return null;
}
}
function getIdentityForSelectedServer()
{
var folderTree = GetFolderTree();
var identity = null;
var selectedFolderList = folderTree.selectedItems;
if(selectedFolderList.length > 0) {
var selectedFolder = selectedFolderList[0];
var folderUri = selectedFolder.getAttribute('id');
// dump("selectedFolder uri = " + uri + "\n");
// get the incoming server associated with this folder uri
var server = FindIncomingServer(folderUri);
// dump("server = " + server + "\n");
// get the identity associated with this server
var identities = accountManager.GetIdentitiesForServer(server);
// dump("identities = " + identities + "\n");
// just get the first one
if (identities.Count() > 0 ) {
identity = identities.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIdentity);
}
}
return identity;
}
function ComposeMessage(type, format) //type is a nsIMsgCompType and format is a nsIMsgCompFormat
{
var msgComposeType = Components.interfaces.nsIMsgCompType;
var identity = null;
var newsgroup = null;
try
{
var folderTree = GetFolderTree();
var selectedFolderList = folderTree.selectedItems;
if(selectedFolderList.length > 0)
{
var selectedFolder = selectedFolderList[0];
var uri = selectedFolder.getAttribute('id');
// dump("selectedFolder uri = " + uri + "\n");
// get the incoming server associated with this uri
var server = FindIncomingServer(uri);
// if they hit new or reply and they are reading a newsgroup
// turn this into a new post or a reply to group.
if (server.type == "nntp")
{
if (type == msgComposeType.Reply)
type = msgComposeType.ReplyToGroup;
else
if (type == msgComposeType.New)
{
type = msgComposeType.NewsPost;
// from the uri, get the newsgroup name
var resource = RDF.GetResource(uri);
var msgfolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder);
if (msgfolder.isServer)
newsgroup = "";
else
newsgroup = msgfolder.name;
}
}
}
identity = getIdentityForSelectedServer();
// dump("identity = " + identity + "\n");
}
catch (ex)
{
// dump("failed to get an identity to pre-select: " + ex + "\n");
}
dump("\nComposeMessage from XUL: " + identity + "\n");
var uri = null;
if (! msgComposeService)
{
dump("### msgComposeService is invalid\n");
return;
}
if (type == msgComposeType.New) //new message
{
//dump("OpenComposeWindow with " + identity + "\n");
msgComposeService.OpenComposeWindow(null, null, type, format, identity);
return;
}
else if (type == msgComposeType.NewsPost)
{
dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n");
msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity);
return;
}
var tree = GetThreadTree();
if (tree)
{
var nodeList = tree.selectedItems;
var appCore = FindMessenger();
if (appCore)
appCore.SetWindow(window, msgWindow);
var object = null;
if (nodeList && nodeList.length > 0)
{
uri = "";
for (var i = 0; i < nodeList.length && i < 8; i ++)
{
dump('i = '+ i);
dump('\n');
if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline ||
type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSenderAndGroup ||
type == msgComposeType.Template || type == msgComposeType.Draft)
{
msgComposeService.OpenComposeWindow(null, nodeList[i].getAttribute('id'), type, format, identity);
}
else
{
if (i)
uri += ","
uri += nodeList[i].getAttribute('id');
}
}
if (type == msgComposeType.ForwardAsAttachment)
{
msgComposeService.OpenComposeWindow(null, uri, type, format, identity);
}
}
else
dump("### nodeList is invalid\n");
}
else
dump("### tree is invalid\n");
}
function GetNewMessages()
{
var folderTree = GetFolderTree();
var selectedFolderList = folderTree.selectedItems;
if(selectedFolderList.length > 0)
{
var selectedFolder = selectedFolderList[0];
//Whenever we do get new messages, clear the old new messages.
var msgFolder = GetMsgFolderFromNode(selectedFolder);
if(msgFolder && msgFolder.hasNewMessages())
msgFolder.clearNewMessages();
messenger.GetNewMessages(folderTree.database, selectedFolder.resource);
}
else {
dump("Nothing was selected\n");
}
}
function GetMsgFolderFromNode(folderNode)
{

Просмотреть файл

@ -30,8 +30,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<tree style="width:100px; height: 600px;" flex="100%"
rdf:datasources="rdf:null"
<tree rdf:datasources="rdf:null"
id="folderTree" class="mail-folders"
rdf:ignore="http://home.netscape.com/NC-rdf#MessageChild"
onselect="top.FolderPaneSelectionChange(); document.commandDispatcher.updateCommands('tree-select');"

Просмотреть файл

@ -0,0 +1,359 @@
<?xml version="1.0"?>
<!--
The contents of this file are subject to the Netscape 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/NPL/
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 Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
-->
<?xml-stylesheet href="chrome://messenger/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/platformMailnewsOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/threadPane.xul"?>
<?xul-overlay href="chrome://messenger/content/folderPane.xul"?>
<?xul-overlay href="chrome://messenger/content/msgHdrViewOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailWindowOverlay.xul"?>
<?xul-overlay href="chrome://sidebar/content/sidebarOverlay.xul"?>
<?xul-overlay href="chrome://global/content/tasksOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/messenger.dtd">
<window id="messengerWindow"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:nc="http://home.netscape.com/NC-rdf#"
title="&messengerWindow.title;"
titlemodifier="&titleModifier.label;"
titlemenuseparator="&titleSeperator.label;"
onload="OnLoadMessenger()"
onunload="OnUnloadMessenger()"
align="vertical"
width="750"
height="500"
persist="width height screenX screenY"
windowtype="mail:3pane">
<html:script src="chrome://global/content/strres.js"/>
<html:script src="chrome://messenger/content/widgetglue.js"/>
<html:script src="chrome://messenger/content/commandglue.js"/>
<html:script src="chrome://messenger/content/shareglue.js"/>
<html:script src="chrome://messenger/content/msgViewNavigation.js"/>
<html:script src="chrome://messenger/content/mailWindow.js"/>
<html:script src="chrome://messenger/content/msgMail3PaneWindow.js"/>
<html:script src="chrome://messenger/content/mailContextMenus.js"/>
<html:script src="chrome://messenger/content/messengerdnd.js"/>
<html:script src="chrome://messenger/content/accountUtils.js"/>
<commands id="commands">
<commandset id="CommandUpdate_Mail"
commandupdater="true"
events="focus,tree-select"
oncommandupdate="CommandUpdate_Mail()"/>
<commandset id="globalEditMenuItems"/>
<commandset id="selectEditMenuItems"/>
<commandset id="undoEditMenuItems"/>
</commands>
<broadcasterset id="broadcasterset"/>
<keyset id="keyset">
<!-- File Menu -->
<key id="key_newNavigator"/>
<key id="key_newMessage"/>
<key id="key_close"/>
<key id="key_quit"/>
<!-- Edit Menu -->
<key id="key_undo"/>
<key id="key_redo"/>
<key id="key_cut"/>
<key id="key_copy"/>
<key id="key_paste"/>
<key id="key_delete" shift="false"/>
<key id="cmd_shiftDelete" oncommand="goDoCommand('cmd_shiftDelete')"/>
<key id="key_selectAll"/>
<key id="key_preferences"/>
<key id="key_nextUnreadMsg" key="&nextUnreadMsgCmd.key;" control="false" shift="false" observes="cmd_nextUnreadMsg"/>
<key id="key_nextUnreadThread" key="&nextUnreadThreadCmd.key;" control="false" shift="false" observes="cmd_nextUnreadThread"/>
</keyset>
<popupset>
<popup id="threadPaneContext" oncreate="return fillThreadPaneContextMenu();" >
<menuitem id="threadPaneContext-openNewWindow"
value="&contextOpenNewWindow.label;"
accesskey=""
oncommand="MsgOpenNewWindowForMessage();"/>
<menuitem id="threadPaneContext-editAsNew"
value="&contextEditAsNew.label;"
accesskey=""
oncommand="MsgEditMessageAsNew();"/>
<menuseparator id="threadPaneContext-sep-open"/>
<menuitem id="threadPaneContext-replySender"
value="&contextReplySender.label;"
accesskey=""
oncommand="MsgReplyMessage(event);"/>
<menuitem id="threadPaneContext-replyAll"
value="&contextReplyAll.label;"
accesskey=""
oncommand="MsgReplyToAllMessage(event);"/>
<menuitem id="threadPaneContext-forward"
value="&contextForward.label;"
accesskey=""
oncommand="MsgForwardMessage(event);"/>
<menuseparator id="threadPaneContext-sep-reply"/>
<menu id="threadPaneContext-moveMenu"
value="&contextMoveMsgMenu.label;"
datasources="rdf:null"
rdf:ignore="http://home.netscape.com/NC-rdf#MessageChild">
<menupopup/>
<template>
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup>
<menuitem uri="..." value="&fileHereMenu.label;"
oncommand="MsgMoveMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType" />
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="false" nc:ServerType="nntp">
<!-- don't show nntp servers in the file and copies menus -->
</rule>
<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
<!-- note, there is no "file here" -->
<menupopup>
<menu uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup/>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name" oncommand="MsgMoveMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
</menu>
<menu id="threadPaneContext-copyMenu"
value="&contextCopyMsgMenu.label;"
datasources="rdf:null"
rdf:ignore="http://home.netscape.com/NC-rdf#MessageChild">
<menupopup/>
<template>
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup>
<menuitem uri="..." value="&fileHereMenu.label;"
oncommand="MsgCopyMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="false" nc:ServerType="nntp">
<!-- don't show nntp servers in the file and copies menus -->
</rule>
<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
<!-- note, there is no "file here" -->
<menupopup>
<menu uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup/>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="MsgCopyMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
</menu>
<menuitem id="threadPaneContext-saveAs"
value="&contextSaveAs.label;"
accesskey=""
oncommand="MsgSaveAsFile();"/>
<menuitem id="threadPaneContext-print"
value="&contextPrint.label;"
accesskey=""
oncommand="PrintEnginePrint();"/>
<menuitem id="threadPaneContext-delete"
value="&contextDelete.label;"
accesskey=""
oncommand="MsgDeleteMessage(false, false);"/>
<menuseparator id="threadPaneContext-sep-edit"/>
<menuitem id="threadPaneContext-addSenderToAddressBook"
value="&contextAddSenderToAddressBook.label;"
accesskey=""
oncommand="MsgAddSenderToAddressBook();"/>
<menuitem id="threadPaneContext-addAllToAddressBook"
value="&contextAddAllToAddressBook.label;"
accesskey=""
oncommand="MsgAddAllToAddressBook();"/>
</popup>
<popup id="folderPaneContext" oncreate="return fillFolderPaneContextMenu();" >
<menuitem id="folderPaneContext-getMessages"
value="&folderContextGetMessages.label;"
accesskey=""
oncommand="MsgGetMessage();"/>
<menuitem id="folderPaneContext-openNewWindow"
value="&folderContextOpenNewWindow.label;"
accesskey=""
oncommand="MsgOpenNewWindowForFolder(null);"/>
<menuitem id="folderPaneContext-rename"
value="&folderContextRename.label;"
accesskey=""
oncommand="MsgRenameFolder();"/>
<menuitem id="folderPaneContext-remove"
value="&folderContextRemove.label;"
accesskey=""
oncommand="MsgDeleteFolder();"/>
<menuitem id="folderPaneContext-emptyTrash"
value="&folderContextEmptyTrash.label;"
accesskey=""
oncommand="MsgEmptyTrash();"/>
<menuitem id="folderPaneContext-sendUnsentMessages"
value="&folderContextSendUnsentMessages.label;"
accesskey=""
oncommand="MsgSendUnsentMsg();"/>
<menuitem id="folderPaneContext-unsubscribe"
value="&folderContextUnsubscribe.label;"
accesskey=""
oncommand="MsgUnsubscribe();"/>
<menuitem id="folderPaneContext-markFolderRead"
value="&folderContextMarkNewsgroupRead.label;"
accesskey=""
oncommand="MsgMarkFolderRead();"/>
<menuseparator id="folderPaneContext-sep-edit"/>
<menuitem id="folderPaneContext-new"
value="&folderContextNew.label;"
accesskey=""
oncommand="MsgNewFolder();"/>
<menuitem id="folderPaneContext-subscribe"
value="&folderContextSubscribe.label;"
accesskey=""
oncommand="MsgSubscribe();"/>
<menuseparator id="folderPaneContext-sep-new"/>
<menuitem id="folderPaneContext-searchMessages"
value="&folderContextSearchMessages.label;"
accesskey=""
oncommand="MsgSearchMessages();"/>
<menuseparator id="folderPaneContext-sep-search"/>
<menuitem id="folderPaneContext-properties"
value="&folderContextProperties.label;"
accesskey=""
oncommand="MsgFolderProperties();"/>
</popup>
<popup id="emailAddressPopup" oncreate="return fillEmailAddressMenu(document.popupNode);" popupanchor="bottomleft">
<menuitem value="&AddToAddressBook.label;"
oncommand="AddNodeToAddressBook(document.popupNode)"/>
<menuitem value="&SendMailTo.label;"
oncommand="SendMailToNode(document.popupNode)"/>
</popup>
</popupset>
<menubar id="mailMenubar"/>
<toolbox id="mailToolbarToolbox"/>
<!-- The main mail three pane frame -->
<box align="horizontal" style="height:100px" flex="1">
<box id="sidebar-box"/>
<splitter id="sidebar-splitter" state="collapsed"/>
<box align="vertical" flex="1">
<box align ="horizontal" flex="1">
<tree id="folderTree" flex="1" style="width:0px" context="folderPaneContext"/>
<splitter class="gray-horizontal-splitter" collapse="after" persist="state"/>
<tree id="threadTree" flex="2" style="width:0px" context="threadPaneContext"/>
</box>
<!-- if you change this id, please change GetThreadAndMessagePaneSplitter() and MsgToggleMessagePnae() -->
<splitter id="gray_horizontal_splitter" collapse="after" persist="state"
onclick="OnClickThreadAndMessagePaneSplitter()"/>
<!-- msg header view -->
<box id="messagepanebox" align="vertical" flex="4" persist="collapsed">
<toolbox id="msgHeaderView"/>
<!-- message view -->
<html:iframe id="messagepane" style="height: 0px" flex="1" name="messagepane" type="content" src="about:blank"/>
</box>
<box id="status-bar">
<box align="vertical" style="width:100px">
<spring flex="100%"/>
<progressmeter id="statusbar-icon" mode="normal" value="0" onclick="dumpProgress()">
<observes element="Messenger:LoadingProgress" attribute="mode"/>
<observes element="Messenger:LoadingProgress" attribute="value"/>
<observes element="Messenger:Throbber" attribute="busy" onbroadcast="onProgress()"/>
</progressmeter>
<spring flex="100%"/>
</box>
<titledbutton id="statusText" class="status-bar" align="left" flex="100%" value="&statusText.label;">
<observes element="Messenger:Status" attribute="value" onbroadcast="onStatus()"/>
</titledbutton>
<titledbutton value="&unreadCountText.label;"/>
<titledbutton id="unreadMessageCount" style="min-width: 5px"/>
<titledbutton value="&totalCountText.label;"/>
<titledbutton id="totalMessageCount" style="min-width: 5px"/>
</box>
</box>
</box>
<toolbar id="taskbar"/>
</window>

Просмотреть файл

@ -0,0 +1,303 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*/
function DoRDFCommand(dataSource, command, srcArray, argumentArray)
{
var commandResource = RDF.GetResource(command);
if(commandResource)
dataSource.DoCommand(srcArray, commandResource, argumentArray);
}
//Converts an array of messages into an nsISupportsArray of resources.
//messages: array of messages that needs to be converted
//resourceArray: nsISupportsArray in which the resources should be put. If it's null a new one will be created.
//returns the resource array
function ConvertMessagesToResourceArray(messages, resourceArray)
{
if(!resourceArray)
resourceArray = Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray);
for (var i=0; i<messages.length; i++) {
var messageResource = messages[i].QueryInterface(Components.interfaces.nsIRDFResource);
resourceArray.AppendElement(messageResource);
}
return resourceArray;
}
function GetNewMessages(selectedFolders, compositeDataSource)
{
var numFolders = selectedFolders.length;
if(numFolders > 0)
{
var msgFolder = selectedFolders[0];
//Whenever we do get new messages, clear the old new messages.
if(msgFolder && msgFolder.hasNewMessages())
msgFolder.clearNewMessages();
if(compositeDataSource)
{
var folderResource = msgFolder.QueryInterface(Components.interfaces.nsIRDFResource);
var folderArray = Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray);
folderArray.AppendElement(folderResource);
DoRDFCommand(compositeDataSource, "http://home.netscape.com/NC-rdf#GetNewMessages", folderArray, null);
}
}
else {
dump("Nothing was selected\n");
}
}
function CopyMessages(compositeDataSource, srcFolder, destFolder, messages, isMove)
{
if(compositeDataSource)
{
var destFolderResource = destFolder.QueryInterface(Components.interfaces.nsIRDFResource);
var folderArray = Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray);
folderArray.AppendElement(destFolderResource);
var argumentArray = Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray);
var srcFolderResource = destFolder.QueryInterface(Components.interfaces.nsIRDFResource);
argumentArray.AppendElement(srcFolderResource);
ConvertMessagesToResourceArray(messages, argumentArray);
DoRDFCommand(compositeDataSource, "http://home.netscape.com/NC-rdf#Copy", folderArray, argumentArray);
}
}
function getIdentityForServer(server)
{
var identity = null;
if(server) {
// get the identity associated with this server
var identities = accountManager.GetIdentitiesForServer(server);
// dump("identities = " + identities + "\n");
// just get the first one
if (identities.Count() > 0 ) {
identity = identities.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIdentity);
}
}
return identity;
}
function ComposeMessage(type, format, folder, messageArray) //type is a nsIMsgCompType and format is a nsIMsgCompFormat
{
var msgComposeType = Components.interfaces.nsIMsgCompType;
var identity = null;
var newsgroup = null;
var server;
try
{
server = folder.server;
if(folder)
{
// get the incoming server associated with this uri
var server = loadedFolder.server;
// if they hit new or reply and they are reading a newsgroup
// turn this into a new post or a reply to group.
if (server.type == "nntp")
{
if (type == msgComposeType.Reply)
type = msgComposeType.ReplyToGroup;
else
if (type == msgComposeType.New)
{
type = msgComposeType.NewsPost;
if (loadedFolder.isServer)
newsgroup = "";
else
newsgroup = folder.name;
}
}
}
identity = getIdentityForServer(server);
// dump("identity = " + identity + "\n");
}
catch (ex)
{
// dump("failed to get an identity to pre-select: " + ex + "\n");
}
dump("\nComposeMessage from XUL: " + identity + "\n");
var uri = null;
if (! msgComposeService)
{
dump("### msgComposeService is invalid\n");
return;
}
if (type == msgComposeType.New) //new message
{
//dump("OpenComposeWindow with " + identity + "\n");
msgComposeService.OpenComposeWindow(null, null, type, format, identity);
return;
}
else if (type == msgComposeType.NewsPost)
{
dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n");
msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity);
return;
}
messenger.SetWindow(window, msgWindow);
var object = null;
if (messageArray && messageArray.length > 0)
{
uri = "";
for (var i = 0; i < messageArray.length && i < 8; i ++)
{
var messageResource = messageArray[i].QueryInterface(Components.interfaces.nsIRDFResource);
var messageUri = messageResource.Value;
dump('i = '+ i);
dump('\n');
if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline ||
type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSenderAndGroup ||
type == msgComposeType.Template || type == msgComposeType.Draft)
{
msgComposeService.OpenComposeWindow(null, messageUri, type, format, identity);
}
else
{
if (i)
uri += ","
uri += messageUri;
}
}
if (type == msgComposeType.ForwardAsAttachment)
{
msgComposeService.OpenComposeWindow(null, uri, type, format, identity);
}
}
else
dump("### nodeList is invalid\n");
}
function CreateNewSubfolder(chromeWindowURL,windowTitle, preselectedMsgFolder)
{
var preselectedURI;
if(preselectedMsgFolder)
{
var preselectedFolderResource = preselectedMsgFolder.QueryInterface(Components.interfaces.nsIRDFResource);
if(preselectedFolderResource)
preselectedURI = preselectedFolderResource.Value;
dump("preselectedURI = " + preselectedURI + "\n");
}
var dialog = window.openDialog(
chromeWindowURL,
"",
"chrome,modal",
{preselectedURI:preselectedURI, title:windowTitle,
okCallback:NewFolder});
}
function NewFolder(name,uri)
{
//dump("uri,name = " + uri + "," + name + "\n");
if (uri && (uri != "") && name && (name != "")) {
var selectedFolderResource = RDF.GetResource(uri);
//dump("selectedFolder = " + uri + "\n");
var compositeDataSource = GetCompositeDataSource("NewFolder");
var folderArray = Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray);
var nameArray = Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray);
folderArray.AppendElement(selectedFolderResource);
var nameLiteral = RDF.GetLiteral(name);
nameArray.AppendElement(nameLiteral);
DoRDFCommand(compositeDataSource, "http://home.netscape.com/NC-rdf#NewFolder", folderArray, nameArray);
}
else {
dump("no name or nothing selected\n");
}
}
function Subscribe(windowTitle, preselectedMsgFolder)
{
var preselectedURI;
if(preselectedMsgFolder)
{
var preselectedFolderResource = preselectedMsgFolder.QueryInterface(Components.interfaces.nsIRDFResource);
if(preselectedFolderResource)
preselectedURI = preselectedFolderResource.Value;
dump("preselectedURI = " + preselectedURI + "\n");
}
window.openDialog("chrome://messenger/content/subscribe.xul",
"subscribe", "chrome,modal",
{preselectedURI:preselectedURI, title:windowTitle,
okCallback:SubscribeOKCallback});
}
function SubscribeOKCallback(serverURI, changeTable)
{
dump("in SubscribeOKCallback(" + serverURI +")\n");
dump("change table = " + changeTable + "\n");
for (var name in changeTable) {
dump(name + " = " + changeTable[name] + "\n");
if (changeTable[name] == 1) {
NewFolder(name,serverURI);
}
else if (changeTable[name] == -1) {
dump("unsuscribe\n");
}
}
}
function SaveAsFile(message)
{
var messageResource = message.QueryInterface(Components.interfaces.nsIRDFResource);
var uri = messageResource.Value;
//dump (uri);
if (uri)
messenger.saveAs(uri, true, null, msgWindow);
}
function SaveAsTemplate(message, folder)
{
var messageResource = message.QueryInterface(Components.interfaces.nsIRDFResource);
var uri = messageResource.Value;
// dump (uri);
if (uri)
{
var identity = getIdentityForServer(folder.server);
messenger.saveAs(uri, false, identity, msgWindow);
}
}

Просмотреть файл

@ -0,0 +1,211 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*/
//This file stores variables common to mail windows
var messengerProgID = "component://netscape/messenger";
var statusFeedbackProgID = "component://netscape/messenger/statusfeedback";
var messageViewProgID = "component://netscape/messenger/messageview";
var mailSessionProgID = "component://netscape/messenger/services/session";
var prefProgID = "component://netscape/preferences";
var msgWindowProgID = "component://netscape/messenger/msgwindow";
var messenger;
var pref;
var statusFeedback;
var messageView;
var msgWindow;
var msgComposeService;
var accountManager;
var RDF;
var msgComposeType;
var msgComposeFormat;
var mailSession;
var Bundle;
var BrandBundle;
var datasourceProgIDPrefix = "component://netscape/rdf/datasource?name=";
var accountManagerDSProgID = datasourceProgIDPrefix + "msgaccountmanager";
var folderDSProgID = datasourceProgIDPrefix + "mailnewsfolders";
var messageDSProgID = datasourceProgIDPrefix + "mailnewsmessages";
var accountManagerDataSource;
var folderDataSource;
var messageDataSource;
//Progress and Status variables
var gStatusObserver;
var bindCount = 0;
var gThrobberObserver;
var gMeterObserver;
var startTime = 0;
//End progress and Status variables
function CreateMailWindowGlobals()
{
// get the messenger instance
messenger = Components.classes[messengerProgID].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
pref = Components.classes[prefProgID].getService(Components.interfaces.nsIPref);
//Create windows status feedback
statusFeedback = Components.classes[statusFeedbackProgID].createInstance();
statusFeedback = statusFeedback.QueryInterface(Components.interfaces.nsIMsgStatusFeedback);
//Create message view object
messageView = Components.classes[messageViewProgID].createInstance();
messageView = messageView.QueryInterface(Components.interfaces.nsIMessageView);
//Create message window object
msgWindow = Components.classes[msgWindowProgID].createInstance();
msgWindow = msgWindow.QueryInterface(Components.interfaces.nsIMsgWindow);
msgComposeService = Components.classes['component://netscape/messengercompose'].getService();
msgComposeService = msgComposeService.QueryInterface(Components.interfaces.nsIMsgComposeService);
mailSession = Components.classes["component://netscape/messenger/services/session"].getService(Components.interfaces.nsIMsgMailSession);
accountManager = Components.classes["component://netscape/messenger/account-manager"].getService(Components.interfaces.nsIMsgAccountManager);
RDF = Components.classes['component://netscape/rdf/rdf-service'].getService();
RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService);
msgComposeType = Components.interfaces.nsIMsgCompType;
msgComposeFormat = Components.interfaces.nsIMsgCompFormat;
Bundle = srGetStrBundle("chrome://messenger/locale/messenger.properties");
BrandBundle = srGetStrBundle("chrome://global/locale/brand.properties");
//Create datasources
accountManagerDataSource = Components.classes[accountManagerDSProgID].createInstance();
folderDataSource = Components.classes[folderDSProgID].createInstance();
messageDataSource = Components.classes[messageDSProgID].createInstance();
}
function InitMsgWindow()
{
msgWindow.statusFeedback = statusFeedback;
msgWindow.messageView = messageView;
msgWindow.msgHeaderSink = messageHeaderSink;
msgWindow.SetDOMWindow(window);
}
function AddDataSources()
{
accountManagerDataSource = accountManagerDataSource.QueryInterface(Components.interfaces.nsIRDFDataSource);
folderDataSource = folderDataSource.QueryInterface(Components.interfaces.nsIRDFDataSource);
//to move menu item
SetupMoveCopyMenus('moveMenu', accountManagerDataSource, folderDataSource);
//to copy menu item
SetupMoveCopyMenus('copyMenu', accountManagerDataSource, folderDataSource);
//To FileButton menu
SetupMoveCopyMenus('FileButtonMenu', accountManagerDataSource, folderDataSource);
//Add statusFeedback
var msgDS = folderDataSource.QueryInterface(Components.interfaces.nsIMsgRDFDataSource);
msgDS.window = msgWindow;
msgDS = messageDataSource.QueryInterface(Components.interfaces.nsIMsgRDFDataSource);
msgDS.window = msgWindow;
msgDS = accountManagerDataSource.QueryInterface(Components.interfaces.nsIMsgRDFDataSource);
msgDS.window = msgWindow;
}
function SetupMoveCopyMenus(menuid, accountManagerDataSource, folderDataSource)
{
var menu = document.getElementById(menuid);
if(menu)
{
menu.database.AddDataSource(accountManagerDataSource);
menu.database.AddDataSource(folderDataSource);
menu.setAttribute('ref', 'msgaccounts:/');
}
}
function onStatus() {
if (!gStatusObserver)
gStatusObserver = document.getElementById("Messenger:Status");
if ( gStatusObserver ) {
var text = gStatusObserver.getAttribute("value");
if ( text == "" ) {
text = defaultStatus;
}
var statusText = document.getElementById("statusText");
if ( statusText ) {
statusText.setAttribute( "value", text );
}
} else {
dump("Can't find status broadcaster!\n");
}
}
function onProgress() {
if (!gThrobberObserver)
gThrobberObserver = document.getElementById("Messenger:Throbber");
if (!gMeterObserver)
gMeterObserver = document.getElementById("Messenger:LoadingProgress");
if ( gThrobberObserver && gMeterObserver ) {
var busy = gThrobberObserver.getAttribute("busy");
var wasBusy = gMeterObserver.getAttribute("mode") == "undetermined" ? "true" : "false";
if ( busy == "true" ) {
if ( wasBusy == "false" ) {
// Remember when loading commenced.
startTime = (new Date()).getTime();
// Turn progress meter on.
gMeterObserver.setAttribute("mode","undetermined");
}
// Update status bar.
} else if ( busy == "false" && wasBusy == "true" ) {
// Record page loading time.
if (!gStatusObserver)
gStatusObserver = document.getElementById("Messenger:Status");
if ( gStatusObserver ) {
var elapsed = ( (new Date()).getTime() - startTime ) / 1000;
var msg = "Document: Done (" + elapsed + " secs)";
dump( msg + "\n" );
gStatusObserver.setAttribute("value",msg);
defaultStatus = msg;
}
// Turn progress meter off.
gMeterObserver.setAttribute("mode","normal");
}
}
}
function dumpProgress() {
var broadcaster = document.getElementById("Messenger:LoadingProgress");
dump( "bindCount=" + bindCount + "\n" );
dump( "broadcaster mode=" + broadcaster.getAttribute("mode") + "\n" );
dump( "broadcaster value=" + broadcaster.getAttribute("value") + "\n" );
dump( "meter mode=" + meter.getAttribute("mode") + "\n" );
dump( "meter value=" + meter.getAttribute("value") + "\n" );
}

Просмотреть файл

@ -0,0 +1,248 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*/
function MsgGetMessage()
{
var folders = GetSelectedMsgFolders();
var compositeDataSource = GetCompositeDataSource("GetNewMessages");
GetNewMessages(folders, compositeDataSource);
}
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 srcFolder = GetLoadedMsgFolder();
var compositeDataSource = GetCompositeDataSource("Copy");
var messages = GetSelectedMessages();
CopyMessages(compositeDataSource, srcFolder, destMsgFolder, messages);
}
function MsgNewMessage(event)
{
var loadedFolder = GetLoadedMsgFolder();
var messageArray = GetSelectedMessages();
if (event.shiftKey)
ComposeMessage(msgComposeType.New, msgComposeFormat.OppositeOfDefault, loadedFolder, messageArray);
else
ComposeMessage(msgComposeType.New, msgComposeFormat.Default, loadedFolder, messageArray);
}
function MsgReplyMessage(event)
{
var loadedFolder = GetLoadedMsgFolder();
var messageArray = GetSelectedMessages();
dump("\nMsgReplyMessage from XUL\n");
if (event.shiftKey)
ComposeMessage(msgComposeType.Reply, msgComposeFormat.OppositeOfDefault, loadedFolder, messageArray);
else
ComposeMessage(msgComposeType.Reply, msgComposeFormat.Default, loadedFolder, messageArray);
}
function MsgReplyToAllMessage(event)
{
var loadedFolder = GetLoadedMsgFolder();
var messageArray = GetSelectedMessages();
dump("\nMsgReplyToAllMessage from XUL\n");
if (event.shiftKey)
ComposeMessage(msgComposeType.ReplyAll, msgComposeFormat.OppositeOfDefault, loadedFolder, messageArray);
else
ComposeMessage(msgComposeType.ReplyAll, msgComposeFormat.Default, loadedFolder, messageArray);
}
function MsgForwardMessage(event)
{
dump("\nMsgForwardMessage from XUL\n");
var forwardType = 0;
try {
var forwardType = pref.GetIntPref("mail.forward_message_mode");
} catch (e) {dump ("failed to retrieve pref mail.forward_message_mode");}
if (forwardType == 0)
MsgForwardAsAttachment(event);
else
MsgForwardAsInline(event);
}
function MsgForwardAsAttachment(event)
{
var loadedFolder = GetLoadedMsgFolder();
var messageArray = GetSelectedMessages();
dump("\nMsgForwardAsAttachment from XUL\n");
if (event.shiftKey)
ComposeMessage(msgComposeType.ForwardAsAttachment,
msgComposeFormat.OppositeOfDefault, loadedFolder, messageArray);
else
ComposeMessage(msgComposeType.ForwardAsAttachment, msgComposeFormat.Default, loadedFolder, messageArray);
}
function MsgForwardAsInline(event)
{
var loadedFolder = GetLoadedMsgFolder();
var messageArray = GetSelectedMessages();
dump("\nMsgForwardAsInline from XUL\n");
if (event.shiftKey)
ComposeMessage(msgComposeType.ForwardInline,
msgComposeFormat.OppositeOfDefault, loadedFolder, messageArray);
else
ComposeMessage(msgComposeType.ForwardInline, msgComposeFormat.Default, loadedFolder, messageArray);
}
function MsgHome(url)
{
window.open( url, "_blank", "chrome,dependent=yes,all" );
}
function MsgNewFolder()
{
var windowTitle = Bundle.GetStringFromName("newFolderDialogTitle");
var selectedFolders = GetSelectedMsgFolders();
var preselectedFolder = null;
if(selectedFolders.len > 0)
preselectedFolder = selectedFolders[0];
CreateNewSubfolder("chrome://messenger/content/newFolderNameDialog.xul",windowTitle, preselectedFolder);
}
function MsgSubscribe()
{
var windowTitle = Bundle.GetStringFromName("subscribeDialogTitle");
var useRealSubscribeDialog = false;
try {
useRealSubscribeDialog = pref.GetBoolPref("mailnews.use-real-subscribe-dialog");
}
catch (ex) {
useRealSubscribeDialog = false;
}
var selectedFolders = GetSelectedMsgFolders();
var preselectedFolder = null;
if(selectedFolders.len > 0)
preselectedFolder = selectedFolders[0];
if (useRealSubscribeDialog) {
Subscribe(windowTitle, preselectedFolder);
}
else {
CreateNewSubfolder("chrome://messenger/content/subscribeDialog.xul", windowTitle, preselectedFolder);
}
}
function MsgAccountManager()
{
window.openDialog("chrome://messenger/content/AccountManager.xul",
"AccountManager", "chrome,modal");
}
// we do this from a timer because if this is called from the onload=
// handler, then the parent window doesn't appear until after the wizard
// has closed, and this is confusing to the user
function MsgAccountWizard()
{
setTimeout("msgOpenAccountWizard();", 0);
}
function msgOpenAccountWizard()
{
window.openDialog("chrome://messenger/content/AccountWizard.xul",
"AccountWizard", "chrome,modal");
}
function MsgSaveAsFile()
{
dump("\MsgSaveAsFile from XUL\n");
var messages = GetSelectedMessages();
if (messages && messages.length == 1)
{
SaveAsFile(messages[0]);
}
}
function MsgSaveAsTemplate()
{
dump("\MsgSaveAsTemplate from XUL\n");
var folder = GetLoadedMsgFolder();
var messages = GetSelectedMessages();
if (messages && messages.length == 1)
{
SaveAsTemplate(messages[0], folder);
}
}
function MsgOpenNewWindowForFolder(folderUri)
{
if(!folderUri)
{
var folder = GetLoadedMsgFolder();
var folderResource = folder.QueryInterface(Components.interfaces.nsIRDFResource);
folderUri = folderResource.Value;
}
if(folderUri)
{
var layoutType = pref.GetIntPref("mail.pane_config");
if(layoutType == 0)
window.openDialog( "chrome://messenger/content/", "_blank", "chrome,all,dialog=no", folderUri );
else
window.openDialog("chrome://messenger/content/mail3PaneWindowVertLayout.xul", "_blank", "chrome,all,dialog=no", folderUri );
}
}
function MsgOpenNewWindowForMessage(messageUri, folderUri)
{
if(!messageUri)
{
var message = GetLoadedMessage();
var messageResource = message.QueryInterface(Components.interfaces.nsIRDFResource);
messageUri = messageResource.Value;
}
if(!folderUri)
{
var folder = GetLoadedMsgFolder();
var folderResource = folder.QueryInterface(Components.interfaces.nsIRDFResource);
folderUri = folderResource.Value;
}
if(messageUri && folderUri)
{
window.openDialog( "chrome://messenger/content/messageWindow.xul", "_blank", "chrome,all,dialog=no", messageUri, folderUri );
}
}

Просмотреть файл

@ -0,0 +1,567 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://messenger/skin/" type="text/css"?>
<!--
The contents of this file are subject to the Netscape 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/NPL/
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 Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
-->
<!DOCTYPE window SYSTEM "chrome://messenger/locale/messenger.dtd">
<overlay
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:nc="http://home.netscape.com/NC-rdf#"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<html:script src="chrome://messenger/content/mailCommands.js"/>
<html:script src="chrome://messenger/content/mailWindowOverlay.js"/>
<broadcasterset id="broadcasterset">
<!-- File Menu -->
<broadcaster id="cmd_newNavigator"/>
<broadcaster id="cmd_newMessage"/>
<broadcaster id="cmd_close" oncommand="CloseMessenger()"/>
<broadcaster id="cmd_quit"/>
<!-- Edit Menu -->
<broadcaster id="cmd_undo"
valueDeleteMsg="&undoDeleteMsgCmd.label;"
valueMoveMsg="&undoMoveMsgCmd.label;"
valueCopyMsg="&undoCopyMsgCmd.label;"
valueDefault="&undoDefaultCmd.label;"/>
<broadcaster id="cmd_redo"
valueDeleteMsg="&redoDeleteMsgCmd.label;"
valueMoveMsg="&redoMoveMsgCmd.label;"
valueCopyMsg="&redoCopyMsgCmd.label;"
valueDefault="&redoDefaultCmd.label;"/>
<broadcaster id="cmd_cut"/>
<broadcaster id="cmd_copy"/>
<broadcaster id="cmd_paste"/>
<broadcaster id="cmd_delete"
valueFolder="&deleteFolderCmd.label;"
valueMessage="&deleteMsgCmd.label;"
valueMessages="&deleteMsgsCmd.label;"/>
<broadcaster id="cmd_selectAll"/>
<broadcaster id="cmd_preferences"/>
<broadcaster id="Messenger:Throbber" busy="false"/>
<broadcaster id="Messenger:Status"/>
<broadcaster id="Messenger:LoadingProgress"/>
<broadcaster id="cmd_nextUnreadMsg" oncommand="goDoCommand('cmd_nextUnreadMsg')" disabled="true"/>
<broadcaster id="cmd_nextUnreadThread" oncommand="goDoCommand('cmd_nextUnreadThread')" disabled="true"/>
</broadcasterset>
<menubar id="mailMenubar">
<menu id="menu_File">
<menupopup id="menu_FilePopup">
<menuitem value="&newMessage.label;"
accessKey="&newMessage.accesskey;"
key="key_newMessage"
observes="cmd_newMessage"/>
<menu id="menu_New">
<menupopup id="menu_NewPopup">
<menuitem value="&newFolderCmd.label;" oncommand="MsgNewFolder();"/>
<menuitem value="&newAccountCmd.label;" oncommand="MsgAccountWizard();"/>
<menuseparator/>
<menuitem id="menu_newNavigator"/>
<menuitem id="menu_newMessage"/>
<menuitem id="cmd_newCard"/>
</menupopup>
</menu>
<menuitem value="&openAttachmentCmd.label;" disabled="true" oncommand="MsgOpenAttachment();"/>
<menuseparator/>
<menuitem id="menu_close"/>
<menu value="&saveAsMenu.label;" accessKey="&saveAsMenu.accesskey;">
<menupopup>
<menuitem value="&saveAsFileCmd.label;"
accessKey="&saveAsFileCmd.accesskey;"
oncommand="MsgSaveAsFile();"/>
<menuitem value="&saveAsTemplateCmd.label;"
accessKey="&saveAsTemplateCmd.accesskey;"
oncommand="MsgSaveAsTemplate();"/>
</menupopup>
</menu>
<menuseparator/>
<menuitem value="&getNewMsgCmd.label;"
accessKey="&getNewMsgCmd.accesskey;"
oncommand="MsgGetMessage();"/>
<menuitem value="&sendUnsentCmd.label;"
accessKey="&sendUnsentCmd.accesskey;"
oncommand="MsgSendUnsentMsg();"/>
<menuitem value="&emptyTrashCmd.label;" oncommand="MsgEmptyTrash();"/>
<menuitem value="&subscribeCmd.label;"
accessKey="&subscribeCmd.accesskey;"
oncommand="MsgSubscribe();"/>
<menuseparator/>
<menuitem value="&renameFolder.label;" oncommand="MsgRenameFolder();"/>
<menuitem value="&compactFolder.label;" oncommand="MsgCompactFolder();"/>
<menuseparator/>
<menuitem value="&importCmd.label;" disabled="true" oncommand="MsgImport();"/>
<menuseparator/>
<menu value="&offlineMenu.label;" disabled="true">
<menupopup>
<menuitem value="&workOfflineCmd.label;" disabled="true" oncommand="MsgWorkOffline();"/>
<menuitem value="&syncCmd.label;" disabled="true" oncommand="MsgSynchronize();"/>
<menuitem value="&getSelectedCmd.label;" disabled="true" oncommand="MsgGetSelectedMsg();"/>
<menuitem value="&getFlaggedCmd.label;" disabled="true" oncommand="MsgGetFlaggedMsg();"/>
</menupopup>
</menu>
<menuseparator/>
<menuitem id="menu_pageSetup"/>
<menuitem value="&printPreviewCmd.label;" disabled="true" oncommand="PrintPreview();"/>
<menuitem value="&printCmd.label;" oncommand="PrintEnginePrint();"/>
<menuseparator/>
</menupopup>
</menu>
<menu id="menu_Edit" onclick="CommandUpdate_UndoRedo();">
<menupopup>
<menuitem id="menu_undo" value="&undoDefaultCmd.label;" key="key_undo" oncommand="Undo()"/>
<menuitem id="menu_redo" value="&redoDefaultCmd.label;" key="key_redo" oncommand="Redo()"/>
<menuseparator/>
<menuitem id="menu_cut"/>
<menuitem id="menu_copy"/>
<menuitem id="menu_paste"/>
<menuseparator/>
<menuitem id="menu_delete"/>
<menuseparator/>
<menuitem id="menu_selectAll"/>
<menuitem value="&selectThreadCmd.label;" disabled="true" oncommand="MsgSelectThread();"/>
<menuitem value="&selectFlaggedCmd.label;" disabled="true" oncommand="MsgSelectFlaggedMsg();"/>
<menuseparator/>
<menuitem value="&spamFiltersCmd.label;" disabled="true"/>
<menuitem value="&filtersCmd.label;" disabled="true" oncommand="MsgFilters();"/>
<menuitem value="&folderPropsCmd.label;" disabled="true" oncommand="MsgFolderProperties();"/>
<menuseparator/>
<menuitem value="&accountManagerCmd.label;" oncommand="MsgAccountManager();"/>
<menuitem id="menu_preferences" oncommand="goPreferences('messenger.xul', 'chrome://messenger/content/pref-mailnews.xul')"/>
</menupopup>
</menu>
<menu id="menu_View">
<menupopup>
<menu id="menu_Toolbars">
<menupopup>
<menuitem id="menu_showMessengerToolbar"
value="&showMessengerToolbarCmd.label;"
accesskey="&showMessengerToolbarCmd.accesskey;"
oncommand="goToggleToolbar('msgToolbar', 'menu_showMessengerToolbar')"
checked="true"/>
<menuitem id="menu_showLocationToolbar"
value="&showLocationToolbarCmd.label;"
accesskey="&showLocationToolbarCmd.accesskey;"
disabled="true"/>
<menuitem id="menu_showTaskbar"/>
</menupopup>
</menu>
<menuitem value="&showMessageCmd.label;" oncommand="MsgToggleMessagePane();"/>
<menuseparator/>
<menu value="&sortMenu.label;">
<menupopup>
<menuitem value="&sortByDateCmd.label;" oncommand="MsgSortByDate();"/>
<menuitem value="&sortByFlagCmd.label;" disabled="true" oncommand="MsgSortByFlag();"/>
<menuitem value="&sortByPriorityCmd.label;" oncommand="MsgSortByPriority();"/>
<menuitem value="&sortBySenderCmd.label;" oncommand="MsgSortBySender();"/>
<menuitem value="&sortBySizeCmd.label;" oncommand="MsgSortBySize();"/>
<menuitem value="&sortByStatusCmd.label;" oncommand="MsgSortByStatus();"/>
<menuitem value="&sortBySubjectCmd.label;" oncommand="MsgSortBySubject();"/>
<menuitem value="&sortByUnreadCmd.label;" disabled="true" oncommand="MsgSortByUnread();"/>
<menuitem value="&sortByOrderReceivedCmd.label;" oncommand="MsgSortByOrderReceived();"/>
<menuseparator/>
<menuitem value="&sortAscendCmd.label;" disabled="true" oncommand="MsgSortAscending();"/>
<menuitem value="&sortDescendCmd.label;" disabled="true" oncommand="MsgSortDescending();"/>
</menupopup>
</menu>
<menu value="&msgsMenu.label;" disabled="true">
<menupopup>
<menuitem value="&threadsMsgsCmd.label;" disabled="true" oncommand="MsgViewAllThreadMsgs();"/>
<menuitem value="&allMsgsCmd.label;" disabled="true" oncommand="MsgViewAllMsgs();"/>
<menuitem value="&unreadMsgsCmd.label;" disabled="true" oncommand="MsgViewUnreadMsg();"/>
<menuitem value="&threadsWithUnreadMsgsCmd.label;" disabled="true" oncommand="MsgViewThreadsUnread();"/>
<menuitem value="&watchedThreadsMsgsCmd.label;" disabled="true" oncommand="MsgViewWatchedThreadsUnread();"/>
<menuseparator/>
<menuitem value="&ignoreThreadMsgsCmd.label;" disabled="true" oncommand="MsgViewIgnoreThread();"/>
</menupopup>
</menu>
<menu id="viewheadersmenu" value="&headersMenu.label;" disabled="true">
<menupopup>
<menuitem id="viewallheaders" type="radio" name="viewheadergroup" value="&headersAllCmd.label;" disabled="true" oncommand="MsgViewAllHeaders();"/>
<menuitem id="viewnormalheaders" type="radio" name="viewheadergroup" value="&headersNormalCmd.label;" disabled="true" oncommand="MsgViewNormalHeaders();"/>
<menuitem id="viewbriefheaders" type="radio" name="viewheadergroup" value="&headersBriefCmd.label;" disabled="true" oncommand="MsgViewBriefHeaders();"/>
</menupopup>
</menu>
<menuseparator/>
<menuitem value="&viewAttachmentsInlineCmd.label;" disabled="true" oncommand="MsgViewAttachInline();"/>
<menuitem value="&wrapLongLinesCmd.label;" disabled="true" oncommand="MsgWrapLongLines();"/>
<menuseparator/>
<menuitem value="&increaseFontCmd.label;" disabled="true" oncommand="MsgIncreaseFont();"/>
<menuitem value="&decreaseFontCmd.label;" disabled="true" oncommand="MsgDecreaseFont();"/>
<menuseparator/>
<menuitem value="&reloadCmd.label;" disabled="true" oncommand="MsgReload();"/>
<menuitem value="&showImagesCmd.label;" disabled="true" oncommand="MsgShowImages();"/>
<menuitem value="&stopCmd.label;" disabled="true" oncommand="MsgStop();"/>
<menuseparator/>
<menuitem value="&pageSourceCmd.label;" oncommand="MsgViewPageSource();"/>
<menuitem value="&pageInfoCmd.label;" disabled="true" oncommand="MsgViewPageInfo();"/>
<menuseparator/>
<menu value="&dcharMenu.label;">
<menupopup>
<menuitem value="&dcharIso1Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-1');"/>
<menuitem value="&dcharIso15Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-15');"/>
<menuitem value="&dcharIso2Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-2');"/>
<menuitem value="&dcharIso3Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-3');"/>
<menuitem value="&dcharIso4Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-4');"/>
<menuitem value="&dcharIsoGreekCmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-7');"/>
<menuitem value="&dcharIso9Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-9');"/>
<menuitem value="&dcharIso10Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-10');"/>
<menuitem value="&dcharIso13Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-13');"/>
<menuitem value="&dcharIso14Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-14');"/>
</menupopup>
</menu>
<menu value="&dcharMenu1.label;">
<menupopup>
<menuitem value="&dcharJapanCmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-2022-JP');"/>
<menuitem value="&dcharJapanShiftjsCmd.label;" oncommand="MessengerSetDefaultCharacterSet('Shift_JIS');"/>
<menuitem value="&dcharJapanEucCmd.label;" oncommand="MessengerSetDefaultCharacterSet('EUC-JP');"/>
<menuseparator />
<menuitem value="&dcharTradChiBigCmd.label;" oncommand="MessengerSetDefaultCharacterSet('Big5');"/>
<menuitem value="&dcharTriChiEucCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-euc-tw');"/>
<menuitem value="&dcharSimpChiGbCmd.label;" oncommand="MessengerSetDefaultCharacterSet('GB2312');"/>
<menuseparator />
<menuitem value="&dcharKoreanCmd.label;" oncommand="MessengerSetDefaultCharacterSet('EUC-KR');"/>
<menuseparator />
<menuitem value="&dcharUtf7Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('UTF-7');"/>
<menuitem value="&dcharUtf8Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('UTF-8');"/>
</menupopup>
</menu>
<menu value="&dcharMenu2.label;">
<menupopup>
<menuitem value="&dcharRusCmd.label; " oncommand="MessengerSetDefaultCharacterSet('KOI8-R');"/>
<menuitem value="&dcharIsoCyrCmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-5');"/>
<menuitem value="&dcharWinCyrCmd.label;" oncommand="MessengerSetDefaultCharacterSet('windows-1251');"/>
<menuitem value="&dcharEcmaCyrCmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-IR-111');"/>
<menuitem value="&dcharDosCyrCmd.label;" oncommand="MessengerSetDefaultCharacterSet('IBM866');"/>
<menuitem value="&dcharMacCyrCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-mac-cyrillic');"/>
<menuitem value="&dcharUkrCmd.label;" oncommand="MessengerSetDefaultCharacterSet('KOI8-U');"/>
<menuitem value="&dcharMacUkrCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-mac-ukrainian');"/>
</menupopup>
</menu>
<menu value="&dcharMenu3.label;">
<menupopup>
<menuitem value="&dcharWinVietCmd.label;" oncommand="MessengerSetDefaultCharacterSet('windows-1258');"/>
<menuitem value="&dcharVietTcnCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-viet-tcvn5712');"/>
<menuitem value="&dcharVietViCmd.label;" oncommand="MessengerSetDefaultCharacterSet('VISCII');"/>
<menuitem value="&dcharVieVpCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-viet-vps');"/>
<menuseparator />
<menuitem value="&dcharThaiCmd.label;" oncommand="MessengerSetDefaultCharacterSet('TIS-620');"/>
<menuseparator />
<menuitem value="&dcharArmCmd.label;" oncommand="MessengerSetDefaultCharacterSet('ARMSCII-8');"/>
<!--
<menuseparator />
<menuitem value="&dcharIso6Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-6');"/>
<menuitem value="&dcharCp1256Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('windows-1256');"/>
<menuseparator />
<menuitem value="&dcharIso8Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-8');"/>
<menuitem value="&dcharCp1255Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('windows-1255');"/>
-->
</menupopup>
</menu>
<menu value="&dcharMenu4.label;">
<menupopup>
<menuitem value="&dcharMacRomCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-mac-roman');"/>
<menuitem value="&dcharMacCenEuroCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-mac-ce');"/>
<menuitem value="&dcharMacTurCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-mac-turkish');"/>
<menuitem value="&dcharMacCroaCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-mac-croatian');"/>
<menuitem value="&dcharMacRomanianCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-mac-romanian');"/>
<menuitem value="&dcharMacIceCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-mac-icelandic');"/>
<menuitem value="&dcharMacGreekCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-mac-greek');"/>
</menupopup>
</menu>
<menu value="&dcharMenu5.label;">
<menupopup>
<menuitem value="&dcharWinLat1Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('windows-1252');"/>
<menuitem value="&dcharWinLat2Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('windows-1250');"/>
<menuitem value="&dcharWinLat5Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('windows-1254');"/>
<menuitem value="&dcharWinBalRimCmd.label;" oncommand="MessengerSetDefaultCharacterSet('windows-1257');"/>
<menuitem value="&dcharWinGreekCmd.label;" oncommand="MessengerSetDefaultCharacterSet('windows-1253');"/>
</menupopup>
</menu>
</menupopup>
</menu>
<menu value="&searchMenu.label;">
<menupopup>
<menuitem value="&findCmd.label;" oncommand="MsgFind();"/>
<menuitem value="&findAgainCmd.label;" oncommand="MsgFindAgain();"/>
<menuseparator/>
<!--
<menuitem value="&searchCurrentCmd.label;" disabled="true" oncommand="MsgSearchCurrent();"/>
<menuitem value="&searchParentCmd.label;" disabled="true" oncommand="MsgSearchParent();"/>
<menuitem value="&searchParentParentCmd.label;" disabled="true" oncommand="MsgSearchParentParent();"/>
<menuseparator/>
-->
<menuitem value="&searchInternetCmd.label;" disabled="true" oncommand="MsgSearchInternet();"/>
<menuitem value="&searchMailCmd.label;" disabled="true" oncommand="MsgSearchMessages();"/>
<menuitem value="&searchBookmarksCmd.label;" disabled="true" oncommand="MsgSearchBookmarks();"/>
<menuitem value="&searchPeopleCmd.label;" disabled="true" oncommand="MsgSearchPeople();"/>
<menuseparator/>
<menuitem value="&searchLocalCmd.label;" disabled="true" oncommand="MsgSearchLocal();"/>
</menupopup>
</menu>
<menu value="&goMenu.label;">
<menupopup>
<menuitem value="&firstUnreadMsgCmd.label;" disabled="true" oncommand="MsgFirstUnreadMessage();"/>
<menuitem value="&firstFlaggedMsgCmd.label;" disabled="true" oncommand="MsgFirstFlaggedMessage();"/>
<menuseparator/>
<menu value="&nextMenu.label;">
<menupopup>
<menuitem value="&nextMsgCmd.label;" oncommand="MsgNextMessage();"/>
<menuitem value="&nextUnreadMsgCmd.label;" key="key_nextUnreadMsg" accesskey="&nextUnreadMsgCmd.key;" observes="cmd_nextUnreadMsg"/>
<menuitem value="&nextFlaggedMsgCmd.label;" oncommand="MsgNextFlaggedMessage();"/>
<menuseparator/>
<menuitem value="&nextUnreadThread.label;" observes="cmd_nextUnreadThread"/>
</menupopup>
</menu>
<menu value="&prevMenu.label;">
<menupopup>
<menuitem value="&prevMsgCmd.label;" oncommand="MsgPreviousMessage();"/>
<menuitem value="&prevUnreadMsgCmd.label;" oncommand="MsgPreviousUnreadMessage();"/>
<menuitem value="&prevFlaggedMsgCmd.label;" oncommand="MsgPreviousFlaggedMessage();"/>
</menupopup>
</menu>
<menuseparator/>
<menuitem value="&backCmd.label;" disabled="true" oncommand="MsgGoBack();"/>
<menuitem value="&forwardCmd.label;" disabled="true" oncommand="MsgGoForward();"/>
</menupopup>
</menu>
<menu value="&msgMenu.label;">
<menupopup>
<menuitem value="&newMsgCmd.label;" oncommand="MsgNewMessage(event);"/>
<menuitem value="&replyMsgCmd.label;" oncommand="MsgReplyMessage(event);"/>
<menuitem value="&replyToAllMsgCmd.label;" oncommand="MsgReplyToAllMessage(event);"/>
<menuitem value="&forwardMsgCmd.label;" oncommand="MsgForwardMessage(event);"/>
<menu value="&forwardAsMenu.label;">
<menupopup>
<menuitem value="&forwardAsInline.label;" oncommand="MsgForwardAsInline(event);"/>
<menuitem value="&forwardAsAttachmentCmd.label;" oncommand="MsgForwardAsAttachment(event);"/>
</menupopup>
</menu>
<menuitem value="&editMsgAsNewCmd.label;" oncommand="MsgEditMessageAsNew();"/>
<menuseparator/>
<menu value="&moveMsgMenu.label;" id="moveMenu" datasources="rdf:null"
rdf:ignore="http://home.netscape.com/NC-rdf#MessageChild">
<menupopup/>
<template>
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup>
<menuitem uri="..." value="&fileHereMenu.label;"
oncommand="MsgMoveMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType" />
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="false" nc:ServerType="nntp">
<!-- don't show nntp servers in the file and copies menus -->
</rule>
<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
<!-- note, there is no "file here" -->
<menupopup>
<menu uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup/>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name" oncommand="MsgMoveMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
</menu>
<menu value="&copyMsgMenu.label;" id="copyMenu" datasources="rdf:null"
rdf:ignore="http://home.netscape.com/NC-rdf#MessageChild">
<menupopup/>
<template>
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup>
<menuitem uri="..." value="&fileHereMenu.label;"
oncommand="MsgCopyMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="false" nc:ServerType="nntp">
<!-- don't show nntp servers in the file and copies menus -->
</rule>
<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
<!-- note, there is no "file here" -->
<menupopup>
<menu uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup/>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="MsgCopyMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
</menu>
<menuseparator/>
<menuitem value="&addSenderToAddressBookCmd.label;" disabled="true" oncommand="MsgAddSenderToAddressBook();"/>
<menuitem value="&addAllToAddressBookCmd.label;" disabled="true" oncommand="MsgAddAllToAddressBook();"/>
<menuseparator/>
<menu value="&markMenu.label;">
<menupopup>
<menuitem value="&markAsReadCmd.label;" oncommand="MsgMarkMsgAsRead(true);"/>
<menuitem value="&markAsUnreadCmd.label;" oncommand="MsgMarkMsgAsRead(false);"/>
<menuitem value="&markThreadAsReadCmd.label;" oncommand="MsgMarkThreadAsRead();"/>
<menuitem value="&markByDateCmd.label;" disabled="true" oncommand="MsgMarkByDate();"/>
<menuitem value="&markAllReadCmd.label;" oncommand="MsgMarkAllRead();"/>
<menuseparator/>
<menuitem value="&markFlaggedCmd.label;" oncommand="MsgMarkAsFlagged(true);"/>
<menuitem value="&markUnflaggedCmd.label;" oncommand="MsgMarkAsFlagged(false);"/>
</menupopup>
</menu>
<menuseparator/>
<menuitem value="&ignoreThreadCmd.label;" disabled="true" oncommand="MsgIgnoreThread();"/>
<menuitem value="&watchThreadCmd.label;" disabled="true" oncommand="MsgWatchThread();"/>
</menupopup>
</menu>
<menu id="tasksMenu"/>
<menu id="menu_Help"/>
<spring flex="100%"/>
</menubar>
<toolbox id="mailToolbarToolbox">
<toolbar id="msgToolbar" class="standard" persist="collapsed">
<box id="toolbar_button_box">
<button class="key-toolbar left" orient="vertical" id="button_getmsg" value="&getMsgButton.label;" onclick="MsgGetMessage()"/>
<button class="key-toolbar left" orient="vertical" id="button_newmsg" value="&newMsgButton.label;" onclick="MsgNewMessage(event)"/>
<toolbarseparator/>
<button class="key-toolbar left" orient="vertical" id="button_reply" value="&replyButton.label;" onclick="MsgReplyMessage(event)"/>
<button class="key-toolbar left" orient="vertical" id="button_replyall" value="&replyAllButton.label;" onclick="MsgReplyToAllMessage(event)"/>
<button class="key-toolbar left" orient="vertical" id="button_forward" value="&forwardButton.label;" onclick="MsgForwardMessage(event)"/>
<toolbarseparator/>
<menu id="FileButtonMenu" datasources="rdf:null" rdf:ignore="http://home.netscape.com/NC-rdf#MessageChild">
<button class="toolbar left" orient="vertical" id="button_file" value="&fileButton.label;"/>
<template>
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup>
<menuitem uri="..." value="&fileHereMenu.label;"
oncommand="MsgMoveMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType" />
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="false" nc:ServerType="nntp">
<!-- don't show nntp servers in the file and copies menus -->
</rule>
<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
<!-- note, there is no "file here" -->
<menupopup>
<menu uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup/>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name" oncommand="MsgMoveMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
<menupopup/>
</menu>
<button class="toolbar left" orient="vertical" id="button_next" value="&nextButton.label;" onclick="MsgNextUnreadMessage()"/>
<button class="toolbar left" orient="vertical" id="button_delete" disabled="true" value="&deleteButton.label;" onclick="goDoCommand('button_delete')"/>
<button class="toolbar left" orient="vertical" id="button_print" value="&printButton.label;" onclick="PrintEnginePrint()"/>
<button class="toolbar left" orient="vertical" id="button_stop" value="&stopButton.label;" onclick="MsgStop();"/>
<spring flex="100%"/>
</box>
<box id="toolbar_throbber_box" align="vertical">
<titledbutton id="Throbber" onclick='goClickThrobber("messenger.throbber.url")'>
<observes element="Messenger:Throbber" attribute="busy"/>
</titledbutton>
</box>
</toolbar>
</toolbox>
</overlay>

Просмотреть файл

@ -27,6 +27,12 @@ include <$(DEPTH)\config\rules.mak>
install::
$(MAKE_INSTALL) messenger.xul $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) mail3PaneWindowVertLayout.xul $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) mailWindowOverlay.xul $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) mailWindowOverlay.js $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) mailWindow.js $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) messageWindow.xul $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) messageWindow.js $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) folderPane.xul $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) threadPane.xul $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) msgHdrViewOverlay.xul $(DIST)\bin\chrome\messenger\content\default
@ -34,6 +40,7 @@ install::
$(MAKE_INSTALL) msgHdrViewAddresses.js $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) widgetglue.js $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) commandglue.js $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) mailCommands.js $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) shareglue.js $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) subscribeDialog.xul $(DIST)\bin\chrome\messenger\content\default
$(MAKE_INSTALL) subscribe.xul $(DIST)\bin\chrome\messenger\content\default
@ -54,6 +61,12 @@ install::
clobber::
rm -f $(DIST)\chrome\messenger\content\default\messenger.xul
rm -f $(DIST)\chrome\messenger\content\default\mail3PaneWindowVertLayout.xul
rm -f $(DIST)\chrome\messenger\content\default\mailWindowOverlay.xul
rm -f $(DIST)\chrome\messenger\content\default\mailWindowOverlay.js
rm -f $(DIST)\chrome\messenger\content\default\mailWindow.js
rm -f $(DIST)\chrome\messenger\content\default\messageWindow.xul
rm -f $(DIST)\chrome\messenger\content\default\messageWindow.js
rm -f $(DIST)\chrome\messenger\content\default\msgHdrViewOverlay.xul
rm -f $(DIST)\chrome\messenger\content\default\msgHdrViewOverlay.js
rm -f $(DIST)\chrome\messenger\content\default\msgHdrViewAddresses.js
@ -61,6 +74,7 @@ clobber::
rm -f $(DIST)\chrome\messenger\content\default\threadPane.xul
rm -f $(DIST)\chrome\messenger\content\default\widgetglue.js
rm -f $(DIST)\chrome\messenger\content\default\commandglue.js
rm -f $(DIST)\chrome\messenger\content\default\mailCommands.js
rm -f $(DIST)\chrome\messenger\content\default\shareglue.js
rm -f $(DIST)\chrome\messenger\content\default\subscribeDialog.xul
rm -f $(DIST)\chrome\messenger\content\default\subscribe.xul

Просмотреть файл

@ -0,0 +1,137 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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 Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*/
/* This is where functions related to the standalone message window are kept */
/* globals for a particular window */
var compositeDataSourceProgID = datasourceProgIDPrefix + "composite-datasource";
var gCompositeDataSource;
var gCurrentMessageUri;
var gCurrentFolderUri;
function OnLoadMessageWindow()
{
CreateMailWindowGlobals();
CreateMessageWindowGlobals();
InitMsgWindow();
messenger.SetWindow(window, msgWindow);
InitializeDataSources();
// FIX ME - later we will be able to use onload from the overlay
OnLoadMsgHeaderPane();
if(window.arguments && window.arguments.length == 2)
{
if(window.arguments[0])
{
gCurrentMessageUri = window.arguments[0];
}
else
{
gCurrentMessageUri = null;
}
if(window.arguments[1])
{
gCurrentFolderUri = window.arguments[1];
}
else
{
gCurrentFolderUri = null;
}
}
setTimeout("OpenURL(gCurrentMessageUri);", 0);
}
function OnUnloadMessageWindow()
{
messenger.SetWindow(null, null);
}
function CreateMessageWindowGlobals()
{
gCompositeDataSource = Components.classes[compositeDataSourceProgID].createInstance();
gCompositeDataSource = gCompositeDataSource.QueryInterface(Components.interfaces.nsIRDFCompositeDataSource);
}
function InitializeDataSources()
{
AddDataSources();
//Now add datasources to composite datasource
gCompositeDataSource.AddDataSource(accountManagerDataSource);
gCompositeDataSource.AddDataSource(folderDataSource);
gCompositeDataSource.AddDataSource(messageDataSource);
}
function GetSelectedMsgFolders()
{
var folderArray = new Array(1);
var msgFolder = GetLoadedMsgFolder();
if(msgFolder)
{
folderArray[0] = msgFolder;
}
return folderArray;
}
function GetSelectedMessages()
{
var messageArray = new Array(1);
var message = GetLoadedMessage();
if(message)
{
messageArray[0] = message;
}
return messageArray;
}
function GetLoadedMsgFolder()
{
var folderResource = RDF.GetResource(gCurrentFolderUri);
if(folderResource)
{
var msgFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder);
return msgFolder;
}
return null;
}
function GetLoadedMessage()
{
var messageResource = RDF.GetResource(gCurrentMessageUri);
if(messageResource)
{
var message = messageResource.QueryInterface(Components.interfaces.nsIMessage);
return message;
}
return null;
}
function GetCompositeDataSource(command)
{
return gCompositeDataSource;
}

Просмотреть файл

@ -0,0 +1,83 @@
<?xml version="1.0"?>
<!--
The contents of this file are subject to the Netscape 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/NPL/
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 Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
-->
<?xml-stylesheet href="chrome://messenger/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://global/content/tasksOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/platformMailnewsOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/msgHdrViewOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailWindowOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/messenger.dtd">
<window id="messengerWindow"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:nc="http://home.netscape.com/NC-rdf#"
title="&messengerWindow.title;"
titlemodifier="&titleModifier.label;"
titlemenuseparator="&titleSeperator.label;"
onload="OnLoadMessageWindow()"
onunload="OnUnloadMessageWindow()"
align="vertical"
width="750"
height="500"
persist="width height screenX screenY"
windowtype="mail:messageWindow">
<html:script src="chrome://global/content/strres.js"/>
<html:script src="chrome://messenger/content/commandglue.js"/>
<html:script src="chrome://messenger/content/mailWindow.js"/>
<html:script src="chrome://messenger/content/messageWindow.js"/>
<broadcasterset id="broadcasterset"/>
<menubar id="mailMenubar"/>
<toolbox id="mailToolbarToolbox"/>
<!-- msg header view -->
<box id="messagepanebox" align="vertical" flex="3" persist="collapsed">
<toolbox id="msgHeaderView"/>
<!-- message view -->
<html:iframe id="messagepane" style="height: 0px" flex="1" name="messagepane" type="content" src="about:blank"/>
</box>
<box id="status-bar">
<box align="vertical" style="width:100px">
<spring flex="100%"/>
<progressmeter id="statusbar-icon" mode="normal" value="0" onclick="dumpProgress()">
<observes element="Messenger:LoadingProgress" attribute="mode"/>
<observes element="Messenger:LoadingProgress" attribute="value"/>
<observes element="Messenger:Throbber" attribute="busy" onbroadcast="onProgress()"/>
</progressmeter>
<spring flex="100%"/>
</box>
<titledbutton id="statusText" class="status-bar" align="left" flex="100%" value="&statusText.label;">
<observes element="Messenger:Status" attribute="value" onbroadcast="onStatus()"/>
</titledbutton>
</box>
<toolbar id="taskbar"/>
</window>

Просмотреть файл

@ -25,6 +25,7 @@ Rights Reserved.
<?xul-overlay href="chrome://messenger/content/threadPane.xul"?>
<?xul-overlay href="chrome://messenger/content/folderPane.xul"?>
<?xul-overlay href="chrome://messenger/content/msgHdrViewOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailWindowOverlay.xul"?>
<?xul-overlay href="chrome://sidebar/content/sidebarOverlay.xul"?>
<?xul-overlay href="chrome://global/content/tasksOverlay.xul"?>
@ -51,6 +52,7 @@ Rights Reserved.
<html:script src="chrome://messenger/content/commandglue.js"/>
<html:script src="chrome://messenger/content/shareglue.js"/>
<html:script src="chrome://messenger/content/msgViewNavigation.js"/>
<html:script src="chrome://messenger/content/mailWindow.js"/>
<html:script src="chrome://messenger/content/msgMail3PaneWindow.js"/>
<html:script src="chrome://messenger/content/mailContextMenus.js"/>
<html:script src="chrome://messenger/content/messengerdnd.js"/>
@ -67,40 +69,7 @@ Rights Reserved.
<commandset id="undoEditMenuItems"/>
</commands>
<broadcasterset id="broadcasterset">
<!-- File Menu -->
<broadcaster id="cmd_newNavigator"/>
<broadcaster id="cmd_newMessage"/>
<broadcaster id="cmd_close" oncommand="CloseMessenger()"/>
<broadcaster id="cmd_quit"/>
<!-- Edit Menu -->
<broadcaster id="cmd_undo"
valueDeleteMsg="&undoDeleteMsgCmd.label;"
valueMoveMsg="&undoMoveMsgCmd.label;"
valueCopyMsg="&undoCopyMsgCmd.label;"
valueDefault="&undoDefaultCmd.label;"/>
<broadcaster id="cmd_redo"
valueDeleteMsg="&redoDeleteMsgCmd.label;"
valueMoveMsg="&redoMoveMsgCmd.label;"
valueCopyMsg="&redoCopyMsgCmd.label;"
valueDefault="&redoDefaultCmd.label;"/>
<broadcaster id="cmd_cut"/>
<broadcaster id="cmd_copy"/>
<broadcaster id="cmd_paste"/>
<broadcaster id="cmd_delete"
valueFolder="&deleteFolderCmd.label;"
valueMessage="&deleteMsgCmd.label;"
valueMessages="&deleteMsgsCmd.label;"/>
<broadcaster id="cmd_selectAll"/>
<broadcaster id="cmd_preferences"/>
<broadcaster id="Messenger:Throbber" busy="false"/>
<broadcaster id="Messenger:Status"/>
<broadcaster id="Messenger:LoadingProgress"/>
<broadcaster id="cmd_nextUnreadMsg" oncommand="goDoCommand('cmd_nextUnreadMsg')" disabled="true"/>
<broadcaster id="cmd_nextUnreadThread" oncommand="goDoCommand('cmd_nextUnreadThread')" disabled="true"/>
</broadcasterset>
<broadcasterset id="broadcasterset"/>
<keyset id="keyset">
<!-- File Menu -->
@ -333,562 +302,63 @@ Rights Reserved.
</popup>
</popupset>
<menubar>
<menu id="menu_File">
<menupopup id="menu_FilePopup">
<menuitem value="&newMessage.label;"
accessKey="&newMessage.accesskey;"
key="key_newMessage"
observes="cmd_newMessage"/>
<menu id="menu_New">
<menupopup id="menu_NewPopup">
<menuitem value="&newFolderCmd.label;" oncommand="MsgNewFolder();"/>
<menuitem value="&newAccountCmd.label;" oncommand="MsgAccountWizard();"/>
<menuseparator/>
<menuitem id="menu_newNavigator"/>
<menuitem id="menu_newMessage"/>
<menuitem id="cmd_newCard"/>
</menupopup>
</menu>
<menuitem value="&openAttachmentCmd.label;" disabled="true" oncommand="MsgOpenAttachment();"/>
<menuseparator/>
<menuitem id="menu_close"/>
<menu value="&saveAsMenu.label;" accessKey="&saveAsMenu.accesskey;">
<menupopup>
<menuitem value="&saveAsFileCmd.label;"
accessKey="&saveAsFileCmd.accesskey;"
oncommand="MsgSaveAsFile();"/>
<menuitem value="&saveAsTemplateCmd.label;"
accessKey="&saveAsTemplateCmd.accesskey;"
oncommand="MsgSaveAsTemplate();"/>
</menupopup>
</menu>
<menuseparator/>
<menuitem value="&getNewMsgCmd.label;"
accessKey="&getNewMsgCmd.accesskey;"
oncommand="MsgGetMessage();"/>
<menuitem value="&sendUnsentCmd.label;"
accessKey="&sendUnsentCmd.accesskey;"
oncommand="MsgSendUnsentMsg();"/>
<menuitem value="&emptyTrashCmd.label;" oncommand="MsgEmptyTrash();"/>
<menuitem value="&subscribeCmd.label;"
accessKey="&subscribeCmd.accesskey;"
oncommand="MsgSubscribe();"/>
<menuseparator/>
<menuitem value="&renameFolder.label;" oncommand="MsgRenameFolder();"/>
<menuitem value="&compactFolder.label;" oncommand="MsgCompactFolder();"/>
<menuseparator/>
<menuitem value="&importCmd.label;" disabled="true" oncommand="MsgImport();"/>
<menuseparator/>
<menu value="&offlineMenu.label;" disabled="true">
<menupopup>
<menuitem value="&workOfflineCmd.label;" disabled="true" oncommand="MsgWorkOffline();"/>
<menuitem value="&syncCmd.label;" disabled="true" oncommand="MsgSynchronize();"/>
<menuitem value="&getSelectedCmd.label;" disabled="true" oncommand="MsgGetSelectedMsg();"/>
<menuitem value="&getFlaggedCmd.label;" disabled="true" oncommand="MsgGetFlaggedMsg();"/>
</menupopup>
</menu>
<menuseparator/>
<menuitem id="menu_pageSetup"/>
<menuitem value="&printPreviewCmd.label;" disabled="true" oncommand="PrintPreview();"/>
<menuitem value="&printCmd.label;" oncommand="PrintEnginePrint();"/>
<menuseparator/>
</menupopup>
</menu>
<menu id="menu_Edit" onclick="CommandUpdate_UndoRedo();">
<menupopup>
<menuitem id="menu_undo" value="&undoDefaultCmd.label;" key="key_undo" oncommand="Undo()"/>
<menuitem id="menu_redo" value="&redoDefaultCmd.label;" key="key_redo" oncommand="Redo()"/>
<menuseparator/>
<menuitem id="menu_cut"/>
<menuitem id="menu_copy"/>
<menuitem id="menu_paste"/>
<menuseparator/>
<menuitem id="menu_delete"/>
<menuseparator/>
<menuitem id="menu_selectAll"/>
<menuitem value="&selectThreadCmd.label;" disabled="true" oncommand="MsgSelectThread();"/>
<menuitem value="&selectFlaggedCmd.label;" disabled="true" oncommand="MsgSelectFlaggedMsg();"/>
<menuseparator/>
<menuitem value="&spamFiltersCmd.label;" disabled="true"/>
<menuitem value="&filtersCmd.label;" disabled="true" oncommand="MsgFilters();"/>
<menuitem value="&folderPropsCmd.label;" disabled="true" oncommand="MsgFolderProperties();"/>
<menuseparator/>
<menuitem value="&accountManagerCmd.label;" oncommand="MsgAccountManager();"/>
<menuitem id="menu_preferences" oncommand="goPreferences('messenger.xul', 'chrome://messenger/content/pref-mailnews.xul')"/>
</menupopup>
</menu>
<menu id="menu_View">
<menupopup>
<menu id="menu_Toolbars">
<menupopup>
<menuitem id="menu_showMessengerToolbar"
value="&showMessengerToolbarCmd.label;"
accesskey="&showMessengerToolbarCmd.accesskey;"
oncommand="goToggleToolbar('msgToolbar', 'menu_showMessengerToolbar')"
checked="true"/>
<menuitem id="menu_showLocationToolbar"
value="&showLocationToolbarCmd.label;"
accesskey="&showLocationToolbarCmd.accesskey;"
disabled="true"/>
<menuitem id="menu_showTaskbar"/>
</menupopup>
</menu>
<menuitem value="&showMessageCmd.label;" oncommand="MsgToggleMessagePane();"/>
<menuseparator/>
<menu value="&sortMenu.label;">
<menupopup>
<menuitem value="&sortByDateCmd.label;" oncommand="MsgSortByDate();"/>
<menuitem value="&sortByFlagCmd.label;" disabled="true" oncommand="MsgSortByFlag();"/>
<menuitem value="&sortByPriorityCmd.label;" oncommand="MsgSortByPriority();"/>
<menuitem value="&sortBySenderCmd.label;" oncommand="MsgSortBySender();"/>
<menuitem value="&sortBySizeCmd.label;" oncommand="MsgSortBySize();"/>
<menuitem value="&sortByStatusCmd.label;" oncommand="MsgSortByStatus();"/>
<menuitem value="&sortBySubjectCmd.label;" oncommand="MsgSortBySubject();"/>
<menuitem value="&sortByUnreadCmd.label;" disabled="true" oncommand="MsgSortByUnread();"/>
<menuitem value="&sortByOrderReceivedCmd.label;" oncommand="MsgSortByOrderReceived();"/>
<menuseparator/>
<menuitem value="&sortAscendCmd.label;" disabled="true" oncommand="MsgSortAscending();"/>
<menuitem value="&sortDescendCmd.label;" disabled="true" oncommand="MsgSortDescending();"/>
</menupopup>
</menu>
<menu value="&msgsMenu.label;" disabled="true">
<menupopup>
<menuitem value="&threadsMsgsCmd.label;" disabled="true" oncommand="MsgViewAllThreadMsgs();"/>
<menuitem value="&allMsgsCmd.label;" disabled="true" oncommand="MsgViewAllMsgs();"/>
<menuitem value="&unreadMsgsCmd.label;" disabled="true" oncommand="MsgViewUnreadMsg();"/>
<menuitem value="&threadsWithUnreadMsgsCmd.label;" disabled="true" oncommand="MsgViewThreadsUnread();"/>
<menuitem value="&watchedThreadsMsgsCmd.label;" disabled="true" oncommand="MsgViewWatchedThreadsUnread();"/>
<menuseparator/>
<menuitem value="&ignoreThreadMsgsCmd.label;" disabled="true" oncommand="MsgViewIgnoreThread();"/>
</menupopup>
</menu>
<menu id="viewheadersmenu" value="&headersMenu.label;" disabled="true">
<menupopup>
<menuitem id="viewallheaders" type="radio" name="viewheadergroup" value="&headersAllCmd.label;" disabled="true" oncommand="MsgViewAllHeaders();"/>
<menuitem id="viewnormalheaders" type="radio" name="viewheadergroup" value="&headersNormalCmd.label;" disabled="true" oncommand="MsgViewNormalHeaders();"/>
<menuitem id="viewbriefheaders" type="radio" name="viewheadergroup" value="&headersBriefCmd.label;" disabled="true" oncommand="MsgViewBriefHeaders();"/>
</menupopup>
</menu>
<menuseparator/>
<menuitem value="&viewAttachmentsInlineCmd.label;" disabled="true" oncommand="MsgViewAttachInline();"/>
<menuitem value="&wrapLongLinesCmd.label;" disabled="true" oncommand="MsgWrapLongLines();"/>
<menuseparator/>
<menuitem value="&increaseFontCmd.label;" disabled="true" oncommand="MsgIncreaseFont();"/>
<menuitem value="&decreaseFontCmd.label;" disabled="true" oncommand="MsgDecreaseFont();"/>
<menuseparator/>
<menuitem value="&reloadCmd.label;" disabled="true" oncommand="MsgReload();"/>
<menuitem value="&showImagesCmd.label;" disabled="true" oncommand="MsgShowImages();"/>
<menuitem value="&stopCmd.label;" disabled="true" oncommand="MsgStop();"/>
<menuseparator/>
<menuitem value="&pageSourceCmd.label;" oncommand="MsgViewPageSource();"/>
<menuitem value="&pageInfoCmd.label;" disabled="true" oncommand="MsgViewPageInfo();"/>
<menuseparator/>
<menu value="&dcharMenu.label;">
<menupopup>
<menuitem value="&dcharIso1Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-1');"/>
<menuitem value="&dcharIso15Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-15');"/>
<menuitem value="&dcharIso2Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-2');"/>
<menuitem value="&dcharIso3Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-3');"/>
<menuitem value="&dcharIso4Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-4');"/>
<menuitem value="&dcharIsoGreekCmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-7');"/>
<menuitem value="&dcharIso9Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-9');"/>
<menuitem value="&dcharIso10Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-10');"/>
<menuitem value="&dcharIso13Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-13');"/>
<menuitem value="&dcharIso14Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-14');"/>
</menupopup>
</menu>
<menu value="&dcharMenu1.label;">
<menupopup>
<menuitem value="&dcharJapanCmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-2022-JP');"/>
<menuitem value="&dcharJapanShiftjsCmd.label;" oncommand="MessengerSetDefaultCharacterSet('Shift_JIS');"/>
<menuitem value="&dcharJapanEucCmd.label;" oncommand="MessengerSetDefaultCharacterSet('EUC-JP');"/>
<menuseparator />
<menuitem value="&dcharTradChiBigCmd.label;" oncommand="MessengerSetDefaultCharacterSet('Big5');"/>
<menuitem value="&dcharTriChiEucCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-euc-tw');"/>
<menuitem value="&dcharSimpChiGbCmd.label;" oncommand="MessengerSetDefaultCharacterSet('GB2312');"/>
<menuseparator />
<menuitem value="&dcharKoreanCmd.label;" oncommand="MessengerSetDefaultCharacterSet('EUC-KR');"/>
<menuseparator />
<menuitem value="&dcharUtf7Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('UTF-7');"/>
<menuitem value="&dcharUtf8Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('UTF-8');"/>
</menupopup>
</menu>
<menu value="&dcharMenu2.label;">
<menupopup>
<menuitem value="&dcharRusCmd.label; " oncommand="MessengerSetDefaultCharacterSet('KOI8-R');"/>
<menuitem value="&dcharIsoCyrCmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-5');"/>
<menuitem value="&dcharWinCyrCmd.label;" oncommand="MessengerSetDefaultCharacterSet('windows-1251');"/>
<menuitem value="&dcharEcmaCyrCmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-IR-111');"/>
<menuitem value="&dcharDosCyrCmd.label;" oncommand="MessengerSetDefaultCharacterSet('IBM866');"/>
<menuitem value="&dcharMacCyrCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-mac-cyrillic');"/>
<menuitem value="&dcharUkrCmd.label;" oncommand="MessengerSetDefaultCharacterSet('KOI8-U');"/>
<menuitem value="&dcharMacUkrCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-mac-ukrainian');"/>
</menupopup>
</menu>
<menu value="&dcharMenu3.label;">
<menupopup>
<menuitem value="&dcharWinVietCmd.label;" oncommand="MessengerSetDefaultCharacterSet('windows-1258');"/>
<menuitem value="&dcharVietTcnCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-viet-tcvn5712');"/>
<menuitem value="&dcharVietViCmd.label;" oncommand="MessengerSetDefaultCharacterSet('VISCII');"/>
<menuitem value="&dcharVieVpCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-viet-vps');"/>
<menuseparator />
<menuitem value="&dcharThaiCmd.label;" oncommand="MessengerSetDefaultCharacterSet('TIS-620');"/>
<menuseparator />
<menuitem value="&dcharArmCmd.label;" oncommand="MessengerSetDefaultCharacterSet('ARMSCII-8');"/>
<!--
<menuseparator />
<menuitem value="&dcharIso6Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-6');"/>
<menuitem value="&dcharCp1256Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('windows-1256');"/>
<menuseparator />
<menuitem value="&dcharIso8Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('ISO-8859-8');"/>
<menuitem value="&dcharCp1255Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('windows-1255');"/>
-->
</menupopup>
</menu>
<menu value="&dcharMenu4.label;">
<menupopup>
<menuitem value="&dcharMacRomCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-mac-roman');"/>
<menuitem value="&dcharMacCenEuroCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-mac-ce');"/>
<menuitem value="&dcharMacTurCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-mac-turkish');"/>
<menuitem value="&dcharMacCroaCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-mac-croatian');"/>
<menuitem value="&dcharMacRomanianCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-mac-romanian');"/>
<menuitem value="&dcharMacIceCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-mac-icelandic');"/>
<menuitem value="&dcharMacGreekCmd.label;" oncommand="MessengerSetDefaultCharacterSet('x-mac-greek');"/>
</menupopup>
</menu>
<menu value="&dcharMenu5.label;">
<menupopup>
<menuitem value="&dcharWinLat1Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('windows-1252');"/>
<menuitem value="&dcharWinLat2Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('windows-1250');"/>
<menuitem value="&dcharWinLat5Cmd.label;" oncommand="MessengerSetDefaultCharacterSet('windows-1254');"/>
<menuitem value="&dcharWinBalRimCmd.label;" oncommand="MessengerSetDefaultCharacterSet('windows-1257');"/>
<menuitem value="&dcharWinGreekCmd.label;" oncommand="MessengerSetDefaultCharacterSet('windows-1253');"/>
</menupopup>
</menu>
</menupopup>
</menu>
<menu value="&searchMenu.label;">
<menupopup>
<menuitem value="&findCmd.label;" oncommand="MsgFind();"/>
<menuitem value="&findAgainCmd.label;" oncommand="MsgFindAgain();"/>
<menuseparator/>
<!--
<menuitem value="&searchCurrentCmd.label;" disabled="true" oncommand="MsgSearchCurrent();"/>
<menuitem value="&searchParentCmd.label;" disabled="true" oncommand="MsgSearchParent();"/>
<menuitem value="&searchParentParentCmd.label;" disabled="true" oncommand="MsgSearchParentParent();"/>
<menuseparator/>
-->
<menuitem value="&searchInternetCmd.label;" disabled="true" oncommand="MsgSearchInternet();"/>
<menuitem value="&searchMailCmd.label;" disabled="true" oncommand="MsgSearchMessages();"/>
<menuitem value="&searchBookmarksCmd.label;" disabled="true" oncommand="MsgSearchBookmarks();"/>
<menuitem value="&searchPeopleCmd.label;" disabled="true" oncommand="MsgSearchPeople();"/>
<menuseparator/>
<menuitem value="&searchLocalCmd.label;" disabled="true" oncommand="MsgSearchLocal();"/>
</menupopup>
</menu>
<menu value="&goMenu.label;">
<menupopup>
<menuitem value="&firstUnreadMsgCmd.label;" disabled="true" oncommand="MsgFirstUnreadMessage();"/>
<menuitem value="&firstFlaggedMsgCmd.label;" disabled="true" oncommand="MsgFirstFlaggedMessage();"/>
<menuseparator/>
<menu value="&nextMenu.label;">
<menupopup>
<menuitem value="&nextMsgCmd.label;" oncommand="MsgNextMessage();"/>
<menuitem value="&nextUnreadMsgCmd.label;" key="key_nextUnreadMsg" accesskey="&nextUnreadMsgCmd.key;" observes="cmd_nextUnreadMsg"/>
<menuitem value="&nextFlaggedMsgCmd.label;" oncommand="MsgNextFlaggedMessage();"/>
<menuseparator/>
<menuitem value="&nextUnreadThread.label;" observes="cmd_nextUnreadThread"/>
</menupopup>
</menu>
<menu value="&prevMenu.label;">
<menupopup>
<menuitem value="&prevMsgCmd.label;" oncommand="MsgPreviousMessage();"/>
<menuitem value="&prevUnreadMsgCmd.label;" oncommand="MsgPreviousUnreadMessage();"/>
<menuitem value="&prevFlaggedMsgCmd.label;" oncommand="MsgPreviousFlaggedMessage();"/>
</menupopup>
</menu>
<menuseparator/>
<menuitem value="&backCmd.label;" disabled="true" oncommand="MsgGoBack();"/>
<menuitem value="&forwardCmd.label;" disabled="true" oncommand="MsgGoForward();"/>
</menupopup>
</menu>
<menu value="&msgMenu.label;">
<menupopup>
<menuitem value="&newMsgCmd.label;" oncommand="MsgNewMessage(event);"/>
<menuitem value="&replyMsgCmd.label;" oncommand="MsgReplyMessage(event);"/>
<menuitem value="&replyToAllMsgCmd.label;" oncommand="MsgReplyToAllMessage(event);"/>
<menuitem value="&forwardMsgCmd.label;" oncommand="MsgForwardMessage(event);"/>
<menu value="&forwardAsMenu.label;">
<menupopup>
<menuitem value="&forwardAsInline.label;" oncommand="MsgForwardAsInline(event);"/>
<menuitem value="&forwardAsAttachmentCmd.label;" oncommand="MsgForwardAsAttachment(event);"/>
</menupopup>
</menu>
<menuitem value="&editMsgAsNewCmd.label;" oncommand="MsgEditMessageAsNew();"/>
<menuseparator/>
<menu value="&moveMsgMenu.label;" id="moveMenu" datasources="rdf:null"
rdf:ignore="http://home.netscape.com/NC-rdf#MessageChild">
<menupopup/>
<template>
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup>
<menuitem uri="..." value="&fileHereMenu.label;"
oncommand="MsgMoveMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType" />
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="false" nc:ServerType="nntp">
<!-- don't show nntp servers in the file and copies menus -->
</rule>
<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
<!-- note, there is no "file here" -->
<menupopup>
<menu uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup/>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name" oncommand="MsgMoveMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
</menu>
<menu value="&copyMsgMenu.label;" id="copyMenu" datasources="rdf:null"
rdf:ignore="http://home.netscape.com/NC-rdf#MessageChild">
<menupopup/>
<template>
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup>
<menuitem uri="..." value="&fileHereMenu.label;"
oncommand="MsgCopyMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="false" nc:ServerType="nntp">
<!-- don't show nntp servers in the file and copies menus -->
</rule>
<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
<!-- note, there is no "file here" -->
<menupopup>
<menu uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup/>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="MsgCopyMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
</menu>
<menuseparator/>
<menuitem value="&addSenderToAddressBookCmd.label;" disabled="true" oncommand="MsgAddSenderToAddressBook();"/>
<menuitem value="&addAllToAddressBookCmd.label;" disabled="true" oncommand="MsgAddAllToAddressBook();"/>
<menuseparator/>
<menu value="&markMenu.label;">
<menupopup>
<menuitem value="&markAsReadCmd.label;" oncommand="MsgMarkMsgAsRead(true);"/>
<menuitem value="&markAsUnreadCmd.label;" oncommand="MsgMarkMsgAsRead(false);"/>
<menuitem value="&markThreadAsReadCmd.label;" oncommand="MsgMarkThreadAsRead();"/>
<menuitem value="&markByDateCmd.label;" disabled="true" oncommand="MsgMarkByDate();"/>
<menuitem value="&markAllReadCmd.label;" oncommand="MsgMarkAllRead();"/>
<menuseparator/>
<menuitem value="&markFlaggedCmd.label;" oncommand="MsgMarkAsFlagged(true);"/>
<menuitem value="&markUnflaggedCmd.label;" oncommand="MsgMarkAsFlagged(false);"/>
</menupopup>
</menu>
<menuseparator/>
<menuitem value="&ignoreThreadCmd.label;" disabled="true" oncommand="MsgIgnoreThread();"/>
<menuitem value="&watchThreadCmd.label;" disabled="true" oncommand="MsgWatchThread();"/>
</menupopup>
</menu>
<menu id="tasksMenu"/>
<menu id="menu_Help"/>
<spring flex="100%"/>
</menubar>
<toolbox>
<toolbar id="msgToolbar" class="standard" persist="collapsed">
<box id="toolbar_button_box">
<button class="key-toolbar left" orient="vertical" id="button_getmsg" value="&getMsgButton.label;" onclick="MsgGetMessage()"/>
<button class="key-toolbar left" orient="vertical" id="button_newmsg" value="&newMsgButton.label;" onclick="MsgNewMessage(event)"/>
<toolbarseparator/>
<button class="key-toolbar left" orient="vertical" id="button_reply" value="&replyButton.label;" onclick="MsgReplyMessage(event)"/>
<button class="key-toolbar left" orient="vertical" id="button_replyall" value="&replyAllButton.label;" onclick="MsgReplyToAllMessage(event)"/>
<button class="key-toolbar left" orient="vertical" id="button_forward" value="&forwardButton.label;" onclick="MsgForwardMessage(event)"/>
<toolbarseparator/>
<menu id="FileButtonMenu" datasources="rdf:null"
rdf:ignore="http://home.netscape.com/NC-rdf#MessageChild"
>
<button class="toolbar left" orient="vertical" id="button_file" value="&fileButton.label;"/>
<template>
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup>
<menuitem uri="..." value="&fileHereMenu.label;"
oncommand="MsgMoveMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType" />
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="false" nc:ServerType="nntp">
<!-- don't show nntp servers in the file and copies menus -->
</rule>
<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
<!-- note, there is no "file here" -->
<menupopup>
<menu uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup/>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem" value="rdf:http://home.netscape.com/NC-rdf#Name" oncommand="MsgMoveMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
<menupopup/>
</menu>
<menubar id="mailMenubar"/>
<button class="toolbar left" orient="vertical" id="button_next" value="&nextButton.label;" onclick="MsgNextUnreadMessage()"/>
<button class="toolbar left" orient="vertical" id="button_delete" disabled="true" value="&deleteButton.label;" onclick="goDoCommand('button_delete')"/>
<button class="toolbar left" orient="vertical" id="button_print" value="&printButton.label;" onclick="PrintEnginePrint()"/>
<button class="toolbar left" orient="vertical" id="button_stop" value="&stopButton.label;" onclick="MsgStop();"/>
<spring flex="100%"/>
</box>
<box id="toolbar_throbber_box" align="vertical">
<titledbutton id="Throbber" onclick='goClickThrobber("messenger.throbber.url")'>
<observes element="Messenger:Throbber" attribute="busy"/>
</titledbutton>
</box>
</toolbar>
</toolbox>
<toolbox id="mailToolbarToolbox"/>
<!-- The main mail three pane frame -->
<box align="horizontal" style="height:100px" flex="1">
<box align="horizontal" style="height:100px" flex="1">
<box id="sidebar-box">
<splitter class="sidebar-main-header" collapse="after" persist="state">
<html:div class="panel-bar">&mail-sidebar-header.label;</html:div>
</splitter>
<tree id="folderTree" style="width:100px; height: 600px;" flex="1" context="folderPaneContext"/>
</box>
<box id="sidebar-box">
<splitter class="sidebar-main-header" collapse="after"
persist="state">
<html:div class="panel-bar">&mail-sidebar-header.label;</html:div>
</splitter>
<tree id="folderTree" context="folderPaneContext"/>
</box>
<splitter id="sidebar-splitter"/>
<box align="vertical" flex="1">
<splitter id="sidebar-splitter"/>
<box align="vertical" flex="1">
<tree id="threadTree" flex="2" style="height:0px" context="threadPaneContext"/>
<tree id="threadTree" flex="2" style="height:0px" context="threadPaneContext"/>
<!-- if you change this id, please change GetThreadAndMessagePaneSplitter() and MsgToggleMessagePnae() -->
<splitter id="gray_horizontal_splitter" collapse="after" persist="state"
onclick="OnClickThreadAndMessagePaneSplitter()"/>
<!-- if you change this id, please change GetThreadAndMessagePaneSplitter() and MsgToggleMessagePnae() -->
<splitter id="gray_horizontal_splitter" collapse="after" persist="state"
onclick="OnClickThreadAndMessagePaneSplitter()"/>
<!-- msg header view -->
<box id="messagepanebox" align="vertical" flex="3" persist="collapsed">
<toolbox id="msgHeaderView"/>
<!-- msg header view -->
<box id="messagepanebox" align="vertical" flex="3" persist="collapsed">
<toolbox id="msgHeaderView"/>
<!-- message view -->
<html:iframe id="messagepane" style="height: 0px" flex="1" name="messagepane" type="content" src="about:blank"/>
</box>
<box id="status-bar">
<box align="vertical" style="width:100px">
<spring flex="100%"/>
<progressmeter id="statusbar-icon" mode="normal" value="0" onclick="dumpProgress()">
<observes element="Messenger:LoadingProgress" attribute="mode"/>
<observes element="Messenger:LoadingProgress" attribute="value"/>
<observes element="Messenger:Throbber" attribute="busy" onbroadcast="onProgress()"/>
</progressmeter>
<spring flex="100%"/>
</box>
<!-- message view -->
<html:iframe id="messagepane" style="height: 0px" flex="1" name="messagepane" type="content" src="about:blank"/>
</box>
<box id="status-bar">
<box align="vertical" style="width:100px">
<spring flex="100%"/>
<progressmeter id="statusbar-icon" mode="normal" value="0" onclick="dumpProgress()">
<observes element="Messenger:LoadingProgress" attribute="mode"/>
<observes element="Messenger:LoadingProgress" attribute="value"/>
<observes element="Messenger:Throbber" attribute="busy" onbroadcast="onProgress()"/>
</progressmeter>
<spring flex="100%"/>
</box>
<titledbutton id="statusText" class="status-bar" align="left" flex="100%" value="&statusText.label;">
<observes element="Messenger:Status" attribute="value" onbroadcast="onStatus()"/>
</titledbutton>
<titledbutton value="&unreadCountText.label;"/>
<titledbutton id="unreadMessageCount" style="min-width: 5px"/>
<titledbutton value="&totalCountText.label;"/>
<titledbutton id="totalMessageCount" style="min-width: 5px"/>
</box>
</box>
</box>
<titledbutton id="statusText" class="status-bar" align="left" flex="100%" value="&statusText.label;">
<observes element="Messenger:Status" attribute="value" onbroadcast="onStatus()"/>
</titledbutton>
<titledbutton value="&unreadCountText.label;"/>
<titledbutton id="unreadMessageCount" style="min-width: 5px"/>
<titledbutton value="&totalCountText.label;"/>
<titledbutton id="totalMessageCount" style="min-width: 5px"/>
</box>
</box>
</box>
<toolbar id="taskbar"/>

Просмотреть файл

@ -20,41 +20,10 @@
/* This is where functions related to the 3 pane window are kept */
/* globals for a particular window */
var messengerProgID = "component://netscape/messenger";
var statusFeedbackProgID = "component://netscape/messenger/statusfeedback";
var messageViewProgID = "component://netscape/messenger/messageview";
var mailSessionProgID = "component://netscape/messenger/services/session";
var prefProgID = "component://netscape/preferences";
var msgWindowProgID = "component://netscape/messenger/msgwindow";
var datasourceProgIDPrefix = "component://netscape/rdf/datasource?name=";
var accountManagerDSProgID = datasourceProgIDPrefix + "msgaccountmanager";
var folderDSProgID = datasourceProgIDPrefix + "mailnewsfolders";
var messageDSProgID = datasourceProgIDPrefix + "mailnewsmessages";
var messenger;
var accountManagerDataSource;
var folderDataSource;
var messageDataSource;
var pref;
var statusFeedback;
var messageView;
var msgWindow;
var msgComposeService;
var mailSession;
var accountManager;
var RDF;
var showPerformance;
var msgNavigationService;
var msgComposeType;
var msgComposeFormat;
var Bundle;
var BrandBundle;
var gFolderTree;
var gThreadTree;
var gThreadAndMessagePaneSplitter = null;
@ -209,7 +178,8 @@ function OnLoadMessenger()
{
var beforeLoadMessenger = new Date();
CreateGlobals();
CreateMailWindowGlobals();
Create3PaneGlobals();
verifyAccounts();
loadStartPage();
@ -217,7 +187,7 @@ function OnLoadMessenger()
messenger.SetWindow(window, msgWindow);
AddDataSources();
InitializeDataSources();
InitPanes();
@ -312,51 +282,13 @@ function OnUnloadMessenger()
}
function CreateGlobals()
function Create3PaneGlobals()
{
// get the messenger instance
messenger = Components.classes[messengerProgID].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
//Create datasources
accountManagerDataSource = Components.classes[accountManagerDSProgID].createInstance();
folderDataSource = Components.classes[folderDSProgID].createInstance();
messageDataSource = Components.classes[messageDSProgID].createInstance();
pref = Components.classes[prefProgID].getService(Components.interfaces.nsIPref);
//Create windows status feedback
statusFeedback = Components.classes[statusFeedbackProgID].createInstance();
statusFeedback = statusFeedback.QueryInterface(Components.interfaces.nsIMsgStatusFeedback);
//Create message view object
messageView = Components.classes[messageViewProgID].createInstance();
messageView = messageView.QueryInterface(Components.interfaces.nsIMessageView);
//Create message window object
msgWindow = Components.classes[msgWindowProgID].createInstance();
msgWindow = msgWindow.QueryInterface(Components.interfaces.nsIMsgWindow);
msgComposeService = Components.classes['component://netscape/messengercompose'].getService();
msgComposeService = msgComposeService.QueryInterface(Components.interfaces.nsIMsgComposeService);
mailSession = Components.classes["component://netscape/messenger/services/session"].getService(Components.interfaces.nsIMsgMailSession);
accountManager = Components.classes["component://netscape/messenger/account-manager"].getService(Components.interfaces.nsIMsgAccountManager);
RDF = Components.classes['component://netscape/rdf/rdf-service'].getService();
RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService);
showPerformance = pref.GetBoolPref('mail.showMessengerPerformance');
msgNavigationService = Components.classes['component://netscape/messenger/msgviewnavigationservice'].getService();
msgNavigationService= msgNavigationService.QueryInterface(Components.interfaces.nsIMsgViewNavigationService);
msgComposeType = Components.interfaces.nsIMsgCompType;
msgComposeFormat = Components.interfaces.nsIMsgCompFormat;
Bundle = srGetStrBundle("chrome://messenger/locale/messenger.properties");
BrandBundle = srGetStrBundle("chrome://global/locale/brand.properties");
}
@ -475,56 +407,6 @@ function AddToSession()
}
}
function InitMsgWindow()
{
msgWindow.statusFeedback = statusFeedback;
msgWindow.messageView = messageView;
msgWindow.msgHeaderSink = messageHeaderSink;
msgWindow.SetDOMWindow(window);
}
function AddDataSources()
{
accountManagerDataSource = accountManagerDataSource.QueryInterface(Components.interfaces.nsIRDFDataSource);
folderDataSource = folderDataSource.QueryInterface(Components.interfaces.nsIRDFDataSource);
//to move menu item
SetupMoveCopyMenus('moveMenu', accountManagerDataSource, folderDataSource);
//to copy menu item
SetupMoveCopyMenus('copyMenu', accountManagerDataSource, folderDataSource);
//To threadpane move context menu
SetupMoveCopyMenus('threadPaneContext-moveMenu', accountManagerDataSource, folderDataSource);
//To threadpane copy content menu
SetupMoveCopyMenus('threadPaneContext-copyMenu', accountManagerDataSource, folderDataSource);
//To FileButton menu
SetupMoveCopyMenus('FileButtonMenu', accountManagerDataSource, folderDataSource);
//Add statusFeedback
var msgDS = folderDataSource.QueryInterface(Components.interfaces.nsIMsgRDFDataSource);
msgDS.window = msgWindow;
msgDS = messageDataSource.QueryInterface(Components.interfaces.nsIMsgRDFDataSource);
msgDS.window = msgWindow;
msgDS = accountManagerDataSource.QueryInterface(Components.interfaces.nsIMsgRDFDataSource);
msgDS.window = msgWindow;
}
function SetupMoveCopyMenus(menuid, accountManagerDataSource, folderDataSource)
{
var menu = document.getElementById(menuid);
if(menu)
{
menu.database.AddDataSource(accountManagerDataSource);
menu.database.AddDataSource(folderDataSource);
menu.setAttribute('ref', 'msgaccounts:/');
}
}
function InitPanes()
{
@ -539,6 +421,18 @@ function InitPanes()
SetupCommandUpdateHandlers();
}
function InitializeDataSources()
{
//Setup common mailwindow stuff.
AddDataSources();
//To threadpane move context menu
SetupMoveCopyMenus('threadPaneContext-moveMenu', accountManagerDataSource, folderDataSource);
//To threadpane copy content menu
SetupMoveCopyMenus('threadPaneContext-copyMenu', accountManagerDataSource, folderDataSource);
}
function OnLoadFolderPane(folderTree)
{
gFolderTree = folderTree;
@ -695,6 +589,17 @@ function GetSelectedFolder()
}
function GetSelectedMessage()
{
var tree = GetThreadTree();
var selection = tree.selectedItems;
if(selection.length > 0)
return selection[0];
else
return null;
}
function ThreadPaneOnClick(event)
{
var targetclass = event.target.getAttribute('class');
@ -724,14 +629,24 @@ function ThreadPaneDoubleClick(treeitem)
{
if(IsSpecialFolderSelected("Drafts"))
{
ComposeMessage(msgComposeType.Draft, msgComposeFormat.Default);
var loadedFolder = GetLoadedMsgFolder();
var messageArray = GetSelectedMessages();
ComposeMessage(msgComposeType.Draft, msgComposeFormat.Default, loadedFolder, messageArray);
}
else if(IsSpecialFolderSelected("Templates"))
{
ComposeMessage(msgComposeType.Template, msgComposeFormat.Default);
var loadedFolder = GetLoadedMsgFolder();
var messageArray = GetSelectedMessages();
ComposeMessage(msgComposeType.Template, msgComposeFormat.Default, loadedFolder, messageArray);
}
else
{
MsgOpenNewWindowForMessage();
}
}
function GetServer(uri)
{
try {
@ -807,7 +722,7 @@ function FolderPaneDoubleClick(treeitem)
// don't open a new msg window if we are double clicking on a server.
// only do it for folders or newsgroups
if (!isServer) {
MsgOpenNewWindowForFolder(treeitem);
MsgOpenNewWindowForFolder(treeitem.getAttribute('id'));
}
}
@ -842,3 +757,466 @@ function ClearActiveThreadPaneSortColumn()
}
}
// Controller object for folder pane
var FolderPaneController =
{
supportsCommand: function(command)
{
switch ( command )
{
case "cmd_delete":
case "button_delete":
return true;
case "cmd_selectAll":
case "cmd_undo":
case "cmd_redo":
case "cmd_cut":
case "cmd_copy":
case "cmd_paste":
return true;
default:
return false;
}
},
isCommandEnabled: function(command)
{
// dump("FolderPaneController.IsCommandEnabled(" + command + ")\n");
switch ( command )
{
case "cmd_selectAll":
case "cmd_undo":
case "cmd_redo":
case "cmd_cut":
case "cmd_copy":
case "cmd_paste":
return false;
case "cmd_delete":
case "button_delete":
if ( command == "cmd_delete" )
goSetMenuValue(command, 'valueFolder');
var folderTree = GetFolderTree();
if ( folderTree && folderTree.selectedItems &&
folderTree.selectedItems.length > 0)
{
var specialFolder = null;
try {
specialFolder = folderTree.selectedItems[0].getAttribute('SpecialFolder');
}
catch (ex) {
//dump("specialFolder failure: " + ex + "\n");
}
if (specialFolder == "Inbox" || specialFolder == "Trash")
return false;
else
return true;
}
else
return false;
default:
return false;
}
},
doCommand: function(command)
{
switch ( command )
{
case "cmd_delete":
case "button_delete":
MsgDeleteFolder();
break;
}
},
onEvent: function(event)
{
// on blur events set the menu item texts back to the normal values
if ( event == 'blur' )
{
goSetMenuValue('cmd_delete', 'valueDefault');
goSetMenuValue('cmd_undo', 'valueDefault');
goSetMenuValue('cmd_redo', 'valueDefault');
}
}
};
// Controller object for thread pane
var ThreadPaneController =
{
supportsCommand: function(command)
{
switch ( command )
{
case "cmd_undo":
case "cmd_redo":
case "cmd_selectAll":
return true;
case "cmd_cut":
case "cmd_copy":
case "cmd_paste":
return true;
default:
return false;
}
},
isCommandEnabled: function(command)
{
switch ( command )
{
case "cmd_selectAll":
return true;
case "cmd_cut":
case "cmd_copy":
case "cmd_paste":
return false;
case "cmd_undo":
case "cmd_redo":
return SetupUndoRedoCommand(command);
default:
return false;
}
},
doCommand: function(command)
{
switch ( command )
{
case "cmd_selectAll":
var threadTree = GetThreadTree();
if ( threadTree )
{
threadTree.selectAll();
if ( threadTree.selectedItems && threadTree.selectedItems.length != 1 )
ClearMessagePane();
}
break;
case "cmd_undo":
messenger.Undo(msgWindow);
break;
case "cmd_redo":
messenger.Redo(msgWindow);
break;
}
},
onEvent: function(event)
{
// on blur events set the menu item texts back to the normal values
if ( event == 'blur' )
{
goSetMenuValue('cmd_undo', 'valueDefault');
goSetMenuValue('cmd_redo', 'valueDefault');
}
}
};
// DefaultController object (handles commands when one of the trees does not have focus)
var DefaultController =
{
supportsCommand: function(command)
{
switch ( command )
{
case "cmd_delete":
case "button_delete":
case "cmd_shiftDelete":
case "cmd_nextUnreadMsg":
case "cmd_nextUnreadThread":
return true;
default:
return false;
}
},
isCommandEnabled: function(command)
{
switch ( command )
{
case "cmd_delete":
case "button_delete":
case "cmd_shiftDelete":
var threadTree = GetThreadTree();
var numSelected = 0;
if ( threadTree && threadTree.selectedItems )
numSelected = threadTree.selectedItems.length;
if ( command == "cmd_delete")
{
if ( numSelected < 2 )
goSetMenuValue(command, 'valueMessage');
else
goSetMenuValue(command, 'valueMessages');
}
return ( numSelected > 0 );
case "cmd_nextUnreadMsg":
case "cmd_nextUnreadThread":
//Input and TextAreas should get access to the keys that cause these commands.
//Currently if we don't do this then we will steal the key away and you can't type them
//in these controls. This is a bug that should be fixed and when it is we can get rid of
//this.
var focusedElement = top.document.commandDispatcher.focusedElement;
if(focusedElement)
{
var name = focusedElement.nodeName;
return ((name != "INPUT") && (name != "TEXTAREA"));
}
else
{
return true;
}
default:
return false;
}
},
doCommand: function(command)
{
//dump("ThreadPaneController.doCommand(" + command + ")\n");
switch ( command )
{
case "cmd_delete":
MsgDeleteMessage(false, false);
break;
case "cmd_shiftDelete":
MsgDeleteMessage(true, false);
break;
case "button_delete":
MsgDeleteMessage(false, true);
break;
case "cmd_nextUnreadMsg":
MsgNextUnreadMessage();
break;
case "cmd_nextUnreadThread":
MsgNextUnreadThread();
break;
}
},
onEvent: function(event)
{
// on blur events set the menu item texts back to the normal values
if ( event == 'blur' )
{
goSetMenuValue('cmd_delete', 'valueDefault');
}
}
};
function CommandUpdate_Mail()
{
/*var messagePane = top.document.getElementById('messagePane');
var drawFocusBorder = messagePane.getAttribute('draw-focus-border');
if ( MessagePaneHasFocus() )
{
if ( !drawFocusBorder )
messagePane.setAttribute('draw-focus-border', 'true');
}
else
{
if ( drawFocusBorder )
messagePane.removeAttribute('draw-focus-border');
}*/
goUpdateCommand('cmd_delete');
goUpdateCommand('button_delete');
goUpdateCommand('cmd_shiftDelete');
goUpdateCommand('cmd_nextUnreadMsg');
goUpdateCommand('cmd_nextUnreadThread');
}
function SetupUndoRedoCommand(command)
{
// dump ("--- SetupUndoRedoCommand: " + command + "\n");
var canUndoOrRedo = false;
var txnType = 0;
if (command == "cmd_undo")
{
canUndoOrRedo = messenger.CanUndo();
txnType = messenger.GetUndoTransactionType();
}
else
{
canUndoOrRedo = messenger.CanRedo();
txnType = messenger.GetRedoTransactionType();
}
if (canUndoOrRedo)
{
switch (txnType)
{
default:
case 0:
goSetMenuValue(command, 'valueDefault');
break;
case 1:
goSetMenuValue(command, 'valueDeleteMsg');
break;
case 2:
goSetMenuValue(command, 'valueMoveMsg');
break;
case 3:
goSetMenuValue(command, 'valueCopyMsg');
break;
}
}
return canUndoOrRedo;
}
function CommandUpdate_UndoRedo()
{
ShowMenuItem("menu_undo", true);
EnableMenuItem("menu_undo", SetupUndoRedoCommand("cmd_undo"));
ShowMenuItem("menu_redo", true);
EnableMenuItem("menu_redo", SetupUndoRedoCommand("cmd_redo"));
}
/*function MessagePaneHasFocus()
{
var focusedWindow = top.document.commandDispatcher.focusedWindow;
var messagePaneWindow = top.frames['messagepane'];
if ( focusedWindow && messagePaneWindow && (focusedWindow != top) )
{
var hasFocus = IsSubWindowOf(focusedWindow, messagePaneWindow, false);
dump("...........Focus on MessagePane = " + hasFocus + "\n");
return hasFocus;
}
return false;
}
function IsSubWindowOf(search, wind, found)
{
//dump("IsSubWindowOf(" + search + ", " + wind + ", " + found + ")\n");
if ( found || (search == wind) )
return true;
for ( index = 0; index < wind.frames.length; index++ )
{
if ( IsSubWindowOf(search, wind.frames[index], false) )
return true;
}
return false;
}*/
function SetupCommandUpdateHandlers()
{
dump("SetupCommandUpdateHandlers\n");
var widget;
// folder pane
widget = GetFolderTree();
if ( widget )
widget.controllers.appendController(FolderPaneController);
// thread pane
widget = GetThreadTree();
if ( widget )
widget.controllers.appendController(ThreadPaneController);
top.controllers.insertControllerAt(0, DefaultController);
}
function GetSelectedMsgFolders()
{
var folderTree = GetFolderTree();
var selectedFolders = folderTree.selectedItems;
var numFolders = selectedFolders.length;
var folderArray = new Array(numFolders);
for(var i = 0; i < numFolders; i++)
{
var folder = selectedFolders[i];
var folderUri = folder.getAttribute("id");
var folderResource = RDF.GetResource(folderUri);
var msgFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder);
if(msgFolder)
{
folderArray[i] = msgFolder;
}
}
return folderArray;
}
function GetSelectedMessages()
{
var threadTree = GetThreadTree();
var selectedMessages = threadTree.selectedItems;
var numMessages = selectedMessages.length;
var messageArray = new Array(numMessages);
for(var i = 0; i < numMessages; i++)
{
var messageNode = selectedMessages[i];
var messageUri = messageNode.getAttribute("id");
var messageResource = RDF.GetResource(messageUri);
var message = messageResource.QueryInterface(Components.interfaces.nsIMessage);
if(message)
{
messageArray[i] = message;
}
}
return messageArray;
}
function GetLoadedMsgFolder()
{
var loadedFolder = GetThreadTreeFolder();
var folderUri = loadedFolder.getAttribute("ref");
var folderResource = RDF.GetResource(folderUri);
if(folderResource)
{
var msgFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder);
return msgFolder;
}
return null;
}
function GetLoadedMessage()
{
var messageResource = RDF.GetResource(gCurrentDisplayedMessage);
if(messageResource)
{
var message = messageResource.QueryInterface(Components.interfaces.nsIMessage);
return message;
}
return null;
}
function GetCompositeDataSource(command)
{
if(command == "GetNewMessages" || command == "Copy" || command == "NewFolder")
{
var folderTree = GetFolderTree();
return folderTree.database;
}
return null;
}

Просмотреть файл

@ -24,388 +24,8 @@
* and then calls a function/command in commandglue
*/
// Controller object for folder pane
var FolderPaneController =
{
supportsCommand: function(command)
{
switch ( command )
{
case "cmd_delete":
case "button_delete":
return true;
case "cmd_selectAll":
case "cmd_undo":
case "cmd_redo":
case "cmd_cut":
case "cmd_copy":
case "cmd_paste":
return true;
default:
return false;
}
},
isCommandEnabled: function(command)
{
// dump("FolderPaneController.IsCommandEnabled(" + command + ")\n");
switch ( command )
{
case "cmd_selectAll":
case "cmd_undo":
case "cmd_redo":
case "cmd_cut":
case "cmd_copy":
case "cmd_paste":
return false;
case "cmd_delete":
case "button_delete":
if ( command == "cmd_delete" )
goSetMenuValue(command, 'valueFolder');
var folderTree = GetFolderTree();
if ( folderTree && folderTree.selectedItems &&
folderTree.selectedItems.length > 0)
{
var specialFolder = null;
try {
specialFolder = folderTree.selectedItems[0].getAttribute('SpecialFolder');
}
catch (ex) {
//dump("specialFolder failure: " + ex + "\n");
}
if (specialFolder == "Inbox" || specialFolder == "Trash")
return false;
else
return true;
}
else
return false;
default:
return false;
}
},
doCommand: function(command)
{
switch ( command )
{
case "cmd_delete":
case "button_delete":
MsgDeleteFolder();
break;
}
},
onEvent: function(event)
{
// on blur events set the menu item texts back to the normal values
if ( event == 'blur' )
{
goSetMenuValue('cmd_delete', 'valueDefault');
goSetMenuValue('cmd_undo', 'valueDefault');
goSetMenuValue('cmd_redo', 'valueDefault');
}
}
};
// Controller object for thread pane
var ThreadPaneController =
{
supportsCommand: function(command)
{
switch ( command )
{
case "cmd_undo":
case "cmd_redo":
case "cmd_selectAll":
return true;
case "cmd_cut":
case "cmd_copy":
case "cmd_paste":
return true;
default:
return false;
}
},
isCommandEnabled: function(command)
{
switch ( command )
{
case "cmd_selectAll":
return true;
case "cmd_cut":
case "cmd_copy":
case "cmd_paste":
return false;
case "cmd_undo":
case "cmd_redo":
return SetupUndoRedoCommand(command);
default:
return false;
}
},
doCommand: function(command)
{
switch ( command )
{
case "cmd_selectAll":
var threadTree = GetThreadTree();
if ( threadTree )
{
threadTree.selectAll();
if ( threadTree.selectedItems && threadTree.selectedItems.length != 1 )
ClearMessagePane();
}
break;
case "cmd_undo":
messenger.Undo(msgWindow);
break;
case "cmd_redo":
messenger.Redo(msgWindow);
break;
}
},
onEvent: function(event)
{
// on blur events set the menu item texts back to the normal values
if ( event == 'blur' )
{
goSetMenuValue('cmd_undo', 'valueDefault');
goSetMenuValue('cmd_redo', 'valueDefault');
}
}
};
// DefaultController object (handles commands when one of the trees does not have focus)
var DefaultController =
{
supportsCommand: function(command)
{
switch ( command )
{
case "cmd_delete":
case "button_delete":
case "cmd_shiftDelete":
case "cmd_nextUnreadMsg":
case "cmd_nextUnreadThread":
return true;
default:
return false;
}
},
isCommandEnabled: function(command)
{
switch ( command )
{
case "cmd_delete":
case "button_delete":
case "cmd_shiftDelete":
var threadTree = GetThreadTree();
var numSelected = 0;
if ( threadTree && threadTree.selectedItems )
numSelected = threadTree.selectedItems.length;
if ( command == "cmd_delete")
{
if ( numSelected < 2 )
goSetMenuValue(command, 'valueMessage');
else
goSetMenuValue(command, 'valueMessages');
}
return ( numSelected > 0 );
case "cmd_nextUnreadMsg":
case "cmd_nextUnreadThread":
//Input and TextAreas should get access to the keys that cause these commands.
//Currently if we don't do this then we will steal the key away and you can't type them
//in these controls. This is a bug that should be fixed and when it is we can get rid of
//this.
var focusedElement = top.document.commandDispatcher.focusedElement;
if(focusedElement)
{
var name = focusedElement.nodeName;
return ((name != "INPUT") && (name != "TEXTAREA"));
}
else
{
return true;
}
default:
return false;
}
},
doCommand: function(command)
{
//dump("ThreadPaneController.doCommand(" + command + ")\n");
switch ( command )
{
case "cmd_delete":
MsgDeleteMessage(false, false);
break;
case "cmd_shiftDelete":
MsgDeleteMessage(true, false);
break;
case "button_delete":
MsgDeleteMessage(false, true);
break;
case "cmd_nextUnreadMsg":
MsgNextUnreadMessage();
break;
case "cmd_nextUnreadThread":
MsgNextUnreadThread();
break;
}
},
onEvent: function(event)
{
// on blur events set the menu item texts back to the normal values
if ( event == 'blur' )
{
goSetMenuValue('cmd_delete', 'valueDefault');
}
}
};
function CommandUpdate_Mail()
{
/*var messagePane = top.document.getElementById('messagePane');
var drawFocusBorder = messagePane.getAttribute('draw-focus-border');
if ( MessagePaneHasFocus() )
{
if ( !drawFocusBorder )
messagePane.setAttribute('draw-focus-border', 'true');
}
else
{
if ( drawFocusBorder )
messagePane.removeAttribute('draw-focus-border');
}*/
goUpdateCommand('cmd_delete');
goUpdateCommand('button_delete');
goUpdateCommand('cmd_shiftDelete');
goUpdateCommand('cmd_nextUnreadMsg');
goUpdateCommand('cmd_nextUnreadThread');
}
function SetupUndoRedoCommand(command)
{
// dump ("--- SetupUndoRedoCommand: " + command + "\n");
var canUndoOrRedo = false;
var txnType = 0;
if (command == "cmd_undo")
{
canUndoOrRedo = messenger.CanUndo();
txnType = messenger.GetUndoTransactionType();
}
else
{
canUndoOrRedo = messenger.CanRedo();
txnType = messenger.GetRedoTransactionType();
}
if (canUndoOrRedo)
{
switch (txnType)
{
default:
case 0:
goSetMenuValue(command, 'valueDefault');
break;
case 1:
goSetMenuValue(command, 'valueDeleteMsg');
break;
case 2:
goSetMenuValue(command, 'valueMoveMsg');
break;
case 3:
goSetMenuValue(command, 'valueCopyMsg');
break;
}
}
return canUndoOrRedo;
}
function CommandUpdate_UndoRedo()
{
ShowMenuItem("menu_undo", true);
EnableMenuItem("menu_undo", SetupUndoRedoCommand("cmd_undo"));
ShowMenuItem("menu_redo", true);
EnableMenuItem("menu_redo", SetupUndoRedoCommand("cmd_redo"));
}
/*function MessagePaneHasFocus()
{
var focusedWindow = top.document.commandDispatcher.focusedWindow;
var messagePaneWindow = top.frames['messagepane'];
if ( focusedWindow && messagePaneWindow && (focusedWindow != top) )
{
var hasFocus = IsSubWindowOf(focusedWindow, messagePaneWindow, false);
dump("...........Focus on MessagePane = " + hasFocus + "\n");
return hasFocus;
}
return false;
}
function IsSubWindowOf(search, wind, found)
{
//dump("IsSubWindowOf(" + search + ", " + wind + ", " + found + ")\n");
if ( found || (search == wind) )
return true;
for ( index = 0; index < wind.frames.length; index++ )
{
if ( IsSubWindowOf(search, wind.frames[index], false) )
return true;
}
return false;
}*/
function SetupCommandUpdateHandlers()
{
dump("SetupCommandUpdateHandlers\n");
var widget;
// folder pane
widget = GetFolderTree();
if ( widget )
widget.controllers.appendController(FolderPaneController);
// thread pane
widget = GetThreadTree();
if ( widget )
widget.controllers.appendController(ThreadPaneController);
top.controllers.insertControllerAt(0, DefaultController);
}
//The eventual goal is for this file to go away and its contents to be brought into
//mailWindowOverlay.js. This is currently being done.
var viewShowAll =0;
@ -413,15 +33,6 @@ var viewShowRead = 1;
var viewShowUnread =2;
var viewShowWatched = 3;
function MsgHome(url)
{
window.open( url, "_blank", "chrome,dependent=yes,all" );
}
function MsgGetMessage()
{
GetNewMessages();
}
function MsgDeleteMessage(reallyDelete, fromToolbar)
{
@ -500,87 +111,7 @@ function MsgDeleteFolder()
}
function MsgNewMessage(event)
{
if (event.shiftKey)
ComposeMessage(msgComposeType.New, msgComposeFormat.OppositeOfDefault);
else
ComposeMessage(msgComposeType.New, msgComposeFormat.Default);
}
function MsgReplyMessage(event)
{
dump("\nMsgReplyMessage from XUL\n");
if (event.shiftKey)
ComposeMessage(msgComposeType.Reply, msgComposeFormat.OppositeOfDefault);
else
ComposeMessage(msgComposeType.Reply, msgComposeFormat.Default);
}
function MsgReplyToAllMessage(event)
{
dump("\nMsgReplyToAllMessage from XUL\n");
if (event.shiftKey)
ComposeMessage(msgComposeType.ReplyAll, msgComposeFormat.OppositeOfDefault);
else
ComposeMessage(msgComposeType.ReplyAll, msgComposeFormat.Default);
}
function MsgForwardMessage(event)
{
dump("\nMsgForwardMessage from XUL\n");
var forwardType = 0;
try {
var forwardType = pref.GetIntPref("mail.forward_message_mode");
} catch (e) {dump ("failed to retrieve pref mail.forward_message_mode");}
if (forwardType == 0)
MsgForwardAsAttachment(event);
else
MsgForwardAsInline(event);
}
function MsgForwardAsAttachment(event)
{
dump("\nMsgForwardAsAttachment from XUL\n");
if (event.shiftKey)
ComposeMessage(msgComposeType.ForwardAsAttachment,
msgComposeFormat.OppositeOfDefault);
else
ComposeMessage(msgComposeType.ForwardAsAttachment, msgComposeFormat.Default);
}
function MsgForwardAsInline(event)
{
dump("\nMsgForwardAsInline from XUL\n");
if (event.shiftKey)
ComposeMessage(msgComposeType.ForwardInline,
msgComposeFormat.OppositeOfDefault);
else
ComposeMessage(msgComposeType.ForwardInline, msgComposeFormat.Default);
}
function MsgCopyMessage(destFolder)
{
// Get the id for the folder we're copying into
destUri = destFolder.getAttribute('id');
dump(destUri);
var tree = GetThreadTree();
if(tree)
{
//Get the selected messages to copy
var messageList = ConvertDOMListToResourceArray(tree.selectedItems);
//get the current folder
// dump('In copy messages. Num Selected Items = ' + messageList.length);
// dump('\n');
var srcFolder = GetThreadTreeFolder();
messenger.CopyMessages(tree.database,
srcFolder.resource,
destFolder.resource, messageList, false);
}
}
function MsgMoveMessage(destFolder)
{
@ -716,52 +247,7 @@ function MsgSortByTotal()
SortThreadPane('TotalColumn', 'http://home.netscape.com/NC-rdf#TotalMessages', 'http://home.netscape.com/NC-rdf#Date', true, null);
}
function MsgNewFolder()
{
var windowTitle = Bundle.GetStringFromName("newFolderDialogTitle");
MsgNewSubfolder("chrome://messenger/content/newFolderNameDialog.xul",windowTitle);
}
function SubscribeOKCallback(serverURI, changeTable)
{
dump("in SubscribeOKCallback(" + serverURI +")\n");
dump("change table = " + changeTable + "\n");
for (var name in changeTable) {
dump(name + " = " + changeTable[name] + "\n");
if (changeTable[name] == 1) {
NewFolder(name,serverURI);
}
else if (changeTable[name] == -1) {
dump("unsuscribe\n");
}
}
}
function MsgSubscribe()
{
var windowTitle = Bundle.GetStringFromName("subscribeDialogTitle");
var useRealSubscribeDialog = false;
try {
useRealSubscribeDialog = pref.GetBoolPref("mailnews.use-real-subscribe-dialog");
}
catch (ex) {
useRealSubscribeDialog = false;
}
if (useRealSubscribeDialog) {
var preselectedURI = GetSelectedFolderURI();
window.openDialog("chrome://messenger/content/subscribe.xul",
"subscribe", "chrome,modal",
{preselectedURI:preselectedURI, title:windowTitle,
okCallback:SubscribeOKCallback});
}
else {
MsgNewSubfolder("chrome://messenger/content/subscribeDialog.xul", windowTitle);
}
}
function GetSelectedFolderURI()
{
@ -797,89 +283,13 @@ function GetSelectedFolderURI()
return uri;
}
function MsgNewSubfolder(chromeWindowURL,windowTitle)
{
var preselectedURI = GetSelectedFolderURI();
dump("preselectedURI = " + preselectedURI + "\n");
var dialog = window.openDialog(
chromeWindowURL,
"",
"chrome,modal",
{preselectedURI:preselectedURI, title:windowTitle,
okCallback:NewFolder});
}
function NewFolder(name,uri)
{
var tree = GetFolderTree();
dump("uri,name = " + uri + "," + name + "\n");
if (uri && (uri != "") && name && (name != "")) {
var selectedFolder = GetResourceFromUri(uri);
dump("selectedFolder = " + selectedFolder + "\n");
messenger.NewFolder(tree.database, selectedFolder, name);
}
else {
dump("no name or nothing selected\n");
}
}
function MsgAccountManager()
{
window.openDialog("chrome://messenger/content/AccountManager.xul",
"AccountManager", "chrome,modal");
}
// we do this from a timer because if this is called from the onload=
// handler, then the parent window doesn't appear until after the wizard
// has closed, and this is confusing to the user
function MsgAccountWizard()
{
setTimeout("msgOpenAccountWizard();", 0);
}
function msgOpenAccountWizard()
{
window.openDialog("chrome://messenger/content/AccountWizard.xul",
"AccountWizard", "chrome,modal");
}
function MsgOpenAttachment() {}
function MsgSaveAsFile()
{
dump("\MsgSaveAsFile from XUL\n");
var tree = GetThreadTree();
//get the selected elements
var messageList = tree.selectedItems;
if (messageList && messageList.length == 1)
{
var uri = messageList[0].getAttribute('id');
dump (uri);
if (uri)
messenger.saveAs(uri, true, null, msgWindow);
}
}
function MsgSaveAsTemplate()
{
dump("\MsgSaveAsTemplate from XUL\n");
var tree = GetThreadTree();
//get the selected elements
var messageList = tree.selectedItems;
if (messageList && messageList.length == 1)
{
var uri = messageList[0].getAttribute('id');
// dump (uri);
if (uri)
{
var identity = getIdentityForSelectedServer();
messenger.saveAs(uri, false, identity, msgWindow);
}
}
}
function MsgSendUnsentMsg()
{
var identity = getIdentityForSelectedServer();
@ -1273,70 +683,6 @@ function MsgMarkAsFlagged(markFlagged)
function MsgIgnoreThread() {}
function MsgWatchThread() {}
var gStatusObserver;
var bindCount = 0;
function onStatus() {
if (!gStatusObserver)
gStatusObserver = document.getElementById("Messenger:Status");
if ( gStatusObserver ) {
var text = gStatusObserver.getAttribute("value");
if ( text == "" ) {
text = defaultStatus;
}
var statusText = document.getElementById("statusText");
if ( statusText ) {
statusText.setAttribute( "value", text );
}
} else {
dump("Can't find status broadcaster!\n");
}
}
var gThrobberObserver;
var gMeterObserver;
var startTime = 0;
function onProgress() {
if (!gThrobberObserver)
gThrobberObserver = document.getElementById("Messenger:Throbber");
if (!gMeterObserver)
gMeterObserver = document.getElementById("Messenger:LoadingProgress");
if ( gThrobberObserver && gMeterObserver ) {
var busy = gThrobberObserver.getAttribute("busy");
var wasBusy = gMeterObserver.getAttribute("mode") == "undetermined" ? "true" : "false";
if ( busy == "true" ) {
if ( wasBusy == "false" ) {
// Remember when loading commenced.
startTime = (new Date()).getTime();
// Turn progress meter on.
gMeterObserver.setAttribute("mode","undetermined");
}
// Update status bar.
} else if ( busy == "false" && wasBusy == "true" ) {
// Record page loading time.
if (!gStatusObserver)
gStatusObserver = document.getElementById("Messenger:Status");
if ( gStatusObserver ) {
var elapsed = ( (new Date()).getTime() - startTime ) / 1000;
var msg = "Document: Done (" + elapsed + " secs)";
dump( msg + "\n" );
gStatusObserver.setAttribute("value",msg);
defaultStatus = msg;
}
// Turn progress meter off.
gMeterObserver.setAttribute("mode","normal");
}
}
}
function dumpProgress() {
var broadcaster = document.getElementById("Messenger:LoadingProgress");
dump( "bindCount=" + bindCount + "\n" );
dump( "broadcaster mode=" + broadcaster.getAttribute("mode") + "\n" );
dump( "broadcaster value=" + broadcaster.getAttribute("value") + "\n" );
dump( "meter mode=" + meter.getAttribute("mode") + "\n" );
dump( "meter value=" + meter.getAttribute("value") + "\n" );
}
function GetMsgFolderFromUri(uri)
{
@ -1361,24 +707,6 @@ function GetResourceFromUri(uri)
return resource;
}
function MsgOpenNewWindowForFolder(folder)
{
if(!folder)
{
folder = GetSelectedFolder();
}
if(folder)
{
var uri = folder.getAttribute("id");
if(uri)
{
window.openDialog( "chrome://messenger/content/", "_blank", "chrome,all,dialog=no", uri );
}
}
}
var accountManagerProgID = "component://netscape/messenger/account-manager";
var messengerMigratorProgID = "component://netscape/messenger/migrator";

Просмотреть файл

@ -116,7 +116,7 @@ iframe {
.folderMenuItem > .menu-left {
list-style-image: url("chrome://messenger/skin/Folder.gif");
list-style-image: url("chrome://messenger/skin/folder-closed.gif");
}
@ -124,10 +124,6 @@ iframe {
list-style-image: url("chrome://messenger/skin/folder-open.gif");
}
.folderMenuItem[IsServer="true"] > .menu-left {
list-style-image: url("chrome://messenger/skin/server.gif");
}
/* special folder */
.folderMenuItem[SpecialFolder="Inbox"] > .menu-left {
list-style-image: url("chrome://messenger/skin/folder-inbox.gif");
@ -135,7 +131,7 @@ iframe {
.folderMenuItem[SpecialFolder="Inbox"][open="true"] > .menu-left
{
list-style-image: url("chrome://messenger/skin/folder-inbox-open.gif");
list-style-image: url("chrome://messenger/skin/folder-inbox.gif");
}
.folderMenuItem[SpecialFolder="Trash"] > .menu-left {
@ -143,56 +139,29 @@ iframe {
}
.folderMenuItem[SpecialFolder="Trash"][open="true"] > .menu-left {
list-style-image: url("chrome://messenger/skin/folder-trash-open.gif");
list-style-image: url("chrome://messenger/skin/folder-trash.gif");
}
.folderMenuItem[SpecialFolder="Sent"] > > .menu-left {
list-style-image: url("chrome://messenger/skin/folder-sent.gif");
.folderMenuItem[IsServer="true"] > .menu-left
{
list-style-image: url("chrome://messenger/skin/server-mail.gif");
}
.folderMenuItem[SpecialFolder="Sent"][open="true"] > .menu-left {
list-style-image: url("chrome://messenger/skin/folder-sent-open.gif");
}
.folderMenuItem[SpecialFolder="Templates"] > .menu-left {
list-style-image: url("chrome://messenger/skin/folder-template.gif");
}
.folderMenuItem[SpecialFolder="Templates"][open="true"] > .menu-left {
list-style-image: url("chrome://messenger/skin/folder-template-open.gif");
}
.folderMenuItem[SpecialFolder="Drafts"] > .menu-left {
list-style-image: url("chrome://messenger/skin/folder-draft.gif");
}
.folderMenuItem[SpecialFolder="Drafts"][open="true"] > .menu-left {
list-style-image: url("chrome://messenger/skin/folder-draft-open.gif");
}
.folderMenuItem[SpecialFolder="Unsent Messages"] > .menu-left {
list-style-image: url("chrome://messenger/skin/folder-outbox.gif");
}
.folderMenuItem[BiffState="NewMail"] > .menu-left {
list-style-image: url("chrome://messenger/skin/folder-new.gif");
.folderMenuItem[IsServer="true"][open="true"] > .menu-left
{
list-style-image: url("chrome://messenger/skin/server-mail.gif");
}
/* IMAP folders */
.folderMenuItem[ServerType="imap"] > .menu-left {
list-style-image: url("chrome://messenger/skin/folder-server.gif");
}
.folderMenuItem[ServerType="imap"][open="true"] > .menu-left {
list-style-image: url("chrome://messenger/skin/folder-server-open.gif");
}
.folderMenuItem[IsServer="true"][ServerType="imap"][IsSecure="true"] > .menu-left {
list-style-image: url("chrome://messenger/skin/server-remote-lock.gif");
}
.folderMenuItem[IsServer="true"][ServerType="imap"] > .menu-left {
list-style-image: url("chrome://messenger/skin/server-remote.gif");
/* Local Servers */
.folderMenuItem[IsServer="true"][ServerType="none"] > .menu-left
{
list-style-image: url("chrome://messenger/skin/server-local.gif");
}
/* News folders */

Просмотреть файл

@ -250,27 +250,6 @@ nsMessenger::~nsMessenger()
NS_IMPL_ISUPPORTS(nsMessenger, NS_GET_IID(nsIMessenger))
nsresult
nsMessenger::GetNewMessages(nsIRDFCompositeDataSource *db,
nsIRDFResource *folderResource)
{
nsresult rv=NS_OK;
nsCOMPtr<nsISupportsArray> folderArray;
if(!folderResource || !db)
return NS_ERROR_NULL_POINTER;
if(NS_FAILED(NS_NewISupportsArray(getter_AddRefs(folderArray))))
return NS_ERROR_OUT_OF_MEMORY;
folderArray->AppendElement(folderResource);
DoCommand(db, NC_RDF_GETNEWMESSAGES, folderArray, nsnull);
return rv;
}
NS_IMETHODIMP
nsMessenger::SetWindow(nsIDOMWindow *aWin, nsIMsgWindow *aMsgWindow)
{
@ -1179,40 +1158,7 @@ nsMessenger::MarkMessagesFlagged(nsIRDFCompositeDataSource *database,
}
NS_IMETHODIMP
nsMessenger::NewFolder(nsIRDFCompositeDataSource *database, nsIRDFResource *parentFolderResource,
const PRUnichar *name)
{
nsresult rv;
nsCOMPtr<nsISupportsArray> nameArray, folderArray;
if(!parentFolderResource || !name)
return NS_ERROR_NULL_POINTER;
rv = NS_NewISupportsArray(getter_AddRefs(nameArray));
if(NS_FAILED(rv))
{
return NS_ERROR_OUT_OF_MEMORY;
}
rv = NS_NewISupportsArray(getter_AddRefs(folderArray));
if(NS_FAILED(rv))
return NS_ERROR_OUT_OF_MEMORY;
folderArray->AppendElement(parentFolderResource);
NS_WITH_SERVICE(nsIRDFService, rdfService, kRDFServiceCID, &rv);
if(NS_SUCCEEDED(rv))
{
nsAutoString nameStr = name;
nsCOMPtr<nsIRDFLiteral> nameLiteral;
rdfService->GetLiteral(nameStr.GetUnicode(), getter_AddRefs(nameLiteral));
nameArray->AppendElement(nameLiteral);
rv = DoCommand(database, NC_RDF_NEWFOLDER, folderArray, nameArray);
}
return rv;
}
NS_IMETHODIMP
nsMessenger::RenameFolder(nsIRDFCompositeDataSource* db,
@ -1602,11 +1548,6 @@ nsSaveAsListener::OnStopRunningUrl(nsIURI* url, nsresult exitCode)
m_fileSpec->Flush();
m_fileSpec->CloseStream();
if (NS_FAILED(rv)) goto done;
NS_WITH_SERVICE(nsIRDFService, rdf, kRDFServiceCID, &rv);
if (NS_FAILED(rv)) goto done;
nsCOMPtr<nsIRDFResource> res;
rv = rdf->GetResource(m_templateUri, getter_AddRefs(res));
if (NS_FAILED(rv)) goto done;
if (m_templateUri) { // ** save as template goes here
NS_WITH_SERVICE(nsIRDFService, rdf, kRDFServiceCID, &rv);
if (NS_FAILED(rv)) goto done;

Просмотреть файл

@ -28,10 +28,12 @@
#include "nsMsgBaseCID.h"
#include "nsIMsgMailSession.h"
#include "nsIMsgFolderCache.h"
#include "nsIPref.h"
static NS_DEFINE_CID(kCMsgMailSessionCID, NS_MSGMAILSESSION_CID);
static NS_DEFINE_CID(kMsgAccountManagerCID, NS_MSGACCOUNTMANAGER_CID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);
NS_IMPL_THREADSAFE_ADDREF(nsMessengerBootstrap);
NS_IMPL_THREADSAFE_RELEASE(nsMessengerBootstrap);
@ -73,4 +75,29 @@ nsMessengerBootstrap::Shutdown()
}
CMDLINEHANDLER_IMPL(nsMessengerBootstrap,"-mail","general.startup.mail","chrome://messenger/content/","Start with mail.",NS_MAILSTARTUPHANDLER_PROGID,"Mail Cmd Line Handler",PR_FALSE,"", PR_TRUE)
CMDLINEHANDLER3_IMPL(nsMessengerBootstrap,"-mail","general.startup.mail","Start with mail.",NS_MAILSTARTUPHANDLER_PROGID,"Mail Cmd Line Handler",PR_FALSE,"", PR_TRUE)
NS_IMETHODIMP nsMessengerBootstrap::GetChromeUrlForTask(char **aChromeUrlForTask)
{
if (!aChromeUrlForTask) return NS_ERROR_FAILURE;
nsresult rv;
NS_WITH_SERVICE(nsIPref, prefService, kPrefServiceCID, &rv);
if (NS_SUCCEEDED(rv))
{
PRInt32 layout;
rv = prefService->GetIntPref("mail.pane_config", &layout);
if(NS_SUCCEEDED(rv))
{
if(layout == 0)
*aChromeUrlForTask = PL_strdup("chrome://messenger/content/");
else
*aChromeUrlForTask = PL_strdup("chrome://messenger/content/mail3PaneWindowVertLayout.xul");
return NS_OK;
}
}
*aChromeUrlForTask = PL_strdup("chrome://messenger/content/");
return NS_OK;
}

Просмотреть файл

@ -1228,4 +1228,29 @@ nsNntpService::BuildSubscribeDatasource(nsINntpIncomingServer *aNntpServer)
return NS_OK;
}
CMDLINEHANDLER_IMPL(nsNntpService,"-news","general.startup.news","chrome://messenger/content/","Start with news.",NS_NEWSSTARTUPHANDLER_PROGID,"News Cmd Line Handler", PR_FALSE,"", PR_TRUE)
CMDLINEHANDLER3_IMPL(nsNntpService,"-news","general.startup.news","Start with news.",NS_NEWSSTARTUPHANDLER_PROGID,"News Cmd Line Handler", PR_FALSE,"", PR_TRUE)
NS_IMETHODIMP nsNntpService::GetChromeUrlForTask(char **aChromeUrlForTask)
{
if (!aChromeUrlForTask) return NS_ERROR_FAILURE;
nsresult rv;
NS_WITH_SERVICE(nsIPref, prefService, kCPrefServiceCID, &rv);
if (NS_SUCCEEDED(rv))
{
PRInt32 layout;
rv = prefService->GetIntPref("mail.pane_config", &layout);
if(NS_SUCCEEDED(rv))
{
if(layout == 0)
*aChromeUrlForTask = PL_strdup("chrome://messenger/content/");
else
*aChromeUrlForTask = PL_strdup("chrome://messenger/content/mail3PaneWindowVertLayout.xul");
return NS_OK;
}
}
*aChromeUrlForTask = PL_strdup("chrome://messenger/content/");
return NS_OK;
}

Просмотреть файл

@ -40,7 +40,24 @@
static NS_METHOD RegisterProc(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *registryLocation, const char *componentType); \
static NS_METHOD UnregisterProc(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *registryLocation);
#define CMDLINEHANDLER2_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,macro_chrome_url,macro_help_text, macro_progid, macro_pretty_name, macro_handles_args, macro_open_window_with_args) \
#define CMDLINEHANDLER_GETDEFAULTARGS_IMPL(macro_class,macro_default_args)\
NS_IMETHODIMP macro_class::GetDefaultArgs(PRUnichar **aDefaultArgs) \
{ \
if (!aDefaultArgs) return NS_ERROR_FAILURE; \
nsString args(macro_default_args); \
*aDefaultArgs = args.ToNewUnicode(); \
return NS_OK; \
}
#define CMDLINEHANDLER_GETCHROMEURL_IMPL(macro_class,macro_chrome_url)\
NS_IMETHODIMP macro_class::GetChromeUrlForTask(char **aChromeUrlForTask) \
{ \
if (!aChromeUrlForTask) return NS_ERROR_FAILURE; \
*aChromeUrlForTask = PL_strdup(macro_chrome_url); \
return NS_OK; \
}
#define CMDLINEHANDLER_OTHERS_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,macro_help_text, macro_progid, macro_pretty_name, macro_handles_args, macro_open_window_with_args)\
NS_IMETHODIMP macro_class::GetCommandLineArgument(char **aCommandLineArgument) \
{ \
if (!aCommandLineArgument) return NS_ERROR_FAILURE; \
@ -53,12 +70,6 @@ NS_IMETHODIMP macro_class::GetPrefNameForStartup(char **aPrefNameForStartup) \
*aPrefNameForStartup = PL_strdup(macro_pref_name); \
return NS_OK; \
} \
NS_IMETHODIMP macro_class::GetChromeUrlForTask(char **aChromeUrlForTask) \
{ \
if (!aChromeUrlForTask) return NS_ERROR_FAILURE; \
*aChromeUrlForTask = PL_strdup(macro_chrome_url); \
return NS_OK; \
} \
NS_IMETHODIMP macro_class::GetHelpText(char **aHelpText) \
{ \
if (!aHelpText) return NS_ERROR_FAILURE; \
@ -96,16 +107,20 @@ NS_METHOD macro_class::UnregisterProc(nsIComponentManager *aCompMgr, nsIFile *aP
return NS_OK; \
}
#define CMDLINEHANDLER2_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,macro_chrome_url,macro_help_text, macro_progid, macro_pretty_name, macro_handles_args, macro_open_window_with_args) \
CMDLINEHANDLER_OTHERS_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,macro_help_text, macro_progid, macro_pretty_name, macro_handles_args, macro_open_window_with_args)\
CMDLINEHANDLER_GETCHROMEURL_IMPL(macro_class,macro_chrome_url)
#define CMDLINEHANDLER_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,macro_chrome_url,macro_help_text, macro_progid, macro_pretty_name, macro_handles_args, macro_default_args, macro_open_window_with_args) \
NS_IMETHODIMP macro_class::GetDefaultArgs(PRUnichar **aDefaultArgs) \
{ \
if (!aDefaultArgs) return NS_ERROR_FAILURE; \
nsString args(macro_default_args); \
*aDefaultArgs = args.ToNewUnicode(); \
return NS_OK; \
} \
CMDLINEHANDLER_GETDEFAULTARGS_IMPL(macro_class,macro_default_args)\
CMDLINEHANDLER2_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,macro_chrome_url,macro_help_text, macro_progid, macro_pretty_name, macro_handles_args, macro_open_window_with_args)
//Creates a version without the GetChromeUrlForTaskFunction
#define CMDLINEHANDLER3_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,macro_help_text, macro_progid, macro_pretty_name, macro_handles_args, macro_default_args, macro_open_window_with_args)\
CMDLINEHANDLER_GETDEFAULTARGS_IMPL(macro_class,macro_default_args)\
CMDLINEHANDLER_OTHERS_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,macro_help_text, macro_progid, macro_pretty_name, macro_handles_args, macro_open_window_with_args)\
%}
[scriptable, uuid(ae12670a-1dd1-11b2-80cd-82ec93559deb)]

Просмотреть файл

@ -40,7 +40,24 @@
static NS_METHOD RegisterProc(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *registryLocation, const char *componentType); \
static NS_METHOD UnregisterProc(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *registryLocation);
#define CMDLINEHANDLER2_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,macro_chrome_url,macro_help_text, macro_progid, macro_pretty_name, macro_handles_args, macro_open_window_with_args) \
#define CMDLINEHANDLER_GETDEFAULTARGS_IMPL(macro_class,macro_default_args)\
NS_IMETHODIMP macro_class::GetDefaultArgs(PRUnichar **aDefaultArgs) \
{ \
if (!aDefaultArgs) return NS_ERROR_FAILURE; \
nsString args(macro_default_args); \
*aDefaultArgs = args.ToNewUnicode(); \
return NS_OK; \
}
#define CMDLINEHANDLER_GETCHROMEURL_IMPL(macro_class,macro_chrome_url)\
NS_IMETHODIMP macro_class::GetChromeUrlForTask(char **aChromeUrlForTask) \
{ \
if (!aChromeUrlForTask) return NS_ERROR_FAILURE; \
*aChromeUrlForTask = PL_strdup(macro_chrome_url); \
return NS_OK; \
}
#define CMDLINEHANDLER_OTHERS_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,macro_help_text, macro_progid, macro_pretty_name, macro_handles_args, macro_open_window_with_args)\
NS_IMETHODIMP macro_class::GetCommandLineArgument(char **aCommandLineArgument) \
{ \
if (!aCommandLineArgument) return NS_ERROR_FAILURE; \
@ -53,12 +70,6 @@ NS_IMETHODIMP macro_class::GetPrefNameForStartup(char **aPrefNameForStartup) \
*aPrefNameForStartup = PL_strdup(macro_pref_name); \
return NS_OK; \
} \
NS_IMETHODIMP macro_class::GetChromeUrlForTask(char **aChromeUrlForTask) \
{ \
if (!aChromeUrlForTask) return NS_ERROR_FAILURE; \
*aChromeUrlForTask = PL_strdup(macro_chrome_url); \
return NS_OK; \
} \
NS_IMETHODIMP macro_class::GetHelpText(char **aHelpText) \
{ \
if (!aHelpText) return NS_ERROR_FAILURE; \
@ -96,16 +107,20 @@ NS_METHOD macro_class::UnregisterProc(nsIComponentManager *aCompMgr, nsIFile *aP
return NS_OK; \
}
#define CMDLINEHANDLER2_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,macro_chrome_url,macro_help_text, macro_progid, macro_pretty_name, macro_handles_args, macro_open_window_with_args) \
CMDLINEHANDLER_OTHERS_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,macro_help_text, macro_progid, macro_pretty_name, macro_handles_args, macro_open_window_with_args)\
CMDLINEHANDLER_GETCHROMEURL_IMPL(macro_class,macro_chrome_url)
#define CMDLINEHANDLER_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,macro_chrome_url,macro_help_text, macro_progid, macro_pretty_name, macro_handles_args, macro_default_args, macro_open_window_with_args) \
NS_IMETHODIMP macro_class::GetDefaultArgs(PRUnichar **aDefaultArgs) \
{ \
if (!aDefaultArgs) return NS_ERROR_FAILURE; \
nsString args(macro_default_args); \
*aDefaultArgs = args.ToNewUnicode(); \
return NS_OK; \
} \
CMDLINEHANDLER_GETDEFAULTARGS_IMPL(macro_class,macro_default_args)\
CMDLINEHANDLER2_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,macro_chrome_url,macro_help_text, macro_progid, macro_pretty_name, macro_handles_args, macro_open_window_with_args)
//Creates a version without the GetChromeUrlForTaskFunction
#define CMDLINEHANDLER3_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,macro_help_text, macro_progid, macro_pretty_name, macro_handles_args, macro_default_args, macro_open_window_with_args)\
CMDLINEHANDLER_GETDEFAULTARGS_IMPL(macro_class,macro_default_args)\
CMDLINEHANDLER_OTHERS_IMPL(macro_class,macro_cmd_line_arg,macro_pref_name,macro_help_text, macro_progid, macro_pretty_name, macro_handles_args, macro_open_window_with_args)\
%}
[scriptable, uuid(ae12670a-1dd1-11b2-80cd-82ec93559deb)]

Просмотреть файл

@ -6,7 +6,18 @@ function toNavigator()
function toMessengerWindow()
{
toOpenWindowByType("mail:3pane", "chrome://messenger/content/");
try{
var layoutType = pref.GetIntPref("mail.pane_config");
if(layoutType == 0)
toOpenWindowByType("mail:3pane", "chrome://messenger/content/");
else
toOpenWindowByType("mail:3pane", "chrome://messenger/content/mail3PaneWindowVertLayout.xul");
}
catch(ex)
{
toOpenWindowByType("mail:3pane", "chrome://messenger/content/");
}
}