Bug #251296 --> front end work for favorite folders. sr=bienvenu

This commit is contained in:
scott%scott-macgregor.org 2006-02-14 23:56:59 +00:00
Родитель 4cc50bbc40
Коммит b6bb0ecf64
13 изменённых файлов: 503 добавлений и 405 удалений

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

@ -159,7 +159,14 @@ pref("xpinstall.whitelist.add", "update.mozilla.org");
pref("xpinstall.whitelist.add.103", "addons.mozilla.org");
pref("mail.phishing.detection.enabled", true); // enable / disable phishing detection for link clicks
pref("mail.spellcheck.inline", true);
pref("mail.spellcheck.inline", true);
// Folder Pane View
// 0 == All Folders
// 1 == Unread Folders
// 2 == Favorite Folders
// 3 == Most Recently Used Folders
pref("mail.ui.folderpane.view", 0);
#ifdef XP_WIN
pref("browser.preferences.instantApply", false);

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

@ -63,7 +63,8 @@ var MSG_FOLDER_FLAG_DRAFTS = 0x0400;
var MSG_FOLDER_FLAG_QUEUE = 0x0800;
var MSG_FOLDER_FLAG_INBOX = 0x1000;
var MSG_FOLDER_FLAG_TEMPLATES = 0x400000;
var MSG_FOLDER_FLAG_JUNK = 0x40000000;
var MSG_FOLDER_FLAG_JUNK = 0x40000000;
var MSG_FOLDER_FLAG_FAVORITE = 0x80000000;
function OpenURL(url)
{

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

@ -297,16 +297,12 @@ function fillFolderPaneContextMenu()
var canGetMessages = (isServer && (serverType != "nntp") && (serverType !="none")) || isNewsgroup;
EnableMenuItem("folderPaneContext-properties", true);
ShowMenuItem("folderPaneContext-getMessages", (numSelected <= 1) && canGetMessages);
EnableMenuItem("folderPaneContext-getMessages", true);
ShowMenuItem("folderPaneContext-openNewWindow", (numSelected <= 1) && !isServer);
EnableMenuItem("folderPaneContext-openNewWindow", true);
SetupRenameMenuItem(folderResource, numSelected, isServer, serverType, specialFolder);
SetupRemoveMenuItem(folderResource, numSelected, isServer, serverType, specialFolder);
SetupCompactMenuItem(folderResource, numSelected);
SetupFavoritesMenuItem(folderResource, numSelected, isServer, 'folderPaneContext-favoriteFolder');
ShowMenuItem("folderPaneContext-copy-location", !isServer && !isVirtualFolder);
ShowMenuItem("folderPaneContext-emptyTrash", (numSelected <= 1) && (specialFolder == 'Trash'));
EnableMenuItem("folderPaneContext-emptyTrash", true);
@ -314,13 +310,8 @@ function fillFolderPaneContextMenu()
var showSendUnsentMessages = (numSelected <= 1)
&& (specialFolder == 'Unsent Messages' || specialFolder == 'Unsent');
ShowMenuItem("folderPaneContext-sendUnsentMessages", showSendUnsentMessages);
if (showSendUnsentMessages) {
if (showSendUnsentMessages)
EnableMenuItem("folderPaneContext-sendUnsentMessages", IsSendUnsentMsgsEnabled(folderResource));
}
ShowMenuItem("folderPaneContext-sep-edit", (numSelected <= 1));
SetupNewMenuItem(folderResource, numSelected, isServer, serverType, specialFolder);
ShowMenuItem("folderPaneContext-subscribe", (numSelected <= 1) && canSubscribeToFolder && !isVirtualFolder);
EnableMenuItem("folderPaneContext-subscribe", !isVirtualFolder);
@ -328,26 +319,27 @@ function fillFolderPaneContextMenu()
// XXX: Hack for RSS servers...
ShowMenuItem("folderPaneContext-rssSubscribe", (numSelected <= 1) && (serverType == "rss"));
EnableMenuItem("folderPaneContext-rssSubscribe", true);
ShowMenuItem("folderPaneContext-sep1", (numSelected <= 1) && !isServer);
// News folder context menu =============================================
// News folder context menu =============================================
ShowMenuItem("folderPaneContext-newsUnsubscribe", (numSelected <= 1) && canSubscribeToFolder && isNewsgroup);
EnableMenuItem("folderPaneContext-newsUnsubscribe", true);
ShowMenuItem("folderPaneContext-markNewsgroupAllRead", (numSelected <= 1) && isNewsgroup);
EnableMenuItem("folderPaneContext-markNewsgroupAllRead", true);
// End of News folder context menu =======================================
// End of News folder context menu =======================================
ShowMenuItem("folderPaneContext-markMailFolderAllRead", (numSelected <= 1) && isMailFolder && !isVirtualFolder);
EnableMenuItem("folderPaneContext-markMailFolderAllRead", !isVirtualFolder);
ShowMenuItem("folderPaneContext-searchMessages", (numSelected<=1) && !isVirtualFolder);
EnableMenuItem("folderPaneContext-searchMessages", IsCanSearchMessagesEnabled() && !isVirtualFolder);
EnableMenuItem("folderPaneContext-searchMessages", IsCanSearchMessagesEnabled() && !isVirtualFolder);
// Hide / Show our menu separators based on the menu items we are showing.
ShowMenuItem("folderPaneContext-sep1", (numSelected <= 1) && !isServer);
ShowMenuItem('folderPaneContext-sep2', shouldShowSeparator('folderPaneContext-sep2'));
ShowMenuItem("folderPaneContext-sep3", shouldShowSeparator('folderPaneContext-sep3')); // we always show the separator before properties menu item
return(true);
}
function SetupRenameMenuItem(folderResource, numSelected, isServer, serverType, specialFolder)
{
var msgFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder);
@ -359,11 +351,6 @@ function SetupRenameMenuItem(folderResource, numSelected, isServer, serverType,
ShowMenuItem("folderPaneContext-rename", (numSelected <= 1) && !isServer && !isSpecialFolder && canRename);
var folder = GetMsgFolderFromResource(folderResource);
EnableMenuItem("folderPaneContext-rename", !isServer && folder.isCommandEnabled("cmd_renameFolder"));
if(canRename)
{
SetMenuItemLabel("folderPaneContext-rename", gMessengerBundle.getString("renameFolder"));
}
}
function SetupRemoveMenuItem(folderResource, numSelected, isServer, serverType, specialFolder)
@ -381,10 +368,6 @@ function SetupRemoveMenuItem(folderResource, numSelected, isServer, serverType,
var folder = GetMsgFolderFromResource(folderResource);
EnableMenuItem("folderPaneContext-remove", folder.isCommandEnabled("cmd_delete"));
}
if(isMail && !isSpecialFolder)
{
SetMenuItemLabel("folderPaneContext-remove", gMessengerBundle.getString("removeFolder"));
}
}
function SetupCompactMenuItem(folderResource, numSelected)
@ -394,35 +377,18 @@ function SetupCompactMenuItem(folderResource, numSelected)
var folder = GetMsgFolderFromResource(folderResource);
ShowMenuItem("folderPaneContext-compact", (numSelected <=1) && canCompact && !(folder.flags & MSG_FOLDER_FLAG_VIRTUAL));
EnableMenuItem("folderPaneContext-compact", folder.isCommandEnabled("cmd_compactFolder") && !(folder.flags & MSG_FOLDER_FLAG_VIRTUAL));
if(canCompact)
{
SetMenuItemLabel("folderPaneContext-compact", gMessengerBundle.getString("compactFolder"));
}
}
function SetupNewMenuItem(folderResource, numSelected, isServer, serverType, specialFolder)
function SetupFavoritesMenuItem(folderResource, numSelected, isServer, menuItemId)
{
var folderTree = GetFolderTree();
var canCreateNew = GetFolderAttribute(folderTree, folderResource, "CanCreateSubfolders") == "true";
var isInbox = specialFolder == "Inbox";
var isIMAPFolder = GetFolderAttribute(folderTree, folderResource,
"ServerType") == "imap";
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var showNew = ((numSelected <=1) && (serverType != 'nntp') && canCreateNew) || isInbox;
ShowMenuItem("folderPaneContext-new", showNew);
EnableMenuItem("folderPaneContext-new", !isIMAPFolder || !ioService.offline);
if(showNew)
{
if(isServer || isInbox)
SetMenuItemLabel("folderPaneContext-new", gMessengerBundle.getString("newFolder"));
else
SetMenuItemLabel("folderPaneContext-new", gMessengerBundle.getString("newSubfolder"));
}
var folder = GetMsgFolderFromResource(folderResource);
var showItem = !isServer && (numSelected <=1);
ShowMenuItem(menuItemId, showItem);
// adjust the checked state on the menu
if (showItem)
document.getElementById(menuItemId).setAttribute('checked',folder.getFlag(MSG_FOLDER_FLAG_FAVORITE));
}
function ShowMenuItem(id, showItem)
@ -499,45 +465,55 @@ function fillMessagePaneContextMenu()
SetupAddSenderToABMenuItem("messagePaneContext-addSenderToAddressBook", numSelected, (numSelected == 0 || hideMailItems));
SetupAddAllToABMenuItem("messagePaneContext-addAllToAddressBook", numSelected, (numSelected == 0 || hideMailItems));
//Figure out separators
ShowMenuItem("messagePaneContext-sep-open", ShowSeparator("messagePaneContext-sep-open"));
ShowMenuItem("messagePaneContext-sep-reply", ShowSeparator("messagePaneContext-sep-reply"));
ShowMenuItem("messagePaneContext-sep-edit", ShowSeparator("messagePaneContext-sep-edit") || gContextMenu.onMailtoLink);
ShowMenuItem("messagePaneContext-sep-link", ShowSeparator("messagePaneContext-sep-link"));
ShowMenuItem("messagePaneContext-sep-copy", ShowSeparator("messagePaneContext-sep-copy"));
ShowMenuItem("messagePaneContext-sep-labels-1", ShowSeparator("messagePaneContext-sep-labels-1"));
ShowMenuItem("messagePaneContext-sep-labels-2", ShowSeparator("messagePaneContext-sep-labels-2"));
ShowMenuItem( "context-addemail", gContextMenu.onMailtoLink );
ShowMenuItem( "context-composeemailto", gContextMenu.onMailtoLink );
// if we are on an image, go ahead and show this separator
if (gContextMenu.onLink && !gContextMenu.onMailtoLink)
ShowMenuItem("messagePaneContext-sep-edit", false);
}
function ShowSeparator(aSeparatorID)
{
var separator = document.getElementById(aSeparatorID);
var sibling = separator.previousSibling;
var siblingID;
var siblingNextHiddenAttrib = separator.nextSibling.getAttribute("hidden");
while (sibling && sibling.localName != "menuseparator") {
siblingID = sibling.getAttribute("id");
// for some reason, context-blockimage and context-unblockimage is not
// hidden on the very first time the context menu is invoked. It's only
// hidden on subsequent triggers of the context menu. Since we're not
// using these two menuitems in mailnews, we can ignore it if encountered.
if ((sibling.getAttribute("hidden") != "true") &&
(siblingNextHiddenAttrib != "true") &&
(siblingID != "context-blockimage") &&
(siblingID != "context-unblockimage"))
return true;
sibling = sibling.previousSibling;
}
return false;
//if (gContextMenu.onLink && !gContextMenu.onMailtoLink)
// ShowMenuItem("messagePaneContext-sep-edit", false);
//Figure out separators
ShowMenuItem("messagePaneContext-sep-link", shouldShowSeparator("messagePaneContext-sep-link"));
ShowMenuItem("messagePaneContext-sep-open", shouldShowSeparator("messagePaneContext-sep-open"));
ShowMenuItem("messagePaneContext-sep-reply", shouldShowSeparator("messagePaneContext-sep-reply"));
ShowMenuItem("messagePaneContext-sep-labels-1", shouldShowSeparator("messagePaneContext-sep-labels-1"));
ShowMenuItem("messagePaneContext-sep-labels-2", shouldShowSeparator("messagePaneContext-sep-labels-2"));
ShowMenuItem("messagePaneContext-sep-edit", shouldShowSeparator("messagePaneContext-sep-edit"));
ShowMenuItem("messagePaneContext-sep-copy", shouldShowSeparator("messagePaneContext-sep-copy"));
}
// Determines whether or not the separator with the specified ID should be
// shown or not by determining if there are any non-hidden items between it
// and the previous separator. You should start with the first separator in the menu.
function shouldShowSeparator(aSeparatorID)
{
var separator = document.getElementById(aSeparatorID);
if (separator)
{
var sibling = separator.previousSibling;
while (sibling)
{
if (sibling.getAttribute("hidden") != "true")
return sibling.localName != "menuseparator" && hasAVisibleNextSibling(separator);
sibling = sibling.previousSibling;
}
}
return false;
}
// helper function used by shouldShowSeparator
function hasAVisibleNextSibling(aNode)
{
var sibling = aNode.nextSibling;
while (sibling)
{
if (sibling.getAttribute("hidden") != "true"
&& sibling.localName != "menuseparator")
return true;
sibling = sibling.nextSibling;
}
return false;
}
function IsMenuItemShowing(menuID)
{

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

@ -69,7 +69,9 @@ var gBrandBundle;
var datasourceContractIDPrefix = "@mozilla.org/rdf/datasource;1?name=";
var accountManagerDSContractID = datasourceContractIDPrefix + "msgaccountmanager";
var folderDSContractID = datasourceContractIDPrefix + "mailnewsfolders";
var unreadFoldersDSContractID = datasourceContractIDPrefix + "mailnewsunreadfolders";
var favoriteFoldersDSContractID = datasourceContractIDPrefix + "mailnewsfavefolders";
var recentFoldersDSContractID = datasourceContractIDPrefix + "mailnewsrecentfolders";
var accountManagerDataSource;
var folderDataSource;
@ -202,7 +204,9 @@ function CreateMailWindowGlobals()
//Create datasources
accountManagerDataSource = Components.classes[accountManagerDSContractID].createInstance();
folderDataSource = Components.classes[folderDSContractID].getService();
unreadFolderDataSource = Components.classes[unreadFoldersDSContractID].getService();
favoriteFoldersDataSource = Components.classes[favoriteFoldersDSContractID].getService();
recentFoldersDataSource = Components.classes[recentFoldersDSContractID].getService();
accountCentralBox = document.getElementById("accountCentralBox");
}

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

