2000-04-11 20:19:32 +00:00
|
|
|
|
/* -*- 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/
|
2001-03-22 00:59:29 +00:00
|
|
|
|
*
|
2000-04-11 20:19:32 +00:00
|
|
|
|
* 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.
|
2001-03-22 00:59:29 +00:00
|
|
|
|
*
|
2000-04-11 20:19:32 +00:00
|
|
|
|
* The Original Code is Mozilla Communicator client code, released
|
|
|
|
|
* March 31, 1998.
|
2001-03-22 00:59:29 +00:00
|
|
|
|
*
|
2000-04-11 20:19:32 +00:00
|
|
|
|
* 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.
|
2000-09-15 06:17:48 +00:00
|
|
|
|
*
|
|
|
|
|
* Contributors: timeless
|
2001-01-19 21:41:12 +00:00
|
|
|
|
* slucy@objectivesw.co.uk
|
2001-03-28 06:37:54 +00:00
|
|
|
|
* H<EFBFBD>kan Waara <hwaara@chello.se>
|
2000-04-11 20:19:32 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2001-02-22 23:32:13 +00:00
|
|
|
|
var gMessengerBundle;
|
2001-05-17 05:06:01 +00:00
|
|
|
|
var nsPrefBranch = null;
|
|
|
|
|
|
|
|
|
|
// Disable the new account menu item if the account preference is locked.
|
|
|
|
|
// Two other affected areas are the account central and the account manager
|
|
|
|
|
// dialog.
|
|
|
|
|
function menu_new_init()
|
|
|
|
|
{
|
|
|
|
|
if (!nsPrefBranch) {
|
|
|
|
|
var prefService = Components.classes["@mozilla.org/preferences-service;1"];
|
|
|
|
|
prefService = prefService.getService();
|
|
|
|
|
prefService = prefService.QueryInterface(Components.interfaces.nsIPrefService);
|
|
|
|
|
|
|
|
|
|
nsPrefBranch = prefService.getBranch(null);
|
|
|
|
|
}
|
|
|
|
|
var newAccountItem = document.getElementById('newAccountMenuItem');
|
|
|
|
|
if (nsPrefBranch.prefIsLocked("mail.accountmanager.accounts"))
|
|
|
|
|
newAccountItem.setAttribute("disabled","true");
|
|
|
|
|
}
|
2001-02-22 23:32:13 +00:00
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
function goUpdateMailMenuItems(commandset)
|
|
|
|
|
{
|
|
|
|
|
// dump("Updating commands for " + commandset.id + "\n");
|
2001-03-22 00:59:29 +00:00
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
for (var i = 0; i < commandset.childNodes.length; i++)
|
|
|
|
|
{
|
|
|
|
|
var commandID = commandset.childNodes[i].getAttribute("id");
|
|
|
|
|
if (commandID)
|
|
|
|
|
{
|
|
|
|
|
goUpdateCommand(commandID);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-15 06:17:48 +00:00
|
|
|
|
function file_init()
|
|
|
|
|
{
|
2001-02-22 23:32:13 +00:00
|
|
|
|
if (!gMessengerBundle)
|
|
|
|
|
gMessengerBundle = document.getElementById("bundle_messenger");
|
2000-09-15 06:17:48 +00:00
|
|
|
|
file_attachments();
|
|
|
|
|
/* file_attachments() can return false to indicate a load failure,
|
|
|
|
|
but if you return false to oncreate then
|
|
|
|
|
the popup menu will not display which is not a good thing.
|
|
|
|
|
*/
|
2001-03-17 01:59:34 +00:00
|
|
|
|
|
|
|
|
|
document.commandDispatcher.updateCommands('create-menu-file');
|
2000-09-15 06:17:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function file_attachments()
|
|
|
|
|
{
|
2001-05-05 07:40:24 +00:00
|
|
|
|
var numAttachments = GetNumberOfAttachmentsForDisplayedMessage();
|
|
|
|
|
var amParent=document.getElementById('fileAttachmentMenu');
|
|
|
|
|
if (!amParent)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
// hide the attachment menu item if the message does not have any messages..
|
|
|
|
|
if (numAttachments > 0)
|
|
|
|
|
{
|
|
|
|
|
amParent.removeAttribute('hidden');
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
amParent.setAttribute('hidden',true);
|
|
|
|
|
return true;
|
2000-09-15 06:17:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
function InitEditMessagesMenu()
|
|
|
|
|
{
|
|
|
|
|
document.commandDispatcher.updateCommands('create-menu-edit');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function InitSearchMessagesMenu()
|
|
|
|
|
{
|
|
|
|
|
document.commandDispatcher.updateCommands('create-menu-search');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function InitGoMessagesMenu()
|
|
|
|
|
{
|
|
|
|
|
document.commandDispatcher.updateCommands('create-menu-go');
|
|
|
|
|
}
|
|
|
|
|
|
2000-07-13 05:18:17 +00:00
|
|
|
|
function view_init()
|
|
|
|
|
{
|
2001-03-17 01:59:34 +00:00
|
|
|
|
if (!gMessengerBundle)
|
|
|
|
|
gMessengerBundle = document.getElementById("bundle_messenger");
|
|
|
|
|
var message_menuitem=document.getElementById('menu_showMessage');
|
2000-08-08 04:46:42 +00:00
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
if (message_menuitem)
|
|
|
|
|
{
|
|
|
|
|
var message_menuitem_hidden = message_menuitem.getAttribute("hidden");
|
|
|
|
|
if(message_menuitem_hidden != "true"){
|
|
|
|
|
message_menuitem.setAttribute('checked',!IsThreadAndMessagePaneSplitterCollapsed());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
var threadColumn = document.getElementById('ThreadColumnHeader');
|
|
|
|
|
var thread_menuitem=document.getElementById('menu_showThreads');
|
|
|
|
|
if (threadColumn && thread_menuitem){
|
|
|
|
|
thread_menuitem.setAttribute('checked',threadColumn.getAttribute('currentView')=='threaded');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
document.commandDispatcher.updateCommands('create-menu-view');
|
2000-07-13 05:18:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-03-23 04:39:54 +00:00
|
|
|
|
function setSortByMenuItemCheckState(id, value)
|
|
|
|
|
{
|
|
|
|
|
var menuitem = document.getElementById(id);
|
|
|
|
|
if (menuitem) {
|
|
|
|
|
menuitem.setAttribute("checked", value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function InitViewSortByMenu()
|
2000-08-21 20:00:48 +00:00
|
|
|
|
{
|
2001-03-23 04:39:54 +00:00
|
|
|
|
var sortType = gDBView.sortType;
|
|
|
|
|
|
|
|
|
|
setSortByMenuItemCheckState("sortByDateMenuitem", (sortType == nsMsgViewSortType.byDate));
|
|
|
|
|
setSortByMenuItemCheckState("sortByFlagMenuitem", (sortType == nsMsgViewSortType.byFlagged));
|
|
|
|
|
setSortByMenuItemCheckState("sortByOrderReceivedMenuitem", (sortType == nsMsgViewSortType.byId));
|
|
|
|
|
setSortByMenuItemCheckState("sortByPriorityMenuitem", (sortType == nsMsgViewSortType.byPriority));
|
|
|
|
|
setSortByMenuItemCheckState("sortBySizeMenuitem", (sortType == nsMsgViewSortType.bySize));
|
|
|
|
|
setSortByMenuItemCheckState("sortByStatusMenuitem", (sortType == nsMsgViewSortType.byStatus));
|
|
|
|
|
setSortByMenuItemCheckState("sortBySubjectMenuitem", (sortType == nsMsgViewSortType.bySubject));
|
2001-03-24 01:12:33 +00:00
|
|
|
|
setSortByMenuItemCheckState("sortByThreadMenuitem", (sortType == nsMsgViewSortType.byThread));
|
2001-03-23 04:39:54 +00:00
|
|
|
|
setSortByMenuItemCheckState("sortByUnreadMenuitem", (sortType == nsMsgViewSortType.byUnread));
|
2001-04-11 23:03:04 +00:00
|
|
|
|
|
|
|
|
|
// the Sender / Recipient menu is dynamic
|
|
|
|
|
setSortByMenuItemCheckState("sortBySenderOrRecipientMenuitem", (sortType == nsMsgViewSortType.byAuthor) || (sortType == nsMsgViewSortType.byRecipient));
|
|
|
|
|
var senderOrRecipientMenuitem = document.getElementById("sortBySenderOrRecipientMenuitem");
|
|
|
|
|
if (senderOrRecipientMenuitem) {
|
|
|
|
|
var currentFolder = gDBView.msgFolder;
|
|
|
|
|
if (IsSpecialFolder(currentFolder, MSG_FOLDER_FLAG_SENTMAIL | MSG_FOLDER_FLAG_DRAFTS | MSG_FOLDER_FLAG_QUEUE)) {
|
|
|
|
|
senderOrRecipientMenuitem.setAttribute('label',gMessengerBundle.getString('recipientColumnHeader'));
|
|
|
|
|
senderOrRecipientMenuitem.setAttribute('accesskey',gMessengerBundle.getString('recipientAccessKey'));
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
senderOrRecipientMenuitem.setAttribute('label',gMessengerBundle.getString('senderColumnHeader'));
|
|
|
|
|
senderOrRecipientMenuitem.setAttribute('accesskey',gMessengerBundle.getString('senderAccessKey'));
|
|
|
|
|
}
|
|
|
|
|
}
|
2001-03-23 04:39:54 +00:00
|
|
|
|
var sortOrder = gDBView.sortOrder;
|
|
|
|
|
|
|
|
|
|
setSortByMenuItemCheckState("sortAscending", (sortOrder == nsMsgViewSortOrder.ascending));
|
|
|
|
|
setSortByMenuItemCheckState("sortDescending", (sortOrder == nsMsgViewSortOrder.descending));
|
|
|
|
|
}
|
2001-03-17 01:59:34 +00:00
|
|
|
|
|
2001-03-23 04:39:54 +00:00
|
|
|
|
function InitViewMessagesMenu()
|
|
|
|
|
{
|
2001-03-17 01:59:34 +00:00
|
|
|
|
var allMenuItem = document.getElementById("viewAllMessagesMenuItem");
|
|
|
|
|
var viewFlags = gDBView.viewFlags;
|
|
|
|
|
var viewType = gDBView.viewType;
|
|
|
|
|
|
|
|
|
|
if(allMenuItem)
|
|
|
|
|
allMenuItem.setAttribute("checked", (viewFlags & nsMsgViewFlagsType.kUnreadOnly) == 0 && (viewType == nsMsgViewType.eShowAllThreads));
|
2000-08-21 20:00:48 +00:00
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
var unreadMenuItem = document.getElementById("viewUnreadMessagesMenuItem");
|
|
|
|
|
if(unreadMenuItem)
|
|
|
|
|
unreadMenuItem.setAttribute("checked", (viewFlags & nsMsgViewFlagsType.kUnreadOnly) != 0);
|
2000-08-21 20:00:48 +00:00
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
var theadedMenuItem = document.getElementById("menu_showThreads");
|
|
|
|
|
if (theadedMenuItem)
|
|
|
|
|
theadedMenuItem.setAttribute("checked", (viewFlags & nsMsgViewFlagsType.kThreadedDisplay) != 0);
|
|
|
|
|
document.commandDispatcher.updateCommands('create-menu-view');
|
|
|
|
|
|
|
|
|
|
var theadsWithUnreadMenuItem = document.getElementById("viewThreadsWithUnreadMenuItem");
|
|
|
|
|
if(theadsWithUnreadMenuItem)
|
|
|
|
|
theadsWithUnreadMenuItem.setAttribute("checked", viewType == nsMsgViewType.eShowThreadsWithUnread);
|
|
|
|
|
|
|
|
|
|
var watchedTheadsWithUnreadMenuItem = document.getElementById("viewWatchedThreadsWithUnreadMenuItem");
|
|
|
|
|
if(watchedTheadsWithUnreadMenuItem)
|
|
|
|
|
watchedTheadsWithUnreadMenuItem.setAttribute("checked", viewType == nsMsgViewType.eShowWatchedThreadsWithUnread);
|
2001-05-04 00:08:23 +00:00
|
|
|
|
var ignoredTheadsMenuItem = document.getElementById("viewIgnoredThreadsMenuItem");
|
|
|
|
|
if(ignoredTheadsMenuItem)
|
|
|
|
|
ignoredTheadsMenuItem.setAttribute("checked", (viewFlags & nsMsgViewFlagsType.kShowIgnored) != 0);
|
2000-08-21 20:00:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function InitMessageMenu()
|
|
|
|
|
{
|
2001-03-17 01:59:34 +00:00
|
|
|
|
var aMessage = GetFirstSelectedMessage();
|
|
|
|
|
var isNews = false;
|
|
|
|
|
if(aMessage) {
|
|
|
|
|
isNews = IsNewsMessage(aMessage);
|
|
|
|
|
}
|
2000-08-21 20:00:48 +00:00
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
//We show reply to Newsgroups only for news messages.
|
|
|
|
|
var replyNewsgroupMenuItem = document.getElementById("replyNewsgroupMainMenu");
|
|
|
|
|
if(replyNewsgroupMenuItem)
|
|
|
|
|
{
|
|
|
|
|
replyNewsgroupMenuItem.setAttribute("hidden", isNews ? "" : "true");
|
|
|
|
|
}
|
2000-08-21 20:00:48 +00:00
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
//For mail messages we say reply. For news we say ReplyToSender.
|
|
|
|
|
var replyMenuItem = document.getElementById("replyMainMenu");
|
|
|
|
|
if(replyMenuItem)
|
|
|
|
|
{
|
|
|
|
|
replyMenuItem.setAttribute("hidden", !isNews ? "" : "true");
|
|
|
|
|
}
|
2000-08-21 20:00:48 +00:00
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
var replySenderMenuItem = document.getElementById("replySenderMainMenu");
|
|
|
|
|
if(replySenderMenuItem)
|
|
|
|
|
{
|
|
|
|
|
replySenderMenuItem.setAttribute("hidden", isNews ? "" : "true");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// we only kill and watch threads for news
|
|
|
|
|
var killThreadMenuItem = document.getElementById("killThread");
|
|
|
|
|
if (killThreadMenuItem) {
|
|
|
|
|
killThreadMenuItem.setAttribute("hidden", isNews ? "" : "true");
|
|
|
|
|
}
|
|
|
|
|
var watchThreadMenuItem = document.getElementById("watchThread");
|
|
|
|
|
if (watchThreadMenuItem) {
|
|
|
|
|
watchThreadMenuItem.setAttribute("hidden", isNews ? "" : "true");
|
|
|
|
|
}
|
2000-08-21 20:00:48 +00:00
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
//disable the move and copy menus only if there are no messages selected.
|
|
|
|
|
var moveMenu = document.getElementById("moveMenu");
|
|
|
|
|
if(moveMenu)
|
|
|
|
|
moveMenu.setAttribute("disabled", !aMessage);
|
2000-08-26 20:54:51 +00:00
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
var copyMenu = document.getElementById("copyMenu");
|
|
|
|
|
if(copyMenu)
|
|
|
|
|
copyMenu.setAttribute("disabled", !aMessage);
|
|
|
|
|
|
|
|
|
|
document.commandDispatcher.updateCommands('create-menu-message');
|
2000-08-21 20:00:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
function IsNewsMessage(messageUri)
|
2000-08-21 20:00:48 +00:00
|
|
|
|
{
|
2001-03-17 01:59:34 +00:00
|
|
|
|
if (!messageUri) return false;
|
|
|
|
|
return (messageUri.substring(0,14) == "news_message:/")
|
2000-08-21 20:00:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-04 00:57:58 +00:00
|
|
|
|
function InitMessageMark()
|
2000-08-21 20:00:48 +00:00
|
|
|
|
{
|
2001-01-04 00:57:58 +00:00
|
|
|
|
InitMarkReadItem("markReadMenuItem");
|
|
|
|
|
InitMarkReadItem("markReadToolbarItem");
|
|
|
|
|
InitMarkFlaggedItem("markFlaggedMenuItem");
|
|
|
|
|
InitMarkFlaggedItem("markFlaggedToolbarItem");
|
2001-05-07 07:58:44 +00:00
|
|
|
|
document.commandDispatcher.updateCommands('create-menu-mark');
|
2000-08-21 20:00:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-04 00:57:58 +00:00
|
|
|
|
function InitMarkReadItem(id)
|
2000-08-21 20:00:48 +00:00
|
|
|
|
{
|
2001-01-04 00:57:58 +00:00
|
|
|
|
var areMessagesRead = SelectedMessagesAreRead();
|
|
|
|
|
var item = document.getElementById(id);
|
|
|
|
|
if(item)
|
|
|
|
|
item.setAttribute("checked", areMessagesRead);
|
|
|
|
|
}
|
2000-08-26 20:54:51 +00:00
|
|
|
|
|
2001-01-04 00:57:58 +00:00
|
|
|
|
function InitMarkFlaggedItem(id)
|
|
|
|
|
{
|
|
|
|
|
var areMessagesFlagged = SelectedMessagesAreFlagged();
|
|
|
|
|
var item = document.getElementById(id);
|
|
|
|
|
if(item)
|
|
|
|
|
item.setAttribute("checked", areMessagesFlagged);
|
2000-08-26 20:54:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function SelectedMessagesAreRead()
|
|
|
|
|
{
|
2001-03-17 01:59:34 +00:00
|
|
|
|
var isRead;
|
|
|
|
|
try {
|
|
|
|
|
isRead = gDBView.hdrForFirstSelectedMessage.isRead;
|
2000-09-15 06:17:48 +00:00
|
|
|
|
}
|
2001-03-17 01:59:34 +00:00
|
|
|
|
catch (ex) {
|
|
|
|
|
isRead = false;
|
|
|
|
|
}
|
|
|
|
|
return isRead;
|
2000-08-21 20:00:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-08-26 20:54:51 +00:00
|
|
|
|
function SelectedMessagesAreFlagged()
|
|
|
|
|
{
|
2001-03-17 01:59:34 +00:00
|
|
|
|
var isFlagged;
|
|
|
|
|
try {
|
|
|
|
|
isFlagged = gDBView.hdrForFirstSelectedMessage.isFlagged;
|
2000-09-15 06:17:48 +00:00
|
|
|
|
}
|
2001-03-17 01:59:34 +00:00
|
|
|
|
catch (ex) {
|
|
|
|
|
isFlagged = false;
|
|
|
|
|
}
|
|
|
|
|
return isFlagged;
|
2000-08-21 20:00:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-05-07 07:58:44 +00:00
|
|
|
|
function getMsgToolbarMenu_init()
|
|
|
|
|
{
|
|
|
|
|
document.commandDispatcher.updateCommands('create-menu-getMsgToolbar');
|
|
|
|
|
}
|
|
|
|
|
|
2000-04-14 14:07:23 +00:00
|
|
|
|
function GetFirstSelectedMsgFolder()
|
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var result = null;
|
|
|
|
|
var selectedFolders = GetSelectedMsgFolders();
|
|
|
|
|
if (selectedFolders.length > 0) {
|
|
|
|
|
result = selectedFolders[0];
|
|
|
|
|
}
|
2000-04-14 14:07:23 +00:00
|
|
|
|
|
2000-09-15 06:17:48 +00:00
|
|
|
|
return result;
|
2000-04-14 14:07:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-23 21:54:34 +00:00
|
|
|
|
function GetInboxFolder(server)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
var rootFolder = server.RootFolder;
|
|
|
|
|
var rootMsgFolder = rootFolder.QueryInterface(Components.interfaces.nsIMsgFolder);
|
|
|
|
|
|
|
|
|
|
//now find Inbox
|
|
|
|
|
var outNumFolders = new Object();
|
|
|
|
|
var inboxFolder = rootMsgFolder.getFoldersWithFlag(0x1000, 1, outNumFolders);
|
|
|
|
|
|
|
|
|
|
return inboxFolder.QueryInterface(Components.interfaces.nsIMsgFolder);
|
|
|
|
|
}
|
|
|
|
|
catch (ex) {
|
|
|
|
|
dump(ex + "\n");
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function GetMessagesForInboxOnServer(server)
|
|
|
|
|
{
|
|
|
|
|
var inboxFolder = GetInboxFolder(server);
|
|
|
|
|
if (!inboxFolder) return;
|
|
|
|
|
|
|
|
|
|
var folders = new Array(1);
|
|
|
|
|
folders[0] = inboxFolder;
|
|
|
|
|
|
|
|
|
|
var compositeDataSource = GetCompositeDataSource("GetNewMessages");
|
|
|
|
|
GetNewMessages(folders, compositeDataSource);
|
|
|
|
|
}
|
|
|
|
|
|
2001-03-22 00:59:29 +00:00
|
|
|
|
function MsgGetMessage()
|
2000-04-11 20:19:32 +00:00
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var folders = GetSelectedMsgFolders();
|
|
|
|
|
var compositeDataSource = GetCompositeDataSource("GetNewMessages");
|
|
|
|
|
GetNewMessages(folders, compositeDataSource);
|
2000-04-11 20:19:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-23 21:54:34 +00:00
|
|
|
|
function MsgGetMessagesForAllServers(defaultServer)
|
|
|
|
|
{
|
|
|
|
|
// now log into any server
|
2001-03-22 00:59:29 +00:00
|
|
|
|
try
|
2001-01-23 21:54:34 +00:00
|
|
|
|
{
|
|
|
|
|
var allServers = accountManager.allServers;
|
2001-03-22 00:59:29 +00:00
|
|
|
|
|
|
|
|
|
for (var i=0;i<allServers.Count();i++)
|
2001-01-23 21:54:34 +00:00
|
|
|
|
{
|
2001-02-23 02:42:31 +00:00
|
|
|
|
var currentServer = allServers.GetElementAt(i).QueryInterface(Components.interfaces.nsIMsgIncomingServer);
|
2001-01-23 21:54:34 +00:00
|
|
|
|
var protocolinfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + currentServer.type].getService(Components.interfaces.nsIMsgProtocolInfo);
|
2001-03-22 00:59:29 +00:00
|
|
|
|
if (protocolinfo.canLoginAtStartUp && currentServer.loginAtStartUp)
|
2001-01-23 21:54:34 +00:00
|
|
|
|
{
|
2001-03-22 00:59:29 +00:00
|
|
|
|
if (defaultServer && defaultServer.equals(currentServer))
|
2001-01-23 21:54:34 +00:00
|
|
|
|
{
|
|
|
|
|
dump(currentServer.serverURI + "...skipping, already opened\n");
|
|
|
|
|
}
|
2001-03-22 00:59:29 +00:00
|
|
|
|
else
|
2001-01-23 21:54:34 +00:00
|
|
|
|
{
|
2001-02-23 02:42:31 +00:00
|
|
|
|
// Check to see if there are new messages on the server
|
|
|
|
|
currentServer.PerformBiff();
|
2001-01-23 21:54:34 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2001-03-22 00:59:29 +00:00
|
|
|
|
catch(ex)
|
2001-01-23 21:54:34 +00:00
|
|
|
|
{
|
|
|
|
|
dump(ex + "\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-03-22 00:59:29 +00:00
|
|
|
|
/**
|
2001-02-07 07:37:04 +00:00
|
|
|
|
* Get messages for all those accounts which have the capability
|
|
|
|
|
* of getting messages and have session password available i.e.,
|
2001-03-22 00:59:29 +00:00
|
|
|
|
* curretnly logged in accounts.
|
|
|
|
|
*/
|
2001-02-07 07:37:04 +00:00
|
|
|
|
function MsgGetMessagesForAllAuthenticatedAccounts()
|
|
|
|
|
{
|
2001-03-22 00:59:29 +00:00
|
|
|
|
try
|
2001-02-07 07:37:04 +00:00
|
|
|
|
{
|
|
|
|
|
var allServers = accountManager.allServers;
|
2001-03-22 00:59:29 +00:00
|
|
|
|
|
|
|
|
|
for (var i=0;i<allServers.Count();i++)
|
2001-02-07 07:37:04 +00:00
|
|
|
|
{
|
|
|
|
|
var currentServer = allServers.GetElementAt(i).QueryInterface(Components.interfaces.nsIMsgIncomingServer);
|
2001-03-22 00:59:29 +00:00
|
|
|
|
var protocolinfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" +
|
2001-02-07 07:37:04 +00:00
|
|
|
|
currentServer.type].getService(Components.interfaces.nsIMsgProtocolInfo);
|
2001-03-22 00:59:29 +00:00
|
|
|
|
if (protocolinfo.canGetMessages && currentServer.password)
|
2001-02-07 07:37:04 +00:00
|
|
|
|
{
|
|
|
|
|
// Get new messages now
|
|
|
|
|
GetMessagesForInboxOnServer(currentServer);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2001-03-22 00:59:29 +00:00
|
|
|
|
catch(ex)
|
2001-02-07 07:37:04 +00:00
|
|
|
|
{
|
|
|
|
|
dump(ex + "\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-03-22 00:59:29 +00:00
|
|
|
|
/**
|
2001-02-07 07:37:04 +00:00
|
|
|
|
* Get messages for the account selected from Menu dropdowns.
|
2001-03-22 00:59:29 +00:00
|
|
|
|
*/
|
2001-02-07 07:37:04 +00:00
|
|
|
|
function MsgGetMessagesForAccount(aEvent)
|
|
|
|
|
{
|
|
|
|
|
if (!aEvent)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var uri = aEvent.target.id;
|
|
|
|
|
var server = GetServer(uri);
|
|
|
|
|
GetMessagesForInboxOnServer(server);
|
|
|
|
|
aEvent.preventBubble();
|
|
|
|
|
}
|
|
|
|
|
|
2000-08-30 23:22:22 +00:00
|
|
|
|
function MsgGetNextNMessages()
|
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var folder = GetFirstSelectedMsgFolder();
|
|
|
|
|
if(folder)
|
|
|
|
|
{
|
|
|
|
|
GetNextNMessages(folder)
|
|
|
|
|
}
|
2000-08-30 23:22:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-04-20 05:30:32 +00:00
|
|
|
|
function MsgDeleteMessage(reallyDelete, fromToolbar)
|
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var srcFolder = GetLoadedMsgFolder();
|
|
|
|
|
// if from the toolbar, return right away if this is a news message
|
|
|
|
|
// only allow cancel from the menu: "Edit | Cancel / Delete Message"
|
|
|
|
|
if (fromToolbar)
|
|
|
|
|
{
|
|
|
|
|
var folderResource = srcFolder.QueryInterface(Components.interfaces.nsIRDFResource);
|
|
|
|
|
var uri = folderResource.Value;
|
2001-03-17 01:59:34 +00:00
|
|
|
|
if (isNewsURI(uri)) {
|
|
|
|
|
// if news, don't delete
|
2000-09-15 06:17:48 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var compositeDataSource = GetCompositeDataSource("DeleteMessages");
|
|
|
|
|
var messages = GetSelectedMessages();
|
|
|
|
|
|
2001-01-30 22:02:27 +00:00
|
|
|
|
SetNextMessageAfterDelete();
|
2001-03-17 01:59:34 +00:00
|
|
|
|
if (reallyDelete) {
|
|
|
|
|
gDBView.doCommand(nsMsgViewCommandType.deleteNoTrash);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
gDBView.doCommand(nsMsgViewCommandType.deleteMsg);
|
|
|
|
|
}
|
2000-04-20 05:30:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-04-11 20:19:32 +00:00
|
|
|
|
function MsgCopyMessage(destFolder)
|
|
|
|
|
{
|
2001-03-17 01:59:34 +00:00
|
|
|
|
try {
|
|
|
|
|
// get the msg folder we're copying messages into
|
2001-03-28 06:37:54 +00:00
|
|
|
|
var destUri = destFolder.getAttribute('id');
|
|
|
|
|
var destResource = RDF.GetResource(destUri);
|
|
|
|
|
var destMsgFolder = destResource.QueryInterface(Components.interfaces.nsIMsgFolder);
|
2001-03-17 01:59:34 +00:00
|
|
|
|
gDBView.doCommandWithFolder(nsMsgViewCommandType.copyMessages, destMsgFolder);
|
|
|
|
|
}
|
|
|
|
|
catch (ex) {
|
|
|
|
|
dump("MsgCopyMessage failed: " + ex + "\n");
|
|
|
|
|
}
|
2000-04-11 20:19:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-04-20 05:30:32 +00:00
|
|
|
|
function MsgMoveMessage(destFolder)
|
|
|
|
|
{
|
2001-03-17 01:59:34 +00:00
|
|
|
|
try {
|
|
|
|
|
// get the msg folder we're moving messages into
|
2001-03-28 06:37:54 +00:00
|
|
|
|
var destUri = destFolder.getAttribute('id');
|
|
|
|
|
var destResource = RDF.GetResource(destUri);
|
|
|
|
|
var destMsgFolder = destResource.QueryInterface(Components.interfaces.nsIMsgFolder);
|
2001-03-17 01:59:34 +00:00
|
|
|
|
// we don't move news messages, we copy them
|
2001-06-14 01:23:27 +00:00
|
|
|
|
if (isNewsURI(gDBView.msgFolder.URI)) {
|
2001-03-17 01:59:34 +00:00
|
|
|
|
gDBView.doCommandWithFolder(nsMsgViewCommandType.copyMessages, destMsgFolder);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
SetNextMessageAfterDelete();
|
|
|
|
|
gDBView.doCommandWithFolder(nsMsgViewCommandType.moveMessages, destMsgFolder);
|
2001-03-22 00:59:29 +00:00
|
|
|
|
}
|
2001-03-17 01:59:34 +00:00
|
|
|
|
}
|
|
|
|
|
catch (ex) {
|
|
|
|
|
dump("MsgMoveMessage failed: " + ex + "\n");
|
2001-03-22 00:59:29 +00:00
|
|
|
|
}
|
2000-04-20 05:30:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-04-11 20:19:32 +00:00
|
|
|
|
function MsgNewMessage(event)
|
|
|
|
|
{
|
2000-04-14 14:07:23 +00:00
|
|
|
|
var loadedFolder = GetFirstSelectedMsgFolder();
|
2000-04-11 20:19:32 +00:00
|
|
|
|
var messageArray = GetSelectedMessages();
|
|
|
|
|
|
2000-07-05 22:06:34 +00:00
|
|
|
|
if (event && event.shiftKey)
|
2000-04-11 20:19:32 +00:00
|
|
|
|
ComposeMessage(msgComposeType.New, msgComposeFormat.OppositeOfDefault, loadedFolder, messageArray);
|
|
|
|
|
else
|
|
|
|
|
ComposeMessage(msgComposeType.New, msgComposeFormat.Default, loadedFolder, messageArray);
|
2001-03-22 00:59:29 +00:00
|
|
|
|
}
|
2000-04-11 20:19:32 +00:00
|
|
|
|
|
|
|
|
|
function MsgReplyMessage(event)
|
2000-08-21 20:00:48 +00:00
|
|
|
|
{
|
|
|
|
|
var loadedFolder = GetLoadedMsgFolder();
|
|
|
|
|
var server = loadedFolder.server;
|
|
|
|
|
|
|
|
|
|
if(server && server.type == "nntp")
|
2000-09-15 06:17:48 +00:00
|
|
|
|
MsgReplyGroup(event);
|
2001-03-22 00:59:29 +00:00
|
|
|
|
else
|
2000-09-15 06:17:48 +00:00
|
|
|
|
MsgReplySender(event);
|
2000-08-21 20:00:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function MsgReplySender(event)
|
2000-04-11 20:19:32 +00:00
|
|
|
|
{
|
|
|
|
|
var loadedFolder = GetLoadedMsgFolder();
|
|
|
|
|
var messageArray = GetSelectedMessages();
|
|
|
|
|
|
2000-05-08 22:04:10 +00:00
|
|
|
|
if (event && event.shiftKey)
|
2001-01-31 23:00:18 +00:00
|
|
|
|
ComposeMessage(msgComposeType.ReplyToSender, msgComposeFormat.OppositeOfDefault, loadedFolder, messageArray);
|
2000-04-11 20:19:32 +00:00
|
|
|
|
else
|
2001-01-31 23:00:18 +00:00
|
|
|
|
ComposeMessage(msgComposeType.ReplyToSender, msgComposeFormat.Default, loadedFolder, messageArray);
|
2000-08-21 20:00:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function MsgReplyGroup(event)
|
|
|
|
|
{
|
|
|
|
|
var loadedFolder = GetLoadedMsgFolder();
|
|
|
|
|
var messageArray = GetSelectedMessages();
|
|
|
|
|
|
|
|
|
|
if (event && event.shiftKey)
|
|
|
|
|
ComposeMessage(msgComposeType.ReplyToGroup, msgComposeFormat.OppositeOfDefault, loadedFolder, messageArray);
|
|
|
|
|
else
|
|
|
|
|
ComposeMessage(msgComposeType.ReplyToGroup, msgComposeFormat.Default, loadedFolder, messageArray);
|
2000-04-11 20:19:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-03-22 00:59:29 +00:00
|
|
|
|
function MsgReplyToAllMessage(event)
|
2000-04-11 20:19:32 +00:00
|
|
|
|
{
|
|
|
|
|
var loadedFolder = GetLoadedMsgFolder();
|
|
|
|
|
var messageArray = GetSelectedMessages();
|
|
|
|
|
|
2000-05-08 22:04:10 +00:00
|
|
|
|
if (event && event.shiftKey)
|
2000-04-11 20:19:32 +00:00
|
|
|
|
ComposeMessage(msgComposeType.ReplyAll, msgComposeFormat.OppositeOfDefault, loadedFolder, messageArray);
|
|
|
|
|
else
|
|
|
|
|
ComposeMessage(msgComposeType.ReplyAll, msgComposeFormat.Default, loadedFolder, messageArray);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function MsgForwardMessage(event)
|
|
|
|
|
{
|
|
|
|
|
var forwardType = 0;
|
|
|
|
|
try {
|
2000-09-15 06:17:48 +00:00
|
|
|
|
forwardType = pref.GetIntPref("mail.forward_message_mode");
|
2000-04-11 20:19:32 +00:00
|
|
|
|
} catch (e) {dump ("failed to retrieve pref mail.forward_message_mode");}
|
2001-03-22 00:59:29 +00:00
|
|
|
|
|
2001-04-06 03:53:42 +00:00
|
|
|
|
// mail.forward_message_mode could be 1, if the user migrated from 4.x
|
|
|
|
|
// 1 (forward as quoted) is obsolete, so we treat is as forward inline
|
|
|
|
|
// since that is more like forward as quoted then forward as attachment
|
2000-04-11 20:19:32 +00:00
|
|
|
|
if (forwardType == 0)
|
2000-09-15 06:17:48 +00:00
|
|
|
|
MsgForwardAsAttachment(event);
|
2000-04-11 20:19:32 +00:00
|
|
|
|
else
|
2000-09-15 06:17:48 +00:00
|
|
|
|
MsgForwardAsInline(event);
|
2000-04-11 20:19:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function MsgForwardAsAttachment(event)
|
|
|
|
|
{
|
|
|
|
|
var loadedFolder = GetLoadedMsgFolder();
|
|
|
|
|
var messageArray = GetSelectedMessages();
|
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
//dump("\nMsgForwardAsAttachment from XUL\n");
|
2000-05-08 22:04:10 +00:00
|
|
|
|
if (event && event.shiftKey)
|
2000-04-11 20:19:32 +00:00
|
|
|
|
ComposeMessage(msgComposeType.ForwardAsAttachment,
|
|
|
|
|
msgComposeFormat.OppositeOfDefault, loadedFolder, messageArray);
|
|
|
|
|
else
|
|
|
|
|
ComposeMessage(msgComposeType.ForwardAsAttachment, msgComposeFormat.Default, loadedFolder, messageArray);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function MsgForwardAsInline(event)
|
|
|
|
|
{
|
|
|
|
|
var loadedFolder = GetLoadedMsgFolder();
|
|
|
|
|
var messageArray = GetSelectedMessages();
|
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
//dump("\nMsgForwardAsInline from XUL\n");
|
2000-05-08 22:04:10 +00:00
|
|
|
|
if (event && event.shiftKey)
|
2000-04-11 20:19:32 +00:00
|
|
|
|
ComposeMessage(msgComposeType.ForwardInline,
|
|
|
|
|
msgComposeFormat.OppositeOfDefault, loadedFolder, messageArray);
|
|
|
|
|
else
|
|
|
|
|
ComposeMessage(msgComposeType.ForwardInline, msgComposeFormat.Default, loadedFolder, messageArray);
|
|
|
|
|
}
|
|
|
|
|
|
2000-04-14 14:07:23 +00:00
|
|
|
|
|
|
|
|
|
function MsgEditMessageAsNew()
|
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var loadedFolder = GetLoadedMsgFolder();
|
|
|
|
|
var messageArray = GetSelectedMessages();
|
2000-04-14 14:07:23 +00:00
|
|
|
|
ComposeMessage(msgComposeType.Template, msgComposeFormat.Default, loadedFolder, messageArray);
|
|
|
|
|
}
|
|
|
|
|
|
2000-04-11 20:19:32 +00:00
|
|
|
|
function MsgHome(url)
|
|
|
|
|
{
|
2001-03-28 06:37:54 +00:00
|
|
|
|
window.open(url, "_blank", "chrome,dependent=yes,all");
|
2000-04-11 20:19:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-02-26 01:58:27 +00:00
|
|
|
|
function MsgNewFolder(callBackFunctionName)
|
2000-04-11 20:19:32 +00:00
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var preselectedFolder = GetFirstSelectedMsgFolder();
|
2000-09-13 14:24:41 +00:00
|
|
|
|
var dualUseFolders = true;
|
|
|
|
|
var server = null;
|
2000-10-06 14:31:00 +00:00
|
|
|
|
var destinationFolder = null;
|
|
|
|
|
|
2000-09-13 14:24:41 +00:00
|
|
|
|
if (preselectedFolder)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
server = preselectedFolder.server;
|
|
|
|
|
if (server)
|
|
|
|
|
{
|
2000-10-06 14:31:00 +00:00
|
|
|
|
destinationFolder = getDestinationFolder(preselectedFolder, server);
|
|
|
|
|
|
2000-09-13 14:24:41 +00:00
|
|
|
|
var imapServer =
|
|
|
|
|
server.QueryInterface(Components.interfaces.nsIImapIncomingServer);
|
|
|
|
|
if (imapServer)
|
|
|
|
|
dualUseFolders = imapServer.dualUseFolders;
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
dump ("Exception: dualUseFolders = true\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
2000-10-06 14:31:00 +00:00
|
|
|
|
|
2001-02-26 01:58:27 +00:00
|
|
|
|
CreateNewSubfolder("chrome://messenger/content/newFolderDialog.xul", destinationFolder, dualUseFolders, callBackFunctionName);
|
2000-04-11 20:19:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2000-10-06 14:31:00 +00:00
|
|
|
|
function getDestinationFolder(preselectedFolder, server)
|
|
|
|
|
{
|
|
|
|
|
var destinationFolder = null;
|
|
|
|
|
|
|
|
|
|
var isCreateSubfolders = preselectedFolder.canCreateSubfolders;
|
2001-03-22 00:59:29 +00:00
|
|
|
|
if (!isCreateSubfolders)
|
2000-10-06 14:31:00 +00:00
|
|
|
|
{
|
|
|
|
|
var tmpDestFolder = server.RootFolder;
|
2001-03-22 00:59:29 +00:00
|
|
|
|
destinationFolder
|
2000-10-06 14:31:00 +00:00
|
|
|
|
= tmpDestFolder.QueryInterface(Components.interfaces.nsIMsgFolder);
|
|
|
|
|
|
|
|
|
|
var verifyCreateSubfolders = null;
|
|
|
|
|
if (destinationFolder)
|
|
|
|
|
verifyCreateSubfolders = destinationFolder.canCreateSubfolders;
|
|
|
|
|
|
|
|
|
|
// in case the server cannot have subfolders,
|
|
|
|
|
// get default account and set its incoming server as parent folder
|
2001-03-22 00:59:29 +00:00
|
|
|
|
if (!verifyCreateSubfolders)
|
2000-10-06 14:31:00 +00:00
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
var account = accountManager.defaultAccount;
|
|
|
|
|
var defaultServer = account.incomingServer;
|
|
|
|
|
var tmpDefaultFolder = defaultServer.RootFolder;
|
2001-03-22 00:59:29 +00:00
|
|
|
|
var defaultFolder
|
2000-10-06 14:31:00 +00:00
|
|
|
|
= tmpDefaultFolder.QueryInterface(Components.interfaces.nsIMsgFolder);
|
|
|
|
|
|
|
|
|
|
var checkCreateSubfolders = null;
|
|
|
|
|
if (defaultFolder)
|
|
|
|
|
checkCreateSubfolders = defaultFolder.canCreateSubfolders;
|
|
|
|
|
|
|
|
|
|
if (checkCreateSubfolders)
|
|
|
|
|
destinationFolder = defaultFolder;
|
|
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
dump ("Exception: defaultAccount Not Available\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
destinationFolder = preselectedFolder;
|
|
|
|
|
|
|
|
|
|
return destinationFolder;
|
|
|
|
|
}
|
|
|
|
|
|
2000-04-11 20:19:32 +00:00
|
|
|
|
function MsgSubscribe()
|
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var preselectedFolder = GetFirstSelectedMsgFolder();
|
2000-12-16 00:42:48 +00:00
|
|
|
|
Subscribe(preselectedFolder);
|
2000-04-11 20:19:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-19 21:41:12 +00:00
|
|
|
|
function ConfirmUnsubscribe(folder)
|
|
|
|
|
{
|
2001-03-19 22:15:38 +00:00
|
|
|
|
if (!gMessengerBundle)
|
|
|
|
|
gMessengerBundle = document.getElementById("bundle_messenger");
|
|
|
|
|
|
|
|
|
|
var titleMsg = gMessengerBundle.getString("confirmUnsubscribeTitle");
|
2001-02-22 23:32:13 +00:00
|
|
|
|
var dialogMsg = gMessengerBundle.getFormattedString("confirmUnsubscribeText",
|
2001-03-17 01:59:34 +00:00
|
|
|
|
[folder.name], 1);
|
2001-01-19 21:41:12 +00:00
|
|
|
|
|
2001-04-09 20:38:20 +00:00
|
|
|
|
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
|
|
|
|
|
return promptService.confirm(window, titleMsg, dialogMsg);
|
2001-01-19 21:41:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function MsgUnsubscribe()
|
|
|
|
|
{
|
|
|
|
|
var folder = GetFirstSelectedMsgFolder();
|
|
|
|
|
if (ConfirmUnsubscribe(folder)) {
|
2001-02-22 23:32:13 +00:00
|
|
|
|
UnSubscribe(folder);
|
2001-01-19 21:41:12 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-03-22 00:59:29 +00:00
|
|
|
|
function MsgSaveAsFile()
|
2000-04-11 20:19:32 +00:00
|
|
|
|
{
|
2001-05-01 07:23:54 +00:00
|
|
|
|
if (GetNumSelectedMessages() == 1) {
|
|
|
|
|
SaveAsFile(GetFirstSelectedMessage());
|
2000-09-15 06:17:48 +00:00
|
|
|
|
}
|
2000-04-11 20:19:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-03-22 00:59:29 +00:00
|
|
|
|
function MsgSaveAsTemplate()
|
2000-04-11 20:19:32 +00:00
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var folder = GetLoadedMsgFolder();
|
2001-05-01 07:23:54 +00:00
|
|
|
|
if (GetNumSelectedMessages() == 1) {
|
|
|
|
|
SaveAsTemplate(GetFirstSelectedMessage(), folder);
|
2000-09-15 06:17:48 +00:00
|
|
|
|
}
|
2000-04-11 20:19:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function MsgOpenNewWindowForFolder(folderUri)
|
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
if(!folderUri)
|
|
|
|
|
{
|
|
|
|
|
var folder = GetLoadedMsgFolder();
|
|
|
|
|
var folderResource = folder.QueryInterface(Components.interfaces.nsIRDFResource);
|
|
|
|
|
folderUri = folderResource.Value;
|
|
|
|
|
}
|
2000-04-11 20:19:32 +00:00
|
|
|
|
|
2000-09-15 06:17:48 +00:00
|
|
|
|
if(folderUri)
|
|
|
|
|
{
|
|
|
|
|
var layoutType = pref.GetIntPref("mail.pane_config");
|
2001-03-22 00:59:29 +00:00
|
|
|
|
|
2000-09-15 06:17:48 +00:00
|
|
|
|
if(layoutType == 0)
|
|
|
|
|
window.openDialog( "chrome://messenger/content/messenger.xul", "_blank", "chrome,all,dialog=no", folderUri );
|
|
|
|
|
else
|
|
|
|
|
window.openDialog("chrome://messenger/content/mail3PaneWindowVertLayout.xul", "_blank", "chrome,all,dialog=no", folderUri );
|
|
|
|
|
}
|
2000-04-11 20:19:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
// passing in the view, so this will work for search and the thread pane
|
2001-01-20 05:06:10 +00:00
|
|
|
|
function MsgOpenSelectedMessages()
|
|
|
|
|
{
|
2001-03-17 01:59:34 +00:00
|
|
|
|
var dbView = GetDBView();
|
2001-01-20 05:06:10 +00:00
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
var indices = GetSelectedIndices(dbView);
|
|
|
|
|
var numMessages = indices.length;
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < numMessages; i++) {
|
|
|
|
|
MsgOpenNewWindowForMessage(dbView.getURIForViewIndex(indices[i]),dbView.getFolderForViewIndex(indices[i]).URI);
|
2001-01-20 05:06:10 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2000-04-11 20:19:32 +00:00
|
|
|
|
function MsgOpenNewWindowForMessage(messageUri, folderUri)
|
|
|
|
|
{
|
2001-03-17 01:59:34 +00:00
|
|
|
|
var currentIndex;
|
2000-09-08 21:57:43 +00:00
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
if (!messageUri || !folderUri) {
|
|
|
|
|
var outlinerView = gDBView.QueryInterface(Components.interfaces.nsIOutlinerView);
|
|
|
|
|
var outlinerSelection = outlinerView.selection;
|
|
|
|
|
currentIndex = outlinerSelection.currentIndex;
|
2000-09-15 06:17:48 +00:00
|
|
|
|
}
|
2000-04-11 20:19:32 +00:00
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
if (!messageUri) {
|
|
|
|
|
messageUri = gDBView.getURIForViewIndex(currentIndex);
|
2000-09-15 06:17:48 +00:00
|
|
|
|
}
|
2000-04-11 20:19:32 +00:00
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
if (!folderUri) {
|
|
|
|
|
folderUri = gDBView.getFolderForViewIndex(currentIndex).URI;
|
2000-09-15 06:17:48 +00:00
|
|
|
|
}
|
2000-04-11 20:19:32 +00:00
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
// be sure to pass in the current view....
|
|
|
|
|
if (messageUri && folderUri) {
|
|
|
|
|
window.openDialog( "chrome://messenger/content/messageWindow.xul", "_blank", "chrome,all,dialog=no", messageUri, folderUri, gDBView );
|
|
|
|
|
}
|
2000-04-11 20:19:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-03-22 00:59:29 +00:00
|
|
|
|
function CloseMailWindow()
|
2000-05-01 21:58:24 +00:00
|
|
|
|
{
|
2001-03-17 01:59:34 +00:00
|
|
|
|
//dump("\nClose from XUL\nDo something...\n");
|
2000-09-15 06:17:48 +00:00
|
|
|
|
window.close();
|
2000-05-01 21:58:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-04-14 14:07:23 +00:00
|
|
|
|
function MsgMarkMsgAsRead(markRead)
|
|
|
|
|
{
|
2001-03-17 01:59:34 +00:00
|
|
|
|
if (!markRead) {
|
|
|
|
|
markRead = !SelectedMessagesAreRead();
|
2000-09-15 06:17:48 +00:00
|
|
|
|
}
|
2001-03-17 01:59:34 +00:00
|
|
|
|
MarkSelectedMessagesRead(markRead);
|
2000-04-14 14:07:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function MsgMarkAsFlagged(markFlagged)
|
|
|
|
|
{
|
2001-03-17 01:59:34 +00:00
|
|
|
|
if (!markFlagged) {
|
|
|
|
|
markFlagged = !SelectedMessagesAreFlagged();
|
2000-09-15 06:17:48 +00:00
|
|
|
|
}
|
2001-03-17 01:59:34 +00:00
|
|
|
|
MarkSelectedMessagesFlagged(markFlagged);
|
2000-04-14 14:07:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function MsgMarkAllRead()
|
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var compositeDataSource = GetCompositeDataSource("MarkAllMessagesRead");
|
|
|
|
|
var folder = GetLoadedMsgFolder();
|
2000-04-14 14:07:23 +00:00
|
|
|
|
|
2000-09-15 06:17:48 +00:00
|
|
|
|
if(folder)
|
|
|
|
|
MarkAllMessagesRead(compositeDataSource, folder);
|
2000-04-14 14:07:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-12 03:18:06 +00:00
|
|
|
|
function MsgDownloadFlagged()
|
|
|
|
|
{
|
2001-03-22 00:59:29 +00:00
|
|
|
|
gDBView.doCommand(nsMsgViewCommandType.downloadFlaggedForOffline);
|
2000-12-12 03:18:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function MsgDownloadSelected()
|
|
|
|
|
{
|
2001-03-22 00:59:29 +00:00
|
|
|
|
gDBView.doCommand(nsMsgViewCommandType.downloadSelectedForOffline);
|
2000-12-12 03:18:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-04-14 14:07:23 +00:00
|
|
|
|
function MsgMarkThreadAsRead()
|
|
|
|
|
{
|
2001-03-22 01:42:59 +00:00
|
|
|
|
var uri = GetFirstSelectedMessage();
|
|
|
|
|
if (uri) {
|
|
|
|
|
MarkThreadAsRead(uri);
|
2000-09-15 06:17:48 +00:00
|
|
|
|
}
|
2000-04-14 14:07:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-03-22 00:59:29 +00:00
|
|
|
|
function MsgViewPageSource()
|
2000-04-20 05:30:32 +00:00
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var messages = GetSelectedMessages();
|
|
|
|
|
ViewPageSource(messages);
|
2000-04-20 05:30:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-03-22 00:59:29 +00:00
|
|
|
|
function MsgFind()
|
2001-02-15 06:29:47 +00:00
|
|
|
|
{
|
2001-05-05 00:47:47 +00:00
|
|
|
|
var contentWindow = window.top._content;
|
|
|
|
|
|
|
|
|
|
// from utilityOverlay.js
|
|
|
|
|
findInPage(getMessageBrowser(), contentWindow, contentWindow)
|
2000-04-20 05:30:32 +00:00
|
|
|
|
}
|
2001-02-15 06:29:47 +00:00
|
|
|
|
|
2001-03-22 00:59:29 +00:00
|
|
|
|
function MsgFindAgain()
|
2001-02-15 06:29:47 +00:00
|
|
|
|
{
|
2001-05-05 00:47:47 +00:00
|
|
|
|
var contentWindow = window.top._content;
|
|
|
|
|
findAgainInPage(getMessageBrowser(), contentWindow, contentWindow)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function MsgCanFindAgain()
|
|
|
|
|
{
|
|
|
|
|
return canFindAgainInPage();
|
2000-04-20 05:30:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-03-22 00:59:29 +00:00
|
|
|
|
function MsgSearchMessages()
|
2001-02-15 06:29:47 +00:00
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var preselectedFolder = GetFirstSelectedMsgFolder();
|
2001-05-11 00:24:08 +00:00
|
|
|
|
window.openDialog("chrome://messenger/content/SearchDialog.xul", "SearchMail", "chrome,resizable,centerscreen", { folder: preselectedFolder });
|
2000-04-20 05:30:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-03-22 00:59:29 +00:00
|
|
|
|
function MsgFilters()
|
2001-02-15 06:29:47 +00:00
|
|
|
|
{
|
2001-02-01 07:26:38 +00:00
|
|
|
|
var preselectedFolder = GetFirstSelectedMsgFolder();
|
2001-05-11 00:24:08 +00:00
|
|
|
|
window.openDialog("chrome://messenger/content/FilterListDialog.xul", "FilterDialog", "chrome,resizable,centerscreen", { folder: preselectedFolder });
|
2000-04-20 05:30:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-03-22 00:59:29 +00:00
|
|
|
|
function MsgViewAllHeaders()
|
2000-05-01 21:58:24 +00:00
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
pref.SetIntPref("mail.show_headers",2);
|
|
|
|
|
MsgReload();
|
|
|
|
|
return true;
|
2000-05-01 21:58:24 +00:00
|
|
|
|
}
|
2001-02-15 06:29:47 +00:00
|
|
|
|
|
2001-03-22 00:59:29 +00:00
|
|
|
|
function MsgViewNormalHeaders()
|
2000-05-01 21:58:24 +00:00
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
pref.SetIntPref("mail.show_headers",1);
|
|
|
|
|
MsgReload();
|
|
|
|
|
return true;
|
2000-05-01 21:58:24 +00:00
|
|
|
|
}
|
2001-02-15 06:29:47 +00:00
|
|
|
|
|
2001-03-22 00:59:29 +00:00
|
|
|
|
function MsgViewBriefHeaders()
|
2000-05-01 21:58:24 +00:00
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
pref.SetIntPref("mail.show_headers",0);
|
|
|
|
|
MsgReload();
|
|
|
|
|
return true;
|
2000-05-01 21:58:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-03-22 00:59:29 +00:00
|
|
|
|
function MsgReload()
|
2000-05-01 21:58:24 +00:00
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
ReloadMessage();
|
2000-05-01 21:58:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function MsgStop()
|
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
StopUrls();
|
2000-05-01 21:58:24 +00:00
|
|
|
|
}
|
2000-04-20 05:30:32 +00:00
|
|
|
|
|
2001-03-22 00:59:29 +00:00
|
|
|
|
function MsgSendUnsentMsg()
|
2000-05-16 22:56:08 +00:00
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var folder = GetFirstSelectedMsgFolder();
|
2001-03-17 01:59:34 +00:00
|
|
|
|
if(folder) {
|
2000-09-15 06:17:48 +00:00
|
|
|
|
SendUnsentMessages(folder);
|
|
|
|
|
}
|
2000-05-16 22:56:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-08-16 03:23:21 +00:00
|
|
|
|
function PrintEnginePrint()
|
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var messageList = GetSelectedMessages();
|
2001-03-28 06:37:54 +00:00
|
|
|
|
var numMessages = messageList.length;
|
2000-08-16 03:23:21 +00:00
|
|
|
|
|
2001-03-17 01:59:34 +00:00
|
|
|
|
if (numMessages == 0) {
|
2000-09-15 06:17:48 +00:00
|
|
|
|
dump("PrintEnginePrint(): No messages selected.\n");
|
|
|
|
|
return false;
|
2001-03-22 00:59:29 +00:00
|
|
|
|
}
|
2000-08-16 03:23:21 +00:00
|
|
|
|
|
2000-09-15 06:17:48 +00:00
|
|
|
|
printEngineWindow = window.openDialog("chrome://messenger/content/msgPrintEngine.xul",
|
|
|
|
|
"",
|
|
|
|
|
"chrome,dialog=no,all",
|
2001-03-17 01:59:34 +00:00
|
|
|
|
numMessages, messageList, statusFeedback);
|
2000-09-15 06:17:48 +00:00
|
|
|
|
return true;
|
2000-08-16 03:23:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-08-26 20:54:51 +00:00
|
|
|
|
function IsMailFolderSelected()
|
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var selectedFolders = GetSelectedMsgFolders();
|
|
|
|
|
var numFolders = selectedFolders.length;
|
|
|
|
|
if(numFolders !=1)
|
|
|
|
|
return false;
|
2001-03-22 00:59:29 +00:00
|
|
|
|
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var folder = selectedFolders[0];
|
|
|
|
|
if (!folder)
|
|
|
|
|
return false;
|
2001-03-22 00:59:29 +00:00
|
|
|
|
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var server = folder.server;
|
|
|
|
|
var serverType = server.type;
|
2001-03-22 00:59:29 +00:00
|
|
|
|
|
2000-09-15 06:17:48 +00:00
|
|
|
|
if((serverType == "nntp"))
|
|
|
|
|
return false;
|
|
|
|
|
else return true;
|
2000-08-26 20:54:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function IsGetNewMessagesEnabled()
|
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var selectedFolders = GetSelectedMsgFolders();
|
|
|
|
|
var numFolders = selectedFolders.length;
|
|
|
|
|
if(numFolders !=1)
|
|
|
|
|
return false;
|
2001-03-22 00:59:29 +00:00
|
|
|
|
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var folder = selectedFolders[0];
|
|
|
|
|
if (!folder)
|
|
|
|
|
return false;
|
2001-03-22 00:59:29 +00:00
|
|
|
|
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var server = folder.server;
|
|
|
|
|
var isServer = folder.isServer;
|
|
|
|
|
var serverType = server.type;
|
2001-03-22 00:59:29 +00:00
|
|
|
|
|
2000-09-15 06:17:48 +00:00
|
|
|
|
if(isServer && (serverType == "nntp"))
|
|
|
|
|
return false;
|
|
|
|
|
else if(serverType == "none")
|
|
|
|
|
return false;
|
|
|
|
|
else
|
2001-03-22 00:59:29 +00:00
|
|
|
|
return true;
|
2000-08-26 20:54:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-08-30 23:22:22 +00:00
|
|
|
|
function IsGetNextNMessagesEnabled()
|
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var selectedFolders = GetSelectedMsgFolders();
|
2000-08-30 23:22:22 +00:00
|
|
|
|
var numFolders = selectedFolders.length;
|
|
|
|
|
if(numFolders !=1)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
var folder = selectedFolders[0];
|
|
|
|
|
if (!folder)
|
|
|
|
|
return false;
|
2001-03-22 00:59:29 +00:00
|
|
|
|
|
2000-08-30 23:22:22 +00:00
|
|
|
|
var server = folder.server;
|
|
|
|
|
var serverType = server.type;
|
2001-03-22 00:59:29 +00:00
|
|
|
|
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var menuItem = document.getElementById("menu_getnextnmsg");
|
2000-09-01 00:55:11 +00:00
|
|
|
|
if((serverType == "nntp")) {
|
2000-09-15 06:17:48 +00:00
|
|
|
|
var newsServer = server.QueryInterface(Components.interfaces.nsINntpIncomingServer);
|
2001-03-22 00:59:29 +00:00
|
|
|
|
var menuLabel = gMessengerBundle.getFormattedString("getNextNMessages",
|
2001-02-22 23:32:13 +00:00
|
|
|
|
[ newsServer.maxArticles ]);
|
2001-03-22 00:59:29 +00:00
|
|
|
|
menuItem.setAttribute("label",menuLabel);
|
2000-09-15 06:17:48 +00:00
|
|
|
|
menuItem.setAttribute("hidden","false");
|
2000-08-30 23:22:22 +00:00
|
|
|
|
return true;
|
2000-09-15 06:17:48 +00:00
|
|
|
|
}
|
2000-09-01 00:55:11 +00:00
|
|
|
|
else {
|
2000-09-15 06:17:48 +00:00
|
|
|
|
menuItem.setAttribute("hidden","true");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2000-08-30 23:22:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-08-26 20:54:51 +00:00
|
|
|
|
function IsEmptyTrashEnabled()
|
|
|
|
|
{
|
2000-09-15 06:17:48 +00:00
|
|
|
|
return IsMailFolderSelected();
|
2000-08-26 20:54:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function IsCompactFolderEnabled()
|
|
|
|
|
{
|
2001-02-16 02:05:41 +00:00
|
|
|
|
var folderTree = GetFolderTree();
|
|
|
|
|
var selectedFolders = folderTree.selectedItems;
|
|
|
|
|
var numFolders = selectedFolders.length;
|
|
|
|
|
|
|
|
|
|
if (numFolders <= 0 )
|
|
|
|
|
return false;
|
|
|
|
|
|
2001-02-22 23:32:13 +00:00
|
|
|
|
var folder = selectedFolders[0];
|
2001-03-22 00:59:29 +00:00
|
|
|
|
if (!folder)
|
2001-02-16 02:05:41 +00:00
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return (folder.getAttribute('CanCompact') == "true");
|
2000-08-26 20:54:51 +00:00
|
|
|
|
}
|
2000-08-16 03:23:21 +00:00
|
|
|
|
|
2001-01-04 00:57:58 +00:00
|
|
|
|
var gDeleteButton = null;
|
|
|
|
|
var gMarkButton = null;
|
|
|
|
|
|
|
|
|
|
function SetUpToolbarButtons(uri)
|
|
|
|
|
{
|
|
|
|
|
// dump("SetUpToolbarButtons("+uri+")\n");
|
|
|
|
|
|
|
|
|
|
// eventually, we might want to set up the toolbar differently for imap,
|
|
|
|
|
// pop, and news. for now, just tweak it based on if it is news or not.
|
|
|
|
|
var forNews = isNewsURI(uri);
|
|
|
|
|
|
|
|
|
|
if(!gMarkButton) gMarkButton = document.getElementById("button-mark");
|
|
|
|
|
if(!gDeleteButton) gDeleteButton = document.getElementById("button-delete");
|
2001-03-22 00:59:29 +00:00
|
|
|
|
|
2001-01-04 00:57:58 +00:00
|
|
|
|
var buttonToHide = null;
|
|
|
|
|
var buttonToShow = null;
|
|
|
|
|
|
|
|
|
|
if (forNews) {
|
|
|
|
|
buttonToHide = gDeleteButton;
|
|
|
|
|
buttonToShow = gMarkButton;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
buttonToHide = gMarkButton;
|
|
|
|
|
buttonToShow = gDeleteButton;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (buttonToHide) {
|
|
|
|
|
buttonToHide.setAttribute('hidden',true);
|
|
|
|
|
}
|
|
|
|
|
if (buttonToShow) {
|
|
|
|
|
buttonToShow.removeAttribute('hidden');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-01-30 20:45:50 +00:00
|
|
|
|
var gMessageBrowser;
|
|
|
|
|
|
|
|
|
|
function getMessageBrowser()
|
|
|
|
|
{
|
|
|
|
|
if (!gMessageBrowser)
|
|
|
|
|
gMessageBrowser = document.getElementById("messagepane");
|
|
|
|
|
|
|
|
|
|
return gMessageBrowser;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getMarkupDocumentViewer()
|
|
|
|
|
{
|
|
|
|
|
return getMessageBrowser().markupDocumentViewer;
|
|
|
|
|
}
|
|
|
|
|
|
2001-05-04 00:47:53 +00:00
|
|
|
|
function MsgSynchronizeOffline()
|
|
|
|
|
{
|
|
|
|
|
dump("in MsgSynchronize() \n");
|
|
|
|
|
window.openDialog("chrome://messenger/content/msgSynchronize.xul",
|
2001-06-08 21:17:43 +00:00
|
|
|
|
"", "centerscreen,chrome,modal,titlebar,resizable=yes",{msgWindow:msgWindow});
|
2001-05-04 00:47:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2000-04-14 14:07:23 +00:00
|
|
|
|
function MsgMarkByDate() {}
|
|
|
|
|
function MsgOpenAttachment() {}
|
|
|
|
|
function MsgUpdateMsgCount() {}
|
|
|
|
|
function MsgImport() {}
|
|
|
|
|
function MsgSynchronize() {}
|
|
|
|
|
function MsgGetSelectedMsg() {}
|
|
|
|
|
function MsgGetFlaggedMsg() {}
|
|
|
|
|
function MsgSelectThread() {}
|
|
|
|
|
function MsgSelectFlaggedMsg() {}
|
|
|
|
|
function MsgShowFolders(){}
|
|
|
|
|
function MsgShowLocationbar() {}
|
|
|
|
|
function MsgViewAttachInline() {}
|
|
|
|
|
function MsgWrapLongLines() {}
|
|
|
|
|
function MsgIncreaseFont() {}
|
|
|
|
|
function MsgDecreaseFont() {}
|
|
|
|
|
function MsgShowImages() {}
|
|
|
|
|
function MsgRefresh() {}
|
|
|
|
|
function MsgViewPageInfo() {}
|
|
|
|
|
function MsgFirstUnreadMessage() {}
|
|
|
|
|
function MsgFirstFlaggedMessage() {}
|
|
|
|
|
function MsgGoBack() {}
|
|
|
|
|
function MsgGoForward() {}
|
|
|
|
|
function MsgAddSenderToAddressBook() {}
|
|
|
|
|
function MsgAddAllToAddressBook() {}
|
2001-03-20 00:51:23 +00:00
|
|
|
|
|
|
|
|
|
function SpaceHit()
|
|
|
|
|
{
|
|
|
|
|
var contentWindow = window.top._content;
|
|
|
|
|
var oldScrollY = contentWindow.scrollY;
|
|
|
|
|
|
|
|
|
|
contentWindow.scrollByPages(1);
|
|
|
|
|
|
|
|
|
|
// if at the end of the message, go to the next one
|
|
|
|
|
if (oldScrollY == contentWindow.scrollY) {
|
|
|
|
|
goDoCommand('cmd_nextUnreadMsg');
|
|
|
|
|
}
|
|
|
|
|
}
|