1999-06-08 00:59:02 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
1999-06-08 02:17:35 +00:00
|
|
|
* 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.
|
1999-06-08 00:59:02 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* widget-specific wrapper glue. There should be one function for every
|
|
|
|
* widget/menu item, which gets some context (like the current selection)
|
|
|
|
* and then calls a function/command in commandglue
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
1999-05-28 19:41:31 +00:00
|
|
|
function MsgLoadNewsMessage(url)
|
|
|
|
{
|
|
|
|
dump("\n\nMsgLoadNewsMessage from XUL\n");
|
|
|
|
OpenURL(url);
|
|
|
|
}
|
|
|
|
|
|
|
|
function MsgHome(url)
|
|
|
|
{
|
|
|
|
var toolkitCore = XPAppCoresManager.Find("ToolkitCore");
|
|
|
|
if (!toolkitCore) {
|
|
|
|
toolkitCore = new ToolkitCore();
|
|
|
|
if (toolkitCore) {
|
|
|
|
toolkitCore.Init("ToolkitCore");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (toolkitCore) {
|
|
|
|
toolkitCore.ShowWindow(url, window);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function MsgNewMessage()
|
|
|
|
{
|
|
|
|
dump("\n\nMsgNewMessage from XUL\n");
|
|
|
|
NewMessage();
|
|
|
|
}
|
|
|
|
|
|
|
|
function MsgGetMessage()
|
|
|
|
{
|
|
|
|
GetNewMessages();
|
|
|
|
}
|
|
|
|
|
1999-07-23 09:18:13 +00:00
|
|
|
function MsgDeleteMessage(fromToolbar)
|
1999-05-28 19:41:31 +00:00
|
|
|
{
|
|
|
|
dump("\nMsgDeleteMessage from XUL\n");
|
1999-07-23 09:18:13 +00:00
|
|
|
//dump("from toolbar? " + fromToolbar + "\n");
|
|
|
|
|
1999-06-23 03:02:21 +00:00
|
|
|
var tree = GetThreadTree();
|
1999-06-08 00:26:29 +00:00
|
|
|
if(tree) {
|
1999-07-23 09:18:13 +00:00
|
|
|
var srcFolder = GetThreadTreeFolder();
|
|
|
|
// 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) {
|
1999-07-27 23:02:54 +00:00
|
|
|
uri = srcFolder.getAttribute('ref');
|
1999-07-23 09:18:13 +00:00
|
|
|
//dump("uri[0:6]=" + uri.substring(0,6) + "\n");
|
|
|
|
if (uri.substring(0,6) == "news:/") {
|
|
|
|
//dump("delete ignored!\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dump("tree is valid\n");
|
1999-05-28 19:41:31 +00:00
|
|
|
//get the selected elements
|
1999-08-23 02:58:28 +00:00
|
|
|
var messageList = tree.selectedItems;
|
1999-05-28 19:41:31 +00:00
|
|
|
//get the current folder
|
1999-07-23 09:18:13 +00:00
|
|
|
messenger.DeleteMessages(tree, srcFolder, messageList);
|
1999-05-28 19:41:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function MsgDeleteFolder()
|
|
|
|
{
|
1999-06-08 00:26:29 +00:00
|
|
|
//get the selected elements
|
1999-06-23 03:02:21 +00:00
|
|
|
var tree = GetFolderTree();
|
1999-08-23 02:58:28 +00:00
|
|
|
var folderList = tree.selectedItems;
|
1999-06-08 00:26:29 +00:00
|
|
|
var i;
|
|
|
|
var folder, parent;
|
|
|
|
for(i = 0; i < folderList.length; i++)
|
|
|
|
{
|
|
|
|
folder = folderList[i];
|
|
|
|
folderuri = folder.getAttribute('id');
|
|
|
|
dump(folderuri);
|
|
|
|
parent = folder.parentNode.parentNode;
|
|
|
|
var parenturi = parent.getAttribute('id');
|
|
|
|
if(parenturi)
|
|
|
|
dump(parenturi);
|
|
|
|
else
|
|
|
|
dump("No parenturi");
|
|
|
|
dump("folder = " + folder.nodeName + "\n");
|
|
|
|
dump("parent = " + parent.nodeName + "\n");
|
|
|
|
messenger.DeleteFolders(tree.database, parent, folder);
|
1999-05-28 19:41:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function MsgReplyMessage()
|
|
|
|
{
|
1999-06-11 00:25:20 +00:00
|
|
|
dump("\nMsgReplyMessage from XUL\n");
|
|
|
|
ComposeMessage(1, 0);
|
1999-05-28 19:41:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function MsgReplyToAllMessage()
|
|
|
|
{
|
1999-06-11 00:25:20 +00:00
|
|
|
dump("\nMsgReplyToAllMessage from XUL\n");
|
|
|
|
ComposeMessage(2, 0);
|
1999-05-28 19:41:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function MsgForwardMessage()
|
|
|
|
{
|
1999-06-11 00:25:20 +00:00
|
|
|
dump("\nMsgForwardMessage from XUL\n");
|
|
|
|
MsgForwardAsInline();
|
1999-05-28 19:41:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function MsgForwardAsAttachment()
|
|
|
|
{
|
1999-06-11 00:25:20 +00:00
|
|
|
dump("\nMsgForwardAsAttachment from XUL\n");
|
1999-06-21 20:28:39 +00:00
|
|
|
ComposeMessage(4, 0);
|
1999-05-28 19:41:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function MsgForwardAsInline()
|
|
|
|
{
|
1999-06-11 00:25:20 +00:00
|
|
|
dump("\nMsgForwardAsInline from XUL\n");
|
|
|
|
ComposeMessage(3, 0);
|
1999-05-28 19:41:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function MsgCopyMessage(destFolder)
|
|
|
|
{
|
|
|
|
// Get the id for the folder we're copying into
|
|
|
|
destUri = destFolder.getAttribute('id');
|
|
|
|
dump(destUri);
|
|
|
|
|
1999-06-23 03:02:21 +00:00
|
|
|
var tree = GetThreadTree();
|
1999-05-28 19:41:31 +00:00
|
|
|
if(tree)
|
|
|
|
{
|
|
|
|
//Get the selected messages to copy
|
1999-08-23 02:58:28 +00:00
|
|
|
var messageList = tree.selectedItems;
|
1999-06-08 00:26:29 +00:00
|
|
|
//get the current folder
|
1999-06-24 21:26:48 +00:00
|
|
|
|
1999-08-23 02:58:28 +00:00
|
|
|
// dump('In copy messages. Num Selected Items = ' + messageList.length);
|
|
|
|
// dump('\n');
|
1999-06-23 03:02:21 +00:00
|
|
|
var srcFolder = GetThreadTreeFolder();
|
1999-06-24 21:26:48 +00:00
|
|
|
messenger.CopyMessages(tree.database, srcFolder, destFolder, messageList, false);
|
1999-05-28 19:41:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function MsgMoveMessage(destFolder)
|
|
|
|
{
|
|
|
|
// Get the id for the folder we're copying into
|
|
|
|
destUri = destFolder.getAttribute('id');
|
|
|
|
dump(destUri);
|
|
|
|
|
1999-06-23 03:02:21 +00:00
|
|
|
var tree = GetThreadTree();
|
1999-05-28 19:41:31 +00:00
|
|
|
if(tree)
|
|
|
|
{
|
|
|
|
//Get the selected messages to copy
|
1999-08-23 02:58:28 +00:00
|
|
|
var messageList = tree.selectedItems;
|
1999-06-08 00:26:29 +00:00
|
|
|
//get the current folder
|
1999-06-23 03:02:21 +00:00
|
|
|
var srcFolder = GetThreadTreeFolder();
|
1999-06-24 21:26:48 +00:00
|
|
|
messenger.CopyMessages(tree.database, srcFolder, destFolder, messageList, true);
|
1999-05-28 19:41:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function MsgViewAllMsgs()
|
|
|
|
{
|
|
|
|
dump("MsgViewAllMsgs");
|
|
|
|
|
1999-08-20 22:47:12 +00:00
|
|
|
var view = messageViewDataSource.QueryInterface(Components.interfaces.nsIMessageView);
|
|
|
|
if(view)
|
|
|
|
{
|
|
|
|
view.SetShowAll();
|
|
|
|
view.SetShowThreads(false);
|
|
|
|
}
|
1999-06-23 03:02:21 +00:00
|
|
|
RefreshThreadTreeView();
|
1999-05-28 19:41:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function MsgViewUnreadMsg()
|
|
|
|
{
|
|
|
|
dump("MsgViewUnreadMsgs");
|
|
|
|
|
1999-08-20 22:47:12 +00:00
|
|
|
var view = messageViewDataSource.QueryInterface(Components.interfaces.nsIMessageView);
|
|
|
|
if(view)
|
|
|
|
{
|
|
|
|
view.SetShowUnread();
|
|
|
|
view.SetShowThreads(false);
|
|
|
|
}
|
1999-05-28 19:41:31 +00:00
|
|
|
|
1999-06-23 03:02:21 +00:00
|
|
|
RefreshThreadTreeView();
|
1999-05-28 19:41:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function MsgViewAllThreadMsgs()
|
|
|
|
{
|
|
|
|
dump("MsgViewAllMessagesThreaded");
|
|
|
|
|
1999-08-20 22:47:12 +00:00
|
|
|
var view = messageViewDataSource.QueryInterface(Components.interfaces.nsIMessageView);
|
|
|
|
if(view)
|
|
|
|
{
|
|
|
|
view.SetShowAll();
|
|
|
|
view.SetShowThreads(true);
|
|
|
|
}
|
1999-06-23 03:02:21 +00:00
|
|
|
RefreshThreadTreeView();
|
1999-05-28 19:41:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function MsgSortByDate()
|
|
|
|
{
|
|
|
|
SortThreadPane('DateColumn', 'http://home.netscape.com/NC-rdf#Date');
|
|
|
|
}
|
|
|
|
|
|
|
|
function MsgSortBySender()
|
|
|
|
{
|
|
|
|
SortThreadPane('AuthorColumn', 'http://home.netscape.com/NC-rdf#Sender');
|
|
|
|
}
|
|
|
|
|
|
|
|
function MsgSortByStatus()
|
|
|
|
{
|
|
|
|
SortThreadPane('StatusColumn', 'http://home.netscape.com/NC-rdf#Status');
|
|
|
|
}
|
|
|
|
|
|
|
|
function MsgSortBySubject()
|
|
|
|
{
|
|
|
|
SortThreadPane('SubjectColumn', 'http://home.netscape.com/NC-rdf#Subject');
|
|
|
|
}
|
|
|
|
|
|
|
|
function MsgNewFolder()
|
1999-08-11 04:52:24 +00:00
|
|
|
{
|
|
|
|
var folderTree = GetFolderTree();
|
1999-08-23 02:58:28 +00:00
|
|
|
var selectedFolderList = folderTree.selectedItems;
|
1999-08-11 04:52:24 +00:00
|
|
|
var selectedFolder = selectedFolderList[0];
|
|
|
|
if (selectedFolder)
|
|
|
|
{
|
|
|
|
var dialog = window.openDialog(
|
|
|
|
"chrome://messenger/content/newFolderNameDialog.xul",
|
|
|
|
"",
|
|
|
|
"chrome",
|
|
|
|
{title:"New Folder",
|
|
|
|
okCallback:NewFolder});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function NewFolder(name)
|
1999-05-28 19:41:31 +00:00
|
|
|
{
|
1999-06-23 03:02:21 +00:00
|
|
|
var folderTree = GetFolderTree();
|
1999-08-23 02:58:28 +00:00
|
|
|
var selectedFolderList = folderTree.selectedItems;
|
1999-05-28 19:41:31 +00:00
|
|
|
var selectedFolder = selectedFolderList[0];
|
|
|
|
|
1999-08-11 04:52:24 +00:00
|
|
|
messenger.NewFolder(folderTree.database, selectedFolder, name);
|
1999-05-28 19:41:31 +00:00
|
|
|
}
|
|
|
|
|
1999-08-11 03:37:06 +00:00
|
|
|
|
1999-06-15 00:49:23 +00:00
|
|
|
function MsgAccountManager()
|
|
|
|
{
|
|
|
|
dump('Opening account manager..\n');
|
1999-07-22 18:38:40 +00:00
|
|
|
window.open("chrome://messenger/content/AccountManager.xul", "AccountManager", "chrome");
|
1999-06-15 00:49:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function MsgSubscribe()
|
|
|
|
{
|
|
|
|
dump('open subscribe window.\n');
|
1999-06-15 04:22:41 +00:00
|
|
|
window.openDialog("chrome://messenger/content/subscribe.xul", "subscribe", "chrome");
|
1999-06-15 00:49:23 +00:00
|
|
|
}
|
1999-05-28 19:41:31 +00:00
|
|
|
|
1999-06-25 09:44:39 +00:00
|
|
|
function MsgAccountWizard()
|
|
|
|
{
|
1999-08-31 03:36:29 +00:00
|
|
|
window.openDialog("chrome://messenger/content/AccountWizard.xul", "wizard", "chrome, modal,height=300,width=400");
|
1999-06-25 09:44:39 +00:00
|
|
|
}
|
|
|
|
|
1999-05-28 19:41:31 +00:00
|
|
|
function MsgOpenAttachment() {}
|
|
|
|
function MsgSaveAsFile() {}
|
|
|
|
function MsgSaveAsTemplate() {}
|
1999-06-11 22:11:32 +00:00
|
|
|
function MsgSendUnsentMsg()
|
|
|
|
{
|
|
|
|
messenger.SendUnsentMessages();
|
|
|
|
}
|
1999-07-31 19:59:35 +00:00
|
|
|
function MsgLoadFirstDraft()
|
|
|
|
{
|
|
|
|
messenger.LoadFirstDraft();
|
|
|
|
}
|
1999-05-28 19:41:31 +00:00
|
|
|
function MsgUpdateMsgCount() {}
|
1999-08-11 04:52:24 +00:00
|
|
|
|
|
|
|
function MsgRenameFolder()
|
|
|
|
{
|
|
|
|
var tree = GetFolderTree();
|
|
|
|
if (tree)
|
|
|
|
{
|
1999-08-23 02:58:28 +00:00
|
|
|
var folderList = tree.selectedItems;
|
1999-08-11 04:52:24 +00:00
|
|
|
if (folderList && folderList.length == 1)
|
|
|
|
{
|
|
|
|
var folder = folderList[0];
|
|
|
|
if (folder)
|
|
|
|
{
|
|
|
|
var dialog = window.openDialog(
|
|
|
|
"chrome://messenger/content/newFolderNameDialog.xul",
|
|
|
|
"",
|
|
|
|
"chrome",
|
|
|
|
{title:"Rename Folder",
|
|
|
|
okCallback:RenameFolder});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function RenameFolder(name)
|
|
|
|
{
|
|
|
|
var tree = GetFolderTree();
|
|
|
|
if (tree)
|
|
|
|
{
|
1999-08-23 02:58:28 +00:00
|
|
|
var folderList = tree.selectedItems;
|
1999-08-11 04:52:24 +00:00
|
|
|
if (folderList && folderList.length == 1)
|
|
|
|
{
|
|
|
|
var folder = folderList[0];
|
|
|
|
if (folder)
|
|
|
|
messenger.RenameFolder(tree.database, folder, name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-08-06 18:22:05 +00:00
|
|
|
function MsgEmptyTrash()
|
|
|
|
{
|
|
|
|
var tree = GetFolderTree();
|
|
|
|
if (tree)
|
|
|
|
{
|
1999-08-23 02:58:28 +00:00
|
|
|
var folderList = tree.selectedItems;
|
1999-08-06 18:22:05 +00:00
|
|
|
if (folderList)
|
|
|
|
{
|
|
|
|
var folder;
|
|
|
|
folder = folderList[0];
|
|
|
|
if (folder)
|
1999-08-09 19:51:07 +00:00
|
|
|
{
|
1999-08-06 18:22:05 +00:00
|
|
|
messenger.EmptyTrash(tree.database, folder);
|
1999-08-09 19:51:07 +00:00
|
|
|
if(IsSpecialFolderSelected('Trash'))
|
|
|
|
{
|
|
|
|
RefreshThreadTreeView()
|
|
|
|
}
|
|
|
|
}
|
1999-08-06 18:22:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1999-08-11 04:52:24 +00:00
|
|
|
|
1999-08-06 13:35:11 +00:00
|
|
|
function MsgCompactFolder()
|
|
|
|
{
|
|
|
|
//get the selected elements
|
|
|
|
var tree = GetFolderTree();
|
1999-08-06 18:22:05 +00:00
|
|
|
if (tree)
|
|
|
|
{
|
1999-08-23 02:58:28 +00:00
|
|
|
var folderList = tree.selectedItems;
|
1999-08-06 18:22:05 +00:00
|
|
|
if (folderList)
|
|
|
|
{
|
|
|
|
var i;
|
|
|
|
var folder;
|
|
|
|
for(i = 0; i < folderList.length; i++)
|
|
|
|
{
|
|
|
|
folder = folderList[i];
|
|
|
|
if (folder)
|
|
|
|
{
|
|
|
|
folderuri = folder.getAttribute('id');
|
|
|
|
dump(folderuri);
|
|
|
|
dump("folder = " + folder.nodeName + "\n");
|
|
|
|
messenger.CompactFolder(tree.database, folder);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1999-08-06 13:35:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-05-28 19:41:31 +00:00
|
|
|
function MsgImport() {}
|
|
|
|
function MsgWorkOffline() {}
|
|
|
|
function MsgSynchronize() {}
|
|
|
|
function MsgGetSelectedMsg() {}
|
|
|
|
function MsgGetFlaggedMsg() {}
|
1999-06-08 22:15:58 +00:00
|
|
|
|
|
|
|
function MsgEditUndo()
|
|
|
|
{
|
|
|
|
messenger.Undo();
|
|
|
|
}
|
|
|
|
|
|
|
|
function MsgEditRedo()
|
|
|
|
{
|
|
|
|
messenger.Redo();
|
|
|
|
}
|
|
|
|
|
1999-05-28 19:41:31 +00:00
|
|
|
function MsgEditCut() {}
|
|
|
|
function MsgEditCopy() {}
|
|
|
|
function MsgEditPaste() {}
|
|
|
|
function MsgSelectAll() {}
|
|
|
|
function MsgSelectThread() {}
|
|
|
|
function MsgSelectFlaggedMsg() {}
|
|
|
|
function MsgFind() {}
|
|
|
|
function MsgFindAgain() {}
|
1999-06-15 00:49:23 +00:00
|
|
|
|
|
|
|
function MsgSearchMessages() {
|
|
|
|
window.openDialog("chrome://messenger/content/SearchDialog.xul", "SearchMail", "chrome");
|
|
|
|
}
|
|
|
|
|
|
|
|
function MsgFilters() {
|
|
|
|
window.openDialog("chrome://messenger/content/FilterListDialog.xul", "FilterDialog", "chrome");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-05-28 19:41:31 +00:00
|
|
|
function MsgFolderProperties() {}
|
|
|
|
function MsgPreferences()
|
|
|
|
{
|
1999-06-10 20:23:06 +00:00
|
|
|
var prefwindow = Components.classes['component://netscape/prefwindow'].createInstance(Components.interfaces.nsIPrefWindow);
|
1999-08-04 18:29:28 +00:00
|
|
|
prefwindow.showWindow("widgetglue.js", window, "chrome://messenger/content/pref-mailnews.xul");
|
1999-05-28 19:41:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function MsgShowMsgToolbar() {}
|
|
|
|
function MsgShowLocationbar() {}
|
|
|
|
function MsgShowMessage() {}
|
|
|
|
function MsgShowFolders() {}
|
|
|
|
function MsgSortByFlag() {}
|
|
|
|
function MsgSortByPriority() {}
|
|
|
|
function MsgSortBySize() {}
|
|
|
|
function MsgSortByThread() {}
|
|
|
|
function MsgSortByUnread() {}
|
|
|
|
function MsgSortByOrderReceived() {}
|
|
|
|
function MsgSortAscending() {}
|
|
|
|
function MsgSortDescending() {}
|
|
|
|
function MsgViewThreadsUnread() {}
|
|
|
|
function MsgViewWatchedThreadsUnread() {}
|
|
|
|
function MsgViewIgnoreThread() {}
|
|
|
|
function MsgViewAllHeaders() {}
|
|
|
|
function MsgViewNormalHeaders() {}
|
|
|
|
function MsgViewBriefHeaders() {}
|
|
|
|
function MsgViewAttachInline() {}
|
|
|
|
function MsgWrapLongLines() {}
|
|
|
|
function MsgIncreaseFont() {}
|
|
|
|
function MsgDecreaseFont() {}
|
|
|
|
function MsgReload() {}
|
|
|
|
function MsgShowImages() {}
|
|
|
|
function MsgRefresh() {}
|
|
|
|
function MsgStop() {}
|
|
|
|
function MsgViewPageSource() {}
|
|
|
|
function MsgViewPageInfo() {}
|
|
|
|
function MsgFirstUnreadMessage() {}
|
|
|
|
function MsgFirstFlaggedMessage() {}
|
1999-08-02 23:58:09 +00:00
|
|
|
function MsgNextMessage()
|
|
|
|
{
|
1999-08-30 22:13:45 +00:00
|
|
|
GoNextMessage(GoMessage, false);
|
1999-08-02 23:58:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function MsgNextUnreadMessage()
|
|
|
|
{
|
1999-08-30 22:13:45 +00:00
|
|
|
GoNextMessage(GoUnreadMessage, true);
|
1999-08-02 23:58:09 +00:00
|
|
|
}
|
1999-08-30 22:13:45 +00:00
|
|
|
function MsgNextFlaggedMessage()
|
|
|
|
{
|
|
|
|
GoNextMessage(GoFlaggedMessage, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
function MsgPreviousMessage()
|
|
|
|
{
|
|
|
|
GoPreviousMessage(GoMessage, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
function MsgPreviousUnreadMessage()
|
|
|
|
{
|
|
|
|
GoPreviousMessage(GoUnreadMessage, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
function MsgPreviousFlaggedMessage()
|
|
|
|
{
|
|
|
|
GoPreviousMessage(GoFlaggedMessage, true);
|
|
|
|
}
|
|
|
|
|
1999-05-28 19:41:31 +00:00
|
|
|
function MsgGoBack() {}
|
|
|
|
function MsgGoForward() {}
|
|
|
|
function MsgEditMessageAsNew() {}
|
|
|
|
function MsgAddSenderToAddressBook() {}
|
|
|
|
function MsgAddAllToAddressBook() {}
|
|
|
|
|
|
|
|
function MsgMarkMsgAsRead(markRead)
|
|
|
|
{
|
|
|
|
dump("\MsgMarkMsgAsRead from XUL\n");
|
1999-06-23 03:02:21 +00:00
|
|
|
var tree = GetThreadTree();
|
1999-06-08 00:26:29 +00:00
|
|
|
//get the selected elements
|
1999-08-23 02:58:28 +00:00
|
|
|
var messageList = tree.selectedItems;
|
1999-06-08 00:26:29 +00:00
|
|
|
messenger.MarkMessagesRead(tree.database, messageList, markRead);
|
1999-05-28 19:41:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function MsgMarkThreadAsRead() {}
|
|
|
|
function MsgMarkByDate() {}
|
1999-07-24 21:10:53 +00:00
|
|
|
function MsgMarkAllRead()
|
|
|
|
{
|
|
|
|
var folderTree = GetFolderTree();;
|
1999-08-23 02:58:28 +00:00
|
|
|
var selectedFolderList = folderTree.selectedItems;
|
1999-07-24 21:10:53 +00:00
|
|
|
if(selectedFolderList.length > 0)
|
|
|
|
{
|
|
|
|
var selectedFolder = selectedFolderList[0];
|
|
|
|
messenger.MarkAllMessagesRead(folderTree.database, selectedFolder);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dump("Nothing was selected\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-08-24 21:48:44 +00:00
|
|
|
function MsgMarkAsFlagged(markFlagged)
|
|
|
|
{
|
|
|
|
dump("\MsgMarkMsgAsFlagged from XUL\n");
|
|
|
|
var tree = GetThreadTree();
|
|
|
|
//get the selected elements
|
|
|
|
var messageList = tree.selectedItems;
|
|
|
|
messenger.MarkMessagesFlagged(tree.database, messageList, markFlagged);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
1999-05-28 19:41:31 +00:00
|
|
|
function MsgIgnoreThread() {}
|
|
|
|
function MsgWatchThread() {}
|
1999-07-31 18:19:54 +00:00
|
|
|
|
1999-08-01 18:39:04 +00:00
|
|
|
var bindCount = 0;
|
|
|
|
function onStatus() {
|
|
|
|
var status = document.getElementById("Messenger:Status");
|
|
|
|
if ( status ) {
|
|
|
|
var text = status.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");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-07-31 18:19:54 +00:00
|
|
|
var startTime = 0;
|
|
|
|
function onProgress() {
|
|
|
|
var throbber = document.getElementById("Messenger:Throbber");
|
|
|
|
var meter = document.getElementById("Messenger:LoadingProgress");
|
|
|
|
if ( throbber && meter ) {
|
|
|
|
var busy = throbber.getAttribute("busy");
|
|
|
|
var wasBusy = meter.getAttribute("mode") == "undetermined" ? "true" : "false";
|
|
|
|
if ( busy == "true" ) {
|
|
|
|
if ( wasBusy == "false" ) {
|
|
|
|
// Remember when loading commenced.
|
|
|
|
startTime = (new Date()).getTime();
|
|
|
|
// Turn progress meter on.
|
|
|
|
meter.setAttribute("mode","undetermined");
|
|
|
|
}
|
|
|
|
// Update status bar.
|
|
|
|
} else if ( busy == "false" && wasBusy == "true" ) {
|
|
|
|
// Record page loading time.
|
|
|
|
var status = document.getElementById("Messenger:Status");
|
|
|
|
if ( status ) {
|
|
|
|
var elapsed = ( (new Date()).getTime() - startTime ) / 1000;
|
|
|
|
var msg = "Document: Done (" + elapsed + " secs)";
|
|
|
|
dump( msg + "\n" );
|
|
|
|
status.setAttribute("value",msg);
|
|
|
|
defaultStatus = msg;
|
|
|
|
}
|
|
|
|
// Turn progress meter off.
|
|
|
|
meter.setAttribute("mode","normal");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function dumpProgress() {
|
|
|
|
var broadcaster = document.getElementById("Messenger:LoadingProgress");
|
|
|
|
var meter = document.getElementById("meter");
|
|
|
|
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" );
|
|
|
|
}
|