@ -155,7 +155,24 @@ function InitEditMessagesMenu()
{
goSetMenuValue('cmd_delete', 'valueDefault');
goSetAccessKey('cmd_delete', 'valueDefaultAccessKey');
document.commandDispatcher.updateCommands('create-menu-edit');
document.commandDispatcher.updateCommands('create-menu-edit');
// initialize the favorite Folder checkbox in the edit menu
var favoriteFolderMenu = document.getElementById('menu_favoriteFolder');
if (favoriteFolderMenu && !favoriteFolderMenu.disabled)
{
var folderTree = GetFolderTree();
var startIndex = {};
var endIndex = {};
folderTree.view.selection.getRangeAt(0, startIndex, endIndex);
if (startIndex.value >= 0)
{
var numSelected = endIndex.value - startIndex.value + 1;
var folderResource = GetFolderResource(folderTree, startIndex.value);
var isServer = GetFolderAttribute(folderTree, folderResource, "IsServer") == 'true';
SetupFavoritesMenuItem(folderResource, numSelected, isServer, 'menu_favoriteFolder');
}
}
}
function InitGoMessagesMenu()
@ -204,79 +221,71 @@ function view_init()
document.commandDispatcher.updateCommands('create-menu-view');
}
function InitViewLayoutStyleMenu()
function InitViewLayoutStyleMenu(event)
{
var paneConfig = pref.getIntPref("mail.pane_config.dynamic");
switch (paneConfig)
{
case kClassicMailLayout:
id ="messagePaneClassic";
break;
case kWideMailLayout:
id = "messagePaneWide";
break;
case kVerticalMailLayout:
id = "messagePaneVertical";
break;
}
var layoutStyleMenuitem = document.getElementById(id);
if (layoutStyleMenuitem)
var paneConfig = pref.getIntPref("mail.pane_config.dynamic");
var layoutStyleMenuitem = event.target.childNodes[paneConfig];
if (layoutStyleMenuitem)
layoutStyleMenuitem.setAttribute("checked", "true");
}
function InitViewFolderViewsMenu(event)
{
var layoutStyleMenuitem = event.target.childNodes[gCurrentFolderView];
if (layoutStyleMenuitem)
layoutStyleMenuitem.setAttribute("checked", "true");
}
function setSortByMenuItemCheckState(id, value)
{
var menuitem = document.getElementById(id);
if (menuitem) {
menuitem.setAttribute("checked", value);
}
var menuitem = document.getElementById(id);
if (menuitem)
menuitem.setAttribute("checked", value);
}
function InitViewSortByMenu()
{
var sortType = gDBView.sortType;
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));
setSortByMenuItemCheckState("sortByUnreadMenuitem", (sortType == nsMsgViewSortType.byUnread));
setSortByMenuItemCheckState("sortByLabelMenuitem", (sortType == nsMsgViewSortType.byLabel));
setSortByMenuItemCheckState("sortByJunkStatusMenuitem", (sortType == nsMsgViewSortType.byJunkStatus));
setSortByMenuItemCheckState("sortBySenderMenuitem", (sortType == nsMsgViewSortType.byAuthor));
setSortByMenuItemCheckState("sortByRecipientMenuitem", (sortType == nsMsgViewSortType.byRecipient));
setSortByMenuItemCheckState("sortByAttachmentsMenuitem", (sortType == nsMsgViewSortType.byAttachments));
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));
setSortByMenuItemCheckState("sortByUnreadMenuitem", (sortType == nsMsgViewSortType.byUnread));
setSortByMenuItemCheckState("sortByLabelMenuitem", (sortType == nsMsgViewSortType.byLabel));
setSortByMenuItemCheckState("sortByJunkStatusMenuitem", (sortType == nsMsgViewSortType.byJunkStatus));
setSortByMenuItemCheckState("sortBySenderMenuitem", (sortType == nsMsgViewSortType.byAuthor));
setSortByMenuItemCheckState("sortByRecipientMenuitem", (sortType == nsMsgViewSortType.byRecipient));
setSortByMenuItemCheckState("sortByAttachmentsMenuitem", (sortType == nsMsgViewSortType.byAttachments));
var sortOrder = gDBView.sortOrder;
var sortTypeSupportsGrouping = (sortType == nsMsgViewSortType.byAuthor
|| sortType == nsMsgViewSortType.byDate || sortType == nsMsgViewSortType.byPriority
|| sortType == nsMsgViewSortType.bySubject || sortType == nsMsgViewSortType.byLabel
|| sortType == nsMsgViewSortType.byRecipient || sortType == nsMsgViewSortType.byAccount
|| sortType == nsMsgViewSortType.byStatus);
var sortOrder = gDBView.sortOrder;
var sortTypeSupportsGrouping = (sortType == nsMsgViewSortType.byAuthor
|| sortType == nsMsgViewSortType.byDate || sortType == nsMsgViewSortType.byPriority
|| sortType == nsMsgViewSortType.bySubject || sortType == nsMsgViewSortType.byLabel
|| sortType == nsMsgViewSortType.byRecipient || sortType == nsMsgViewSortType.byAccount
|| sortType == nsMsgViewSortType.byStatus);
setSortByMenuItemCheckState("sortAscending", (sortOrder == nsMsgViewSortOrder.ascending));
setSortByMenuItemCheckState("sortDescending", (sortOrder == nsMsgViewSortOrder.descending));
setSortByMenuItemCheckState("sortAscending", (sortOrder == nsMsgViewSortOrder.ascending));
setSortByMenuItemCheckState("sortDescending", (sortOrder == nsMsgViewSortOrder.descending));
var grouped = ((gDBView.viewFlags & nsMsgViewFlagsType.kGroupBySort) != 0);
var threaded = ((gDBView.viewFlags & nsMsgViewFlagsType.kThreadedDisplay) != 0 && !grouped);
var sortThreadedMenuItem = document.getElementById("sortThreaded");
var sortUnthreadedMenuItem = document.getElementById("sortUnthreaded");
var grouped = ((gDBView.viewFlags & nsMsgViewFlagsType.kGroupBySort) != 0);
var threaded = ((gDBView.viewFlags & nsMsgViewFlagsType.kThreadedDisplay) != 0 && !grouped);
var sortThreadedMenuItem = document.getElementById("sortThreaded");
var sortUnthreadedMenuItem = document.getElementById("sortUnthreaded");
sortThreadedMenuItem.setAttribute("checked", threaded);
sortUnthreadedMenuItem.setAttribute("checked", !threaded && !grouped);
sortThreadedMenuItem.setAttribute("checked", threaded);
sortUnthreadedMenuItem.setAttribute("checked", !threaded && !grouped);
sortThreadedMenuItem.setAttribute("disabled", !gDBView.supportsThreading);
sortUnthreadedMenuItem.setAttribute("disabled", !gDBView.supportsThreading);
sortThreadedMenuItem.setAttribute("disabled", !gDBView.supportsThreading);
sortUnthreadedMenuItem.setAttribute("disabled", !gDBView.supportsThreading);
var groupBySortOrderMenuItem = document.getElementById("groupBySort");
var groupBySortOrderMenuItem = document.getElementById("groupBySort");
groupBySortOrderMenuItem.setAttribute("disabled", !gDBView.supportsThreading || !sortTypeSupportsGrouping);
groupBySortOrderMenuItem.setAttribute("checked", grouped);
groupBySortOrderMenuItem.setAttribute("disabled", !gDBView.supportsThreading || !sortTypeSupportsGrouping);
groupBySortOrderMenuItem.setAttribute("checked", grouped);
}
function InitViewMessagesMenu()
@ -1103,38 +1112,42 @@ function MsgSubscribe()
function ConfirmUnsubscribe(folder)
{
if (!gMessengerBundle)
gMessengerBundle = document.getElementById("bundle_messenger");
if (!gMessengerBundle)
gMessengerBundle = document.getElementById("bundle_messenger");
var titleMsg = gMessengerBundle.getString("confirmUnsubscribeTitle");
var dialogMsg = gMessengerBundle.getFormattedString("confirmUnsubscribeText",
[folder.name], 1);
var titleMsg = gMessengerBundle.getString("confirmUnsubscribeTitle");
var dialogMsg = gMessengerBundle.getFormattedString("confirmUnsubscribeText",
[folder.name], 1);
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
return promptService.confirm(window, titleMsg, dialogMsg);
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
return promptService.confirm(window, titleMsg, dialogMsg);
}
function MsgUnsubscribe()
{
var folder = GetFirstSelectedMsgFolder();
if (ConfirmUnsubscribe(folder)) {
UnSubscribe(folder);
}
var folder = GetFirstSelectedMsgFolder();
if (ConfirmUnsubscribe(folder)) {
UnSubscribe(folder);
}
}
function ToggleFavoriteFolderFlag()
{
var folder = GetFirstSelectedMsgFolder();
folder.toggleFlag(MSG_FOLDER_FLAG_FAVORITE);
}
function MsgSaveAsFile()
{
if (GetNumSelectedMessages() == 1) {
SaveAsFile(GetFirstSelectedMessage());
}
if (GetNumSelectedMessages() == 1)
SaveAsFile(GetFirstSelectedMessage());
}
function MsgSaveAsTemplate()
{
var folder = GetLoadedMsgFolder();
if (GetNumSelectedMessages() == 1) {
SaveAsTemplate(GetFirstSelectedMessage(), folder);
}
var folder = GetLoadedMsgFolder();
if (GetNumSelectedMessages() == 1)
SaveAsTemplate(GetFirstSelectedMessage(), folder);
}
function MsgOpenNewWindowForMsgHdr(hdr)

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

@ -693,14 +693,12 @@
<popup id="folderPaneContext" onpopupshowing="return fillFolderPaneContextMenu();"
onpopuphiding="if (event.target == this) folderPaneOnPopupHiding();">
<menuitem id="folderPaneContext-openNewWindow"
label="&folderContextOpenNewWindow.label;"
accesskey="&folderContextOpenNewWindow.accesskey;"
oncommand="MsgOpenNewWindowForFolder(null,-1);"/>
<menuitem id="folderPaneContext-copy-location"
label="&folderContextCopyLocation.label;"
accesskey="&folderContextCopyLocation.accesskey;"
oncommand="CopyFolderUrl();"/>
<menuitem id="folderPaneContext-searchMessages"
label="&folderContextSearchMessages.label;"
accesskey="&folderContextSearchMessages.accesskey;"
observes="cmd_search"/>
<menuitem id="folderPaneContext-subscribe"
label="&folderContextSubscribe.label;"
accesskey="&folderContextSubscribe.accesskey;"
@ -708,36 +706,38 @@
<menuitem id="folderPaneContext-newsUnsubscribe"
label="&folderContextUnsubscribe.label;"
accesskey="&folderContextUnsubscribe.accesskey;"
oncommand="MsgUnsubscribe();"/>
<menuseparator id="folderPaneContext-sep1"/>
<menuitem id="folderPaneContext-getMessages"
label="&folderContextGetMessages.label;"
accesskey="&folderContextGetMessages.accesskey;"
oncommand="MsgGetMessage();"/>
oncommand="MsgUnsubscribe();"/>
<!-- To Do: Move this to the folder properties dialog -->
<menuitem id="folderPaneContext-copy-location"
label="&folderContextCopyLocation.label;"
accesskey="&folderContextCopyLocation.accesskey;"
oncommand="CopyFolderUrl();"/>
<menuseparator id="folderPaneContext-sep1"/>
<menuitem id="folderPaneContext-remove"
label="&folderContextRemove.label;"
accesskey="&folderContextRemove.accesskey;"
oncommand="MsgDeleteFolder();"/>
<menuitem id="folderPaneContext-rename"
label="&folderContextRename.label;"
accesskey="&folderContextRename.accesskey;"
oncommand="MsgRenameFolder();"/>
<menuseparator id="folderPaneContext-sep2"/>
<menuitem id="folderPaneContext-compact"
label="&folderContextCompact.label;"
accesskey="&folderContextCompact.accesskey;"
oncommand="MsgCompactFolder(false);"/>
<menuitem id="folderPaneContext-markMailFolderAllRead"
label="&folderContextMarkMailFolderRead.label;"
accesskey="&folderContextMarkMailFolderRead.accesskey;"
oncommand="MsgMarkAllRead();"/>
<menuitem id="folderPaneContext-markNewsgroupAllRead"
label="&folderContextMarkNewsgroupRead.label;"
accesskey="&folderContextMarkNewsgroupRead.accesskey;"
oncommand="MsgMarkAllRead();"/>
<menuitem id="folderPaneContext-markMailFolderAllRead"
label="&folderContextMarkMailFolderRead.label;"
accesskey="&folderContextMarkMailFolderRead.accesskey;"
oncommand="MsgMarkAllRead();"/>
<menuitem id="folderPaneContext-new"
label="&folderContextNew.label;"
accesskey="&folderContextNew.accesskey;"
oncommand="MsgNewFolder(NewFolder);"/>
<menuitem id="folderPaneContext-rename"
label="&folderContextRename.label;"
accesskey="&folderContextRename.accesskey;"
oncommand="MsgRenameFolder();"/>
<menuitem id="folderPaneContext-compact"
label="&folderContextCompact.label;"
accesskey="&folderContextCompact.accesskey;"
oncommand="MsgCompactFolder(false);"/> //for one folder only
<menuitem id="folderPaneContext-remove"
label="&folderContextRemove.label;"
accesskey="&folderContextRemove.accesskey;"
oncommand="MsgDeleteFolder();"/>
<menuitem id="folderPaneContext-emptyTrash"
label="&folderContextEmptyTrash.label;"
accesskey="&folderContextEmptyTrash.accesskey;"
@ -746,11 +746,15 @@
label="&folderContextSendUnsentMessages.label;"
accesskey="&folderContextSendUnsentMessages.accesskey;"
oncommand="goDoCommand('cmd_sendUnsentMsgs')"/>
<menuseparator id="folderPaneContext-sep-edit"/>
<menuitem id="folderPaneContext-searchMessages"
label="&folderContextSearchMessages.label;"
accesskey="&folderContextSearchMessages.accesskey;"
observes="cmd_search"/>
<menuseparator id="folderPaneContext-sep3"/>
<menuitem id="folderPaneContext-favoriteFolder"
type="checkbox"
label="&folderContextFavoriteFolder.label;"
accesskey="&folderContextFavoriteFolder.accesskey;"
check="false"
oncommand="ToggleFavoriteFolderFlag();"/>
<menuitem id="folderPaneContext-properties"
label="&folderContextProperties.label;"
accesskey="&folderContextProperties.accesskey;"
@ -1024,35 +1028,35 @@
<menuitem id="messagePaneContext-delete"
command="cmd_delete"/>
<menuseparator id="messagePaneContext-sep-edit"/>
<menuitem id="context-copylink"
label="&copyLinkCmd.label;"
accesskey="&copyLinkCmd.accesskey;"
command="cmd_copyLink"/>
<menuitem id="context-copyimage"
label="&copyImageCmd.label;"
accesskey="&copyImageCmd.accesskey;"
command="cmd_copyImageLocation"/>
<menuitem id="context-addemail"
label="&AddToAddressBook.label;"
accesskey="&AddToAddressBook.accesskey;"
oncommand="addEmail();"/>
<menuitem id="context-composeemailto"
label="&SendMailTo.label;"
accesskey="&SendMailTo.accesskey;"
oncommand="composeEmailTo();"/>
<menuitem id="context-copyemail"
label="&copyEmailCmd.label;"
accesskey="&copyEmailCmd.accesskey;"
oncommand="gContextMenu.copyEmail();"/>
<menuseparator id="messagePaneContext-sep-copy"/>
<menuitem id="context-savelink"
label="&saveLinkCmd.label;"
accesskey="&saveLinkCmd.accesskey;"
oncommand="gContextMenu.saveLink();"/>
<menuitem id="context-saveimage"
label="&saveImageCmd.label;"
accesskey="&saveImageCmd.accesskey;"
oncommand="gContextMenu.saveImage();"/>
<menuitem id="context-copylink"
label="&copyLinkCmd.label;"
accesskey="&copyLinkCmd.accesskey;"
command="cmd_copyLink"/>
<menuitem id="context-copyimage"
label="&copyImageCmd.label;"
accesskey="&copyImageCmd.accesskey;"
command="cmd_copyImageLocation"/>
<menuitem id="context-addemail"
label="&AddToAddressBook.label;"
accesskey="&AddToAddressBook.accesskey;"
oncommand="addEmail();"/>
<menuitem id="context-composeemailto"
label="&SendMailTo.label;"
accesskey="&SendMailTo.accesskey;"
oncommand="composeEmailTo();"/>
<menuitem id="context-copyemail"
label="&copyEmailCmd.label;"
accesskey="&copyEmailCmd.accesskey;"
oncommand="gContextMenu.copyEmail();"/>
<menuseparator id="messagePaneContext-sep-copy"/>
<menuitem id="context-savelink"
label="&saveLinkCmd.label;"
accesskey="&saveLinkCmd.accesskey;"
oncommand="gContextMenu.saveLink();"/>
<menuitem id="context-saveimage"
label="&saveImageCmd.label;"
accesskey="&saveImageCmd.accesskey;"
oncommand="gContextMenu.saveImage();"/>
</popup>
@ -1165,49 +1169,55 @@
<!-- Edit -->
<menu id="menu_Edit" oncommand="CommandUpdate_UndoRedo();">
<menupopup onpopupshowing="InitEditMessagesMenu()">
<menuitem id="menu_undo" label="&undoDefaultCmd.label;" accesskey="&undoDefaultCmd.accesskey;" key="key_undo" observes="cmd_undo" oncommand="Undo()"/>
<menuitem id="menu_redo" label="&redoDefaultCmd.label;" accesskey="&redoDefaultCmd.accesskey;" key="key_redo" observes="cmd_redo" oncommand="Redo()"/>
<menuseparator/>
<menuitem id="menu_cut"/>
<menuitem id="menu_copy"/>
<menuitem id="menu_paste"/>
<menuitem id="menu_delete" observes="cmd_delete"/>
<menuseparator/>
<menu label="&selectMenu.label;" accesskey="&selectMenu.accesskey;">
<menupopup>
<menuitem label="&all.label;" accesskey="&all.accesskey;" key="key_selectAll"
command="cmd_selectAll"/>
<menuseparator/>
<menuitem label="&selectThreadCmd.label;"
accesskey="&selectThreadCmd.accesskey;"
key="key_selectThread"
observes="cmd_selectThread"/>
</menupopup>
</menu>
<menuseparator/>
<menu label="&find.label;" accesskey="&find.accesskey;">
<menupopup>
<menuitem label="&findCmd.label;" key="key_find" accesskey="&findCmd.accesskey;" observes="cmd_find"/>
<menuitem label="&findAgainCmd.label;" key="key_findAgain" accesskey="&findAgainCmd.accesskey;" observes="cmd_findAgain"/>
<menuitem label="&findPrevCmd.label;" key="key_findPrev" accesskey="&findPrevCmd.accesskey;" observes="cmd_findPrev"/>
<menuseparator/>
<menuitem id="searchMailCmd" label="&searchMailCmd.label;"
key="key_searchMail"
accesskey="&searchMailCmd.accesskey;"
oncommand="MsgSearchMessages();"/>
<menuitem id="searchAddressesCmd" label="&searchAddressesCmd.label;"
accesskey="&searchAddressesCmd.accesskey;"
oncommand="MsgSearchAddresses()"/>
</menupopup>
</menu>
<menuseparator id="editPropertiesSeparator"/>
<menuitem id="menu_properties" label="&folderPropsCmd.label;"
accesskey="&folderPropsCmd.accesskey;"
observes="cmd_properties"/>
<menuitem id="menu_undo" label="&undoDefaultCmd.label;" accesskey="&undoDefaultCmd.accesskey;" key="key_undo" observes="cmd_undo" oncommand="Undo()"/>
<menuitem id="menu_redo" label="&redoDefaultCmd.label;" accesskey="&redoDefaultCmd.accesskey;" key="key_redo" observes="cmd_redo" oncommand="Redo()"/>
<menuseparator/>
<menuitem id="menu_cut"/>
<menuitem id="menu_copy"/>
<menuitem id="menu_paste"/>
<menuitem id="menu_delete" observes="cmd_delete"/>
<menuseparator/>
<menu label="&selectMenu.label;" accesskey="&selectMenu.accesskey;">
<menupopup>
<menuitem label="&all.label;" accesskey="&all.accesskey;" key="key_selectAll"
command="cmd_selectAll"/>
<menuseparator/>
<menuitem label="&selectThreadCmd.label;"
accesskey="&selectThreadCmd.accesskey;"
key="key_selectThread"
observes="cmd_selectThread"/>
</menupopup>
</menu>
<menuseparator/>
<menu label="&find.label;" accesskey="&find.accesskey;">
<menupopup>
<menuitem label="&findCmd.label;" key="key_find" accesskey="&findCmd.accesskey;" observes="cmd_find"/>
<menuitem label="&findAgainCmd.label;" key="key_findAgain" accesskey="&findAgainCmd.accesskey;" observes="cmd_findAgain"/>
<menuitem label="&findPrevCmd.label;" key="key_findPrev" accesskey="&findPrevCmd.accesskey;" observes="cmd_findPrev"/>
<menuseparator/>
<menuitem id="searchMailCmd" label="&searchMailCmd.label;"
key="key_searchMail"
accesskey="&searchMailCmd.accesskey;"
oncommand="MsgSearchMessages();"/>
<menuitem id="searchAddressesCmd" label="&searchAddressesCmd.label;"
accesskey="&searchAddressesCmd.accesskey;"
oncommand="MsgSearchAddresses()"/>
</menupopup>
</menu>
<menuseparator id="editPropertiesSeparator"/>
<menuitem id="menu_favoriteFolder"
type="checkbox"
label="&menuFavoriteFolder.label;"
accesskey="&menuFavoriteFolder.accesskey;"
check="false"
oncommand="ToggleFavoriteFolderFlag();"/>
<menuitem id="menu_properties" label="&folderPropsCmd.label;"
accesskey="&folderPropsCmd.accesskey;"
observes="cmd_properties"/>
#ifdef XP_UNIX
#ifndef XP_MACOSX
<menuitem id="menu_accountmgr" label="&accountManagerCmd.label;" accesskey="&accountManagerCmdUnix.accesskey;" oncommand="MsgAccountManager(null);"/>
<menuitem id="menu_preferences" oncommand="openOptionsDialog()"/>
<menuitem id="menu_accountmgr" label="&accountManagerCmd.label;" accesskey="&accountManagerCmdUnix.accesskey;" oncommand="MsgAccountManager(null);"/>
<menuitem id="menu_preferences" oncommand="openOptionsDialog()"/>
#endif
#endif
</menupopup>
@ -1216,6 +1226,7 @@
<!-- View -->
<menu id="menu_View">
<menupopup id="menu_View_Popup" onpopupshowing="view_init()">
<menu id="menu_Toolbars">
<menupopup id="view_toolbars_popup">
<menuitem id="menu_showMessengerToolbar"
@ -1229,8 +1240,9 @@
<menuitem id="menu_customizeToolbar" oncommand="CustomizeMailToolbar('mail-toolbox');" label="&customizeToolbar.label;" accesskey="&customizeToolbar.accesskey;"/>
</menupopup>
</menu>
<menu id="menu_MessagePaneLayout" label="&messagePaneLayoutStyle.label;" accesskey="&messagePaneLayoutStyle.accesskey;">
<menupopup onpopupshowing="InitViewLayoutStyleMenu()">
<menupopup onpopupshowing="InitViewLayoutStyleMenu(event)">
<menuitem id="messagePaneClassic" type="radio" label="&messagePaneClassic.label;" name="viewlayoutgroup"
accesskey="&messagePaneClassic.accesskey;" oncommand="ChangeMailLayout(kClassicMailLayout);"/>
<menuitem id="messagePaneWide" type="radio" label="&messagePaneWide.label;" name="viewlayoutgroup"
@ -1241,6 +1253,19 @@
<menuitem id="menu_showMessage" type="checkbox" label="&showMessageCmd.label;" key="key_toggleMessagePane"
accesskey="&showMessageCmd.accesskey;" oncommand="MsgToggleMessagePane();"/>
</menupopup>
</menu>
<menu id="menu_FolderViews" label="&folderView.label;" accesskey="&folderView.accesskey;">
<menupopup onpopupshowing="InitViewFolderViewsMenu(event)">
<menuitem id="menu_allFolders" label="&allFolders.label;" accesskey="&allFolders.accesskey;"
type="radio" name="viewmessages" oncommand="loadFolderView(0);"/>
<menuitem id="menu_unreadFolders" label="&unreadFolders.label;" accesskey="&unreadFolders.accesskey;"
type="radio" name="viewmessages" oncommand="loadFolderView(1);"/>
<menuitem id="menu_favoriteFolders" label="&favoriteFolders.label;" accesskey="&favoriteFolders.accesskey;"
type="radio" name="viewmessages" oncommand="loadFolderView(2);"/>
<menuitem id="menu_recentFolders" label="&recentFolders.label;" accesskey="&recentFolders.accesskey;"
type="radio" name="viewmessages" oncommand="loadFolderView(3);"/>
</menupopup>
</menu>
<menuseparator id="viewSortMenuSeparator"/>

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

@ -463,6 +463,10 @@ function HideMenus()
var viewLayoutMenu = document.getElementById("menu_MessagePaneLayout");
if (viewLayoutMenu)
viewLayoutMenu.setAttribute("hidden", "true");
var viewFolderMenu = document.getElementById("menu_FolderViews");
if (viewFolderMenu)
viewFolderMenu.setAttribute("hidden", "true");
var viewMessagesMenu = document.getElementById('viewMessagesMenu');
if (viewMessagesMenu)
@ -498,7 +502,14 @@ function HideMenus()
var menuProperties = document.getElementById('menu_properties');
if (menuProperties)
menuProperties.setAttribute("hidden", "true");
menuProperties.setAttribute("hidden", "true");
var favoriteFolder = document.getElementById('menu_favoriteFolder');
if (favoriteFolder)
{
favoriteFolder.disabled = true;
favoriteFolder.setAttribute("hidden", "true");
}
var compactFolderMenu = document.getElementById('menu_compactFolder');
if (compactFolderMenu)

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

@ -177,7 +177,8 @@
<label id="folderColumnLabel" hidden="true" value="&folderColumn.label;"/>
<sidebarheader id="folderPaneHeader" align="center">
<label id="folderpane-title" value="&folderPaneHeader.label;"/>
<toolbarbutton id="folderpane-title" onclick="CycleFolderView();">
</toolbarbutton>
</sidebarheader>
<tree id="folderTree" class="plain focusring" flex="1" seltype="single" selstyle="primary"
@ -280,7 +281,7 @@
sort="?folderTreeNameSort"
sortActive="true"
sortDirection="ascending"/>
<splitter class="tree-splitter"/>
<splitter class="tree-splitter"/>
<treecol id="folderUnreadCol"
persist="hidden width"
flex="1"

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

@ -50,7 +50,9 @@ const kMailCheckOncePrefName = "mail.startup.enabledMailCheckOnce";
const kStandardPaneConfig = 0;
const kWidePaneConfig = 1;
const kVerticalPaneConfig = 2;
const kVerticalPaneConfig = 2;
const kNumFolderViews = 4; // total number of folder views
// from nsMsgFolderFlags.h
const MSG_FOLDER_FLAG_ELIDED = 0x10;
@ -64,7 +66,7 @@ var gThreadAndMessagePaneSplitter = null;
var gUnreadCount = null;
var gTotalCount = null;
var gCurrentPaneConfig = 0;
var gCurrentFolderView;
var gCurrentLoadingFolderURI;
var gCurrentFolderToReroot;
var gCurrentLoadingFolderSortType = 0;
@ -1016,9 +1018,9 @@ function AddToSession()
function InitPanes()
{
OnLoadFolderPane();
OnLoadThreadPane();
SetupCommandUpdateHandlers();
OnLoadFolderPane();
OnLoadThreadPane();
SetupCommandUpdateHandlers();
}
function InitializeDataSources()
@ -1035,67 +1037,109 @@ function InitializeDataSources()
function OnFolderUnreadColAttrModified(event)
{
if (event.attrName == "hidden")
{
var folderNameCell = document.getElementById("folderNameCell");
var label = {"true": "?folderTreeName", "false": "?folderTreeSimpleName"};
folderNameCell.setAttribute("label", label[event.newValue]);
}
if (event.attrName == "hidden")
{
var folderNameCell = document.getElementById("folderNameCell");
var label = {"true": "?folderTreeName", "false": "?folderTreeSimpleName"};
folderNameCell.setAttribute("label", label[event.newValue]);
}
}
function UpdateFolderColumnVisibility()
{
var folderNameCol = document.getElementById("folderNameCol");
var showColumns = pref.getBoolPref("mail.showFolderPaneColumns");
var folderUnreadCol = document.getElementById("folderUnreadCol");
var folderColumnLabel = document.getElementById("folderColumnLabel");
if (!showColumns)
{
var folderTotalCol = document.getElementById("folderTotalCol");
var folderSizeCol = document.getElementById("folderSizeCol");
folderUnreadCol.setAttribute("hidden", "true");
folderTotalCol.setAttribute("hidden", "true");
folderSizeCol.setAttribute("hidden", "true");
folderNameCol.removeAttribute("label");
}
else
{
folderNameCol.setAttribute("label", folderColumnLabel.value);
}
var folderNameCol = document.getElementById("folderNameCol");
var showColumns = pref.getBoolPref("mail.showFolderPaneColumns");
var folderUnreadCol = document.getElementById("folderUnreadCol");
var folderColumnLabel = document.getElementById("folderColumnLabel");
if (!showColumns)
{
var folderTotalCol = document.getElementById("folderTotalCol");
var folderSizeCol = document.getElementById("folderSizeCol");
folderUnreadCol.setAttribute("hidden", "true");
folderTotalCol.setAttribute("hidden", "true");
folderSizeCol.setAttribute("hidden", "true");
folderNameCol.removeAttribute("label");
}
else
{
folderNameCol.setAttribute("label", folderColumnLabel.value);
}
folderNameCol.setAttribute("hideheader", showColumns ? "false" : "true");
var folderPaneHeader = document.getElementById("folderPaneHeader");
folderPaneHeader.setAttribute("hidden", showColumns ? "true" : "false");
var folderTree = document.getElementById("folderTree");
folderTree.setAttribute("hidecolumnpicker", showColumns ? "false" : "true");
var hidden = folderUnreadCol.getAttribute("hidden");
if (hidden != "true")
{
var folderNameCell = document.getElementById("folderNameCell");
folderNameCell.setAttribute("label", "?folderTreeSimpleName");
}
folderNameCol.setAttribute("hideheader", showColumns ? "false" : "true");
var folderPaneHeader = document.getElementById("folderPaneHeader");
folderPaneHeader.setAttribute("hidden", showColumns ? "true" : "false");
var folderTree = document.getElementById("folderTree");
folderTree.setAttribute("hidecolumnpicker", showColumns ? "false" : "true");
var hidden = folderUnreadCol.getAttribute("hidden");
if (hidden != "true")
{
var folderNameCell = document.getElementById("folderNameCell");
folderNameCell.setAttribute("label", "?folderTreeSimpleName");
}
}
function loadFolderView(aNewFolderView)
{
if (gCurrentFolderView && (gCurrentFolderView == aNewFolderView))
return;
var folderPaneHeader = document.getElementById('folderpane-title');
var folderTree = GetFolderTree();
var database = GetFolderDatasource();
var nsIRDFDataSource = Components.interfaces.nsIRDFDataSource;
// Each folder pane view has the following properties:
// ref-> the ref attribute for the folderTree
// label -> the UI label associated with the folder view
// datasources -> array of the data sources associated with the view
var folderViews = [
{ref:"msgaccounts:/", label:"folderPaneHeader", dataSources: [accountManagerDataSource.QueryInterface(nsIRDFDataSource),
folderDataSource.QueryInterface(nsIRDFDataSource)] },
{ref:"mailnewsunreadfolders:/", label:"folderPaneHeader_unread", dataSources: [unreadFolderDataSource.QueryInterface(nsIRDFDataSource)]},
{ref:"mailnewsfavefolders:/", label:"folderPaneHeader_favorites", dataSources: [favoriteFoldersDataSource.QueryInterface(nsIRDFDataSource)]},
{ref:"mailnewsrecentfolders:/", label:"folderPaneHeader_recent", dataSources: [recentFoldersDataSource.QueryInterface(nsIRDFDataSource)]},
];
// unload the current data sources
if (gCurrentFolderView != undefined)
{
var dataSourcesToUnload = folderViews[gCurrentFolderView].dataSources;
for (index in dataSourcesToUnload)
database.RemoveDataSource(dataSourcesToUnload[index]);
}
// add the new data sources
var dataSourcesToAdd = folderViews[aNewFolderView].dataSources;
for (index in dataSourcesToAdd)
database.AddDataSource(dataSourcesToAdd[index]);
folderTree.setAttribute('ref', folderViews[aNewFolderView].ref);
folderPaneHeader.label = gMessengerBundle.getString(folderViews[aNewFolderView].label);
// reflect the new value back into prefs
pref.setIntPref('mail.ui.folderpane.view', gCurrentFolderView = aNewFolderView);
}
function CycleFolderView()
{
// pass the call onto loadFolderView...
loadFolderView((gCurrentFolderView + 1) % kNumFolderViews);
}
function OnLoadFolderPane()
{
UpdateFolderColumnVisibility();
var folderUnreadCol = document.getElementById("folderUnreadCol");
folderUnreadCol.addEventListener("DOMAttrModified", OnFolderUnreadColAttrModified, false);
UpdateFolderColumnVisibility();
var folderUnreadCol = document.getElementById("folderUnreadCol");
folderUnreadCol.addEventListener("DOMAttrModified", OnFolderUnreadColAttrModified, false);
//Add folderDataSource and accountManagerDataSource to folderPane
accountManagerDataSource = accountManagerDataSource.QueryInterface(Components.interfaces.nsIRDFDataSource);
folderDataSource = folderDataSource.QueryInterface(Components.interfaces.nsIRDFDataSource);
var database = GetFolderDatasource();
database.AddDataSource(accountManagerDataSource);
database.AddDataSource(folderDataSource);
var folderTree = GetFolderTree();
folderTree.setAttribute("ref", "msgaccounts:/");
var folderTreeBuilder = folderTree.builder.QueryInterface(Components.interfaces.nsIXULTreeBuilder);
folderTreeBuilder.addObserver(folderObserver);
folderTree.addEventListener("click",FolderPaneOnClick,true);
folderTree.addEventListener("mousedown",TreeOnMouseDown,true);
loadFolderView(pref.getIntPref('mail.ui.folderpane.view'));
var folderTree = GetFolderTree();
var folderTreeBuilder = folderTree.builder.QueryInterface(Components.interfaces.nsIXULTreeBuilder);
folderTreeBuilder.addObserver(folderObserver);
folderTree.addEventListener("click",FolderPaneOnClick,true);
folderTree.addEventListener("mousedown",TreeOnMouseDown,true);
}
// builds prior to 12-08-2001 did not have the labels column
@ -1335,9 +1379,11 @@ function FolderPaneOnClick(event)
var elt = {};
folderTree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, col, elt);
if (row.value == -1) {
if (event.originalTarget.localName == "treecol")
if (event.originalTarget.localName == "treecol") {
// clicking on the name column in the folder pane should not sort
event.preventBubble();
CycleFolderView(); // needed to cycle the folder view for the old school tree col users
}
return;
}
@ -1590,15 +1636,15 @@ function EnsureFolderIndex(builder, msgFolder)
function SelectFolder(folderUri)
{
var folderTree = GetFolderTree();
var folderResource = RDF.GetResource(folderUri);
var msgFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder);
var folderTree = GetFolderTree();
var folderResource = RDF.GetResource(folderUri);
var msgFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder);
// before we can select a folder, we need to make sure it is "visible"
// in the tree. to do that, we need to ensure that all its
// ancestors are expanded
var folderIndex = EnsureFolderIndex(folderTree.builderView, msgFolder);
ChangeSelection(folderTree, folderIndex);
// before we can select a folder, we need to make sure it is "visible"
// in the tree. to do that, we need to ensure that all its
// ancestors are expanded
var folderIndex = EnsureFolderIndex(folderTree.builderView, msgFolder);
ChangeSelection(folderTree, folderIndex);
}
function SelectMessage(messageUri)
@ -1620,44 +1666,45 @@ function ReloadMessage()
function GetDBView()
{
return gDBView;
return gDBView;
}
function GetFolderResource(tree, index)
{
return tree.builderView.getResourceAtIndex(index);
return tree.builderView.getResourceAtIndex(index);
}
function GetFolderIndex(tree, resource)
{
return tree.builderView.getIndexOfResource(resource);
return tree.builderView.getIndexOfResource(resource);
}
function GetFolderAttribute(tree, source, attribute)
{
var property = RDF.GetResource("http://home.netscape.com/NC-rdf#" + attribute);
var target = tree.database.GetTarget(source, property, true);
if (target)
target = target.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
return target;
var property = RDF.GetResource("http://home.netscape.com/NC-rdf#" + attribute);
var target = tree.database.GetTarget(source, property, true);
if (target)
target = target.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
return target;
}
// Thunderbird has been storing old attachment download meta data in downloads.rdf
// even though there was no way to show or clean up this data. Now that we are using
// the new download manager in toolkit, we don't want to present this old data.
// Thunderbird has been storing old attachment download meta data in downloads.rdf
// even though there was no way to show or clean up this data. Now that we are using
// the new download manager in toolkit, we don't want to present this old data.
// To migrate to the new download manager, remove downloads.rdf.
function MigrateAttachmentDownloadStore()
{
var attachmentStoreVersion = pref.getIntPref("mail.attachment.store.version");
if (!attachmentStoreVersion)
{
var dirService = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties);
var downloadsFile = dirService.get("DLoads", Components.interfaces.nsIFile);
if (downloadsFile && downloadsFile.exists())
downloadsFile.remove(false);
// bump the version so we don't bother doing this again.
pref.setIntPref("mail.attachment.store.version", 1);
}
}
function MigrateAttachmentDownloadStore()
{
var attachmentStoreVersion = pref.getIntPref("mail.attachment.store.version");
if (!attachmentStoreVersion)
{
var dirService = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties);
var downloadsFile = dirService.get("DLoads", Components.interfaces.nsIFile);
if (downloadsFile && downloadsFile.exists())
downloadsFile.remove(false);
// bump the version so we don't bother doing this again.
pref.setIntPref("mail.attachment.store.version", 1);
}
}

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

@ -1,5 +1,5 @@
<!-- folder pane context menu item -->
<!ENTITY folderContextRSSSubscribe.label "Manage Subscriptions...">
<!ENTITY folderContextRSSSubscribe.accesskey "M">
<!ENTITY folderContextRSSSubscribe.label "Subscribe...">
<!ENTITY folderContextRSSSubscribe.accesskey "b">

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

@ -76,11 +76,9 @@
<!ENTITY all.accesskey "A">
<!ENTITY selectThreadCmd.label "Thread">
<!ENTITY selectThreadCmd.accesskey "T">
<!ENTITY selectThreadCmd.key "a">
<!ENTITY filtersCmd.label "Message Filters...">
<!ENTITY filtersCmd.accesskey "F">
<!ENTITY filtersApply.label "Run Filters on Folder">
<!ENTITY filtersApply.accesskey "R">
<!ENTITY selectThreadCmd.key "a">
<!ENTITY menuFavoriteFolder.label "Favorite Folder">
<!ENTITY menuFavoriteFolder.accesskey "a">
<!ENTITY folderPropsCmd.label "Properties...">
<!ENTITY folderPropsFolderCmd.label "Folder Properties...">
<!ENTITY folderPropsNewsgroupCmd.label "Newsgroup Properties...">
@ -107,7 +105,6 @@
<!ENTITY customizeToolbar.label "Customize...">
<!ENTITY customizeToolbar.accesskey "C">
<!-- Layout Style Menu -->
<!ENTITY messagePaneLayoutStyle.label "Layout">
<!ENTITY messagePaneLayoutStyle.accesskey "L">
<!ENTITY messagePaneClassic.label "Classic View">
@ -117,7 +114,18 @@
<!ENTITY messagePaneVertical.label "Vertical View">
<!ENTITY messagePaneVertical.accesskey "V">
<!ENTITY showMessageCmd.label "Message Pane">
<!ENTITY showMessageCmd.accesskey "M">
<!ENTITY showMessageCmd.accesskey "M">
<!ENTITY folderView.label "Folders">
<!ENTITY folderView.accesskey "F">
<!ENTITY allFolders.label "All">
<!ENTITY allFolders.accesskey "A">
<!ENTITY unreadFolders.label "Unread">
<!ENTITY unreadFolders.accesskey "U">
<!ENTITY favoriteFolders.label "Favorite">
<!ENTITY favoriteFolders.accesskey "F">
<!ENTITY recentFolders.label "Recent">
<!ENTITY recentFolders.accesskey "R">
<!-- Sort Menu -->
<!ENTITY sortMenu.label "Sort by">
@ -400,7 +408,11 @@
<!ENTITY deleteJunk.label "Delete Mail Marked as Junk in Folder">
<!ENTITY deleteJunk.accesskey "l">
<!ENTITY javaScriptConsoleCmd.label "JavaScript Console">
<!ENTITY javaScriptConsoleCmd.accesskey "n">
<!ENTITY javaScriptConsoleCmd.accesskey "n">
<!ENTITY filtersCmd.label "Message Filters...">
<!ENTITY filtersCmd.accesskey "F">
<!ENTITY filtersApply.label "Run Filters on Folder">
<!ENTITY filtersApply.accesskey "R">
<!-- Help Menu -->
<!ENTITY helpMenu.label "Help">
@ -457,21 +469,16 @@
<!ENTITY addressBookButton.tooltip "Go to the address book">
<!-- Folder Pane -->
<!ENTITY folderPaneHeader.label "Folders">
<!ENTITY folderColumn.label "Name">
<!ENTITY folderSizeColumn.label "Size">
<!ENTITY folderSizeColumn.label "Size">
<!-- Folder Pane Context Menu -->
<!ENTITY folderContextGetMessages.label "Get Messages for Account">
<!ENTITY folderContextGetMessages.accesskey "G">
<!ENTITY folderContextOpenNewWindow.label "Open in New Mail Window">
<!ENTITY folderContextOpenNewWindow.accesskey "W">
<!ENTITY folderContextRename.label "Rename">
<!ENTITY folderContextRename.accesskey "R">
<!ENTITY folderContextRemove.label "Delete">
<!ENTITY folderContextRemove.accesskey "D">
<!ENTITY folderContextCompact.label "Compact This Folder">
<!ENTITY folderContextCompact.accesskey "F">
<!ENTITY folderContextCompact.label "Compact">
<!ENTITY folderContextCompact.accesskey "C">
<!ENTITY folderContextEmptyTrash.label "Empty Trash">
<!ENTITY folderContextEmptyTrash.accesskey "y">
<!ENTITY folderContextSendUnsentMessages.label "Send Unsent Messages...">
@ -482,16 +489,16 @@
<!ENTITY folderContextMarkNewsgroupRead.accesskey "k">
<!ENTITY folderContextMarkMailFolderRead.label "Mark Folder Read">
<!ENTITY folderContextMarkMailFolderRead.accesskey "k">
<!ENTITY folderContextNew.label "New Subfolder...">
<!ENTITY folderContextNew.accesskey "N">
<!ENTITY folderContextSubscribe.label "Subscribe...">
<!ENTITY folderContextSubscribe.accesskey "b">
<!ENTITY folderContextSearchMessages.label "Search Messages...">
<!ENTITY folderContextSearchMessages.label "Search...">
<!ENTITY folderContextSearchMessages.accesskey "S">
<!ENTITY folderContextProperties.label "Properties...">
<!ENTITY folderContextProperties.accesskey "P">
<!ENTITY folderContextCopyLocation.label "Copy Folder Location">
<!ENTITY folderContextCopyLocation.accesskey "C">
<!ENTITY folderContextCopyLocation.accesskey "L">
<!ENTITY folderContextFavoriteFolder.label "Favorite Folder">
<!ENTITY folderContextFavoriteFolder.accesskey "a">
<!-- Search Bar -->
<!ENTITY viewPicker.label "View:">

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

@ -41,11 +41,8 @@
#
renameAccount=Rename Account...
renameNewsAccount=Rename News Account...
renameFolder=Rename Folder...
compactFolder=Compact This Folder
removeAccount=Delete Account...
removeNewsAccount=Delete News Account...
removeFolder=Delete Folder
newFolderMenuItem=Folder...
newSubfolderMenuItem=Subfolder...
newFolder=New Folder...
@ -386,3 +383,9 @@ updatesItem_resume=Resume Downloading %S...
updatesItem_resumeFallback=Resume Downloading Update...
updatesItem_pending=Apply Downloaded Update Now...
updatesItem_pendingFallback=Apply Downloaded Update Now...
# Folder Pane Header Title Strings
folderPaneHeader=All Folders
folderPaneHeader_unread=Unread Folders
folderPaneHeader_favorites=Favorite Folders
folderPaneHeader_recent=Recent Folders

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

@ -871,14 +871,17 @@ treechildren::-moz-tree-cell-text(lc-black, selected, focus) {
/* ..... folder pane adjustments ..... */
#folderPaneHeader {
}
#folderpane-title {
-moz-padding-start: 4px;
}
/* ::::: border adjustments for focus ring and joined splitters ::::: */
#folderpane-title {
margin-top: 0px;
margin-left: 4px;
margin-bottom: 0px;
padding: 0px;
}
#folderpane-title > .toolbarbutton-text {
padding-left: 8px;
padding-right: 8px;
}
/* ..... splitter adjustments ..... */