remove tabs and some trailing white space from thunderbird's xul and js files.

purely white space changes.


git-svn-id: svn://10.0.0.236/trunk@235527 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
scott%scott-macgregor.org 2007-09-12 06:03:27 +00:00
parent af68983146
commit 90ded85a0c
28 changed files with 1787 additions and 1780 deletions

View File

@ -59,11 +59,11 @@ var gCurrentServerURI = null;
var gStatusFeedback = { var gStatusFeedback = {
progressMeterVisible : false, progressMeterVisible : false,
showStatusString: function(status) showStatusString: function(status)
{ {
gStatusText.setAttribute("value", status); gStatusText.setAttribute("value", status);
}, },
startMeteors: function() startMeteors: function()
{ {
// change run button to be a stop button // change run button to be a stop button
gRunFiltersButton.setAttribute("label", gRunFiltersButton.getAttribute("stoplabel")); gRunFiltersButton.setAttribute("label", gRunFiltersButton.getAttribute("stoplabel"));
@ -71,13 +71,13 @@ var gStatusFeedback = {
if (!this.progressMeterVisible) if (!this.progressMeterVisible)
{ {
document.getElementById('statusbar-progresspanel').removeAttribute('collapsed'); document.getElementById('statusbar-progresspanel').removeAttribute('collapsed');
this.progressMeterVisible = true; this.progressMeterVisible = true;
} }
gStatusBar.setAttribute("mode", "undetermined"); gStatusBar.setAttribute("mode", "undetermined");
}, },
stopMeteors: function() stopMeteors: function()
{ {
try { try {
// change run button to be a stop button // change run button to be a stop button
@ -86,7 +86,7 @@ var gStatusFeedback = {
gStatusBar.setAttribute("mode", "normal"); gStatusBar.setAttribute("mode", "normal");
if (this.progressMeterVisible) if (this.progressMeterVisible)
{ {
document.getElementById('statusbar-progresspanel').collapsed = true; document.getElementById('statusbar-progresspanel').collapsed = true;
this.progressMeterVisible = true; this.progressMeterVisible = true;
} }
@ -150,7 +150,7 @@ function onCancel()
var firstItem = getSelectedServerForFilters(); var firstItem = getSelectedServerForFilters();
if (!firstItem) if (!firstItem)
firstItem = getServerThatCanHaveFilters(); firstItem = getServerThatCanHaveFilters();
if (firstItem) { if (firstItem) {
var resource = gRDF.GetResource(firstItem); var resource = gRDF.GetResource(firstItem);
var msgFolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder); var msgFolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder);
@ -185,7 +185,7 @@ function onFilterServerClick(selection)
// Save the current filters to disk before switching because // Save the current filters to disk before switching because
// the dialog may be closed and we'll lose current filters. // the dialog may be closed and we'll lose current filters.
var filterList = currentFilterList(); var filterList = currentFilterList();
if (filterList) if (filterList)
filterList.saveToDefaultFile(); filterList.saveToDefaultFile();
selectServer(itemURI); selectServer(itemURI);
@ -212,8 +212,8 @@ function setServer(uri)
var msgFolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder); var msgFolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder);
//Calling getFilterList will detect any errors in rules.dat, backup the file, and alert the user //Calling getFilterList will detect any errors in rules.dat, backup the file, and alert the user
//we need to do this because gFilterTree.setAttribute will cause rdf to call getFilterList and there is //we need to do this because gFilterTree.setAttribute will cause rdf to call getFilterList and there is
//no way to pass msgWindow in that case. //no way to pass msgWindow in that case.
if (msgFolder) if (msgFolder)
msgFolder.getFilterList(gFilterListMsgWindow); msgFolder.getFilterList(gFilterListMsgWindow);
@ -222,10 +222,10 @@ function setServer(uri)
msgFolder = msgFolder.server.rootMsgFolder; msgFolder = msgFolder.server.rootMsgFolder;
var rootFolderUri = msgFolder.URI; var rootFolderUri = msgFolder.URI;
rebuildFilterTree(uri); rebuildFilterTree(uri);
// root the folder picker to this server // root the folder picker to this server
gRunFiltersFolderPicker.setAttribute("ref", rootFolderUri); gRunFiltersFolderPicker.setAttribute("ref", rootFolderUri);
// run filters after the fact not supported by news // run filters after the fact not supported by news
if (CanRunFiltersAfterTheFact(msgFolder.server)) { if (CanRunFiltersAfterTheFact(msgFolder.server)) {
gRunFiltersFolderPicker.removeAttribute("hidden"); gRunFiltersFolderPicker.removeAttribute("hidden");
@ -270,7 +270,7 @@ function selectServer(uri)
{ {
// update the server menu // update the server menu
var serverMenu = document.getElementById("serverMenu"); var serverMenu = document.getElementById("serverMenu");
var resource = gRDF.GetResource(uri); var resource = gRDF.GetResource(uri);
var msgFolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder); var msgFolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder);
@ -303,7 +303,7 @@ function currentFilter()
var currentIndex = gFilterTree.currentIndex; var currentIndex = gFilterTree.currentIndex;
if (currentIndex == -1) if (currentIndex == -1)
return null; return null;
var filter; var filter;
try { try {
@ -327,7 +327,7 @@ function onFilterSelect(event)
updateButtons(); updateButtons();
} }
function onEditFilter() function onEditFilter()
{ {
var selectedFilter = currentFilter(); var selectedFilter = currentFilter();
var curFilterList = currentFilterList(); var curFilterList = currentFilterList();
@ -343,7 +343,7 @@ function onNewFilter(emailAddress)
{ {
var curFilterList = currentFilterList(); var curFilterList = currentFilterList();
var args = {filterList: curFilterList}; var args = {filterList: curFilterList};
window.openDialog("chrome://messenger/content/FilterEditor.xul", "FilterEditor", "chrome,modal,titlebar,resizable,centerscreen", args); window.openDialog("chrome://messenger/content/FilterEditor.xul", "FilterEditor", "chrome,modal,titlebar,resizable,centerscreen", args);
if ("refresh" in args && args.refresh) if ("refresh" in args && args.refresh)
@ -357,8 +357,8 @@ function onDeleteFilter()
return; return;
var sel = gFilterTree.view.selection, selCount = sel.getRangeCount(); var sel = gFilterTree.view.selection, selCount = sel.getRangeCount();
if (!selCount || if (!selCount ||
gPromptService.confirmEx(window, null, gPromptService.confirmEx(window, null,
gFilterBundle.getString("deleteFilterConfirmation"), gFilterBundle.getString("deleteFilterConfirmation"),
gPromptService.STD_YES_NO_BUTTONS, gPromptService.STD_YES_NO_BUTTONS,
'', '', '', '', {})) '', '', '', '', {}))
@ -401,7 +401,7 @@ function onFilterClose()
{ {
// make sure to save the filter to disk // make sure to save the filter to disk
var filterList = currentFilterList(); var filterList = currentFilterList();
if (filterList) if (filterList)
filterList.saveToDefaultFile(); filterList.saveToDefaultFile();
if (gRunFiltersButton.getAttribute("label") == gRunFiltersButton.getAttribute("stoplabel")) { if (gRunFiltersButton.getAttribute("label") == gRunFiltersButton.getAttribute("stoplabel")) {
@ -434,7 +434,7 @@ function runSelectedFilters()
gFilterListMsgWindow.StopUrls(); gFilterListMsgWindow.StopUrls();
return; return;
} }
var folderURI = gRunFiltersFolderPicker.getAttribute("uri"); var folderURI = gRunFiltersFolderPicker.getAttribute("uri");
var resource = gRDF.GetResource(folderURI); var resource = gRDF.GetResource(folderURI);
var msgFolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder); var msgFolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder);
@ -464,7 +464,7 @@ function moveCurrentFilter(motion)
{ {
var filterList = currentFilterList(); var filterList = currentFilterList();
var filter = currentFilter(); var filter = currentFilter();
if (!filterList || !filter) if (!filterList || !filter)
return; return;
filterList.moveFilter(filter, motion); filterList.moveFilter(filter, motion);
@ -478,9 +478,9 @@ function rebuildFilterTree(uri)
gFilterTree.setAttribute("ref", uri); gFilterTree.setAttribute("ref", uri);
} }
function refresh() function refresh()
{ {
if (!gFilterTree) if (!gFilterTree)
return; return;
var selectedRes; var selectedRes;
@ -515,7 +515,7 @@ function updateButtons()
var filter = currentFilter(); var filter = currentFilter();
// "edit" only enabled when one filter selected or if we couldn't parse the filter // "edit" only enabled when one filter selected or if we couldn't parse the filter
gEditButton.disabled = !oneFilterSelected || filter.unparseable; gEditButton.disabled = !oneFilterSelected || filter.unparseable;
// "delete" only disabled when no filters are selected // "delete" only disabled when no filters are selected
gDeleteButton.disabled = !numFiltersSelected; gDeleteButton.disabled = !numFiltersSelected;
@ -539,7 +539,7 @@ function getSelectedServerForFilters()
var firstItem = null; var firstItem = null;
var args = window.arguments; var args = window.arguments;
var selectedFolder = args[0].folder; var selectedFolder = args[0].folder;
if (args && args[0] && selectedFolder) if (args && args[0] && selectedFolder)
{ {
var msgFolder = selectedFolder.QueryInterface(Components.interfaces.nsIMsgFolder); var msgFolder = selectedFolder.QueryInterface(Components.interfaces.nsIMsgFolder);
@ -613,18 +613,18 @@ function onFilterClick(event)
// we only care about button 0 (left click) events // we only care about button 0 (left click) events
if (event.button != 0) if (event.button != 0)
return; return;
var row = {}, col = {}, childElt = {}; var row = {}, col = {}, childElt = {};
var filterTree = document.getElementById("filterTree"); var filterTree = document.getElementById("filterTree");
filterTree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, col, childElt); filterTree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, col, childElt);
if (row.value == -1 || row.value > filterTree.view.rowCount-1 || event.originalTarget.localName != "treechildren") { if (row.value == -1 || row.value > filterTree.view.rowCount-1 || event.originalTarget.localName != "treechildren") {
if (event.originalTarget.localName == "treecol") { if (event.originalTarget.localName == "treecol") {
// clicking on the name column in the filter list should not sort // clicking on the name column in the filter list should not sort
event.stopPropagation(); event.stopPropagation();
} }
return; return;
} }
if (col.value.id == "activeColumn") { if (col.value.id == "activeColumn") {
toggleFilter(filterTree.builderView.getResourceAtIndex(row.value)); toggleFilter(filterTree.builderView.getResourceAtIndex(row.value));
} }

View File

@ -1,4 +1,4 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
@ -44,12 +44,12 @@
%customizeToolbarDTD; %customizeToolbarDTD;
]> ]>
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?> <?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://global/content/customizeToolbar.css" type="text/css"?> <?xml-stylesheet href="chrome://global/content/customizeToolbar.css" type="text/css"?>
<?xml-stylesheet href="chrome://global/skin/customizeToolbar.css" type="text/css"?> <?xml-stylesheet href="chrome://global/skin/customizeToolbar.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/addressbook/addressbook.css" type="text/css"?> <?xml-stylesheet href="chrome://messenger/skin/addressbook/addressbook.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/messengercompose/messengercompose.css" type="text/css"?> <?xml-stylesheet href="chrome://messenger/skin/messengercompose/messengercompose.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/smime/msgCompSMIMEOverlay.css" type="text/css"?> <?xml-stylesheet href="chrome://messenger/skin/smime/msgCompSMIMEOverlay.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/primaryToolbar.css" type="text/css"?> <?xml-stylesheet href="chrome://messenger/skin/primaryToolbar.css" type="text/css"?>
#ifndef XP_MACOSX #ifndef XP_MACOSX
@ -62,7 +62,7 @@
onload="onLoad();" onload="onLoad();"
onunload="onUnload();" onunload="onUnload();"
buttons="accept,cancel" buttons="accept,cancel"
ondialogaccept="return onAccept();" ondialogaccept="return onAccept();"
ondialogcancel="return onCancel();" ondialogcancel="return onCancel();"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@ -96,7 +96,7 @@
<menuitem value="text" label="&text.label;"/> <menuitem value="text" label="&text.label;"/>
</menupopup> </menupopup>
</menulist> </menulist>
<checkbox id="smallicons" oncommand="updateIconSize(this.checked);" label="&useSmallIcons.label;"/> <checkbox id="smallicons" oncommand="updateIconSize(this.checked);" label="&useSmallIcons.label;"/>
<button label="&restoreDefaultSet.label;" oncommand="restoreDefaultSet();"/> <button label="&restoreDefaultSet.label;" oncommand="restoreDefaultSet();"/>

View File

@ -40,28 +40,28 @@ function hiddenWindowStartup()
{ {
// Disable menus which are not appropriate // Disable menus which are not appropriate
var disabledItems = ['newNewMsgCmd', 'menu_newFolder', 'newAccountMenuItem', 'menu_close', 'menu_saveAs', var disabledItems = ['newNewMsgCmd', 'menu_newFolder', 'newAccountMenuItem', 'menu_close', 'menu_saveAs',
'menu_saveAsFile', 'menu_newVirtualFolder', 'menu_find', 'menu_findCmd', 'menu_findAgainCmd', 'menu_saveAsFile', 'menu_newVirtualFolder', 'menu_find', 'menu_findCmd', 'menu_findAgainCmd',
'menu_sendunsentmsgs', 'menu_subscribe', 'menu_renameFolder', 'menu_select', 'menu_sendunsentmsgs', 'menu_subscribe', 'menu_renameFolder', 'menu_select',
'menu_selectAll', 'menu_selectThread', 'menu_selectAll', 'menu_selectThread',
'menu_favoriteFolder', 'menu_properties', 'menu_favoriteFolder', 'menu_properties',
'menu_Toolbars', 'menu_MessagePaneLayout', 'menu_showMessage', 'menu_FolderViews', 'menu_Toolbars', 'menu_MessagePaneLayout', 'menu_showMessage', 'menu_FolderViews',
'viewSortMenu', 'groupBySort', 'viewMessageViewMenu', 'mailviewCharsetMenu', 'viewSortMenu', 'groupBySort', 'viewMessageViewMenu', 'mailviewCharsetMenu',
'viewMessagesMenu', 'menu_expandAllThreads', 'collapseAllThreads', 'viewMessagesMenu', 'menu_expandAllThreads', 'collapseAllThreads',
'viewheadersmenu', 'viewBodyMenu', 'viewAttachmentsInlineMenuitem', 'viewheadersmenu', 'viewBodyMenu', 'viewAttachmentsInlineMenuitem',
'viewTextSizeMenu', 'menu_textZoomEnlarge', 'menu_textZoomReduce', 'viewTextSizeMenu', 'menu_textZoomEnlarge', 'menu_textZoomReduce',
'goNextMenu', 'menu_nextMsg', 'menu_nextUnreadMsg', 'menu_nextUnreadThread', 'goNextMenu', 'menu_nextMsg', 'menu_nextUnreadMsg', 'menu_nextUnreadThread',
'goPreviousMenu', 'menu_prevMsg', 'menu_prevUnreadMsg', 'menu_goForward', 'menu_goBack', 'goPreviousMenu', 'menu_prevMsg', 'menu_prevUnreadMsg', 'menu_goForward', 'menu_goBack',
'goStartPage', 'newMsgCmd', 'replyMainMenu', 'replySenderMainMenu', 'replyNewsgroupMainMenu', 'goStartPage', 'newMsgCmd', 'replyMainMenu', 'replySenderMainMenu', 'replyNewsgroupMainMenu',
'menu_replyToAll', 'menu_forwardMsg', 'forwardAsMenu', 'menu_editMsgAsNew', 'openMessageWindowMenuitem', 'menu_replyToAll', 'menu_forwardMsg', 'forwardAsMenu', 'menu_editMsgAsNew', 'openMessageWindowMenuitem',
'moveMenu', 'copyMenu', 'moveToFolderAgain', 'tagMenu', 'markMenu', 'moveMenu', 'copyMenu', 'moveToFolderAgain', 'tagMenu', 'markMenu',
'markReadMenuItem', 'menu_markThreadAsRead', 'menu_markReadByDate', 'menu_markAllRead', 'markReadMenuItem', 'menu_markThreadAsRead', 'menu_markReadByDate', 'menu_markAllRead',
'markFlaggedMenuItem', 'menu_markAsJunk', 'menu_markAsNotJunk', 'createFilter', 'markFlaggedMenuItem', 'menu_markAsJunk', 'menu_markAsNotJunk', 'createFilter',
'killThread', 'watchThread', 'applyFilters', 'runJunkControls', 'deleteJunk', 'menu_import', 'killThread', 'watchThread', 'applyFilters', 'runJunkControls', 'deleteJunk', 'menu_import',
'searchMailCmd', 'searchAddressesCmd', 'filtersCmd', 'junkMailCmd', 'searchMailCmd', 'searchAddressesCmd', 'filtersCmd', 'junkMailCmd',
'cmd_close', 'minimizeWindow', 'zoomWindow']; 'cmd_close', 'minimizeWindow', 'zoomWindow'];
var id; var id;
var element; var element;
for (id in disabledItems) for (id in disabledItems)
{ {
element = document.getElementById(disabledItems[id]); element = document.getElementById(disabledItems[id]);
if (element) if (element)

View File

@ -45,61 +45,61 @@ var gMessengerBundle = document.getElementById("bundle_messenger");
var FolderPaneController = var FolderPaneController =
{ {
supportsCommand: function(command) supportsCommand: function(command)
{ {
switch ( command ) switch ( command )
{ {
case "cmd_delete": case "cmd_delete":
case "button_delete": case "button_delete":
//case "cmd_selectAll": the folder pane currently only handles single selection //case "cmd_selectAll": the folder pane currently only handles single selection
case "cmd_cut": case "cmd_cut":
case "cmd_copy": case "cmd_copy":
case "cmd_paste": case "cmd_paste":
return true; return true;
default: default:
return false; return false;
} }
}, },
isCommandEnabled: function(command) isCommandEnabled: function(command)
{ {
if (IsFakeAccount()) if (IsFakeAccount())
return false; return false;
switch ( command ) switch ( command )
{ {
case "cmd_cut": case "cmd_cut":
case "cmd_copy": case "cmd_copy":
case "cmd_paste": case "cmd_paste":
return false; return false;
case "cmd_delete": case "cmd_delete":
case "button_delete": case "button_delete":
if ( command == "cmd_delete" ) if ( command == "cmd_delete" )
goSetMenuValue(command, 'valueFolder'); goSetMenuValue(command, 'valueFolder');
var folderTree = GetFolderTree(); var folderTree = GetFolderTree();
var startIndex = {}; var startIndex = {};
var endIndex = {}; var endIndex = {};
folderTree.view.selection.getRangeAt(0, startIndex, endIndex); folderTree.view.selection.getRangeAt(0, startIndex, endIndex);
if (startIndex.value >= 0) { if (startIndex.value >= 0) {
var canDeleteThisFolder; var canDeleteThisFolder;
var specialFolder = null; var specialFolder = null;
var isServer = null; var isServer = null;
var serverType = null; var serverType = null;
try { try {
var folderResource = GetFolderResource(folderTree, startIndex.value); var folderResource = GetFolderResource(folderTree, startIndex.value);
specialFolder = GetFolderAttribute(folderTree, folderResource, "SpecialFolder"); specialFolder = GetFolderAttribute(folderTree, folderResource, "SpecialFolder");
isServer = GetFolderAttribute(folderTree, folderResource, "IsServer"); isServer = GetFolderAttribute(folderTree, folderResource, "IsServer");
serverType = GetFolderAttribute(folderTree, folderResource, "ServerType"); serverType = GetFolderAttribute(folderTree, folderResource, "ServerType");
if (serverType == "nntp") { if (serverType == "nntp") {
if ( command == "cmd_delete" ) { if ( command == "cmd_delete" ) {
goSetMenuValue(command, 'valueNewsgroup'); goSetMenuValue(command, 'valueNewsgroup');
goSetAccessKey(command, 'valueNewsgroupAccessKey'); goSetAccessKey(command, 'valueNewsgroupAccessKey');
} }
} }
} }
catch (ex) { catch (ex) {
//dump("specialFolder failure: " + ex + "\n"); //dump("specialFolder failure: " + ex + "\n");
} }
if (specialFolder == "Inbox" || specialFolder == "Trash" || specialFolder == "Drafts" || if (specialFolder == "Inbox" || specialFolder == "Trash" || specialFolder == "Drafts" ||
specialFolder == "Sent" || specialFolder == "Templates" || specialFolder == "Unsent Messages" || specialFolder == "Sent" || specialFolder == "Templates" || specialFolder == "Unsent Messages" ||
(specialFolder == "Junk" && !CanRenameDeleteJunkMail(GetSelectedFolderURI())) || isServer == "true") (specialFolder == "Junk" && !CanRenameDeleteJunkMail(GetSelectedFolderURI())) || isServer == "true")
@ -108,127 +108,127 @@ var FolderPaneController =
canDeleteThisFolder = true; canDeleteThisFolder = true;
return canDeleteThisFolder && isCommandEnabled(command); return canDeleteThisFolder && isCommandEnabled(command);
} }
else else
return false; return false;
default: default:
return false; return false;
} }
}, },
doCommand: function(command) doCommand: function(command)
{ {
// if the user invoked a key short cut then it is possible that we got here for a command which is // if the user invoked a key short cut then it is possible that we got here for a command which is
// really disabled. kick out if the command should be disabled. // really disabled. kick out if the command should be disabled.
if (!this.isCommandEnabled(command)) return; if (!this.isCommandEnabled(command)) return;
switch ( command ) switch ( command )
{ {
case "cmd_delete": case "cmd_delete":
case "button_delete": case "button_delete":
MsgDeleteFolder(); MsgDeleteFolder();
break; break;
} }
}, },
onEvent: function(event) onEvent: function(event)
{ {
} }
}; };
// DefaultController object (handles commands when one of the trees does not have focus) // DefaultController object (handles commands when one of the trees does not have focus)
var DefaultController = var DefaultController =
{ {
supportsCommand: function(command) supportsCommand: function(command)
{ {
switch ( command ) switch ( command )
{ {
case "cmd_createFilterFromPopup": case "cmd_createFilterFromPopup":
case "cmd_close": case "cmd_close":
case "cmd_reply": case "cmd_reply":
case "button_reply": case "button_reply":
case "cmd_replySender": case "cmd_replySender":
case "cmd_replyGroup": case "cmd_replyGroup":
case "cmd_replyall": case "cmd_replyall":
case "button_replyall": case "button_replyall":
case "cmd_forward": case "cmd_forward":
case "button_forward": case "button_forward":
case "cmd_forwardInline": case "cmd_forwardInline":
case "cmd_forwardAttachment": case "cmd_forwardAttachment":
case "cmd_editAsNew": case "cmd_editAsNew":
case "cmd_createFilterFromMenu": case "cmd_createFilterFromMenu":
case "cmd_delete": case "cmd_delete":
case "button_delete": case "button_delete":
case "button_junk": case "button_junk":
case "cmd_shiftDelete": case "cmd_shiftDelete":
case "cmd_nextMsg": case "cmd_nextMsg":
case "button_next": case "button_next":
case "button_previous": case "button_previous":
case "cmd_nextUnreadMsg": case "cmd_nextUnreadMsg":
case "cmd_nextFlaggedMsg": case "cmd_nextFlaggedMsg":
case "cmd_nextUnreadThread": case "cmd_nextUnreadThread":
case "cmd_previousMsg": case "cmd_previousMsg":
case "cmd_previousUnreadMsg": case "cmd_previousUnreadMsg":
case "cmd_previousFlaggedMsg": case "cmd_previousFlaggedMsg":
case "button_goForward": case "button_goForward":
case "button_goBack": case "button_goBack":
case "cmd_goForward": case "cmd_goForward":
case "cmd_goBack": case "cmd_goBack":
case "cmd_goStartPage": case "cmd_goStartPage":
case "cmd_viewAllMsgs": case "cmd_viewAllMsgs":
case "cmd_viewUnreadMsgs": case "cmd_viewUnreadMsgs":
case "cmd_viewThreadsWithUnread": case "cmd_viewThreadsWithUnread":
case "cmd_viewWatchedThreadsWithUnread": case "cmd_viewWatchedThreadsWithUnread":
case "cmd_viewIgnoredThreads": case "cmd_viewIgnoredThreads":
case "cmd_undo": case "cmd_undo":
case "cmd_redo": case "cmd_redo":
case "cmd_expandAllThreads": case "cmd_expandAllThreads":
case "cmd_collapseAllThreads": case "cmd_collapseAllThreads":
case "cmd_renameFolder": case "cmd_renameFolder":
case "cmd_sendUnsentMsgs": case "cmd_sendUnsentMsgs":
case "cmd_openMessage": case "cmd_openMessage":
case "button_print": case "button_print":
case "cmd_print": case "cmd_print":
case "cmd_printpreview": case "cmd_printpreview":
case "cmd_printSetup": case "cmd_printSetup":
case "cmd_saveAsFile": case "cmd_saveAsFile":
case "cmd_saveAsTemplate": case "cmd_saveAsTemplate":
case "cmd_properties": case "cmd_properties":
case "cmd_viewPageSource": case "cmd_viewPageSource":
case "cmd_setFolderCharset": case "cmd_setFolderCharset":
case "cmd_reload": case "cmd_reload":
case "button_getNewMessages": case "button_getNewMessages":
case "cmd_getNewMessages": case "cmd_getNewMessages":
case "cmd_getMsgsForAuthAccounts": case "cmd_getMsgsForAuthAccounts":
case "cmd_getNextNMessages": case "cmd_getNextNMessages":
case "cmd_find": case "cmd_find":
case "cmd_findAgain": case "cmd_findAgain":
case "cmd_findPrevious": case "cmd_findPrevious":
case "cmd_search": case "cmd_search":
case "button_mark": case "button_mark":
case "cmd_tag": case "cmd_tag":
case "cmd_markAsRead": case "cmd_markAsRead":
case "cmd_markAllRead": case "cmd_markAllRead":
case "cmd_markThreadAsRead": case "cmd_markThreadAsRead":
case "cmd_markReadByDate": case "cmd_markReadByDate":
case "cmd_markAsFlagged": case "cmd_markAsFlagged":
case "cmd_markAsJunk": case "cmd_markAsJunk":
case "cmd_markAsNotJunk": case "cmd_markAsNotJunk":
case "cmd_recalculateJunkScore": case "cmd_recalculateJunkScore":
case "cmd_applyFilters": case "cmd_applyFilters":
case "cmd_runJunkControls": case "cmd_runJunkControls":
case "cmd_deleteJunk": case "cmd_deleteJunk":
case "button_file": case "button_file":
case "cmd_file": case "cmd_file":
case "cmd_emptyTrash": case "cmd_emptyTrash":
case "cmd_compactFolder": case "cmd_compactFolder":
case "cmd_settingsOffline": case "cmd_settingsOffline":
case "cmd_close": case "cmd_close":
case "cmd_selectAll": case "cmd_selectAll":
case "cmd_selectThread": case "cmd_selectThread":
case "cmd_moveToFolderAgain": case "cmd_moveToFolderAgain":
return true; return true;
case "cmd_downloadFlagged": case "cmd_downloadFlagged":
case "cmd_downloadSelected": case "cmd_downloadSelected":
case "cmd_synchronizeOffline": case "cmd_synchronizeOffline":
@ -238,10 +238,10 @@ var DefaultController =
case "cmd_killThread": case "cmd_killThread":
return(isNewsURI(GetFirstSelectedMessage())); return(isNewsURI(GetFirstSelectedMessage()));
default: default:
return false; return false;
} }
}, },
isCommandEnabled: function(command) isCommandEnabled: function(command)
{ {
@ -311,7 +311,7 @@ var DefaultController =
} }
return false; return false;
case "cmd_printpreview": case "cmd_printpreview":
if ( GetNumSelectedMessages() == 1 && gDBView) if ( GetNumSelectedMessages() == 1 && gDBView)
{ {
gDBView.getCommandStatus(nsMsgViewCommandType.cmdRequiringMsgBody, enabled, checkStatus); gDBView.getCommandStatus(nsMsgViewCommandType.cmdRequiringMsgBody, enabled, checkStatus);
return enabled.value; return enabled.value;
@ -436,101 +436,101 @@ var DefaultController =
return false; return false;
}, },
doCommand: function(command) doCommand: function(command)
{ {
// if the user invoked a key short cut then it is possible that we got here for a command which is // if the user invoked a key short cut then it is possible that we got here for a command which is
// really disabled. kick out if the command should be disabled. // really disabled. kick out if the command should be disabled.
if (!this.isCommandEnabled(command)) return; if (!this.isCommandEnabled(command)) return;
switch ( command ) switch ( command )
{ {
case "cmd_close": case "cmd_close":
CloseMailWindow(); CloseMailWindow();
break; break;
case "button_getNewMessages": case "button_getNewMessages":
case "cmd_getNewMessages": case "cmd_getNewMessages":
MsgGetMessage(); MsgGetMessage();
break; break;
case "cmd_getMsgsForAuthAccounts": case "cmd_getMsgsForAuthAccounts":
MsgGetMessagesForAllAuthenticatedAccounts(); MsgGetMessagesForAllAuthenticatedAccounts();
break; break;
case "cmd_getNextNMessages": case "cmd_getNextNMessages":
MsgGetNextNMessages(); MsgGetNextNMessages();
break; break;
case "cmd_reply": case "cmd_reply":
MsgReplyMessage(null); MsgReplyMessage(null);
break; break;
case "cmd_replySender": case "cmd_replySender":
MsgReplySender(null); MsgReplySender(null);
break; break;
case "cmd_replyGroup": case "cmd_replyGroup":
MsgReplyGroup(null); MsgReplyGroup(null);
break; break;
case "cmd_replyall": case "cmd_replyall":
MsgReplyToAllMessage(null); MsgReplyToAllMessage(null);
break; break;
case "cmd_forward": case "cmd_forward":
MsgForwardMessage(null); MsgForwardMessage(null);
break; break;
case "cmd_forwardInline": case "cmd_forwardInline":
MsgForwardAsInline(null); MsgForwardAsInline(null);
break; break;
case "cmd_forwardAttachment": case "cmd_forwardAttachment":
MsgForwardAsAttachment(null); MsgForwardAsAttachment(null);
break; break;
case "cmd_editAsNew": case "cmd_editAsNew":
MsgEditMessageAsNew(); MsgEditMessageAsNew();
break; break;
case "cmd_createFilterFromMenu": case "cmd_createFilterFromMenu":
MsgCreateFilter(); MsgCreateFilter();
break; break;
case "cmd_createFilterFromPopup": case "cmd_createFilterFromPopup":
break;// This does nothing because the createfilter is invoked from the popupnode oncommand. break;// This does nothing because the createfilter is invoked from the popupnode oncommand.
case "button_delete": case "button_delete":
case "cmd_delete": case "cmd_delete":
// if the user deletes a message before its mark as read timer goes off, we should mark it as read // if the user deletes a message before its mark as read timer goes off, we should mark it as read
// this ensures that we clear the biff indicator from the system tray when the user deletes the new message // this ensures that we clear the biff indicator from the system tray when the user deletes the new message
if (gMarkViewedMessageAsReadTimer) if (gMarkViewedMessageAsReadTimer)
MarkCurrentMessageAsRead(); MarkCurrentMessageAsRead();
SetNextMessageAfterDelete(); SetNextMessageAfterDelete();
gDBView.doCommand(nsMsgViewCommandType.deleteMsg); gDBView.doCommand(nsMsgViewCommandType.deleteMsg);
break; break;
case "cmd_shiftDelete": case "cmd_shiftDelete":
if (gMarkViewedMessageAsReadTimer) if (gMarkViewedMessageAsReadTimer)
MarkCurrentMessageAsRead(); MarkCurrentMessageAsRead();
SetNextMessageAfterDelete(); SetNextMessageAfterDelete();
gDBView.doCommand(nsMsgViewCommandType.deleteNoTrash); gDBView.doCommand(nsMsgViewCommandType.deleteNoTrash);
break; break;
case "cmd_killThread": case "cmd_killThread":
/* kill thread kills the thread and then does a next unread */ /* kill thread kills the thread and then does a next unread */
GoNextMessage(nsMsgNavigationType.toggleThreadKilled, true); GoNextMessage(nsMsgNavigationType.toggleThreadKilled, true);
break; break;
case "cmd_watchThread": case "cmd_watchThread":
gDBView.doCommand(nsMsgViewCommandType.toggleThreadWatched); gDBView.doCommand(nsMsgViewCommandType.toggleThreadWatched);
break; break;
case "button_next": case "button_next":
case "cmd_nextUnreadMsg": case "cmd_nextUnreadMsg":
MsgNextUnreadMessage(); MsgNextUnreadMessage();
break; break;
case "cmd_nextUnreadThread": case "cmd_nextUnreadThread":
MsgNextUnreadThread(); MsgNextUnreadThread();
break; break;
case "cmd_nextMsg": case "cmd_nextMsg":
MsgNextMessage(); MsgNextMessage();
break; break;
case "cmd_nextFlaggedMsg": case "cmd_nextFlaggedMsg":
MsgNextFlaggedMessage(); MsgNextFlaggedMessage();
break; break;
case "cmd_previousMsg": case "cmd_previousMsg":
MsgPreviousMessage(); MsgPreviousMessage();
break; break;
case "button_previous": case "button_previous":
case "cmd_previousUnreadMsg": case "cmd_previousUnreadMsg":
MsgPreviousUnreadMessage(); MsgPreviousUnreadMessage();
break; break;
case "cmd_previousFlaggedMsg": case "cmd_previousFlaggedMsg":
MsgPreviousFlaggedMessage(); MsgPreviousFlaggedMessage();
break; break;
case "button_goForward": case "button_goForward":
case "cmd_goForward": case "cmd_goForward":
MsgGoForward(); MsgGoForward();
@ -543,76 +543,76 @@ var DefaultController =
HideMessageHeaderPane(); HideMessageHeaderPane();
loadStartPage(); loadStartPage();
break; break;
case "cmd_viewAllMsgs": case "cmd_viewAllMsgs":
case "cmd_viewThreadsWithUnread": case "cmd_viewThreadsWithUnread":
case "cmd_viewWatchedThreadsWithUnread": case "cmd_viewWatchedThreadsWithUnread":
case "cmd_viewUnreadMsgs": case "cmd_viewUnreadMsgs":
case "cmd_viewIgnoredThreads": case "cmd_viewIgnoredThreads":
SwitchView(command); SwitchView(command);
break; break;
case "cmd_undo": case "cmd_undo":
messenger.undo(msgWindow); messenger.undo(msgWindow);
break; break;
case "cmd_redo": case "cmd_redo":
messenger.redo(msgWindow); messenger.redo(msgWindow);
break; break;
case "cmd_expandAllThreads": case "cmd_expandAllThreads":
gDBView.doCommand(nsMsgViewCommandType.expandAll); gDBView.doCommand(nsMsgViewCommandType.expandAll);
break; break;
case "cmd_collapseAllThreads": case "cmd_collapseAllThreads":
gDBView.doCommand(nsMsgViewCommandType.collapseAll); gDBView.doCommand(nsMsgViewCommandType.collapseAll);
break; break;
case "cmd_renameFolder": case "cmd_renameFolder":
MsgRenameFolder(); MsgRenameFolder();
return; return;
case "cmd_sendUnsentMsgs": case "cmd_sendUnsentMsgs":
MsgSendUnsentMsgs(); MsgSendUnsentMsgs();
return; return;
case "cmd_openMessage": case "cmd_openMessage":
MsgOpenSelectedMessages(); MsgOpenSelectedMessages();
return; return;
case "cmd_printSetup": case "cmd_printSetup":
PrintUtils.showPageSetup(); PrintUtils.showPageSetup();
return; return;
case "cmd_print": case "cmd_print":
PrintEnginePrint(); PrintEnginePrint();
return; return;
case "cmd_printpreview": case "cmd_printpreview":
PrintEnginePrintPreview(); PrintEnginePrintPreview();
return; return;
case "cmd_saveAsFile": case "cmd_saveAsFile":
MsgSaveAsFile(); MsgSaveAsFile();
return; return;
case "cmd_saveAsTemplate": case "cmd_saveAsTemplate":
MsgSaveAsTemplate(); MsgSaveAsTemplate();
return; return;
case "cmd_viewPageSource": case "cmd_viewPageSource":
MsgViewPageSource(); MsgViewPageSource();
return; return;
case "cmd_setFolderCharset": case "cmd_setFolderCharset":
MsgSetFolderCharset(); MsgSetFolderCharset();
return; return;
case "cmd_reload": case "cmd_reload":
MsgReload(); MsgReload();
return; return;
case "cmd_find": case "cmd_find":
// make sure the message pane has focus before we start a find since we only support searching // make sure the message pane has focus before we start a find since we only support searching
// within the message body. Do it here and not in MsgFind() which can be called from standalone where we don't want to set focus // within the message body. Do it here and not in MsgFind() which can be called from standalone where we don't want to set focus
SetFocusMessagePane(); SetFocusMessagePane();
MsgFind(); MsgFind();
return; return;
case "cmd_findAgain": case "cmd_findAgain":
// make sure the message pane has focus before we start a find since we only support searching // make sure the message pane has focus before we start a find since we only support searching
// within the message body. Do it here and not in MsgFind() which can be called from standalone where we don't want to set focus // within the message body. Do it here and not in MsgFind() which can be called from standalone where we don't want to set focus
SetFocusMessagePane(); SetFocusMessagePane();
MsgFindAgain(false); MsgFindAgain(false);
return; return;
case "cmd_findPrevious": case "cmd_findPrevious":
// make sure the message pane has focus before we start a find since we only support searching // make sure the message pane has focus before we start a find since we only support searching
// within the message body. Do it here and not in MsgFind() which can be called from standalone where we don't want to set focus // within the message body. Do it here and not in MsgFind() which can be called from standalone where we don't want to set focus
SetFocusMessagePane(); SetFocusMessagePane();
MsgFindAgain(true); MsgFindAgain(true);
return; return;
case "cmd_markReadByDate": case "cmd_markReadByDate":
MsgMarkReadByDate(); MsgMarkReadByDate();
return; return;
@ -623,30 +623,30 @@ var DefaultController =
MsgSearchMessages(); MsgSearchMessages();
return; return;
case "button_mark": case "button_mark":
case "cmd_markAsRead": case "cmd_markAsRead":
MsgMarkMsgAsRead(null); MsgMarkMsgAsRead(null);
return; return;
case "cmd_markThreadAsRead": case "cmd_markThreadAsRead":
MsgMarkThreadAsRead(); MsgMarkThreadAsRead();
return; return;
case "cmd_markAllRead": case "cmd_markAllRead":
gDBView.doCommand(nsMsgViewCommandType.markAllRead); gDBView.doCommand(nsMsgViewCommandType.markAllRead);
return; return;
case "button_junk": case "button_junk":
MsgJunk(); MsgJunk();
return; return;
case "cmd_stop": case "cmd_stop":
MsgStop(); MsgStop();
return; return;
case "cmd_markAsFlagged": case "cmd_markAsFlagged":
MsgMarkAsFlagged(null); MsgMarkAsFlagged(null);
return; return;
case "cmd_markAsJunk": case "cmd_markAsJunk":
JunkSelectedMessages(true); JunkSelectedMessages(true);
return; return;
case "cmd_markAsNotJunk": case "cmd_markAsNotJunk":
JunkSelectedMessages(false); JunkSelectedMessages(false);
return; return;
case "cmd_recalculateJunkScore": case "cmd_recalculateJunkScore":
analyzeMessagesForJunk(); analyzeMessagesForJunk();
return; return;
@ -659,12 +659,12 @@ var DefaultController =
case "cmd_deleteJunk": case "cmd_deleteJunk":
deleteJunkInFolder(); deleteJunkInFolder();
return; return;
case "cmd_emptyTrash": case "cmd_emptyTrash":
MsgEmptyTrash(); MsgEmptyTrash();
return; return;
case "cmd_compactFolder": case "cmd_compactFolder":
MsgCompactFolder(true); MsgCompactFolder(true);
return; return;
case "cmd_downloadFlagged": case "cmd_downloadFlagged":
MsgDownloadFlagged(); MsgDownloadFlagged();
break; break;
@ -697,18 +697,18 @@ var DefaultController =
case "cmd_selectThread": case "cmd_selectThread":
gDBView.doCommand(nsMsgViewCommandType.selectThread); gDBView.doCommand(nsMsgViewCommandType.selectThread);
break; break;
} }
}, },
onEvent: function(event) onEvent: function(event)
{ {
// on blur events set the menu item texts back to the normal values // on blur events set the menu item texts back to the normal values
if ( event == 'blur' ) if ( event == 'blur' )
{ {
goSetMenuValue('cmd_undo', 'valueDefault'); goSetMenuValue('cmd_undo', 'valueDefault');
goSetMenuValue('cmd_redo', 'valueDefault'); goSetMenuValue('cmd_redo', 'valueDefault');
} }
} }
}; };
function GetNumSelectedMessages() function GetNumSelectedMessages()
@ -760,29 +760,29 @@ function WhichPaneHasFocus()
if (top.document.commandDispatcher.focusedWindow == GetMessagePaneFrame()) if (top.document.commandDispatcher.focusedWindow == GetMessagePaneFrame())
return messagePane; return messagePane;
var currentNode = top.document.commandDispatcher.focusedElement; var currentNode = top.document.commandDispatcher.focusedElement;
while (currentNode) { while (currentNode) {
if (currentNode === threadTree || if (currentNode === threadTree ||
currentNode === folderTree || currentNode === folderTree ||
currentNode === messagePane) currentNode === messagePane)
return currentNode; return currentNode;
currentNode = currentNode.parentNode; currentNode = currentNode.parentNode;
} }
return null; return null;
} }
function SetupCommandUpdateHandlers() function SetupCommandUpdateHandlers()
{ {
var widget; var widget;
// folder pane // folder pane
widget = GetFolderTree(); widget = GetFolderTree();
if ( widget ) if ( widget )
widget.controllers.appendController(FolderPaneController); widget.controllers.appendController(FolderPaneController);
top.controllers.insertControllerAt(0, DefaultController); top.controllers.insertControllerAt(0, DefaultController);
} }
function IsSendUnsentMsgsEnabled(folderResource) function IsSendUnsentMsgsEnabled(folderResource)
@ -888,7 +888,7 @@ function IsPropertiesEnabled(command)
function IsViewNavigationItemEnabled() function IsViewNavigationItemEnabled()
{ {
return IsFolderSelected(); return IsFolderSelected();
} }
function IsFolderSelected() function IsFolderSelected()
@ -976,16 +976,16 @@ function SetFocusThreadPaneIfNotOnMessagePane()
// 3pane related commands. Need to go in own file. Putting here for the moment. // 3pane related commands. Need to go in own file. Putting here for the moment.
function MsgNextMessage() function MsgNextMessage()
{ {
GoNextMessage(nsMsgNavigationType.nextMessage, false ); GoNextMessage(nsMsgNavigationType.nextMessage, false );
} }
function MsgNextUnreadMessage() function MsgNextUnreadMessage()
{ {
GoNextMessage(nsMsgNavigationType.nextUnreadMessage, true); GoNextMessage(nsMsgNavigationType.nextUnreadMessage, true);
} }
function MsgNextFlaggedMessage() function MsgNextFlaggedMessage()
{ {
GoNextMessage(nsMsgNavigationType.nextFlagged, true); GoNextMessage(nsMsgNavigationType.nextFlagged, true);
} }
function MsgNextUnreadThread() function MsgNextUnreadThread()
@ -1000,12 +1000,12 @@ function MsgPreviousMessage()
function MsgPreviousUnreadMessage() function MsgPreviousUnreadMessage()
{ {
GoNextMessage(nsMsgNavigationType.previousUnreadMessage, true); GoNextMessage(nsMsgNavigationType.previousUnreadMessage, true);
} }
function MsgPreviousFlaggedMessage() function MsgPreviousFlaggedMessage()
{ {
GoNextMessage(nsMsgNavigationType.previousFlagged, true); GoNextMessage(nsMsgNavigationType.previousFlagged, true);
} }
function MsgGoForward() function MsgGoForward()
@ -1020,22 +1020,22 @@ function MsgGoBack()
function GetFolderNameFromUri(uri, tree) function GetFolderNameFromUri(uri, tree)
{ {
var folderResource = RDF.GetResource(uri); var folderResource = RDF.GetResource(uri);
var db = tree.database; var db = tree.database;
var nameProperty = RDF.GetResource('http://home.netscape.com/NC-rdf#Name'); var nameProperty = RDF.GetResource('http://home.netscape.com/NC-rdf#Name');
var nameResult; var nameResult;
try { try {
nameResult = db.GetTarget(folderResource, nameProperty , true); nameResult = db.GetTarget(folderResource, nameProperty , true);
} }
catch (ex) { catch (ex) {
return ""; return "";
} }
nameResult = nameResult.QueryInterface(Components.interfaces.nsIRDFLiteral); nameResult = nameResult.QueryInterface(Components.interfaces.nsIRDFLiteral);
return nameResult.Value; return nameResult.Value;
} }
function SwitchPaneFocus(event) function SwitchPaneFocus(event)

View File

@ -89,10 +89,10 @@ function OnMailWindowUnload()
if (gPreQuickSearchView) //close the cached pre quick search view if (gPreQuickSearchView) //close the cached pre quick search view
gPreQuickSearchView.close(); gPreQuickSearchView.close();
} }
var dbview = GetDBView(); var dbview = GetDBView();
if (dbview) { if (dbview) {
dbview.close(); dbview.close();
} }
var mailSession = Components.classes[mailSessionContractID].getService(); var mailSession = Components.classes[mailSessionContractID].getService();
@ -107,10 +107,10 @@ function OnMailWindowUnload()
messenger.setWindow(null, null); messenger.setWindow(null, null);
var msgDS; var msgDS;
var viewDataSources = [accountManagerDataSource, folderDataSource, var viewDataSources = [accountManagerDataSource, folderDataSource,
unreadFolderDataSource, favoriteFoldersDataSource, unreadFolderDataSource, favoriteFoldersDataSource,
recentFoldersDataSource]; recentFoldersDataSource];
for (index in viewDataSources) for (index in viewDataSources)
{ {
msgDS = viewDataSources[index].QueryInterface(Components.interfaces.nsIMsgRDFDataSource); msgDS = viewDataSources[index].QueryInterface(Components.interfaces.nsIMsgRDFDataSource);
@ -181,12 +181,12 @@ function InitMsgWindow()
{ {
msgWindow.windowCommands = new nsMsgWindowCommands(); msgWindow.windowCommands = new nsMsgWindowCommands();
// set the domWindow before setting the status feedback and header sink objects // set the domWindow before setting the status feedback and header sink objects
msgWindow.domWindow = window; msgWindow.domWindow = window;
msgWindow.statusFeedback = statusFeedback; msgWindow.statusFeedback = statusFeedback;
msgWindow.msgHeaderSink = messageHeaderSink; msgWindow.msgHeaderSink = messageHeaderSink;
mailSession.AddMsgWindow(msgWindow); mailSession.AddMsgWindow(msgWindow);
getBrowser().docShell.allowAuth = false; getBrowser().docShell.allowAuth = false;
msgWindow.rootDocShell.allowAuth = true; msgWindow.rootDocShell.allowAuth = true;
msgWindow.rootDocShell.appType = Components.interfaces.nsIDocShell.APP_TYPE_MAIL; msgWindow.rootDocShell.appType = Components.interfaces.nsIDocShell.APP_TYPE_MAIL;
} }
@ -211,7 +211,7 @@ function AddDataSources()
//Add statusFeedback //Add statusFeedback
var msgDS; var msgDS;
var viewDataSources = [accountManagerDataSource, folderDataSource, var viewDataSources = [accountManagerDataSource, folderDataSource,
unreadFolderDataSource, favoriteFoldersDataSource, unreadFolderDataSource, favoriteFoldersDataSource,
recentFoldersDataSource]; recentFoldersDataSource];
for (index in viewDataSources) for (index in viewDataSources)
@ -286,7 +286,7 @@ nsMsgStatusFeedback.prototype =
{ {
if (iid.equals(Components.interfaces.nsIMsgStatusFeedback) || if (iid.equals(Components.interfaces.nsIMsgStatusFeedback) ||
iid.equals(Components.interfaces.nsIXULBrowserWindow) || iid.equals(Components.interfaces.nsIXULBrowserWindow) ||
iid.equals(Components.interfaces.nsISupportsWeakReference) || iid.equals(Components.interfaces.nsISupportsWeakReference) ||
iid.equals(Components.interfaces.nsISupports)) iid.equals(Components.interfaces.nsISupports))
return this; return this;
throw Components.results.NS_NOINTERFACE; throw Components.results.NS_NOINTERFACE;
@ -311,7 +311,7 @@ nsMsgStatusFeedback.prototype =
if (!this.progressMeterVisible) if (!this.progressMeterVisible)
{ {
this.progressMeterContainer.removeAttribute('collapsed'); this.progressMeterContainer.removeAttribute('collapsed');
this.progressMeterVisible = true; this.progressMeterVisible = true;
} }
@ -352,7 +352,7 @@ nsMsgStatusFeedback.prototype =
this.ensureStatusFields(); this.ensureStatusFields();
this.showStatusString(defaultStatus); this.showStatusString(defaultStatus);
// stop the throbber // stop the throbber
if (this.throbber) if (this.throbber)
this.throbber.setAttribute("busy", false); this.throbber.setAttribute("busy", false);
@ -420,17 +420,17 @@ nsMsgWindowCommands.prototype =
return this; return this;
throw Components.results.NS_NOINTERFACE; throw Components.results.NS_NOINTERFACE;
}, },
selectFolder: function(folderUri) selectFolder: function(folderUri)
{ {
SelectFolder(folderUri); SelectFolder(folderUri);
}, },
selectMessage: function(messageUri) selectMessage: function(messageUri)
{ {
SelectMessage(messageUri); SelectMessage(messageUri);
}, },
clearMsgPane: function() clearMsgPane: function()
{ {
if (gDBView) if (gDBView)
@ -438,7 +438,7 @@ nsMsgWindowCommands.prototype =
else else
setTitleFromFolder(null,null); setTitleFromFolder(null,null);
ClearMessagePane(); ClearMessagePane();
} }
} }
function StopUrls() function StopUrls()
@ -446,9 +446,9 @@ function StopUrls()
msgWindow.StopUrls(); msgWindow.StopUrls();
} }
/** /**
* @returns the pref name to use for fetching the start page url. Every time the application version changes, * @returns the pref name to use for fetching the start page url. Every time the application version changes,
* return "mailnews.start_page.override_url". If this is the first time the application has been * return "mailnews.start_page.override_url". If this is the first time the application has been
* launched, return "mailnews.start_page.welcome_url". Otherwise return "mailnews.start_page.url". * launched, return "mailnews.start_page.welcome_url". Otherwise return "mailnews.start_page.url".
*/ */
function startPageUrlPref() function startPageUrlPref()
@ -458,7 +458,7 @@ function startPageUrlPref()
try { try {
savedVersion = pref.getCharPref("mailnews.start_page_override.mstone"); savedVersion = pref.getCharPref("mailnews.start_page_override.mstone");
} catch (ex) {} } catch (ex) {}
if (savedVersion != "ignore") if (savedVersion != "ignore")
{ {
var currentPlatformVersion = Components.classes["@mozilla.org/xre/app-info;1"]. var currentPlatformVersion = Components.classes["@mozilla.org/xre/app-info;1"].
@ -470,11 +470,11 @@ function startPageUrlPref()
else if (currentPlatformVersion != savedVersion) else if (currentPlatformVersion != savedVersion)
prefForStartPageUrl = "mailnews.start_page.override_url"; prefForStartPageUrl = "mailnews.start_page.override_url";
} }
return prefForStartPageUrl; return prefForStartPageUrl;
} }
function loadStartPage() function loadStartPage()
{ {
try try
{ {
@ -528,7 +528,7 @@ function HidingAccountCentral()
function ShowThreadPane() function ShowThreadPane()
{ {
document.getElementById("displayDeck").selectedPanel = document.getElementById("displayDeck").selectedPanel =
document.getElementById("threadPaneBox"); document.getElementById("threadPaneBox");
} }
@ -539,7 +539,7 @@ function ShowingThreadPane()
GetMessagePane().collapsed = (threadPaneSplitter.getAttribute("state") == "collapsed"); GetMessagePane().collapsed = (threadPaneSplitter.getAttribute("state") == "collapsed");
// XXX We need to force the tree to refresh its new height // XXX We need to force the tree to refresh its new height
// so that it will correctly scroll to the newest message // so that it will correctly scroll to the newest message
GetThreadTree().boxObject.height; GetThreadTree().boxObject.height;
document.getElementById("key_toggleMessagePane").removeAttribute("disabled"); document.getElementById("key_toggleMessagePane").removeAttribute("disabled");
} }
@ -554,7 +554,7 @@ function HidingThreadPane()
} }
// the find toolbar needs a method called getBrowser // the find toolbar needs a method called getBrowser
function getBrowser() function getBrowser()
{ {
return getMessageBrowser(); return getMessageBrowser();
} }
@ -572,7 +572,7 @@ function ObserveDisplayDeckChange(event)
ShowingThreadPane(); ShowingThreadPane();
else else
HidingThreadPane(); HidingThreadPane();
if (nowSelected == "accountCentralBox") if (nowSelected == "accountCentralBox")
ShowingAccountCentral(); ShowingAccountCentral();
else else
@ -582,7 +582,7 @@ function ObserveDisplayDeckChange(event)
} }
// Given the server, open the twisty and the set the selection // Given the server, open the twisty and the set the selection
// on inbox of that server. // on inbox of that server.
// prompt if offline. // prompt if offline.
function OpenInboxForServer(server) function OpenInboxForServer(server)
{ {
@ -591,7 +591,7 @@ function OpenInboxForServer(server)
var inboxFolder = GetInboxFolder(server); var inboxFolder = GetInboxFolder(server);
SelectFolder(inboxFolder.URI); SelectFolder(inboxFolder.URI);
if (MailOfflineMgr.isOnline() || MailOfflineMgr.getNewMail()) { if (MailOfflineMgr.isOnline() || MailOfflineMgr.getNewMail()) {
if (server.type != "imap") if (server.type != "imap")
GetMessagesForInboxOnServer(server); GetMessagesForInboxOnServer(server);
} }

View File

@ -70,15 +70,15 @@
<stringbundleset id="stringbundleset"> <stringbundleset id="stringbundleset">
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/> <stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
<stringbundle id="bundle_shell" src="chrome://messenger/locale/shellservice.properties"/> <stringbundle id="bundle_shell" src="chrome://messenger/locale/shellservice.properties"/>
<stringbundle id="bundle_offlinePrompts" src="chrome://messenger/locale/offline.properties"/> <stringbundle id="bundle_offlinePrompts" src="chrome://messenger/locale/offline.properties"/>
</stringbundleset> </stringbundleset>
<!-- Performance optimization...we include utilityOverlay.xul which defines some command sets <!-- Performance optimization...we include utilityOverlay.xul which defines some command sets
which are updated based on events like focus and select. We have our own custom events which are updated based on events like focus and select. We have our own custom events
which we use to optmize when we do command updating. To avoid unnecessary command updating, which we use to optmize when we do command updating. To avoid unnecessary command updating,
we are going to override the events the global edit menu items and select edit menu items we are going to override the events the global edit menu items and select edit menu items
are updated on with events of our own controlling. are updated on with events of our own controlling.
--> -->
<commandset id="globalEditMenuItems" <commandset id="globalEditMenuItems"
@ -100,7 +100,7 @@
<command id="cmd_getNewMessages" oncommand="goDoCommand('cmd_getNewMessages')" disabled="true"/> <command id="cmd_getNewMessages" oncommand="goDoCommand('cmd_getNewMessages')" disabled="true"/>
<command id="cmd_close" oncommand="goDoCommand('cmd_close')"/> <command id="cmd_close" oncommand="goDoCommand('cmd_close')"/>
<command id="cmd_open" oncommand="goDoCommand('cmd_open')"/> <command id="cmd_open" oncommand="goDoCommand('cmd_open')"/>
<command id="cmd_file" disabled="true"/> <command id="cmd_file" disabled="true"/>
<command id="cmd_emptyTrash" oncommand="goDoCommand('cmd_emptyTrash')" disabled="true"/> <command id="cmd_emptyTrash" oncommand="goDoCommand('cmd_emptyTrash')" disabled="true"/>
@ -109,14 +109,14 @@
<command id="cmd_print" oncommand="goDoCommand('cmd_print')" disabled="true"/> <command id="cmd_print" oncommand="goDoCommand('cmd_print')" disabled="true"/>
<command id="cmd_printpreview" oncommand="goDoCommand('cmd_printpreview')" disabled="true"/> <command id="cmd_printpreview" oncommand="goDoCommand('cmd_printpreview')" disabled="true"/>
<command id="cmd_saveAsFile" oncommand="goDoCommand('cmd_saveAsFile')" disabled="true"/> <command id="cmd_saveAsFile" oncommand="goDoCommand('cmd_saveAsFile')" disabled="true"/>
<command id="cmd_saveAsTemplate" oncommand="goDoCommand('cmd_saveAsTemplate')" disabled="true"/> <command id="cmd_saveAsTemplate" oncommand="goDoCommand('cmd_saveAsTemplate')" disabled="true"/>
<command id="cmd_getNextNMessages" oncommand="goDoCommand('cmd_getNextNMessages')" disabled="true"/> <command id="cmd_getNextNMessages" oncommand="goDoCommand('cmd_getNextNMessages')" disabled="true"/>
<command id="cmd_renameFolder" oncommand="goDoCommand('cmd_renameFolder')" /> <command id="cmd_renameFolder" oncommand="goDoCommand('cmd_renameFolder')" />
<command id="cmd_sendUnsentMsgs" oncommand="goDoCommand('cmd_sendUnsentMsgs')" /> <command id="cmd_sendUnsentMsgs" oncommand="goDoCommand('cmd_sendUnsentMsgs')" />
<command id="cmd_synchronizeOffline" oncommand="goDoCommand('cmd_synchronizeOffline')" disabled="true"/> <command id="cmd_synchronizeOffline" oncommand="goDoCommand('cmd_synchronizeOffline')" disabled="true"/>
<command id="cmd_downloadFlagged" oncommand="goDoCommand('cmd_downloadFlagged')" disabled="true"/> <command id="cmd_downloadFlagged" oncommand="goDoCommand('cmd_downloadFlagged')" disabled="true"/>
<command id="cmd_downloadSelected" oncommand="goDoCommand('cmd_downloadSelected')" disabled="true"/> <command id="cmd_downloadSelected" oncommand="goDoCommand('cmd_downloadSelected')" disabled="true"/>
<command id="cmd_settingsOffline" oncommand="goDoCommand('cmd_settingsOffline')" disabled="true"/> <command id="cmd_settingsOffline" oncommand="goDoCommand('cmd_settingsOffline')" disabled="true"/>
</commandset> </commandset>
<commandset id="mailCommands"> <commandset id="mailCommands">
@ -242,7 +242,7 @@
commandupdater="true" commandupdater="true"
events="mail-toolbar" events="mail-toolbar"
oncommandupdate="goUpdateMailMenuItems(this)"> oncommandupdate="goUpdateMailMenuItems(this)">
<command id="button_reply"/> <command id="button_reply"/>
<command id="button_replyall"/> <command id="button_replyall"/>
<command id="button_forward"/> <command id="button_forward"/>
@ -265,8 +265,8 @@
events="create-menu-getMsgToolbar,create-menu-file" events="create-menu-getMsgToolbar,create-menu-file"
oncommandupdate="goUpdateMailMenuItems(this)"> oncommandupdate="goUpdateMailMenuItems(this)">
<command id="cmd_getMsgsForAuthAccounts" <command id="cmd_getMsgsForAuthAccounts"
oncommand="goDoCommand('cmd_getMsgsForAuthAccounts'); event.stopPropagation()" oncommand="goDoCommand('cmd_getMsgsForAuthAccounts'); event.stopPropagation()"
disabled="true"/> disabled="true"/>
</commandset> </commandset>
@ -330,7 +330,7 @@
#endif #endif
<key id="key_selectAll"/> <key id="key_selectAll"/>
<key id="key_selectThread" key="&selectThreadCmd.key;" oncommand="goDoCommand('cmd_selectThread');" modifiers="accel, shift"/> <key id="key_selectThread" key="&selectThreadCmd.key;" oncommand="goDoCommand('cmd_selectThread');" modifiers="accel, shift"/>
<key id="key_toggleRead" key="&markAsReadCmd.key;" oncommand="goDoCommand('cmd_markAsRead');"/> <key id="key_toggleRead" key="&markAsReadCmd.key;" oncommand="goDoCommand('cmd_markAsRead');"/>
<key id="key_toggleFlagged" key="&markStarredCmd.key;" oncommand="goDoCommand('cmd_markAsFlagged');"/> <key id="key_toggleFlagged" key="&markStarredCmd.key;" oncommand="goDoCommand('cmd_markAsFlagged');"/>
<key id="key_markJunk" key="&markAsJunkCmd.key;" oncommand="goDoCommand('cmd_markAsJunk');"/> <key id="key_markJunk" key="&markAsJunkCmd.key;" oncommand="goDoCommand('cmd_markAsJunk');"/>
@ -375,8 +375,8 @@
#elifdef XP_UNIX #elifdef XP_UNIX
<key id="key_getNewMessages2" keycode="VK_F9" oncommand="goDoCommand('cmd_getNewMessages')"/> <key id="key_getNewMessages2" keycode="VK_F9" oncommand="goDoCommand('cmd_getNewMessages')"/>
#endif #endif
<key id="key_getAllNewMessages" <key id="key_getAllNewMessages"
key="&getAllNewMsgCmd.key;" key="&getAllNewMsgCmd.key;"
oncommand="goDoCommand('cmd_getMsgsForAuthAccounts');" oncommand="goDoCommand('cmd_getMsgsForAuthAccounts');"
modifiers="accel, shift"/> modifiers="accel, shift"/>
<key id="key_find" key="&findCmd.key;" oncommand="goDoCommand('cmd_find')" modifiers="accel"/> <key id="key_find" key="&findCmd.key;" oncommand="goDoCommand('cmd_find')" modifiers="accel"/>
@ -486,7 +486,7 @@
sortDirection="ascending" sortDirection="ascending"
datasources="rdf:null"> datasources="rdf:null">
<menupopup> <menupopup>
<menu label="&contextMoveCopyMsgRecentMenu.label;" accesskey="&contextMoveCopyMsgRecentMenu.accesskey;" <menu label="&contextMoveCopyMsgRecentMenu.label;" accesskey="&contextMoveCopyMsgRecentMenu.accesskey;"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName" sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending" sortDirection="ascending"
datasources="rdf:mailnewsrecentfolders" datasources="rdf:mailnewsrecentfolders"
@ -495,8 +495,8 @@
<template> <template>
<rule nc:CanFileMessages="true"> <rule nc:CanFileMessages="true">
<menupopup> <menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#FolderTreeSimpleName" <menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#FolderTreeSimpleName"
oncommand="MsgMoveMessage(event.target.id)" oncommand="MsgMoveMessage(event.target.id)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder" SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState" BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer" IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
@ -508,7 +508,7 @@
</menu> </menu>
<menuseparator/> <menuseparator/>
</menupopup> </menupopup>
<template> <template>
<rule nc:NoSelect="true" iscontainer="true" isempty="false"> <rule nc:NoSelect="true" iscontainer="true" isempty="false">
<menupopup> <menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"> <menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name">
@ -518,7 +518,7 @@
</menupopup> </menupopup>
</menu> </menu>
</menupopup> </menupopup>
</rule> </rule>
<rule nc:NoSelect="true"> <rule nc:NoSelect="true">
<menupopup> <menupopup>
<menuitem uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" disabled="true"/> <menuitem uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" disabled="true"/>
@ -533,7 +533,7 @@
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure" IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"> ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup> <menupopup>
<menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;" <menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;"
oncommand="MsgMoveMessage(event.target.parentNode.parentNode.id)"/> oncommand="MsgMoveMessage(event.target.parentNode.parentNode.id)"/>
<menuseparator/> <menuseparator/>
</menupopup> </menupopup>
@ -559,7 +559,7 @@
</rule> </rule>
<rule nc:CanFileMessages="true"> <rule nc:CanFileMessages="true">
<menupopup> <menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" oncommand="MsgMoveMessage(event.target.id)" <menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" oncommand="MsgMoveMessage(event.target.id)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder" SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState" BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer" IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
@ -569,7 +569,7 @@
</rule> </rule>
</template> </template>
</menu> </menu>
<menu id="threadPaneContext-copyMenu" <menu id="threadPaneContext-copyMenu"
label="&contextCopyMsgMenu.label;" label="&contextCopyMsgMenu.label;"
accesskey="&contextCopyMsgMenu.accesskey;" accesskey="&contextCopyMsgMenu.accesskey;"
@ -577,7 +577,7 @@
sortDirection="ascending" sortDirection="ascending"
datasources="rdf:null"> datasources="rdf:null">
<menupopup> <menupopup>
<menu label="&contextMoveCopyMsgRecentMenu.label;" accesskey="&contextMoveCopyMsgRecentMenu.accesskey;" <menu label="&contextMoveCopyMsgRecentMenu.label;" accesskey="&contextMoveCopyMsgRecentMenu.accesskey;"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName" sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending" sortDirection="ascending"
datasources="rdf:mailnewsrecentfolders" datasources="rdf:mailnewsrecentfolders"
@ -586,8 +586,8 @@
<template> <template>
<rule nc:CanFileMessages="true"> <rule nc:CanFileMessages="true">
<menupopup> <menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#FolderTreeSimpleName" <menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#FolderTreeSimpleName"
oncommand="MsgCopyMessage(event.target.id)" oncommand="MsgCopyMessage(event.target.id)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder" SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState" BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer" IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
@ -609,7 +609,7 @@
</menupopup> </menupopup>
</menu> </menu>
</menupopup> </menupopup>
</rule> </rule>
<rule nc:NoSelect="true"> <rule nc:NoSelect="true">
<menupopup> <menupopup>
<menuitem uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" disabled="true"/> <menuitem uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" disabled="true"/>
@ -624,7 +624,7 @@
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure" IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"> ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup> <menupopup>
<menuitem label="&copyHereMenu.label;" accesskey="&copyHereMenu.accesskey;" <menuitem label="&copyHereMenu.label;" accesskey="&copyHereMenu.accesskey;"
oncommand="MsgCopyMessage(event.target.parentNode.parentNode.id)"/> oncommand="MsgCopyMessage(event.target.parentNode.parentNode.id)"/>
<menuseparator/> <menuseparator/>
</menupopup> </menupopup>
@ -650,8 +650,8 @@
</rule> </rule>
<rule nc:CanFileMessages="true"> <rule nc:CanFileMessages="true">
<menupopup> <menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" <menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="MsgCopyMessage(event.target.id)" oncommand="MsgCopyMessage(event.target.id)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder" SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState" BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer" IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
@ -734,11 +734,11 @@
accesskey="&folderContextGetMessages.accesskey;" accesskey="&folderContextGetMessages.accesskey;"
oncommand="MsgGetMessage();"/> oncommand="MsgGetMessage();"/>
<menuitem id="folderPaneContext-openNewWindow" <menuitem id="folderPaneContext-openNewWindow"
label="&folderContextOpenNewWindow.label;" label="&folderContextOpenNewWindow.label;"
accesskey="&folderContextOpenNewWindow.accesskey;" accesskey="&folderContextOpenNewWindow.accesskey;"
oncommand="MsgOpenNewWindowForFolder(null,-1);"/> oncommand="MsgOpenNewWindowForFolder(null,-1);"/>
<menuitem id="folderPaneContext-openNewTab" <menuitem id="folderPaneContext-openNewTab"
label="&folderContextOpenNewTab.label;" label="&folderContextOpenNewTab.label;"
accesskey="&folderContextOpenNewTab.accesskey;" accesskey="&folderContextOpenNewTab.accesskey;"
oncommand="MsgOpenNewTabForFolder(null,-1);"/> oncommand="MsgOpenNewTabForFolder(null,-1);"/>
@ -813,7 +813,7 @@
oncommand="MsgFolderProperties();"/> oncommand="MsgFolderProperties();"/>
</popup> </popup>
<popup id="messagePaneContext" <popup id="messagePaneContext"
onpopupshowing="if (event.target != this) return true; gContextMenu = new nsContextMenu(this); return fillMessagePaneContextMenu();" onpopupshowing="if (event.target != this) return true; gContextMenu = new nsContextMenu(this); return fillMessagePaneContextMenu();"
onpopuphiding="if (event.target == this) gContextMenu = null;"> onpopuphiding="if (event.target == this) gContextMenu = null;">
<menuseparator id="messagePaneContext-sep-link"/> <menuseparator id="messagePaneContext-sep-link"/>
@ -858,7 +858,7 @@
sortDirection="ascending" sortDirection="ascending"
datasources="rdf:null"> datasources="rdf:null">
<menupopup> <menupopup>
<menu label="&contextMoveCopyMsgRecentMenu.label;" accesskey="&contextMoveCopyMsgRecentMenu.accesskey;" <menu label="&contextMoveCopyMsgRecentMenu.label;" accesskey="&contextMoveCopyMsgRecentMenu.accesskey;"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName" sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending" sortDirection="ascending"
datasources="rdf:mailnewsrecentfolders" datasources="rdf:mailnewsrecentfolders"
@ -867,8 +867,8 @@
<template> <template>
<rule nc:CanFileMessages="true"> <rule nc:CanFileMessages="true">
<menupopup> <menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#FolderTreeSimpleName" <menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#FolderTreeSimpleName"
oncommand="MsgMoveMessage(event.target.id)" oncommand="MsgMoveMessage(event.target.id)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder" SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState" BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer" IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
@ -905,7 +905,7 @@
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure" IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"> ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup> <menupopup>
<menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;" <menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;"
oncommand="MsgMoveMessage(event.target.parentNode.parentNode.id)"/> oncommand="MsgMoveMessage(event.target.parentNode.parentNode.id)"/>
<menuseparator/> <menuseparator/>
</menupopup> </menupopup>
@ -948,7 +948,7 @@
sortDirection="ascending" sortDirection="ascending"
datasources="rdf:null"> datasources="rdf:null">
<menupopup> <menupopup>
<menu label="&contextMoveCopyMsgRecentMenu.label;" accesskey="&contextMoveCopyMsgRecentMenu.accesskey;" <menu label="&contextMoveCopyMsgRecentMenu.label;" accesskey="&contextMoveCopyMsgRecentMenu.accesskey;"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName" sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending" sortDirection="ascending"
datasources="rdf:mailnewsrecentfolders" datasources="rdf:mailnewsrecentfolders"
@ -957,8 +957,8 @@
<template> <template>
<rule nc:CanFileMessages="true"> <rule nc:CanFileMessages="true">
<menupopup> <menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#FolderTreeSimpleName" <menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#FolderTreeSimpleName"
oncommand="MsgCopyMessage(event.target.id)" oncommand="MsgCopyMessage(event.target.id)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder" SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState" BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer" IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
@ -995,7 +995,7 @@
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure" IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"> ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup> <menupopup>
<menuitem label="&copyHereMenu.label;" accesskey="&copyHereMenu.accesskey;" <menuitem label="&copyHereMenu.label;" accesskey="&copyHereMenu.accesskey;"
oncommand="MsgCopyMessage(event.target.parentNode.parentNode.id)"/> oncommand="MsgCopyMessage(event.target.parentNode.parentNode.id)"/>
<menuseparator/> <menuseparator/>
</menupopup> </menupopup>
@ -1021,8 +1021,8 @@
</rule> </rule>
<rule nc:CanFileMessages="true"> <rule nc:CanFileMessages="true">
<menupopup> <menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" <menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="MsgCopyMessage(event.target.id)" oncommand="MsgCopyMessage(event.target.id)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder" SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState" BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer" IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
@ -1033,7 +1033,7 @@
</template> </template>
</menu> </menu>
<menuitem id="messagePaneContext-moveToFolderAgain" command="cmd_moveToFolderAgain" <menuitem id="messagePaneContext-moveToFolderAgain" command="cmd_moveToFolderAgain"
label="&moveToFolderAgain.label;" accesskey="&moveToFolderAgain.accesskey;"/> label="&moveToFolderAgain.label;" accesskey="&moveToFolderAgain.accesskey;"/>
<menuseparator id="messagePaneContext-sep-tags-1"/> <menuseparator id="messagePaneContext-sep-tags-1"/>
<menu id="messagePaneContext-tags" label="&tagMenu.label;" accesskey="&tagMenu.accesskey;"> <menu id="messagePaneContext-tags" label="&tagMenu.label;" accesskey="&tagMenu.accesskey;">
<menupopup id="messagePaneContext-tagpopup" onpopupshowing="InitMessageTags(this)"> <menupopup id="messagePaneContext-tagpopup" onpopupshowing="InitMessageTags(this)">
@ -1067,13 +1067,13 @@
accesskey="&markStarredCmd.accesskey;" accesskey="&markStarredCmd.accesskey;"
command="cmd_markAsFlagged"/> command="cmd_markAsFlagged"/>
<menuseparator/> <menuseparator/>
<menuitem label="&markAsJunkCmd.label;" <menuitem label="&markAsJunkCmd.label;"
accesskey="&markAsJunkCmd.accesskey;" accesskey="&markAsJunkCmd.accesskey;"
command="cmd_markAsJunk"/> command="cmd_markAsJunk"/>
<menuitem label="&markAsNotJunkCmd.label;" <menuitem label="&markAsNotJunkCmd.label;"
accesskey="&markAsNotJunkCmd.accesskey;" accesskey="&markAsNotJunkCmd.accesskey;"
command="cmd_markAsNotJunk"/> command="cmd_markAsNotJunk"/>
<menuitem label="&recalculateJunkScoreCmd.label;" <menuitem label="&recalculateJunkScoreCmd.label;"
accesskey="&recalculateJunkScoreCmd.accesskey;" accesskey="&recalculateJunkScoreCmd.accesskey;"
command="cmd_recalculateJunkScore"/> command="cmd_recalculateJunkScore"/>
@ -1132,9 +1132,9 @@
<menuitem oncommand="CustomizeMailToolbar('mail-toolbox');" id="CustomizeMailToolbar" label="&customizeToolbar.label;" accesskey="&customizeToolbar.accesskey;"/> <menuitem oncommand="CustomizeMailToolbar('mail-toolbox');" id="CustomizeMailToolbar" label="&customizeToolbar.label;" accesskey="&customizeToolbar.accesskey;"/>
</popup> </popup>
<toolbox id="mail-toolbox" class="toolbox-top" mode="full"> <toolbox id="mail-toolbox" class="toolbox-top" mode="full">
<!-- Menu --> <!-- Menu -->
<toolbar type="menubar" id="mail-toolbar-menubar2" class="chromeclass-menubar" customizable="true" <toolbar type="menubar" id="mail-toolbar-menubar2" class="chromeclass-menubar" customizable="true"
#ifdef XP_MACOSX #ifdef XP_MACOSX
defaultset="menubar-items" defaultset="menubar-items"
#else #else
@ -1199,7 +1199,7 @@
<template> <template>
<rule nc:IsServer="true" nc:CanGetMessages="true"> <rule nc:IsServer="true" nc:CanGetMessages="true">
<menupopup> <menupopup>
<menuitem uri="..." value="..." label="rdf:http://home.netscape.com/NC-rdf#Name" <menuitem uri="..." value="..." label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="MsgGetMessagesForAccount(event)"/> oncommand="MsgGetMessagesForAccount(event)"/>
</menupopup> </menupopup>
</rule> </rule>
@ -1224,7 +1224,7 @@
<menuseparator id="trashMenuSeparator"/> <menuseparator id="trashMenuSeparator"/>
<menu id="offlineMenuItem" label="&offlineMenu.label;" accesskey="&offlineMenu.accesskey;"> <menu id="offlineMenuItem" label="&offlineMenu.label;" accesskey="&offlineMenu.accesskey;">
<menupopup> <menupopup>
<menuitem id="goOfflineMenuItem" type="checkbox" label="&offlineGoOfflineCmd.label;" <menuitem id="goOfflineMenuItem" type="checkbox" label="&offlineGoOfflineCmd.label;"
accesskey="&offlineGoOfflineCmd.accesskey;" oncommand="MailOfflineMgr.toggleOfflineStatus();"/> accesskey="&offlineGoOfflineCmd.accesskey;" oncommand="MailOfflineMgr.toggleOfflineStatus();"/>
<menuseparator/> <menuseparator/>
<menuitem label="&synchronizeOfflineCmd.label;" accesskey="&synchronizeOfflineCmd.accesskey;" command="cmd_synchronizeOffline"/> <menuitem label="&synchronizeOfflineCmd.label;" accesskey="&synchronizeOfflineCmd.accesskey;" command="cmd_synchronizeOffline"/>
@ -1243,7 +1243,7 @@
<menuitem id="printMenuItem" key="key_print" label="&printCmd.label;" accesskey="&printCmd.accesskey;" command="cmd_print"/> <menuitem id="printMenuItem" key="key_print" label="&printCmd.label;" accesskey="&printCmd.accesskey;" command="cmd_print"/>
</menupopup> </menupopup>
</menu> </menu>
<!-- Edit --> <!-- Edit -->
<menu id="menu_Edit" oncommand="CommandUpdate_UndoRedo();"> <menu id="menu_Edit" oncommand="CommandUpdate_UndoRedo();">
<menupopup onpopupshowing="InitEditMessagesMenu()"> <menupopup onpopupshowing="InitEditMessagesMenu()">
@ -1272,12 +1272,12 @@
<menuitem id="menu_findCmd" label="&findCmd.label;" key="key_find" accesskey="&findCmd.accesskey;" command="cmd_find"/> <menuitem id="menu_findCmd" label="&findCmd.label;" key="key_find" accesskey="&findCmd.accesskey;" command="cmd_find"/>
<menuitem id="menu_findAgainCmd" label="&findAgainCmd.label;" key="key_findAgain" accesskey="&findAgainCmd.accesskey;" command="cmd_findAgain"/> <menuitem id="menu_findAgainCmd" label="&findAgainCmd.label;" key="key_findAgain" accesskey="&findAgainCmd.accesskey;" command="cmd_findAgain"/>
<menuseparator/> <menuseparator/>
<menuitem id="searchMailCmd" label="&searchMailCmd.label;" <menuitem id="searchMailCmd" label="&searchMailCmd.label;"
key="key_searchMail" key="key_searchMail"
accesskey="&searchMailCmd.accesskey;" accesskey="&searchMailCmd.accesskey;"
command="cmd_search"/> command="cmd_search"/>
<menuitem id="searchAddressesCmd" label="&searchAddressesCmd.label;" <menuitem id="searchAddressesCmd" label="&searchAddressesCmd.label;"
accesskey="&searchAddressesCmd.accesskey;" accesskey="&searchAddressesCmd.accesskey;"
oncommand="MsgSearchAddresses()"/> oncommand="MsgSearchAddresses()"/>
</menupopup> </menupopup>
</menu> </menu>
@ -1334,7 +1334,7 @@
<menu id="menu_FolderViews" label="&folderView.label;" accesskey="&folderView.accesskey;"> <menu id="menu_FolderViews" label="&folderView.label;" accesskey="&folderView.accesskey;">
<menupopup onpopupshowing="InitViewFolderViewsMenu(event)"> <menupopup onpopupshowing="InitViewFolderViewsMenu(event)">
<menuitem id="menu_allFolders" label="&allFolders.label;" accesskey="&allFolders.accesskey;" <menuitem id="menu_allFolders" label="&allFolders.label;" accesskey="&allFolders.accesskey;"
type="radio" name="viewmessages" oncommand="loadFolderView(0);"/> type="radio" name="viewmessages" oncommand="loadFolderView(0);"/>
<menuitem id="menu_unreadFolders" label="&unreadFolders.label;" accesskey="&unreadFolders.accesskey;" <menuitem id="menu_unreadFolders" label="&unreadFolders.label;" accesskey="&unreadFolders.accesskey;"
type="radio" name="viewmessages" oncommand="loadFolderView(1);"/> type="radio" name="viewmessages" oncommand="loadFolderView(1);"/>
@ -1522,14 +1522,14 @@
accesskey="&newMsgCmd.accesskey;" accesskey="&newMsgCmd.accesskey;"
key="key_newMessage2" key="key_newMessage2"
oncommand="MsgNewMessage(null);"/> oncommand="MsgNewMessage(null);"/>
<menuitem id="replyMainMenu" label="&replyMsgCmd.label;" <menuitem id="replyMainMenu" label="&replyMsgCmd.label;"
accesskey="&replyMsgCmd.accesskey;" accesskey="&replyMsgCmd.accesskey;"
key="key_reply" key="key_reply"
command="cmd_reply"/> command="cmd_reply"/>
<menuitem id="replySenderMainMenu" label="&replySenderCmd.label;" <menuitem id="replySenderMainMenu" label="&replySenderCmd.label;"
accesskey="&replySenderCmd.accesskey;" accesskey="&replySenderCmd.accesskey;"
command="cmd_replySender"/> command="cmd_replySender"/>
<menuitem id="replyNewsgroupMainMenu" label="&replyNewsgroupCmd.label;" <menuitem id="replyNewsgroupMainMenu" label="&replyNewsgroupCmd.label;"
accesskey="&replyNewsgroupCmd.accesskey;" accesskey="&replyNewsgroupCmd.accesskey;"
key="key_reply" key="key_reply"
command="cmd_replyGroup"/> command="cmd_replyGroup"/>
@ -1560,7 +1560,7 @@
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName" sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending"> sortDirection="ascending">
<menupopup> <menupopup>
<menu label="&moveCopyMsgRecentMenu.label;" accesskey="&moveCopyMsgRecentMenu.accesskey;" <menu label="&moveCopyMsgRecentMenu.label;" accesskey="&moveCopyMsgRecentMenu.accesskey;"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName" sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending" sortDirection="ascending"
datasources="rdf:mailnewsrecentfolders" datasources="rdf:mailnewsrecentfolders"
@ -1569,8 +1569,8 @@
<template> <template>
<rule nc:CanFileMessages="true"> <rule nc:CanFileMessages="true">
<menupopup> <menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#FolderTreeSimpleName" <menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#FolderTreeSimpleName"
oncommand="MsgMoveMessage(event.target.id)" oncommand="MsgMoveMessage(event.target.id)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder" SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState" BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer" IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
@ -1607,7 +1607,7 @@
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure" IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"> ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup> <menupopup>
<menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;" <menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;"
oncommand="MsgMoveMessage(event.target.parentNode.parentNode.id)"/> oncommand="MsgMoveMessage(event.target.parentNode.parentNode.id)"/>
<menuseparator/> <menuseparator/>
</menupopup> </menupopup>
@ -1648,7 +1648,7 @@
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName" sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending"> sortDirection="ascending">
<menupopup> <menupopup>
<menu label="&moveCopyMsgRecentMenu.label;" accesskey="&moveCopyMsgRecentMenu.accesskey;" <menu label="&moveCopyMsgRecentMenu.label;" accesskey="&moveCopyMsgRecentMenu.accesskey;"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName" sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending" sortDirection="ascending"
datasources="rdf:mailnewsrecentfolders" datasources="rdf:mailnewsrecentfolders"
@ -1657,8 +1657,8 @@
<template> <template>
<rule nc:CanFileMessages="true"> <rule nc:CanFileMessages="true">
<menupopup> <menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#FolderTreeSimpleName" <menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#FolderTreeSimpleName"
oncommand="MsgCopyMessage(event.target.id)" oncommand="MsgCopyMessage(event.target.id)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder" SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState" BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer" IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
@ -1695,7 +1695,7 @@
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure" IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"> ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup> <menupopup>
<menuitem label="&copyHereMenu.label;" accesskey="&copyHereMenu.accesskey;" <menuitem label="&copyHereMenu.label;" accesskey="&copyHereMenu.accesskey;"
oncommand="MsgCopyMessage(event.target.parentNode.parentNode.id)"/> oncommand="MsgCopyMessage(event.target.parentNode.parentNode.id)"/>
<menuseparator/> <menuseparator/>
</menupopup> </menupopup>
@ -1721,8 +1721,8 @@
</rule> </rule>
<rule nc:CanFileMessages="true"> <rule nc:CanFileMessages="true">
<menupopup> <menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" <menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="MsgCopyMessage(event.target.id)" oncommand="MsgCopyMessage(event.target.id)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder" SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState" BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer" IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
@ -1762,26 +1762,26 @@
/> />
<menuitem id="menu_markAllRead" label="&markAllReadCmd.label;" key="key_markAllRead" accesskey="&markAllReadCmd.accesskey;" command="cmd_markAllRead"/> <menuitem id="menu_markAllRead" label="&markAllReadCmd.label;" key="key_markAllRead" accesskey="&markAllReadCmd.accesskey;" command="cmd_markAllRead"/>
<menuseparator/> <menuseparator/>
<menuitem id="markFlaggedMenuItem" <menuitem id="markFlaggedMenuItem"
type="checkbox" type="checkbox"
label="&markStarredCmd.label;" label="&markStarredCmd.label;"
accesskey="&markStarredCmd.accesskey;" accesskey="&markStarredCmd.accesskey;"
command="cmd_markAsFlagged" command="cmd_markAsFlagged"
#ifndef XP_MACOSX #ifndef XP_MACOSX
key="key_toggleFlagged" key="key_toggleFlagged"
#endif #endif
/> />
<menuseparator/> <menuseparator/>
<menuitem id="menu_markAsJunk" label="&markAsJunkCmd.label;" <menuitem id="menu_markAsJunk" label="&markAsJunkCmd.label;"
accesskey="&markAsJunkCmd.accesskey;" accesskey="&markAsJunkCmd.accesskey;"
command="cmd_markAsJunk" command="cmd_markAsJunk"
#ifndef XP_MACOSX #ifndef XP_MACOSX
key="key_markJunk" key="key_markJunk"
#endif #endif
/> />
<menuitem id="menu_markAsNotJunk" label="&markAsNotJunkCmd.label;" <menuitem id="menu_markAsNotJunk" label="&markAsNotJunkCmd.label;"
key="key_markNotJunk" key="key_markNotJunk"
accesskey="&markAsNotJunkCmd.accesskey;" accesskey="&markAsNotJunkCmd.accesskey;"
command="cmd_markAsNotJunk"/> command="cmd_markAsNotJunk"/>
<menuitem label="&recalculateJunkScoreCmd.label;" <menuitem label="&recalculateJunkScoreCmd.label;"
accesskey="&recalculateJunkScoreCmd.accesskey;" accesskey="&recalculateJunkScoreCmd.accesskey;"
@ -1816,12 +1816,12 @@
<menu id="tasksMenu" label="&tasksMenu.label;" accesskey="&tasksMenu.accesskey;"> <menu id="tasksMenu" label="&tasksMenu.label;" accesskey="&tasksMenu.accesskey;">
<menupopup id="taskPopup" onpopupshowing="document.commandDispatcher.updateCommands('create-menu-tasks')"> <menupopup id="taskPopup" onpopupshowing="document.commandDispatcher.updateCommands('create-menu-tasks')">
#ifndef XP_MACOSX #ifndef XP_MACOSX
<menuitem hidden="true" accesskey="&messengerCmd.accesskey;" label="&messengerCmd.label;" <menuitem hidden="true" accesskey="&messengerCmd.accesskey;" label="&messengerCmd.label;"
key="key_mail" oncommand="toMessengerWindow();" id="tasksMenuMail" class="menuitem-iconic menu-iconic"/> key="key_mail" oncommand="toMessengerWindow();" id="tasksMenuMail" class="menuitem-iconic menu-iconic"/>
<menuitem id="addressBook" label="&addressBookCmd.label;" accesskey="&addressBookCmd.accesskey;" key="key_addressbook" <menuitem id="addressBook" label="&addressBookCmd.label;" accesskey="&addressBookCmd.accesskey;" key="key_addressbook"
oncommand="toOpenWindowByType('mail:addressbook', 'chrome://messenger/content/addressbook/addressbook.xul');"/> oncommand="toOpenWindowByType('mail:addressbook', 'chrome://messenger/content/addressbook/addressbook.xul');"/>
#endif #endif
<menuitem id="addonsManager" label="&addons.label;" accesskey="&addons.accesskey;" <menuitem id="addonsManager" label="&addons.label;" accesskey="&addons.accesskey;"
oncommand="openAddonsMgr();"/> oncommand="openAddonsMgr();"/>
<menuseparator id="devToolsSeparator"/> <menuseparator id="devToolsSeparator"/>
@ -1835,15 +1835,15 @@
<menuseparator/> <menuseparator/>
<menuitem id="runJunkControls" <menuitem id="runJunkControls"
label="&runJunkControls.label;" label="&runJunkControls.label;"
accesskey="&runJunkControls.accesskey;" accesskey="&runJunkControls.accesskey;"
command="cmd_runJunkControls"/> command="cmd_runJunkControls"/>
<menuitem id="deleteJunk" <menuitem id="deleteJunk"
label="&deleteJunk.label;" label="&deleteJunk.label;"
accesskey="&deleteJunk.accesskey;" accesskey="&deleteJunk.accesskey;"
command="cmd_deleteJunk"/> command="cmd_deleteJunk"/>
<menuseparator/> <menuseparator/>
<menuitem id="menu_import" label="&importCmd.label;" <menuitem id="menu_import" label="&importCmd.label;"
accesskey="&importCmd.accesskey;" accesskey="&importCmd.accesskey;"
oncommand="toImport();"/> oncommand="toImport();"/>
<menuitem id="javaScriptConsole" label="&errorConsoleCmd.label;" accesskey="&errorConsoleCmd.accesskey;" oncommand="toJavaScriptConsole();"/> <menuitem id="javaScriptConsole" label="&errorConsoleCmd.label;" accesskey="&errorConsoleCmd.accesskey;" oncommand="toJavaScriptConsole();"/>
#ifndef XP_UNIX #ifndef XP_UNIX
@ -1862,13 +1862,13 @@
#endif #endif
#endif #endif
</menupopup> </menupopup>
</menu> </menu>
#ifdef XP_MACOSX #ifdef XP_MACOSX
<!-- Mac window menu --> <!-- Mac window menu -->
#include ../../../toolkit/content/macWindowMenu.inc #include ../../../toolkit/content/macWindowMenu.inc
#endif #endif
<!-- Help --> <!-- Help -->
#ifdef XP_WIN #ifdef XP_WIN
<menu label="&helpMenuWin.label;" accesskey="&helpMenuWin.accesskey;"> <menu label="&helpMenuWin.label;" accesskey="&helpMenuWin.accesskey;">
@ -1907,12 +1907,12 @@
<toolbarbutton id="button-getmsg" type="menu-button" <toolbarbutton id="button-getmsg" type="menu-button"
class="toolbarbutton-1" class="toolbarbutton-1"
label="&getMsgButton.label;" label="&getMsgButton.label;"
tooltiptext="&getMsgButton.tooltip;" tooltiptext="&getMsgButton.tooltip;"
oncommand="goDoCommand('cmd_getNewMessages')" oncommand="goDoCommand('cmd_getNewMessages')"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName" sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending" sortDirection="ascending"
observes="button_getNewMessages" datasources="rdf:msgaccountmanager rdf:mailnewsfolders" observes="button_getNewMessages" datasources="rdf:msgaccountmanager rdf:mailnewsfolders"
containment="http://home.netscape.com/NC-rdf#child" containment="http://home.netscape.com/NC-rdf#child"
ref="msgaccounts:/"> ref="msgaccounts:/">
<menupopup onpopupshowing="getMsgToolbarMenu_init()"> <menupopup onpopupshowing="getMsgToolbarMenu_init()">
<menuitem label="&getAllNewMsgCmd.label;" command="cmd_getMsgsForAuthAccounts"/> <menuitem label="&getAllNewMsgCmd.label;" command="cmd_getMsgsForAuthAccounts"/>
@ -1924,7 +1924,7 @@
<menuitem uri="..." value="..." label="rdf:http://home.netscape.com/NC-rdf#Name" oncommand="MsgGetMessagesForAccount(event);"/> <menuitem uri="..." value="..." label="rdf:http://home.netscape.com/NC-rdf#Name" oncommand="MsgGetMessagesForAccount(event);"/>
</menupopup> </menupopup>
</rule> </rule>
</template> </template>
</toolbarbutton> </toolbarbutton>
<toolbarbutton id="button-newmsg" class="toolbarbutton-1" label="&newMsgButton.label;" tooltiptext="&newMsgButton.tooltip;" oncommand="MsgNewMessage(event)"/> <toolbarbutton id="button-newmsg" class="toolbarbutton-1" label="&newMsgButton.label;" tooltiptext="&newMsgButton.tooltip;" oncommand="MsgNewMessage(event)"/>
@ -1933,13 +1933,13 @@
<toolbarbutton class="toolbarbutton-1" id="button-replyall" label="&replyAllButton.label;" tooltiptext="&replyAllButton.tooltip;" observes="button_replyall" oncommand="MsgReplyToAllMessage(event)"/> <toolbarbutton class="toolbarbutton-1" id="button-replyall" label="&replyAllButton.label;" tooltiptext="&replyAllButton.tooltip;" observes="button_replyall" oncommand="MsgReplyToAllMessage(event)"/>
<toolbarbutton class="toolbarbutton-1" id="button-forward" label="&forwardButton.label;" tooltiptext="&forwardButton.tooltip;" observes="button_forward" oncommand="MsgForwardMessage(event)"/> <toolbarbutton class="toolbarbutton-1" id="button-forward" label="&forwardButton.label;" tooltiptext="&forwardButton.tooltip;" observes="button_forward" oncommand="MsgForwardMessage(event)"/>
<toolbarbutton type="menu" id="button-file" class="toolbarbutton-1" <toolbarbutton type="menu" id="button-file" class="toolbarbutton-1"
label="&fileButton.label;" observes="button_file" label="&fileButton.label;" observes="button_file"
datasources="rdf:null" datasources="rdf:null"
tooltiptext="&fileButton.tooltip;" tooltiptext="&fileButton.tooltip;"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName" sortDirection="ascending"> sortResource="http://home.netscape.com/NC-rdf#FolderTreeName" sortDirection="ascending">
<menupopup> <menupopup>
<menu label="&moveCopyMsgRecentMenu.label;" accesskey="&moveCopyMsgRecentMenu.accesskey;" <menu label="&moveCopyMsgRecentMenu.label;" accesskey="&moveCopyMsgRecentMenu.accesskey;"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName" sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending" sortDirection="ascending"
datasources="rdf:mailnewsrecentfolders" datasources="rdf:mailnewsrecentfolders"
@ -1948,8 +1948,8 @@
<template> <template>
<rule nc:CanFileMessages="true"> <rule nc:CanFileMessages="true">
<menupopup> <menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#FolderTreeSimpleName" <menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#FolderTreeSimpleName"
oncommand="MsgMoveMessage(event.target.id)" oncommand="MsgMoveMessage(event.target.id)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder" SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState" BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer" IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
@ -1960,8 +1960,8 @@
</template> </template>
</menu> </menu>
<menuseparator/> <menuseparator/>
</menupopup> </menupopup>
<template> <template>
<rule nc:NoSelect="true" iscontainer="true" isempty="false"> <rule nc:NoSelect="true" iscontainer="true" isempty="false">
<menupopup> <menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"> <menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name">
@ -1971,7 +1971,7 @@
</menupopup> </menupopup>
</menu> </menu>
</menupopup> </menupopup>
</rule> </rule>
<rule nc:NoSelect="true"> <rule nc:NoSelect="true">
<menupopup> <menupopup>
<menuitem uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" disabled="true"/> <menuitem uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" disabled="true"/>
@ -1986,7 +1986,7 @@
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure" IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"> ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup> <menupopup>
<menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;" <menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;"
oncommand="MsgMoveMessage(event.target.parentNode.parentNode.id)"/> oncommand="MsgMoveMessage(event.target.parentNode.parentNode.id)"/>
<menuseparator/> <menuseparator/>
</menupopup> </menupopup>
@ -2012,7 +2012,7 @@
</rule> </rule>
<rule nc:CanFileMessages="true"> <rule nc:CanFileMessages="true">
<menupopup> <menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" oncommand="MsgMoveMessage(event.target.id)" <menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" oncommand="MsgMoveMessage(event.target.id)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder" SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState" BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer" IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
@ -2023,14 +2023,14 @@
</template> </template>
<menupopup/> <menupopup/>
</toolbarbutton> </toolbarbutton>
<toolbarbutton class="toolbarbutton-1" type="menu-button" id="button-goback" label="&backButton1.label;" chromedir="&locale.dir;" oncommand="goDoCommand('cmd_goBack')" tooltiptext="&goBackButton.tooltip;" observes="button_goBack"> <toolbarbutton class="toolbarbutton-1" type="menu-button" id="button-goback" label="&backButton1.label;" chromedir="&locale.dir;" oncommand="goDoCommand('cmd_goBack')" tooltiptext="&goBackButton.tooltip;" observes="button_goBack">
<menupopup onpopupshowing="backToolbarMenu_init(this)"> <menupopup onpopupshowing="backToolbarMenu_init(this)">
<menuitem label="&goBackCmd.label;" command="cmd_goBack"/> <menuitem label="&goBackCmd.label;" command="cmd_goBack"/>
<menuseparator/> <menuseparator/>
</menupopup> </menupopup>
</toolbarbutton> </toolbarbutton>
<toolbarbutton class="toolbarbutton-1" type="menu-button" id="button-goforward" label="&goForwardButton1.label;" chromedir="&locale.dir;" oncommand="goDoCommand('cmd_goForward')" tooltiptext="&goForwardButton.tooltip;" observes="button_goForward"> <toolbarbutton class="toolbarbutton-1" type="menu-button" id="button-goforward" label="&goForwardButton1.label;" chromedir="&locale.dir;" oncommand="goDoCommand('cmd_goForward')" tooltiptext="&goForwardButton.tooltip;" observes="button_goForward">
<menupopup onpopupshowing="forwardToolbarMenu_init(this)"> <menupopup onpopupshowing="forwardToolbarMenu_init(this)">
<menuitem label="&goForwardCmd.label;" command="cmd_goForward"/> <menuitem label="&goForwardCmd.label;" command="cmd_goForward"/>
@ -2038,32 +2038,32 @@
</menupopup> </menupopup>
</toolbarbutton> </toolbarbutton>
<toolbarbutton class="toolbarbutton-1" id="button-previous" label="&previousButton.label;" chromedir="&locale.dir;" oncommand="goDoCommand('button_previous')" tooltiptext="&previousButton.tooltip;" observes="button_previous"/> <toolbarbutton class="toolbarbutton-1" id="button-previous" label="&previousButton.label;" chromedir="&locale.dir;" oncommand="goDoCommand('button_previous')" tooltiptext="&previousButton.tooltip;" observes="button_previous"/>
<toolbarbutton class="toolbarbutton-1" id="button-next" label="&nextButton.label;" chromedir="&locale.dir;" oncommand="goDoCommand('button_next')" tooltiptext="&nextButton.tooltip;" observes="button_next"/> <toolbarbutton class="toolbarbutton-1" id="button-next" label="&nextButton.label;" chromedir="&locale.dir;" oncommand="goDoCommand('button_next')" tooltiptext="&nextButton.tooltip;" observes="button_next"/>
<toolbaritem id="button-junk"> <toolbaritem id="button-junk">
<deck id="junk-deck" observes="button_junk"> <deck id="junk-deck" observes="button_junk">
<toolbarbutton class="toolbarbutton-1 junk-button" <toolbarbutton class="toolbarbutton-1 junk-button"
label="&junkButton.label;" label="&junkButton.label;"
tooltiptext="&junkButton.tooltip;" tooltiptext="&junkButton.tooltip;"
observes="button_junk" observes="button_junk"
oncommand="goDoCommand('button_junk')"/> oncommand="goDoCommand('button_junk')"/>
<toolbarbutton class="toolbarbutton-1 junk-button" <toolbarbutton class="toolbarbutton-1 junk-button"
label="&notJunkButton.label;" label="&notJunkButton.label;"
tooltiptext="&notJunkButton.tooltip;" tooltiptext="&notJunkButton.tooltip;"
observes="button_junk" observes="button_junk"
oncommand="goDoCommand('button_junk')"/> oncommand="goDoCommand('button_junk')"/>
</deck> </deck>
</toolbaritem> </toolbaritem>
<toolbarbutton class="toolbarbutton-1" id="button-delete" label="&deleteButton.label;" tooltiptext="&deleteButton.tooltip;" observes="button_delete" oncommand="goDoCommand(event.shiftKey ? 'cmd_shiftDelete' : 'cmd_delete')"/> <toolbarbutton class="toolbarbutton-1" id="button-delete" label="&deleteButton.label;" tooltiptext="&deleteButton.tooltip;" observes="button_delete" oncommand="goDoCommand(event.shiftKey ? 'cmd_shiftDelete' : 'cmd_delete')"/>
#ifdef XP_MACOSX #ifdef XP_MACOSX
<toolbarbutton id="button-print" class="toolbarbutton-1" label="&printButton.label;" <toolbarbutton id="button-print" class="toolbarbutton-1" label="&printButton.label;"
observes="button_print" oncommand="goDoCommand('cmd_print')" tooltiptext="&printButton.tooltip;"/> observes="button_print" oncommand="goDoCommand('cmd_print')" tooltiptext="&printButton.tooltip;"/>
#else #else
<toolbarbutton id="button-print" class="toolbarbutton-1" label="&printButton.label;" <toolbarbutton id="button-print" class="toolbarbutton-1" label="&printButton.label;"
observes="button_print" oncommand="goDoCommand('cmd_print')" tooltiptext="&printButton.tooltip;" type="menu-button"> observes="button_print" oncommand="goDoCommand('cmd_print')" tooltiptext="&printButton.tooltip;" type="menu-button">
<menupopup id="printMenu" onpopupshowing="goUpdateCommand('cmd_printpreview');"> <menupopup id="printMenu" onpopupshowing="goUpdateCommand('cmd_printpreview');">
<menuitem label="&printCmd.label;" accesskey="&printCmd.accesskey;" default="true"/> <menuitem label="&printCmd.label;" accesskey="&printCmd.accesskey;" default="true"/>
<menuitem label="&printPreviewCmd.label;" accesskey="&printPreviewCmd.accesskey;" command="cmd_printpreview"/> <menuitem label="&printPreviewCmd.label;" accesskey="&printPreviewCmd.accesskey;" command="cmd_printpreview"/>
@ -2071,14 +2071,14 @@
</toolbarbutton> </toolbarbutton>
#endif #endif
<toolbarbutton id="button-mark" type="menu-button" class="toolbarbutton-1" label="&markButton.label;" oncommand="goDoCommand('button_mark')" <toolbarbutton id="button-mark" type="menu-button" class="toolbarbutton-1" label="&markButton.label;" oncommand="goDoCommand('button_mark')"
observes="button_mark" tooltiptext="&markButton.tooltip;"> observes="button_mark" tooltiptext="&markButton.tooltip;">
<menupopup onpopupshowing="InitMessageMark()"> <menupopup onpopupshowing="InitMessageMark()">
<menuitem type="checkbox" key="key_toggleRead" id="markReadToolbarItem" label="&markAsReadCmd.label;" accesskey="&markAsReadCmd.accesskey;" command="cmd_markAsRead" /> <menuitem type="checkbox" key="key_toggleRead" id="markReadToolbarItem" label="&markAsReadCmd.label;" accesskey="&markAsReadCmd.accesskey;" command="cmd_markAsRead" />
<menuitem label="&markThreadAsReadCmd.label;" key="key_markThreadAsRead" accesskey="&markThreadAsReadCmd.accesskey;" command="cmd_markThreadAsRead"/> <menuitem label="&markThreadAsReadCmd.label;" key="key_markThreadAsRead" accesskey="&markThreadAsReadCmd.accesskey;" command="cmd_markThreadAsRead"/>
<menuitem label="&markReadByDateCmd.label;" key="key_markReadByDate" accesskey="&markReadByDateCmd.accesskey;" command="cmd_markReadByDate"/> <menuitem label="&markReadByDateCmd.label;" key="key_markReadByDate" accesskey="&markReadByDateCmd.accesskey;" command="cmd_markReadByDate"/>
<menuitem label="&markAllReadCmd.label;" key="key_markAllRead" accesskey="&markAllReadCmd.accesskey;" command="cmd_markAllRead"/> <menuitem label="&markAllReadCmd.label;" key="key_markAllRead" accesskey="&markAllReadCmd.accesskey;" command="cmd_markAllRead"/>
<menuseparator/> <menuseparator/>
<menuitem type="checkbox" id="markFlaggedToolbarItem" label="&markStarredCmd.label;" accesskey="&markStarredCmd.accesskey;" <menuitem type="checkbox" id="markFlaggedToolbarItem" label="&markStarredCmd.label;" accesskey="&markStarredCmd.accesskey;"
key="key_toggleFlagged" command="cmd_markAsFlagged"/> key="key_toggleFlagged" command="cmd_markAsFlagged"/>
</menupopup> </menupopup>
</toolbarbutton> </toolbarbutton>
@ -2103,26 +2103,26 @@
<toolbarbutton class="toolbarbutton-1" id="button-stop" label="&stopButton.label;" tooltiptext="&stopButton.tooltip;" command="cmd_stop"/> <toolbarbutton class="toolbarbutton-1" id="button-stop" label="&stopButton.label;" tooltiptext="&stopButton.tooltip;" command="cmd_stop"/>
<toolbaritem id="search-container" title="&searchItem.title;" align="center" class="chromeclass-toolbar-additional"> <toolbaritem id="search-container" title="&searchItem.title;" align="center" class="chromeclass-toolbar-additional">
<textbox id="searchInput" flex="1" onfocus="onSearchInputFocus(event);" onclick="onSearchInputClick(event);" <textbox id="searchInput" flex="1" onfocus="onSearchInputFocus(event);" onclick="onSearchInputClick(event);"
onmousedown="onSearchInputMousedown(event);" onblur="onSearchInputBlur(event);" onmousedown="onSearchInputMousedown(event);" onblur="onSearchInputBlur(event);"
oninput="onSearchInput(false);" onkeypress="onSearchKeyPress(event);"> oninput="onSearchInput(false);" onkeypress="onSearchKeyPress(event);">
<button id="quick-search-button" type="menu"> <button id="quick-search-button" type="menu">
<menupopup id="quick-search-menupopup" value="2" persist="value" onpopupshowing="InitQuickSearchPopup();" popupalign="topleft" popupanchor="bottomleft"> <menupopup id="quick-search-menupopup" value="2" persist="value" onpopupshowing="InitQuickSearchPopup();" popupalign="topleft" popupanchor="bottomleft">
<menuitem value="0" label="&searchSubjectMenu.label;" type="radio" <menuitem value="0" label="&searchSubjectMenu.label;" type="radio"
oncommand="changeQuickSearchMode(this)"/> oncommand="changeQuickSearchMode(this)"/>
<menuitem value="1" label="&searchFromMenu.label;" type="radio" <menuitem value="1" label="&searchFromMenu.label;" type="radio"
oncommand="changeQuickSearchMode(this)" /> oncommand="changeQuickSearchMode(this)" />
<menuitem value="2" label="&searchSubjectOrFromMenu.label;" type="radio" <menuitem value="2" label="&searchSubjectOrFromMenu.label;" type="radio"
oncommand="changeQuickSearchMode(this)"/> oncommand="changeQuickSearchMode(this)"/>
<menuitem value="5" label="&searchRecipient.label;" type="radio" <menuitem value="5" label="&searchRecipient.label;" type="radio"
oncommand="changeQuickSearchMode(this)"/> oncommand="changeQuickSearchMode(this)"/>
<menuitem value="3" label="&searchMessageBody.label;" type="radio" <menuitem value="3" label="&searchMessageBody.label;" type="radio"
oncommand="changeQuickSearchMode(this)"/> oncommand="changeQuickSearchMode(this)"/>
<menuseparator/> <menuseparator/>
<!-- if the value for the save as virtual folder menu changes, please update the <!-- if the value for the save as virtual folder menu changes, please update the
VK_DOWN key handler in searchbar.xml VK_DOWN key handler in searchbar.xml
--> -->
<menuitem value="5" id="quickSearchSaveAsVirtualFolder" label="&saveAsVirtualFolderMenu.label;" <menuitem value="5" id="quickSearchSaveAsVirtualFolder" label="&saveAsVirtualFolderMenu.label;"
oncommand="saveViewAsVirtualFolder()"/> oncommand="saveViewAsVirtualFolder()"/>
</menupopup> </menupopup>
</button> </button>
@ -2134,11 +2134,11 @@
<!--XXX The src attribute is there to give the menulist icon horizontal margin (bug 381364). <!--XXX The src attribute is there to give the menulist icon horizontal margin (bug 381364).
Remove it once bug 381548 is fixed. --> Remove it once bug 381548 is fixed. -->
<menulist id="locationFolders" class="folderMenuItem" label=" " src="" context="folderPaneContext" width="170" crop="center"> <menulist id="locationFolders" class="folderMenuItem" label=" " src="" context="folderPaneContext" width="170" crop="center">
<menupopup id="folderLocationPopup" class="folderLocationPopup" height="400" flex="1" <menupopup id="folderLocationPopup" class="folderLocationPopup" height="400" flex="1"
oncommand="OnLocationTreeSelect(this);"/> oncommand="OnLocationTreeSelect(this);"/>
</menulist> </menulist>
</toolbaritem> </toolbaritem>
<toolbaritem id="mailviews-container" title="&mailViewsToolbarItem.title;" align="center" class="chromeclass-toolbar-additional"> <toolbaritem id="mailviews-container" title="&mailViewsToolbarItem.title;" align="center" class="chromeclass-toolbar-additional">
<label value="&viewPicker.label;" control="viewPicker" accesskey="&viewPicker.accesskey;"/> <label value="&viewPicker.label;" control="viewPicker" accesskey="&viewPicker.accesskey;"/>
<menulist id="viewPicker" oncommand="ViewChangeByMenuitem(event.target);"> <menulist id="viewPicker" oncommand="ViewChangeByMenuitem(event.target);">
@ -2163,13 +2163,13 @@
</menulist> </menulist>
</toolbaritem> </toolbaritem>
</toolbarpalette> </toolbarpalette>
<!-- If changes are made to the default set of toolbar buttons, you may need to rev the id <!-- If changes are made to the default set of toolbar buttons, you may need to rev the id
of mail-bar in order to force the new default items to show up for users who customized their toolbar of mail-bar in order to force the new default items to show up for users who customized their toolbar
in earlier versions. Bumping the id means users will have to re-customize their toolbar! in earlier versions. Bumping the id means users will have to re-customize their toolbar!
--> -->
<toolbar id="mail-bar2" class="toolbar-primary chromeclass-toolbar" <toolbar id="mail-bar2" class="toolbar-primary chromeclass-toolbar"
toolbarname="Mail" toolbarname="Mail"
fullscreentoolbar="true" mode="full" fullscreentoolbar="true" mode="full"
customizable="true" customizable="true"
context="toolbar-context-menu" context="toolbar-context-menu"
@ -2182,8 +2182,8 @@
<toolbarset id="customToolbars" context="toolbar-context-menu"/> <toolbarset id="customToolbars" context="toolbar-context-menu"/>
</toolbox> </toolbox>
<!-- The msgNotificationBar appears on top of the message and displays <!-- The msgNotificationBar appears on top of the message and displays
information like: junk, contains remote images, or is a suspected phishing URL information like: junk, contains remote images, or is a suspected phishing URL
--> -->
<deck id="msgNotificationBar" selectedIndex="0" collapsed="true"> <deck id="msgNotificationBar" selectedIndex="0" collapsed="true">
@ -2234,6 +2234,6 @@
</stack> </stack>
</statusbarpanel> </statusbarpanel>
</hbox> </hbox>
</statusbar> </statusbar>
</overlay> </overlay>

View File

@ -71,11 +71,11 @@ var folderListener = {
}, },
OnItemPropertyChanged: function(item, property, oldValue, newValue) {}, OnItemPropertyChanged: function(item, property, oldValue, newValue) {},
OnItemIntPropertyChanged: function(item, property, oldValue, newValue) { OnItemIntPropertyChanged: function(item, property, oldValue, newValue) {
if (item.Value == gCurrentFolderUri) { if (item.Value == gCurrentFolderUri) {
if (property.toString() == "TotalMessages" || property.toString() == "TotalUnreadMessages") { if (property.toString() == "TotalMessages" || property.toString() == "TotalUnreadMessages") {
UpdateStandAloneMessageCounts(); UpdateStandAloneMessageCounts();
} }
} }
}, },
OnItemBoolPropertyChanged: function(item, property, oldValue, newValue) {}, OnItemBoolPropertyChanged: function(item, property, oldValue, newValue) {},
@ -100,14 +100,14 @@ var folderListener = {
if (gRerootOnFolderLoadForStandAlone) { if (gRerootOnFolderLoadForStandAlone) {
RerootFolderForStandAlone(uri); RerootFolderForStandAlone(uri);
} }
} }
} }
} }
} }
else if (eventType == "JunkStatusChanged") { else if (eventType == "JunkStatusChanged") {
HandleJunkStatusChanged(folder); HandleJunkStatusChanged(folder);
} }
} }
} }
var messagepaneObserver = { var messagepaneObserver = {
@ -116,20 +116,20 @@ var messagepaneObserver = {
onDrop: function (aEvent, aData, aDragSession) onDrop: function (aEvent, aData, aDragSession)
{ {
var sourceUri = aData.data; var sourceUri = aData.data;
if (sourceUri != gCurrentMessageUri) if (sourceUri != gCurrentMessageUri)
{ {
SelectFolder(GetMsgHdrFromUri(sourceUri).folder.URI); SelectFolder(GetMsgHdrFromUri(sourceUri).folder.URI);
SelectMessage(sourceUri); SelectMessage(sourceUri);
} }
}, },
onDragOver: function (aEvent, aFlavour, aDragSession) onDragOver: function (aEvent, aFlavour, aDragSession)
{ {
var messagepanebox = document.getElementById("messagepanebox"); var messagepanebox = document.getElementById("messagepanebox");
messagepanebox.setAttribute("dragover", "true"); messagepanebox.setAttribute("dragover", "true");
}, },
onDragExit: function (aEvent, aDragSession) onDragExit: function (aEvent, aDragSession)
{ {
var messagepanebox = document.getElementById("messagepanebox"); var messagepanebox = document.getElementById("messagepanebox");
@ -142,7 +142,7 @@ var messagepaneObserver = {
var elem = doc.getElementById("messengerWindow"); var elem = doc.getElementById("messengerWindow");
return (elem && (elem.getAttribute("windowtype") == "mail:3pane")); return (elem && (elem.getAttribute("windowtype") == "mail:3pane"));
}, },
getSupportedFlavours: function () getSupportedFlavours: function ()
{ {
var flavourSet = new FlavourSet(); var flavourSet = new FlavourSet();
@ -161,7 +161,7 @@ function UpdateStandAloneMessageCounts()
observerService.notifyObservers(window, "mail:updateStandAloneMessageCounts", ""); observerService.notifyObservers(window, "mail:updateStandAloneMessageCounts", "");
} }
nsMsgDBViewCommandUpdater.prototype = nsMsgDBViewCommandUpdater.prototype =
{ {
updateCommandStatus : function() updateCommandStatus : function()
{ {
@ -191,22 +191,22 @@ nsMsgDBViewCommandUpdater.prototype =
if (iid.equals(Components.interfaces.nsIMsgDBViewCommandUpdater) || if (iid.equals(Components.interfaces.nsIMsgDBViewCommandUpdater) ||
iid.equals(Components.interfaces.nsISupports)) iid.equals(Components.interfaces.nsISupports))
return this; return this;
throw Components.results.NS_NOINTERFACE; throw Components.results.NS_NOINTERFACE;
} }
} }
function HandleDeleteOrMoveMsgCompleted(folder) function HandleDeleteOrMoveMsgCompleted(folder)
{ {
var folderResource = folder.QueryInterface(Components.interfaces.nsIRDFResource); var folderResource = folder.QueryInterface(Components.interfaces.nsIRDFResource);
if (!folderResource) if (!folderResource)
return; return;
if ((folderResource.Value == gCurrentFolderUri) && gCurrentMessageIsDeleted) if ((folderResource.Value == gCurrentFolderUri) && gCurrentMessageIsDeleted)
{ {
gDBView.onDeleteCompleted(true); gDBView.onDeleteCompleted(true);
gCurrentMessageIsDeleted = false; gCurrentMessageIsDeleted = false;
if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None)
{ {
var nextMstKey = gDBView.getKeyAt(gNextMessageViewIndexAfterDelete); var nextMstKey = gDBView.getKeyAt(gNextMessageViewIndexAfterDelete);
if (nextMstKey != nsMsgKey_None) { if (nextMstKey != nsMsgKey_None) {
@ -221,7 +221,7 @@ function HandleDeleteOrMoveMsgCompleted(folder)
// close the stand alone window because there are no more messages in the folder // close the stand alone window because there are no more messages in the folder
window.close(); window.close();
} }
} }
} }
function HandleDeleteOrMoveMsgFailed(folder) function HandleDeleteOrMoveMsgFailed(folder)
@ -295,8 +295,8 @@ function delayedOnLoadMessageWindow()
if (messageUri instanceof Components.interfaces.nsIMsgMailNewsUrl) if (messageUri instanceof Components.interfaces.nsIMsgMailNewsUrl)
folder = messageUri.folder; folder = messageUri.folder;
} }
} }
catch(ex) catch(ex)
{ {
folder = null; folder = null;
dump("## ex=" + ex + "\n"); dump("## ex=" + ex + "\n");
@ -314,12 +314,12 @@ function delayedOnLoadMessageWindow()
gCurrentFolderUri = folder ? folder.URI : null; gCurrentFolderUri = folder ? folder.URI : null;
if (window.arguments[2]) if (window.arguments[2])
originalView = window.arguments[2]; originalView = window.arguments[2];
} }
CreateView(originalView); CreateView(originalView);
gPhishingDetector.init(); gPhishingDetector.init();
// initialize the customizeDone method on the customizeable toolbar // initialize the customizeDone method on the customizeable toolbar
@ -330,7 +330,7 @@ function delayedOnLoadMessageWindow()
toolbox.toolbarset = toolbarset; toolbox.toolbarset = toolbarset;
setTimeout(OnLoadMessageWindowDelayed, 0, loadCustomMessage); setTimeout(OnLoadMessageWindowDelayed, 0, loadCustomMessage);
SetupCommandUpdateHandlers(); SetupCommandUpdateHandlers();
} }
@ -343,12 +343,12 @@ function OnLoadMessageWindowDelayed(loadCustomMessage)
} }
else else
{ {
var msgKey = extractMsgKeyFromURI(gCurrentMessageUri); var msgKey = extractMsgKeyFromURI(gCurrentMessageUri);
LoadMessageByViewIndex(gDBView.findIndexFromKey(msgKey, true)); LoadMessageByViewIndex(gDBView.findIndexFromKey(msgKey, true));
} }
gNextMessageViewIndexAfterDelete = gDBView.msgToSelectAfterDelete; gNextMessageViewIndexAfterDelete = gDBView.msgToSelectAfterDelete;
UpdateStandAloneMessageCounts(); UpdateStandAloneMessageCounts();
// set focus to the message pane // set focus to the message pane
window.content.focus(); window.content.focus();
@ -363,7 +363,7 @@ function CreateView(originalView)
{ {
var msgFolder = GetLoadedMsgFolder(); var msgFolder = GetLoadedMsgFolder();
// extract the sort type, the sort order, // extract the sort type, the sort order,
var sortType; var sortType;
var sortOrder; var sortOrder;
var viewFlags; var viewFlags;
@ -392,14 +392,14 @@ function CreateView(originalView)
} }
else else
{ {
// this is a hack to make opening a stand-alone msg window on a // this is a hack to make opening a stand-alone msg window on a
// .eml file work. We use a search view since its much more tolerant // .eml file work. We use a search view since its much more tolerant
// of not having a folder. // of not having a folder.
viewType = nsMsgViewType.eShowSearch; viewType = nsMsgViewType.eShowSearch;
} }
// create a db view // create a db view
CreateBareDBView(originalView, msgFolder, viewType, viewFlags, sortType, sortOrder); CreateBareDBView(originalView, msgFolder, viewType, viewFlags, sortType, sortOrder);
var uri; var uri;
if (gCurrentMessageUri) if (gCurrentMessageUri)
@ -444,38 +444,38 @@ function HideToolbarButtons()
var defaultSet = mailToolbar.getAttribute("defaultset"); var defaultSet = mailToolbar.getAttribute("defaultset");
defaultSet = defaultSet.replace(/search-container/i, ""); defaultSet = defaultSet.replace(/search-container/i, "");
mailToolbar.setAttribute('defaultset', defaultSet); mailToolbar.setAttribute('defaultset', defaultSet);
var searchContainer = document.getElementById('search-container'); var searchContainer = document.getElementById('search-container');
if (searchContainer) if (searchContainer)
searchContainer.parentNode.removeChild(searchContainer); searchContainer.parentNode.removeChild(searchContainer);
// now hack the toolbar palette to remove all of the toolbar items which don't // now hack the toolbar palette to remove all of the toolbar items which don't
// make sense for the stand alone message window. This prevents them from showing up in the // make sense for the stand alone message window. This prevents them from showing up in the
// customize dialog. // customize dialog.
var toolbarPalette = document.getElementById('mail-toolbox').palette; var toolbarPalette = document.getElementById('mail-toolbox').palette;
toolbarPalette.removeChild(toolbarPalette.getElementsByAttribute('id', 'search-container')[0]); toolbarPalette.removeChild(toolbarPalette.getElementsByAttribute('id', 'search-container')[0]);
toolbarPalette.removeChild(toolbarPalette.getElementsByAttribute('id', 'mailviews-container')[0]); toolbarPalette.removeChild(toolbarPalette.getElementsByAttribute('id', 'mailviews-container')[0]);
toolbarPalette.removeChild(toolbarPalette.getElementsByAttribute('id', 'folder-location-container')[0]); toolbarPalette.removeChild(toolbarPalette.getElementsByAttribute('id', 'folder-location-container')[0]);
} }
} }
function HideMenus() function HideMenus()
{ {
var message_menuitem=document.getElementById('menu_showMessage'); var message_menuitem=document.getElementById('menu_showMessage');
if (message_menuitem) if (message_menuitem)
message_menuitem.setAttribute("hidden", "true"); message_menuitem.setAttribute("hidden", "true");
var showSearch_showMessage_Separator = document.getElementById('menu_showSearch_showMessage_Separator'); var showSearch_showMessage_Separator = document.getElementById('menu_showSearch_showMessage_Separator');
if (showSearch_showMessage_Separator) if (showSearch_showMessage_Separator)
showSearch_showMessage_Separator.setAttribute("hidden", "true"); showSearch_showMessage_Separator.setAttribute("hidden", "true");
var expandOrCollapseMenu = document.getElementById('menu_expandOrCollapse'); var expandOrCollapseMenu = document.getElementById('menu_expandOrCollapse');
if (expandOrCollapseMenu) if (expandOrCollapseMenu)
expandOrCollapseMenu.setAttribute("hidden", "true"); expandOrCollapseMenu.setAttribute("hidden", "true");
var renameFolderMenu = document.getElementById('menu_renameFolder'); var renameFolderMenu = document.getElementById('menu_renameFolder');
if (renameFolderMenu) if (renameFolderMenu)
renameFolderMenu.setAttribute("hidden", "true"); renameFolderMenu.setAttribute("hidden", "true");
var viewLayoutMenu = document.getElementById("menu_MessagePaneLayout"); var viewLayoutMenu = document.getElementById("menu_MessagePaneLayout");
if (viewLayoutMenu) if (viewLayoutMenu)
@ -485,41 +485,41 @@ function HideMenus()
if (viewFolderMenu) if (viewFolderMenu)
viewFolderMenu.setAttribute("hidden", "true"); viewFolderMenu.setAttribute("hidden", "true");
var viewMessagesMenu = document.getElementById('viewMessagesMenu'); var viewMessagesMenu = document.getElementById('viewMessagesMenu');
if (viewMessagesMenu) if (viewMessagesMenu)
viewMessagesMenu.setAttribute("hidden", "true"); viewMessagesMenu.setAttribute("hidden", "true");
var viewMessageViewMenu = document.getElementById('viewMessageViewMenu'); var viewMessageViewMenu = document.getElementById('viewMessageViewMenu');
if (viewMessageViewMenu) if (viewMessageViewMenu)
viewMessageViewMenu.setAttribute("hidden", "true"); viewMessageViewMenu.setAttribute("hidden", "true");
var viewMessagesMenuSeparator = document.getElementById('viewMessagesMenuSeparator'); var viewMessagesMenuSeparator = document.getElementById('viewMessagesMenuSeparator');
if (viewMessagesMenuSeparator) if (viewMessagesMenuSeparator)
viewMessagesMenuSeparator.setAttribute("hidden", "true"); viewMessagesMenuSeparator.setAttribute("hidden", "true");
var openMessageMenu = document.getElementById('openMessageWindowMenuitem'); var openMessageMenu = document.getElementById('openMessageWindowMenuitem');
if (openMessageMenu) if (openMessageMenu)
openMessageMenu.setAttribute("hidden", "true"); openMessageMenu.setAttribute("hidden", "true");
var viewSortMenuSeparator = document.getElementById('viewSortMenuSeparator'); var viewSortMenuSeparator = document.getElementById('viewSortMenuSeparator');
if (viewSortMenuSeparator) if (viewSortMenuSeparator)
viewSortMenuSeparator.setAttribute("hidden", "true"); viewSortMenuSeparator.setAttribute("hidden", "true");
var viewSortMenu = document.getElementById('viewSortMenu'); var viewSortMenu = document.getElementById('viewSortMenu');
if (viewSortMenu) if (viewSortMenu)
viewSortMenu.setAttribute("hidden", "true"); viewSortMenu.setAttribute("hidden", "true");
var emptryTrashMenu = document.getElementById('menu_emptyTrash'); var emptryTrashMenu = document.getElementById('menu_emptyTrash');
if (emptryTrashMenu) if (emptryTrashMenu)
emptryTrashMenu.setAttribute("hidden", "true"); emptryTrashMenu.setAttribute("hidden", "true");
var menuPropertiesSeparator = document.getElementById("editPropertiesSeparator"); var menuPropertiesSeparator = document.getElementById("editPropertiesSeparator");
if (menuPropertiesSeparator) if (menuPropertiesSeparator)
menuPropertiesSeparator.setAttribute("hidden", "true"); menuPropertiesSeparator.setAttribute("hidden", "true");
var menuProperties = document.getElementById('menu_properties'); var menuProperties = document.getElementById('menu_properties');
if (menuProperties) if (menuProperties)
menuProperties.setAttribute("hidden", "true"); menuProperties.setAttribute("hidden", "true");
var favoriteFolder = document.getElementById('menu_favoriteFolder'); var favoriteFolder = document.getElementById('menu_favoriteFolder');
if (favoriteFolder) if (favoriteFolder)
@ -528,35 +528,35 @@ function HideMenus()
favoriteFolder.setAttribute("hidden", "true"); favoriteFolder.setAttribute("hidden", "true");
} }
var compactFolderMenu = document.getElementById('menu_compactFolder'); var compactFolderMenu = document.getElementById('menu_compactFolder');
if (compactFolderMenu) if (compactFolderMenu)
compactFolderMenu.setAttribute("hidden", "true"); compactFolderMenu.setAttribute("hidden", "true");
var trashSeparator = document.getElementById('trashMenuSeparator'); var trashSeparator = document.getElementById('trashMenuSeparator');
if (trashSeparator) if (trashSeparator)
trashSeparator.setAttribute("hidden", "true"); trashSeparator.setAttribute("hidden", "true");
var goStartPageSeparator = document.getElementById('goNextSeparator'); var goStartPageSeparator = document.getElementById('goNextSeparator');
if (goStartPageSeparator) if (goStartPageSeparator)
goStartPageSeparator.hidden = true; goStartPageSeparator.hidden = true;
var goStartPage = document.getElementById('goStartPage'); var goStartPage = document.getElementById('goStartPage');
if (goStartPage) if (goStartPage)
goStartPage.hidden = true; goStartPage.hidden = true;
} }
function OnUnloadMessageWindow() function OnUnloadMessageWindow()
{ {
// FIX ME - later we will be able to use onunload from the overlay // FIX ME - later we will be able to use onunload from the overlay
OnUnloadMsgHeaderPane(); OnUnloadMsgHeaderPane();
gPhishingDetector.shutdown(); gPhishingDetector.shutdown();
OnMailWindowUnload(); OnMailWindowUnload();
} }
function CreateMessageWindowGlobals() function CreateMessageWindowGlobals()
{ {
gCompositeDataSource = Components.classes[compositeDataSourceContractID].createInstance(); gCompositeDataSource = Components.classes[compositeDataSourceContractID].createInstance();
gCompositeDataSource = gCompositeDataSource.QueryInterface(Components.interfaces.nsIRDFCompositeDataSource); gCompositeDataSource = gCompositeDataSource.QueryInterface(Components.interfaces.nsIRDFCompositeDataSource);
} }
function InitializeDataSources() function InitializeDataSources()
@ -572,38 +572,38 @@ function GetSelectedMsgFolders()
var folderArray = new Array(1); var folderArray = new Array(1);
var msgFolder = GetLoadedMsgFolder(); var msgFolder = GetLoadedMsgFolder();
if (msgFolder) if (msgFolder)
folderArray[0] = msgFolder; folderArray[0] = msgFolder;
return folderArray; return folderArray;
} }
function GetFirstSelectedMessage() function GetFirstSelectedMessage()
{ {
return GetLoadedMessage(); return GetLoadedMessage();
} }
function GetNumSelectedMessages() function GetNumSelectedMessages()
{ {
if (gCurrentMessageUri) if (gCurrentMessageUri)
return 1; return 1;
else else
return 0; return 0;
} }
function GetSelectedMessages() function GetSelectedMessages()
{ {
var messageArray = new Array(1); var messageArray = new Array(1);
var message = GetLoadedMessage(); var message = GetLoadedMessage();
if (message) if (message)
messageArray[0] = message; messageArray[0] = message;
return messageArray; return messageArray;
} }
function GetSelectedIndices(dbView) function GetSelectedIndices(dbView)
{ {
try { try {
var indicesArray = {}; var indicesArray = {};
var length = {}; var length = {};
dbView.getIndicesForSelection(indicesArray,length); dbView.getIndicesForSelection(indicesArray,length);
return indicesArray.value; return indicesArray.value;
@ -641,7 +641,7 @@ function ClearMessageSelection()
function GetCompositeDataSource(command) function GetCompositeDataSource(command)
{ {
return gCompositeDataSource; return gCompositeDataSource;
} }
function SetNextMessageAfterDelete() function SetNextMessageAfterDelete()
@ -659,13 +659,13 @@ function SelectFolder(folderUri)
return; return;
// close old folder view // close old folder view
var dbview = GetDBView(); var dbview = GetDBView();
if (dbview) if (dbview)
dbview.close(); dbview.close();
gCurrentFolderToRerootForStandAlone = folderUri; gCurrentFolderToRerootForStandAlone = folderUri;
msgWindow.openFolder = msgfolder; msgWindow.openFolder = msgfolder;
if (msgfolder.manyHeadersToDownload) if (msgfolder.manyHeadersToDownload)
{ {
gRerootOnFolderLoadForStandAlone = true; gRerootOnFolderLoadForStandAlone = true;
@ -691,7 +691,7 @@ function SelectFolder(folderUri)
//Need to do this after rerooting folder. Otherwise possibility of receiving folder loaded //Need to do this after rerooting folder. Otherwise possibility of receiving folder loaded
//notification before folder has actually changed. //notification before folder has actually changed.
msgfolder.updateFolder(msgWindow); msgfolder.updateFolder(msgWindow);
} }
} }
function RerootFolderForStandAlone(uri) function RerootFolderForStandAlone(uri)
@ -700,7 +700,7 @@ function RerootFolderForStandAlone(uri)
// create new folder view // create new folder view
CreateView(null); CreateView(null);
if (gMessageToLoad != nsMsgKey_None) if (gMessageToLoad != nsMsgKey_None)
{ {
LoadMessageByMsgKey(gMessageToLoad); LoadMessageByMsgKey(gMessageToLoad);
@ -712,15 +712,15 @@ function RerootFolderForStandAlone(uri)
gNextMessageAfterLoad = null; gNextMessageAfterLoad = null;
LoadMessageByNavigationType(type); LoadMessageByNavigationType(type);
} }
SetUpToolbarButtons(gCurrentFolderUri); SetUpToolbarButtons(gCurrentFolderUri);
UpdateMailToolbar("reroot folder in stand alone window"); UpdateMailToolbar("reroot folder in stand alone window");
// hook for extra toolbar items // hook for extra toolbar items
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
observerService.notifyObservers(window, "mail:setupToolbarItems", uri); observerService.notifyObservers(window, "mail:setupToolbarItems", uri);
} }
function GetMsgHdrFromUri(messageUri) function GetMsgHdrFromUri(messageUri)
{ {
@ -732,7 +732,7 @@ function SelectMessage(messageUri)
var msgHdr = GetMsgHdrFromUri(messageUri); var msgHdr = GetMsgHdrFromUri(messageUri);
LoadMessageByMsgKey(msgHdr.messageKey); LoadMessageByMsgKey(msgHdr.messageKey);
} }
function ReloadMessage() function ReloadMessage()
{ {
gDBView.reloadMessage(); gDBView.reloadMessage();
@ -744,14 +744,14 @@ function MsgDeleteMessageFromMessageWindow(reallyDelete, fromToolbar)
// only allow cancel from the menu: "Edit | Cancel / Delete Message" // only allow cancel from the menu: "Edit | Cancel / Delete Message"
if (fromToolbar) if (fromToolbar)
{ {
if (isNewsURI(gCurrentFolderUri)) if (isNewsURI(gCurrentFolderUri))
{ {
// if news, don't delete // if news, don't delete
return; return;
} }
} }
// before we delete // before we delete
SetNextMessageAfterDelete(); SetNextMessageAfterDelete();
if (reallyDelete) if (reallyDelete)
@ -837,111 +837,111 @@ var MessageWindowController =
case "cmd_createFilterFromPopup": case "cmd_createFilterFromPopup":
case "cmd_createFilterFromMenu": case "cmd_createFilterFromMenu":
case "cmd_moveToFolderAgain": case "cmd_moveToFolderAgain":
return true; return true;
case "cmd_synchronizeOffline": case "cmd_synchronizeOffline":
case "cmd_downloadFlagged": case "cmd_downloadFlagged":
case "cmd_downloadSelected": case "cmd_downloadSelected":
return MailOfflineMgr.isOnline(); return MailOfflineMgr.isOnline();
default: default:
return false; return false;
} }
}, },
isCommandEnabled: function(command) isCommandEnabled: function(command)
{ {
switch ( command ) switch ( command )
{ {
case "cmd_createFilterFromPopup": case "cmd_createFilterFromPopup":
case "cmd_createFilterFromMenu": case "cmd_createFilterFromMenu":
var loadedFolder = GetLoadedMsgFolder(); var loadedFolder = GetLoadedMsgFolder();
if (!(loadedFolder && loadedFolder.server.canHaveFilters)) if (!(loadedFolder && loadedFolder.server.canHaveFilters))
return false; return false;
case "cmd_delete": case "cmd_delete":
UpdateDeleteCommand(); UpdateDeleteCommand();
// fall through // fall through
case "button_delete": case "button_delete":
case "cmd_shiftDelete": case "cmd_shiftDelete":
var loadedFolder = GetLoadedMsgFolder(); var loadedFolder = GetLoadedMsgFolder();
return gCurrentMessageUri && loadedFolder && (loadedFolder.canDeleteMessages || isNewsURI(gCurrentFolderUri)); return gCurrentMessageUri && loadedFolder && (loadedFolder.canDeleteMessages || isNewsURI(gCurrentFolderUri));
case "button_junk": case "button_junk":
UpdateJunkToolbarButton(); UpdateJunkToolbarButton();
// fall through // fall through
case "cmd_markAsJunk": case "cmd_markAsJunk":
case "cmd_markAsNotJunk": case "cmd_markAsNotJunk":
case "cmd_recalculateJunkScore": case "cmd_recalculateJunkScore":
// can't do junk on news yet // can't do junk on news yet
return (!isNewsURI(gCurrentFolderUri)); return (!isNewsURI(gCurrentFolderUri));
case "cmd_reply": case "cmd_reply":
case "button_reply": case "button_reply":
case "cmd_replySender": case "cmd_replySender":
case "cmd_replyGroup": case "cmd_replyGroup":
case "cmd_replyall": case "cmd_replyall":
case "button_replyall": case "button_replyall":
case "cmd_forward": case "cmd_forward":
case "button_forward": case "button_forward":
case "cmd_forwardInline": case "cmd_forwardInline":
case "cmd_forwardAttachment": case "cmd_forwardAttachment":
case "cmd_editAsNew": case "cmd_editAsNew":
case "cmd_print": case "cmd_print":
case "cmd_printpreview": case "cmd_printpreview":
case "button_print": case "button_print":
case "cmd_saveAsFile": case "cmd_saveAsFile":
case "cmd_saveAsTemplate": case "cmd_saveAsTemplate":
case "cmd_viewPageSource": case "cmd_viewPageSource":
case "cmd_reload": case "cmd_reload":
case "cmd_find": case "cmd_find":
case "cmd_tag": case "cmd_tag":
case "button_mark": case "button_mark":
case "cmd_markAsRead": case "cmd_markAsRead":
case "cmd_markAllRead": case "cmd_markAllRead":
case "cmd_markThreadAsRead": case "cmd_markThreadAsRead":
case "cmd_markReadByDate": case "cmd_markReadByDate":
return(true); return(true);
case "cmd_markAsFlagged": case "cmd_markAsFlagged":
case "button_file": case "button_file":
case "cmd_file": case "cmd_file":
return ( gCurrentMessageUri != null); return ( gCurrentMessageUri != null);
case "cmd_printSetup": case "cmd_printSetup":
return true; return true;
case "cmd_getNewMessages": case "cmd_getNewMessages":
case "button_getNewMessages": case "button_getNewMessages":
case "cmd_getMsgsForAuthAccounts": case "cmd_getMsgsForAuthAccounts":
return IsGetNewMessagesEnabled(); return IsGetNewMessagesEnabled();
case "cmd_getNextNMessages": case "cmd_getNextNMessages":
return IsGetNextNMessagesEnabled(); return IsGetNextNMessagesEnabled();
case "cmd_downloadFlagged": case "cmd_downloadFlagged":
case "cmd_downloadSelected": case "cmd_downloadSelected":
case "cmd_synchronizeOffline": case "cmd_synchronizeOffline":
return MailOfflineMgr.isOnline(); return MailOfflineMgr.isOnline();
case "cmd_settingsOffline": case "cmd_settingsOffline":
return IsAccountOfflineEnabled(); return IsAccountOfflineEnabled();
case "cmd_close": case "cmd_close":
case "cmd_nextMsg": case "cmd_nextMsg":
case "button_next": case "button_next":
case "cmd_nextUnreadMsg": case "cmd_nextUnreadMsg":
case "cmd_nextUnreadThread": case "cmd_nextUnreadThread":
case "button_previous": case "button_previous":
case "cmd_previousMsg": case "cmd_previousMsg":
case "cmd_previousUnreadMsg": case "cmd_previousUnreadMsg":
return true; return true;
case "cmd_findAgain": case "cmd_findAgain":
case "cmd_findPrevious": case "cmd_findPrevious":
case "cmd_goForward": case "cmd_goForward":
case "cmd_goBack": case "cmd_goBack":
return true; return true;
case "button_goForward": case "button_goForward":
case "button_goBack": case "button_goBack":
case "cmd_goForward": case "cmd_goForward":
case "cmd_goBack": case "cmd_goBack":
return gDBView && return gDBView &&
gDBView.navigateStatus((command == "cmd_goBack" || gDBView.navigateStatus((command == "cmd_goBack" ||
command == "button_goBack") command == "button_goBack")
? nsMsgNavigationType.back : nsMsgNavigationType.forward); ? nsMsgNavigationType.back : nsMsgNavigationType.forward);
case "cmd_search": case "cmd_search":
var loadedFolder = GetLoadedMsgFolder(); var loadedFolder = GetLoadedMsgFolder();
if (!loadedFolder) if (!loadedFolder)
return false; return false;
return loadedFolder.server.canSearchMessages; return loadedFolder.server.canSearchMessages;
case "cmd_undo": case "cmd_undo":
case "cmd_redo": case "cmd_redo":
return SetupUndoRedoCommand(command); return SetupUndoRedoCommand(command);
@ -951,27 +951,27 @@ var MessageWindowController =
case "cmd_runJunkControls": case "cmd_runJunkControls":
case "cmd_deleteJunk": case "cmd_deleteJunk":
return false; return false;
default: default:
return false; return false;
} }
}, },
doCommand: function(command) doCommand: function(command)
{ {
// if the user invoked a key short cut then it is possible that we got here for a command which is // if the user invoked a key short cut then it is possible that we got here for a command which is
// really disabled. kick out if the command should be disabled. // really disabled. kick out if the command should be disabled.
if (!this.isCommandEnabled(command)) return; if (!this.isCommandEnabled(command)) return;
var navigationType = nsMsgNavigationType.nextUnreadMessage; var navigationType = nsMsgNavigationType.nextUnreadMessage;
switch ( command ) switch ( command )
{ {
case "cmd_close": case "cmd_close":
CloseMailWindow(); CloseMailWindow();
break; break;
case "cmd_getNewMessages": case "cmd_getNewMessages":
MsgGetMessage(); MsgGetMessage();
break; break;
case "cmd_undo": case "cmd_undo":
messenger.undo(msgWindow); messenger.undo(msgWindow);
break; break;
@ -982,111 +982,111 @@ var MessageWindowController =
MsgGetMessagesForAllAuthenticatedAccounts(); MsgGetMessagesForAllAuthenticatedAccounts();
break; break;
case "cmd_getNextNMessages": case "cmd_getNextNMessages":
MsgGetNextNMessages(); MsgGetNextNMessages();
break; break;
case "cmd_reply": case "cmd_reply":
MsgReplyMessage(null); MsgReplyMessage(null);
break; break;
case "cmd_replySender": case "cmd_replySender":
MsgReplySender(null); MsgReplySender(null);
break; break;
case "cmd_replyGroup": case "cmd_replyGroup":
MsgReplyGroup(null); MsgReplyGroup(null);
break; break;
case "cmd_replyall": case "cmd_replyall":
MsgReplyToAllMessage(null); MsgReplyToAllMessage(null);
break; break;
case "cmd_forward": case "cmd_forward":
MsgForwardMessage(null); MsgForwardMessage(null);
break; break;
case "cmd_forwardInline": case "cmd_forwardInline":
MsgForwardAsInline(null); MsgForwardAsInline(null);
break; break;
case "cmd_forwardAttachment": case "cmd_forwardAttachment":
MsgForwardAsAttachment(null); MsgForwardAsAttachment(null);
break; break;
case "cmd_editAsNew": case "cmd_editAsNew":
MsgEditMessageAsNew(); MsgEditMessageAsNew();
break; break;
case "cmd_moveToFolderAgain": case "cmd_moveToFolderAgain":
var folderId = pref.getCharPref("mail.last_msg_movecopy_target_uri"); var folderId = pref.getCharPref("mail.last_msg_movecopy_target_uri");
if (pref.getBoolPref("mail.last_msg_movecopy_was_move")) if (pref.getBoolPref("mail.last_msg_movecopy_was_move"))
MsgMoveMessage(folderId); MsgMoveMessage(folderId);
else else
MsgCopyMessage(folderId); MsgCopyMessage(folderId);
break; break;
case "cmd_createFilterFromPopup": case "cmd_createFilterFromPopup":
break;// This does nothing because the createfilter is invoked from the popupnode oncommand. break;// This does nothing because the createfilter is invoked from the popupnode oncommand.
case "cmd_createFilterFromMenu": case "cmd_createFilterFromMenu":
MsgCreateFilter(); MsgCreateFilter();
break; break;
case "cmd_delete": case "cmd_delete":
MsgDeleteMessageFromMessageWindow(false, false); MsgDeleteMessageFromMessageWindow(false, false);
break; break;
case "cmd_shiftDelete": case "cmd_shiftDelete":
MsgDeleteMessageFromMessageWindow(true, false); MsgDeleteMessageFromMessageWindow(true, false);
break; break;
case "button_junk": case "button_junk":
MsgJunk(); MsgJunk();
break; break;
case "button_delete": case "button_delete":
MsgDeleteMessageFromMessageWindow(false, true); MsgDeleteMessageFromMessageWindow(false, true);
break; break;
case "cmd_printSetup": case "cmd_printSetup":
PrintUtils.showPageSetup(); PrintUtils.showPageSetup();
break; break;
case "cmd_print": case "cmd_print":
PrintEnginePrint(); PrintEnginePrint();
break; break;
case "cmd_printpreview": case "cmd_printpreview":
PrintEnginePrintPreview(); PrintEnginePrintPreview();
break; break;
case "cmd_saveAsFile": case "cmd_saveAsFile":
MsgSaveAsFile(); MsgSaveAsFile();
break; break;
case "cmd_saveAsTemplate": case "cmd_saveAsTemplate":
MsgSaveAsTemplate(); MsgSaveAsTemplate();
break; break;
case "cmd_viewPageSource": case "cmd_viewPageSource":
MsgViewPageSource(); MsgViewPageSource();
break; break;
case "cmd_reload": case "cmd_reload":
MsgReload(); MsgReload();
break; break;
case "cmd_find": case "cmd_find":
MsgFind(); MsgFind();
break; break;
case "cmd_findAgain": case "cmd_findAgain":
MsgFindAgain(false); MsgFindAgain(false);
break; break;
case "cmd_findPrevious": case "cmd_findPrevious":
MsgFindAgain(true); MsgFindAgain(true);
break; break;
case "cmd_search": case "cmd_search":
MsgSearchMessages(); MsgSearchMessages();
break; break;
case "button_mark": case "button_mark":
case "cmd_markAsRead": case "cmd_markAsRead":
MsgMarkMsgAsRead(null); MsgMarkMsgAsRead(null);
return; return;
case "cmd_markThreadAsRead": case "cmd_markThreadAsRead":
MsgMarkThreadAsRead(); MsgMarkThreadAsRead();
return; return;
case "cmd_markAllRead": case "cmd_markAllRead":
MsgMarkAllRead(); MsgMarkAllRead();
return; return;
case "cmd_markReadByDate": case "cmd_markReadByDate":
MsgMarkReadByDate(); MsgMarkReadByDate();
return; return;
case "cmd_markAsFlagged": case "cmd_markAsFlagged":
MsgMarkAsFlagged(null); MsgMarkAsFlagged(null);
return; return;
case "cmd_markAsJunk": case "cmd_markAsJunk":
JunkSelectedMessages(true); JunkSelectedMessages(true);
return; return;
case "cmd_markAsNotJunk": case "cmd_markAsNotJunk":
JunkSelectedMessages(false); JunkSelectedMessages(false);
return; return;
case "cmd_recalculateJunkScore": case "cmd_recalculateJunkScore":
analyzeMessagesForJunk(); analyzeMessagesForJunk();
return; return;
@ -1106,22 +1106,22 @@ var MessageWindowController =
case "button_next": case "button_next":
performNavigation(nsMsgNavigationType.nextUnreadMessage); performNavigation(nsMsgNavigationType.nextUnreadMessage);
break; break;
case "cmd_nextUnreadThread": case "cmd_nextUnreadThread":
performNavigation(nsMsgNavigationType.nextUnreadThread); performNavigation(nsMsgNavigationType.nextUnreadThread);
break; break;
case "cmd_nextMsg": case "cmd_nextMsg":
performNavigation(nsMsgNavigationType.nextMessage); performNavigation(nsMsgNavigationType.nextMessage);
break; break;
case "cmd_nextFlaggedMsg": case "cmd_nextFlaggedMsg":
performNavigation(nsMsgNavigationType.nextFlagged); performNavigation(nsMsgNavigationType.nextFlagged);
break; break;
case "cmd_previousMsg": case "cmd_previousMsg":
performNavigation(nsMsgNavigationType.previousMessage); performNavigation(nsMsgNavigationType.previousMessage);
break; break;
case "button_previous": case "button_previous":
case "cmd_previousUnreadMsg": case "cmd_previousUnreadMsg":
performNavigation(nsMsgNavigationType.previousUnreadMessage); performNavigation(nsMsgNavigationType.previousUnreadMessage);
break; break;
case "cmd_previousFlaggedMsg": case "cmd_previousFlaggedMsg":
performNavigation(nsMsgNavigationType.previousFlagged); performNavigation(nsMsgNavigationType.previousFlagged);
break; break;
@ -1132,11 +1132,11 @@ var MessageWindowController =
performNavigation(nsMsgNavigationType.back); performNavigation(nsMsgNavigationType.back);
break; break;
} }
}, },
onEvent: function(event) onEvent: function(event)
{ {
} }
}; };
function LoadMessageByNavigationType(type) function LoadMessageByNavigationType(type)
@ -1148,7 +1148,7 @@ function LoadMessageByNavigationType(type)
gDBView.viewNavigate(type, resultId, resultIndex, threadIndex, true /* wrap */); gDBView.viewNavigate(type, resultId, resultIndex, threadIndex, true /* wrap */);
// if we found something....display it. // if we found something....display it.
if ((resultId.value != nsMsgKey_None) && (resultIndex.value != nsMsgKey_None)) if ((resultId.value != nsMsgKey_None) && (resultIndex.value != nsMsgKey_None))
{ {
// load the message key // load the message key
LoadMessageByMsgKey(resultId.value); LoadMessageByMsgKey(resultId.value);
@ -1162,20 +1162,20 @@ function LoadMessageByNavigationType(type)
// no message found to load // no message found to load
return false; return false;
} }
function performNavigation(type) function performNavigation(type)
{ {
// Try to load a message by navigation type if we can find // Try to load a message by navigation type if we can find
// the message in the same folder. // the message in the same folder.
if (LoadMessageByNavigationType(type)) if (LoadMessageByNavigationType(type))
return; return;
CrossFolderNavigation(type); CrossFolderNavigation(type);
} }
function SetupCommandUpdateHandlers() function SetupCommandUpdateHandlers()
{ {
top.controllers.insertControllerAt(0, MessageWindowController); top.controllers.insertControllerAt(0, MessageWindowController);
} }
function GetDBView() function GetDBView()

View File

@ -1,4 +1,4 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
@ -37,7 +37,7 @@
# #
# ***** END LICENSE BLOCK ***** # ***** END LICENSE BLOCK *****
<?xml-stylesheet href="chrome://messenger/skin/messageWindow.css" type="text/css"?> <?xml-stylesheet href="chrome://messenger/skin/messageWindow.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?> <?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?> <?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
@ -51,7 +51,7 @@
<!ENTITY % messengerDTD SYSTEM "chrome://messenger/locale/messenger.dtd" > <!ENTITY % messengerDTD SYSTEM "chrome://messenger/locale/messenger.dtd" >
%messengerDTD; %messengerDTD;
]> ]>
<window id="messengerWindow" <window id="messengerWindow"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:nc="http://home.netscape.com/NC-rdf#" xmlns:nc="http://home.netscape.com/NC-rdf#"
@ -98,7 +98,7 @@
<commandset id="mailMarkMenuItems"/> <commandset id="mailMarkMenuItems"/>
<commandset id="mailToolsMenuItems"/> <commandset id="mailToolsMenuItems"/>
<commandset id="mailEditContextMenuItems"/> <commandset id="mailEditContextMenuItems"/>
<commandset id="tasksCommands"/> <commandset id="tasksCommands"/>
<commandset id="commandKeys"/> <commandset id="commandKeys"/>
#ifdef XP_MACOSX #ifdef XP_MACOSX
<commandset id="macWindowMenuItems"/> <commandset id="macWindowMenuItems"/>
@ -126,11 +126,11 @@
oncommand="SendMailToNode(document.popupNode)"/> oncommand="SendMailToNode(document.popupNode)"/>
<menuitem label="&CopyEmailAddress.label;" <menuitem label="&CopyEmailAddress.label;"
accesskey="&CopyEmailAddress.accesskey;" accesskey="&CopyEmailAddress.accesskey;"
oncommand="CopyEmailAddress(document.popupNode)"/> oncommand="CopyEmailAddress(document.popupNode)"/>
<menuitem label="&CreateFilter.label;" <menuitem label="&CreateFilter.label;"
accesskey="&CreateFilter.accesskey;" accesskey="&CreateFilter.accesskey;"
oncommand="CreateFilter(document.popupNode)" oncommand="CreateFilter(document.popupNode)"
observes="cmd_createFilterFromPopup"/> observes="cmd_createFilterFromPopup"/>
</popup> </popup>
<popup id="messageIdContext"/> <popup id="messageIdContext"/>
@ -148,7 +148,7 @@
<toolbox id="mail-toolbox" class="toolbox-top"> <toolbox id="mail-toolbox" class="toolbox-top">
</toolbox> </toolbox>
<!-- msg header view --> <!-- msg header view -->
<vbox id="messagepanebox" flex="3" persist="collapsed" <vbox id="messagepanebox" flex="3" persist="collapsed"
ondragover="nsDragAndDrop.dragOver(event, messagepaneObserver);" ondragover="nsDragAndDrop.dragOver(event, messagepaneObserver);"
@ -159,15 +159,15 @@
<hbox id="msgHeaderView"/> <hbox id="msgHeaderView"/>
<!-- message view --> <!-- message view -->
<browser id="messagepane" context="messagePaneContext" <browser id="messagepane" context="messagePaneContext"
style="height: 0px; min-height: 1px" flex="1" name="messagepane" style="height: 0px; min-height: 1px" flex="1" name="messagepane"
disablesecurity="true" disablehistory="true" type="content-primary" disablesecurity="true" disablehistory="true" type="content-primary"
onresize="return messagePaneOnResize(event);" autofind="false" onresize="return messagePaneOnResize(event);" autofind="false"
src="about:blank" onclick="return contentAreaClick(event);" /> src="about:blank" onclick="return contentAreaClick(event);" />
<splitter id="attachment-splitter" collapse="after" resizebefore="closest" resizeafter="closest" collapsed="true"/> <splitter id="attachment-splitter" collapse="after" resizebefore="closest" resizeafter="closest" collapsed="true"/>
<hbox id="attachmentView"/> <hbox id="attachmentView"/>
<findbar id="FindToolbar" browserid="messagepane"/> <findbar id="FindToolbar" browserid="messagepane"/>
</vbox> </vbox>
<statusbar class="chromeclass-status" id="status-bar"/> <statusbar class="chromeclass-status" id="status-bar"/>
</window> </window>

View File

@ -44,15 +44,15 @@
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
// Warning: if you go to modify any of these JS routines please get a code review from // Warning: if you go to modify any of these JS routines please get a code review from
// scott@scott-macgregor.org. It's critical that the code in here for displaying // scott@scott-macgregor.org. It's critical that the code in here for displaying
// the message headers for a selected message remain as fast as possible. In particular, // the message headers for a selected message remain as fast as possible. In particular,
// right now, we only introduce one reflow per message. i.e. if you click on a message in the thread // right now, we only introduce one reflow per message. i.e. if you click on a message in the thread
// pane, we batch up all the changes for displaying the header pane (to, cc, attachements button, etc.) // pane, we batch up all the changes for displaying the header pane (to, cc, attachements button, etc.)
// and we make a single pass to display them. It's critical that we maintain this one reflow per message // and we make a single pass to display them. It's critical that we maintain this one reflow per message
// view in the message header pane. // view in the message header pane.
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
const msgHeaderParserContractID = "@mozilla.org/messenger/headerparser;1"; const msgHeaderParserContractID = "@mozilla.org/messenger/headerparser;1";
const abAddressCollectorContractID = "@mozilla.org/addressbook/services/addressCollecter;1"; const abAddressCollectorContractID = "@mozilla.org/addressbook/services/addressCollecter;1";
const kPersonalAddressbookUri = "moz-abmdbdirectory://abook.mab"; const kPersonalAddressbookUri = "moz-abmdbdirectory://abook.mab";
const kRDFServiceContractID = "@mozilla.org/rdf/rdf-service;1"; const kRDFServiceContractID = "@mozilla.org/rdf/rdf-service;1";
@ -98,17 +98,17 @@ var gMessageListeners = new Array;
// see in that view. In addition, include information describing how you want that header field to be // see in that view. In addition, include information describing how you want that header field to be
// presented. i.e. if it's an email address field, if you want a toggle inserted on the node in case // presented. i.e. if it's an email address field, if you want a toggle inserted on the node in case
// of multiple email addresses, etc. We'll then use this static table to dynamically generate header view entries // of multiple email addresses, etc. We'll then use this static table to dynamically generate header view entries
// which manipulate the UI. // which manipulate the UI.
// When you add a header to one of these view lists you can specify the following properties: // When you add a header to one of these view lists you can specify the following properties:
// name: the name of the header. i.e. "to", "subject". This must be in lower case and the name of the // name: the name of the header. i.e. "to", "subject". This must be in lower case and the name of the
// header is used to help dynamically generate ids for objects in the document. (REQUIRED) // header is used to help dynamically generate ids for objects in the document. (REQUIRED)
// useToggle: true if the values for this header are multiple email addresses and you want a // useToggle: true if the values for this header are multiple email addresses and you want a
// a toggle icon to show a short vs. long list (DEFAULT: false) // a toggle icon to show a short vs. long list (DEFAULT: false)
// useShortView: (only works on some fields like From). If the field has a long presentation and a // useShortView: (only works on some fields like From). If the field has a long presentation and a
// short presentation we'll use the short one. i.e. if you are showing the From field and you // short presentation we'll use the short one. i.e. if you are showing the From field and you
// set this to true, we can show just "John Doe" instead of "John Doe <jdoe@netscape.net>". // set this to true, we can show just "John Doe" instead of "John Doe <jdoe@netscape.net>".
// (DEFAULT: false) // (DEFAULT: false)
// //
// outputFunction: this is a method which takes a headerEntry (see the definition below) and a header value // outputFunction: this is a method which takes a headerEntry (see the definition below) and a header value
// This allows you to provide your own methods for actually determining how the header value // This allows you to provide your own methods for actually determining how the header value
// is displayed. (DEFAULT: updateHeaderValue which just sets the header value on the text node) // is displayed. (DEFAULT: updateHeaderValue which just sets the header value on the text node)
@ -120,7 +120,7 @@ var gCollapsedHeaderList = [ {name:"subject", outputFunction:updateHeaderValueIn
{name:"date", outputFunction:updateHeaderValueInTextNode}]; {name:"date", outputFunction:updateHeaderValueInTextNode}];
// We also have an expanded header view. This shows many of your more common (and useful) headers. // We also have an expanded header view. This shows many of your more common (and useful) headers.
var gExpandedHeaderList = [ {name:"subject"}, var gExpandedHeaderList = [ {name:"subject"},
{name:"from", useToggle:true, outputFunction:OutputEmailAddresses}, {name:"from", useToggle:true, outputFunction:OutputEmailAddresses},
{name:"sender", outputFunction:OutputEmailAddresses}, {name:"sender", outputFunction:OutputEmailAddresses},
{name:"reply-to", useToggle:true, outputFunction:OutputEmailAddresses}, {name:"reply-to", useToggle:true, outputFunction:OutputEmailAddresses},
@ -136,7 +136,7 @@ var gExpandedHeaderList = [ {name:"subject"},
// Now, for each view the message pane can generate, we need a global table of headerEntries. These // Now, for each view the message pane can generate, we need a global table of headerEntries. These
// header entry objects are generated dynamically based on the static date in the header lists (see above) // header entry objects are generated dynamically based on the static date in the header lists (see above)
// and elements we find in the DOM based on properties in the header lists. // and elements we find in the DOM based on properties in the header lists.
var gCollapsedHeaderView = {}; var gCollapsedHeaderView = {};
var gExpandedHeaderView = {}; var gExpandedHeaderView = {};
@ -156,7 +156,7 @@ var currentHeaderData = {};
// isExternalAttachment --> boolean flag stating whether the attachment is an attachment which is a URL that refers to the attachment location // isExternalAttachment --> boolean flag stating whether the attachment is an attachment which is a URL that refers to the attachment location
var currentAttachments = new Array(); var currentAttachments = new Array();
// createHeaderEntry --> our constructor method which creates a header Entry // createHeaderEntry --> our constructor method which creates a header Entry
// based on an entry in one of the header lists. A header entry is different from a header list. // based on an entry in one of the header lists. A header entry is different from a header list.
// a header list just describes how you want a particular header to be presented. The header entry // a header list just describes how you want a particular header to be presented. The header entry
// actually has knowledge about the DOM and the actual DOM elements associated with the header. // actually has knowledge about the DOM and the actual DOM elements associated with the header.
@ -203,12 +203,12 @@ function createHeaderEntry(prefix, headerListInfo)
function initializeHeaderViewTables() function initializeHeaderViewTables()
{ {
// iterate over each header in our header list arrays and create header entries // iterate over each header in our header list arrays and create header entries
// for each one. These header entries are then stored in the appropriate header table // for each one. These header entries are then stored in the appropriate header table
var index; var index;
for (index = 0; index < gCollapsedHeaderList.length; index++) for (index = 0; index < gCollapsedHeaderList.length; index++)
{ {
gCollapsedHeaderView[gCollapsedHeaderList[index].name] = gCollapsedHeaderView[gCollapsedHeaderList[index].name] =
new createHeaderEntry('collapsed', gCollapsedHeaderList[index]); new createHeaderEntry('collapsed', gCollapsedHeaderList[index]);
} }
@ -217,7 +217,7 @@ function initializeHeaderViewTables()
var headerName = gExpandedHeaderList[index].name; var headerName = gExpandedHeaderList[index].name;
gExpandedHeaderView[headerName] = new createHeaderEntry('expanded', gExpandedHeaderList[index]); gExpandedHeaderView[headerName] = new createHeaderEntry('expanded', gExpandedHeaderList[index]);
} }
var extraHeaders = gExtraExpandedHeaders.split(' '); var extraHeaders = gExtraExpandedHeaders.split(' ');
for (index = 0; index < extraHeaders.length; index++) for (index = 0; index < extraHeaders.length; index++)
{ {
@ -229,7 +229,7 @@ function initializeHeaderViewTables()
var organizationEntry = {name:"organization", outputFunction:updateHeaderValue}; var organizationEntry = {name:"organization", outputFunction:updateHeaderValue};
gExpandedHeaderView[organizationEntry.name] = new createHeaderEntry('expanded', organizationEntry); gExpandedHeaderView[organizationEntry.name] = new createHeaderEntry('expanded', organizationEntry);
} }
if (gShowUserAgent) if (gShowUserAgent)
{ {
var userAgentEntry = {name:"user-agent", outputFunction:updateHeaderValue}; var userAgentEntry = {name:"user-agent", outputFunction:updateHeaderValue};
@ -248,8 +248,8 @@ function OnLoadMsgHeaderPane()
// HACK...force our XBL bindings file to be load before we try to create our first xbl widget.... // HACK...force our XBL bindings file to be load before we try to create our first xbl widget....
// otherwise we have problems. // otherwise we have problems.
document.loadBindingDocument('chrome://messenger/content/mailWidgets.xml'); document.loadBindingDocument('chrome://messenger/content/mailWidgets.xml');
// load any preferences that at are global with regards to // load any preferences that at are global with regards to
// displaying a message... // displaying a message...
gShowUserAgent = pref.getBoolPref("mailnews.headers.showUserAgent"); gShowUserAgent = pref.getBoolPref("mailnews.headers.showUserAgent");
gMinNumberOfHeaders = pref.getIntPref("mailnews.headers.minNumHeaders"); gMinNumberOfHeaders = pref.getIntPref("mailnews.headers.minNumHeaders");
@ -260,13 +260,13 @@ function OnLoadMsgHeaderPane()
gShowMessageId = pref.getBoolPref("mailnews.headers.showMessageId"); gShowMessageId = pref.getBoolPref("mailnews.headers.showMessageId");
gExtraExpandedHeaders = pref.getCharPref("mailnews.headers.extraExpandedHeaders"); gExtraExpandedHeaders = pref.getCharPref("mailnews.headers.extraExpandedHeaders");
// listen to the // listen to the
pref.addObserver("mail.showCondensedAddresses", MsgHdrViewObserver, false); pref.addObserver("mail.showCondensedAddresses", MsgHdrViewObserver, false);
initializeHeaderViewTables(); initializeHeaderViewTables();
var deckHeaderView = document.getElementById("msgHeaderViewDeck"); var deckHeaderView = document.getElementById("msgHeaderViewDeck");
gCollapsedHeaderViewMode = deckHeaderView.selectedIndex == 0; gCollapsedHeaderViewMode = deckHeaderView.selectedIndex == 0;
// dispatch an event letting any listeners know that we have loaded the message pane // dispatch an event letting any listeners know that we have loaded the message pane
var event = document.createEvent('Events'); var event = document.createEvent('Events');
@ -286,7 +286,7 @@ function OnUnloadMsgHeaderPane()
headerViewElement.dispatchEvent(event); headerViewElement.dispatchEvent(event);
} }
const MsgHdrViewObserver = const MsgHdrViewObserver =
{ {
observe: function(subject, topic, prefName) observe: function(subject, topic, prefName)
{ {
@ -303,7 +303,7 @@ const MsgHdrViewObserver =
}; };
// The messageHeaderSink is the class that gets notified of a message's headers as we display the message // The messageHeaderSink is the class that gets notified of a message's headers as we display the message
// through our mime converter. // through our mime converter.
var messageHeaderSink = { var messageHeaderSink = {
onStartHeaders: function() onStartHeaders: function()
@ -318,12 +318,12 @@ var messageHeaderSink = {
else else
{ {
if (gViewAllHeaders) // if we currently are in view all header mode, rebuild our header view so we remove most of the header data if (gViewAllHeaders) // if we currently are in view all header mode, rebuild our header view so we remove most of the header data
{ {
hideHeaderView(gExpandedHeaderView); hideHeaderView(gExpandedHeaderView);
gExpandedHeaderView = {}; gExpandedHeaderView = {};
initializeHeaderViewTables(); initializeHeaderViewTables();
} }
gViewAllHeaders = false; gViewAllHeaders = false;
} }
@ -340,34 +340,34 @@ var messageHeaderSink = {
gMessageListeners[index].onStartHeaders(); gMessageListeners[index].onStartHeaders();
}, },
onEndHeaders: function() onEndHeaders: function()
{ {
// WARNING: This is the ONLY routine inside of the message Header Sink that should // WARNING: This is the ONLY routine inside of the message Header Sink that should
// trigger a reflow! // trigger a reflow!
CheckNotify(); CheckNotify();
ClearHeaderView(gCollapsedHeaderView); ClearHeaderView(gCollapsedHeaderView);
ClearHeaderView(gExpandedHeaderView); ClearHeaderView(gExpandedHeaderView);
EnsureSubjectValue(); // make sure there is a subject even if it's empty so we'll show the subject and the twisty EnsureSubjectValue(); // make sure there is a subject even if it's empty so we'll show the subject and the twisty
ShowMessageHeaderPane(); ShowMessageHeaderPane();
UpdateMessageHeaders(); UpdateMessageHeaders();
ShowEditMessageButton(); ShowEditMessageButton();
for (index in gMessageListeners) for (index in gMessageListeners)
gMessageListeners[index].onEndHeaders(); gMessageListeners[index].onEndHeaders();
}, },
processHeaders: function(headerNameEnumerator, headerValueEnumerator, dontCollectAddress) processHeaders: function(headerNameEnumerator, headerValueEnumerator, dontCollectAddress)
{ {
this.onStartHeaders(); this.onStartHeaders();
const kMailboxSeparator = ", "; const kMailboxSeparator = ", ";
var index = 0; var index = 0;
while (headerNameEnumerator.hasMore()) while (headerNameEnumerator.hasMore())
{ {
var header = new Object; var header = new Object;
header.headerValue = headerValueEnumerator.getNext(); header.headerValue = headerValueEnumerator.getNext();
header.headerName = headerNameEnumerator.getNext(); header.headerName = headerNameEnumerator.getNext();
@ -376,9 +376,9 @@ var messageHeaderSink = {
var lowerCaseHeaderName = header.headerName.toLowerCase(); var lowerCaseHeaderName = header.headerName.toLowerCase();
// if we have an x-mailer or x-mimeole string, put it in the user-agent slot which we know how to handle // if we have an x-mailer or x-mimeole string, put it in the user-agent slot which we know how to handle
// already. // already.
if (lowerCaseHeaderName == "x-mailer" || lowerCaseHeaderName == "x-mimeole") if (lowerCaseHeaderName == "x-mailer" || lowerCaseHeaderName == "x-mimeole")
lowerCaseHeaderName = "user-agent"; lowerCaseHeaderName = "user-agent";
if (this.mDummyMsgHeader) if (this.mDummyMsgHeader)
{ {
@ -404,7 +404,7 @@ var messageHeaderSink = {
// in this case, we want to append these headers into one. // in this case, we want to append these headers into one.
if (lowerCaseHeaderName == 'to' || lowerCaseHeaderName == 'cc') if (lowerCaseHeaderName == 'to' || lowerCaseHeaderName == 'cc')
currentHeaderData[lowerCaseHeaderName].headerValue = currentHeaderData[lowerCaseHeaderName].headerValue + ',' + header.headerValue; currentHeaderData[lowerCaseHeaderName].headerValue = currentHeaderData[lowerCaseHeaderName].headerValue + ',' + header.headerValue;
else { else {
// use the index to create a unique header name like: // use the index to create a unique header name like:
// received5, received6, etc // received5, received6, etc
currentHeaderData[lowerCaseHeaderName + index++] = header; currentHeaderData[lowerCaseHeaderName + index++] = header;
@ -413,9 +413,9 @@ var messageHeaderSink = {
else else
currentHeaderData[lowerCaseHeaderName] = header; currentHeaderData[lowerCaseHeaderName] = header;
} // while we have more headers to parse } // while we have more headers to parse
// process message tags as if they were headers in the message // process message tags as if they were headers in the message
SetTagHeader(); SetTagHeader();
if (("from" in currentHeaderData) && ("sender" in currentHeaderData) && msgHeaderParser) if (("from" in currentHeaderData) && ("sender" in currentHeaderData) && msgHeaderParser)
{ {
@ -429,8 +429,8 @@ var messageHeaderSink = {
this.onEndHeaders(); this.onEndHeaders();
}, },
handleAttachment: function(contentType, url, displayName, uri, isExternalAttachment) handleAttachment: function(contentType, url, displayName, uri, isExternalAttachment)
{ {
// presentation level change....don't show vcards as external attachments in the UI. // presentation level change....don't show vcards as external attachments in the UI.
// libmime already renders them inline. // libmime already renders them inline.
@ -472,7 +472,7 @@ var messageHeaderSink = {
} }
} }
}, },
onEndAllAttachments: function() onEndAllAttachments: function()
{ {
displayAttachmentsForExpandedView(); displayAttachmentsForExpandedView();
@ -497,7 +497,7 @@ var messageHeaderSink = {
}, },
onEndMsgHeaders: function(url) onEndMsgHeaders: function(url)
{ {
OnMsgLoaded(url); OnMsgLoaded(url);
}, },
@ -591,7 +591,7 @@ function EnsureSubjectValue()
foo.headerValue = ""; foo.headerValue = "";
foo.headerName = 'subject'; foo.headerName = 'subject';
currentHeaderData[foo.headerName] = foo; currentHeaderData[foo.headerName] = foo;
} }
} }
function CheckNotify() function CheckNotify()
@ -606,7 +606,7 @@ function OnTagsChange()
SetTagHeader(); SetTagHeader();
// now update the expanded header view to rebuild the tags, // now update the expanded header view to rebuild the tags,
// and then show or hide the tag header box. // and then show or hide the tag header box.
if (gBuiltExpandedView) if (gBuiltExpandedView)
{ {
var headerEntry = gExpandedHeaderView.tags; var headerEntry = gExpandedHeaderView.tags;
@ -615,7 +615,7 @@ function OnTagsChange()
headerEntry.valid = ("tags" in currentHeaderData); headerEntry.valid = ("tags" in currentHeaderData);
if (headerEntry.valid) if (headerEntry.valid)
headerEntry.outputFunction(headerEntry, currentHeaderData.tags.headerValue); headerEntry.outputFunction(headerEntry, currentHeaderData.tags.headerValue);
// if we are showing the expanded header view then we may need to collapse or // if we are showing the expanded header view then we may need to collapse or
// show the tag header box... // show the tag header box...
if (!gCollapsedHeaderViewMode) if (!gCollapsedHeaderViewMode)
@ -649,7 +649,7 @@ function hideHeaderView(headerTable)
} }
} }
// make sure that any valid header entry in the table specified is // make sure that any valid header entry in the table specified is
// visible // visible
function showHeaderView(headerTable) function showHeaderView(headerTable)
{ {
@ -669,7 +669,7 @@ function showHeaderView(headerTable)
// enumerate through the list of headers and find the number that are visible // enumerate through the list of headers and find the number that are visible
// add empty entries if we don't have the minimum number of rows // add empty entries if we don't have the minimum number of rows
function EnsureMinimumNumberOfHeaders (headerTable) function EnsureMinimumNumberOfHeaders (headerTable)
{ {
if (!gMinNumberOfHeaders) // 0 means we don't have a minimum..do nothing special if (!gMinNumberOfHeaders) // 0 means we don't have a minimum..do nothing special
return; return;
@ -678,16 +678,16 @@ function EnsureMinimumNumberOfHeaders (headerTable)
{ {
if (headerTable[index].valid) if (headerTable[index].valid)
numVisibleHeaders ++; numVisibleHeaders ++;
} }
if (numVisibleHeaders < gMinNumberOfHeaders) if (numVisibleHeaders < gMinNumberOfHeaders)
{ {
// how many empty headers do we need to add? // how many empty headers do we need to add?
var numEmptyHeaders = gMinNumberOfHeaders - numVisibleHeaders; var numEmptyHeaders = gMinNumberOfHeaders - numVisibleHeaders;
// we may have already dynamically created our empty rows and we just need to make them visible // we may have already dynamically created our empty rows and we just need to make them visible
for (index in headerTable) for (index in headerTable)
{ {
if (index.indexOf("Dummy-Header") == 0 && numEmptyHeaders) if (index.indexOf("Dummy-Header") == 0 && numEmptyHeaders)
{ {
headerTable[index].valid = true; headerTable[index].valid = true;
@ -731,14 +731,14 @@ function ToggleHeaderView ()
// Work around a xul deck bug where the height of the deck is determined by the tallest panel in the deck // Work around a xul deck bug where the height of the deck is determined by the tallest panel in the deck
// even if that panel is not selected... // even if that panel is not selected...
document.getElementById('msgHeaderViewDeck').selectedPanel.collapsed = true; document.getElementById('msgHeaderViewDeck').selectedPanel.collapsed = true;
UpdateMessageHeaders(); UpdateMessageHeaders();
// select the new panel. // select the new panel.
document.getElementById('msgHeaderViewDeck').selectedIndex = gCollapsedHeaderViewMode ? 0 : 1; document.getElementById('msgHeaderViewDeck').selectedIndex = gCollapsedHeaderViewMode ? 0 : 1;
// Work around a xul deck bug where the height of the deck is determined by the tallest panel in the deck // Work around a xul deck bug where the height of the deck is determined by the tallest panel in the deck
// even if that panel is not selected... // even if that panel is not selected...
document.getElementById('msgHeaderViewDeck').selectedPanel.collapsed = false; document.getElementById('msgHeaderViewDeck').selectedPanel.collapsed = false;
} }
@ -757,7 +757,7 @@ function createNewHeaderView(headerName, label)
{ {
var idName = 'expanded' + headerName + 'Box'; var idName = 'expanded' + headerName + 'Box';
var newHeader = document.createElement("mail-headerfield"); var newHeader = document.createElement("mail-headerfield");
newHeader.setAttribute('id', idName); newHeader.setAttribute('id', idName);
newHeader.setAttribute('label', label); newHeader.setAttribute('label', label);
newHeader.collapsed = true; newHeader.collapsed = true;
@ -766,7 +766,7 @@ function createNewHeaderView(headerName, label)
var topViewNode = document.getElementById('expandedHeaders'); var topViewNode = document.getElementById('expandedHeaders');
topViewNode.appendChild(newHeader); topViewNode.appendChild(newHeader);
this.enclosingBox = newHeader; this.enclosingBox = newHeader;
this.isValid = false; this.isValid = false;
this.useToggle = false; this.useToggle = false;
@ -804,9 +804,9 @@ function UpdateMessageHeaders()
} }
} catch (ex) {} } catch (ex) {}
} }
if (gCollapsedHeaderViewMode && !gBuiltCollapsedView) if (gCollapsedHeaderViewMode && !gBuiltCollapsedView)
{ {
if (headerName in gCollapsedHeaderView) if (headerName in gCollapsedHeaderView)
headerEntry = gCollapsedHeaderView[headerName]; headerEntry = gCollapsedHeaderView[headerName];
} }
@ -841,7 +841,7 @@ function UpdateMessageHeaders()
{ {
// hide references header if view all headers mode isn't selected, the pref show references is // hide references header if view all headers mode isn't selected, the pref show references is
// deactivated and the currently displayed message isn't a newsgroup posting // deactivated and the currently displayed message isn't a newsgroup posting
headerEntry.valid = false; headerEntry.valid = false;
} }
else else
{ {
@ -858,7 +858,7 @@ function UpdateMessageHeaders()
// now update the view to make sure the right elements are visible // now update the view to make sure the right elements are visible
updateHeaderViews(); updateHeaderViews();
if ("FinishEmailProcessing" in this) if ("FinishEmailProcessing" in this)
FinishEmailProcessing(); FinishEmailProcessing();
} }
@ -870,15 +870,15 @@ function ClearCurrentHeaders()
} }
function ShowMessageHeaderPane() function ShowMessageHeaderPane()
{ {
document.getElementById('msgHeaderView').collapsed = false; document.getElementById('msgHeaderView').collapsed = false;
/* workaround for 39655 */ /* workaround for 39655 */
if (gFolderJustSwitched) if (gFolderJustSwitched)
{ {
var el = document.getElementById("msgHeaderView"); var el = document.getElementById("msgHeaderView");
el.setAttribute("style", el.getAttribute("style")); el.setAttribute("style", el.getAttribute("style"));
gFolderJustSwitched = false; gFolderJustSwitched = false;
} }
} }
@ -894,7 +894,7 @@ function HideMessageHeaderPane()
} }
function OutputNewsgroups(headerEntry, headerValue) function OutputNewsgroups(headerEntry, headerValue)
{ {
headerValue = headerValue.replace(/,/g,", "); headerValue = headerValue.replace(/,/g,", ");
updateHeaderValue(headerEntry, headerValue); updateHeaderValue(headerEntry, headerValue);
} }
@ -914,9 +914,9 @@ function OutputMessageIds(headerEntry, headerValue)
} }
// OutputEmailAddresses --> knows how to take a comma separated list of email addresses, // OutputEmailAddresses --> knows how to take a comma separated list of email addresses,
// extracts them one by one, linkifying each email address into a mailto url. // extracts them one by one, linkifying each email address into a mailto url.
// Then we add the link-ified email address to the parentDiv passed in. // Then we add the link-ified email address to the parentDiv passed in.
// //
// emailAddresses --> comma separated list of the addresses for this header field // emailAddresses --> comma separated list of the addresses for this header field
function OutputEmailAddresses(headerEntry, emailAddresses) function OutputEmailAddresses(headerEntry, emailAddresses)
@ -948,7 +948,7 @@ function OutputEmailAddresses(headerEntry, emailAddresses)
updateEmailAddressNode(headerEntry.enclosingBox.emailAddressNode, address); updateEmailAddressNode(headerEntry.enclosingBox.emailAddressNode, address);
index++; index++;
} }
if (headerEntry.useToggle) if (headerEntry.useToggle)
headerEntry.enclosingBox.buildViews(); headerEntry.enclosingBox.buildViews();
} // if msgheader parser } // if msgheader parser
@ -961,7 +961,7 @@ function updateEmailAddressNode(emailAddressNode, address)
emailAddressNode.setAttribute("fullAddress", address.fullAddress); emailAddressNode.setAttribute("fullAddress", address.fullAddress);
emailAddressNode.setAttribute("displayName", address.displayName); emailAddressNode.setAttribute("displayName", address.displayName);
emailAddressNode.removeAttribute("tooltiptext"); emailAddressNode.removeAttribute("tooltiptext");
AddExtraAddressProcessing(address.emailAddress, emailAddressNode); AddExtraAddressProcessing(address.emailAddress, emailAddressNode);
} }
@ -972,14 +972,14 @@ function updateEmailAddressNode(emailAddressNode, address)
function AddExtraAddressProcessing(emailAddress, addressNode) function AddExtraAddressProcessing(emailAddress, addressNode)
{ {
var displayName = addressNode.getAttribute("displayName"); var displayName = addressNode.getAttribute("displayName");
if (gShowCondensedEmailAddresses && displayName) if (gShowCondensedEmailAddresses && displayName)
{ {
// always show the address for the from and reply-to fields // always show the address for the from and reply-to fields
var parentElementId = addressNode.parentNode.id; var parentElementId = addressNode.parentNode.id;
var condenseName = true; var condenseName = true;
if (parentElementId == "expandedfromBox" || parentElementId == "expandedreply-toBox") if (parentElementId == "expandedfromBox" || parentElementId == "expandedreply-toBox")
condenseName = false; condenseName = false;
@ -989,7 +989,7 @@ function AddExtraAddressProcessing(emailAddress, addressNode)
addressNode.setAttribute("tooltiptext", emailAddress); addressNode.setAttribute("tooltiptext", emailAddress);
} }
} }
} }
function fillEmailAddressPopup(emailAddressNode) function fillEmailAddressPopup(emailAddressNode)
{ {
@ -1006,13 +1006,13 @@ function useDisplayNameForAddress(emailAddress)
// For now, if the email address is in the personal address book, then consider this user a 'known' user // For now, if the email address is in the personal address book, then consider this user a 'known' user
// and use the display name. I could eventually see our rules enlarged to include other local ABs, replicated // and use the display name. I could eventually see our rules enlarged to include other local ABs, replicated
// LDAP directories, and maybe even domain matches (i.e. any email from someone in my company // LDAP directories, and maybe even domain matches (i.e. any email from someone in my company
// should use the friendly display name) // should use the friendly display name)
if (!gPersonalAddressBookDirectory) if (!gPersonalAddressBookDirectory)
{ {
var RDFService = Components.classes[kRDFServiceContractID].getService(Components.interfaces.nsIRDFService); var RDFService = Components.classes[kRDFServiceContractID].getService(Components.interfaces.nsIRDFService);
gPersonalAddressBookDirectory = RDFService.GetResource(kPersonalAddressbookUri).QueryInterface(Components.interfaces.nsIAbMDBDirectory); gPersonalAddressBookDirectory = RDFService.GetResource(kPersonalAddressbookUri).QueryInterface(Components.interfaces.nsIAbMDBDirectory);
if (!gPersonalAddressBookDirectory) if (!gPersonalAddressBookDirectory)
return false; return false;
} }
@ -1029,7 +1029,7 @@ function AddNodeToAddressBook (emailAddressNode)
var displayName = emailAddressNode.getAttribute("displayName"); var displayName = emailAddressNode.getAttribute("displayName");
window.openDialog("chrome://messenger/content/addressbook/abNewCardDialog.xul", window.openDialog("chrome://messenger/content/addressbook/abNewCardDialog.xul",
"", "",
"chrome,resizable=no,titlebar,modal,centerscreen", "chrome,resizable=no,titlebar,modal,centerscreen",
{primaryEmail:primaryEmail, displayName:displayName }); {primaryEmail:primaryEmail, displayName:displayName });
} }
} }
@ -1094,11 +1094,11 @@ function createNewAttachmentInfo(contentType, url, displayName, uri, isExternalA
function dofunc(aFunctionName, aFunctionArg) function dofunc(aFunctionName, aFunctionArg)
{ {
if (aFunctionName == "saveAttachment") if (aFunctionName == "saveAttachment")
saveAttachment(aFunctionArg); saveAttachment(aFunctionArg);
else if (aFunctionName == "openAttachment") else if (aFunctionName == "openAttachment")
openAttachment(aFunctionArg); openAttachment(aFunctionArg);
else if (aFunctionName == "printAttachment") else if (aFunctionName == "printAttachment")
printAttachment(aFunctionArg); printAttachment(aFunctionArg);
else if (aFunctionName == "deleteAttachment") else if (aFunctionName == "deleteAttachment")
detachAttachment(aFunctionArg, false); detachAttachment(aFunctionArg, false);
@ -1108,35 +1108,35 @@ function dofunc(aFunctionName, aFunctionArg)
function saveAttachment(aAttachment) function saveAttachment(aAttachment)
{ {
messenger.saveAttachment(aAttachment.contentType, messenger.saveAttachment(aAttachment.contentType,
aAttachment.url, aAttachment.url,
encodeURIComponent(aAttachment.displayName), encodeURIComponent(aAttachment.displayName),
aAttachment.messageUri, aAttachment.isExternalAttachment); aAttachment.messageUri, aAttachment.isExternalAttachment);
} }
function openAttachment(aAttachment) function openAttachment(aAttachment)
{ {
messenger.openAttachment(aAttachment.contentType, messenger.openAttachment(aAttachment.contentType,
aAttachment.url, aAttachment.url,
encodeURIComponent(aAttachment.displayName), encodeURIComponent(aAttachment.displayName),
aAttachment.messageUri, aAttachment.isExternalAttachment); aAttachment.messageUri, aAttachment.isExternalAttachment);
} }
function printAttachment(aAttachment) function printAttachment(aAttachment)
{ {
/* we haven't implemented the ability to print attachments yet... /* we haven't implemented the ability to print attachments yet...
messenger.printAttachment(aAttachment.contentType, messenger.printAttachment(aAttachment.contentType,
aAttachment.url, aAttachment.url,
encodeURIComponent(aAttachment.displayName), encodeURIComponent(aAttachment.displayName),
aAttachment.messageUri); aAttachment.messageUri);
*/ */
} }
function detachAttachment(aAttachment, aSaveFirst) function detachAttachment(aAttachment, aSaveFirst)
{ {
messenger.detachAttachment(aAttachment.contentType, messenger.detachAttachment(aAttachment.contentType,
aAttachment.url, aAttachment.url,
encodeURIComponent(aAttachment.displayName), encodeURIComponent(aAttachment.displayName),
aAttachment.messageUri, aSaveFirst); aAttachment.messageUri, aSaveFirst);
} }
@ -1147,7 +1147,7 @@ function CanDetachAttachments()
if (canDetach && ("content-type" in currentHeaderData)) if (canDetach && ("content-type" in currentHeaderData))
{ {
var contentType = currentHeaderData["content-type"].headerValue; var contentType = currentHeaderData["content-type"].headerValue;
canDetach = contentType.indexOf("application/x-pkcs7-mime") < 0 && canDetach = contentType.indexOf("application/x-pkcs7-mime") < 0 &&
contentType.indexOf("application/x-pkcs7-signature") < 0; contentType.indexOf("application/x-pkcs7-signature") < 0;
} }
return canDetach; return canDetach;
@ -1208,10 +1208,10 @@ function MessageIdClick(node, event)
} }
} }
// this is our onclick handler for the attachment list. // this is our onclick handler for the attachment list.
// A double click in a listitem simulates "opening" the attachment.... // A double click in a listitem simulates "opening" the attachment....
function attachmentListClick(event) function attachmentListClick(event)
{ {
// we only care about button 0 (left click) events // we only care about button 0 (left click) events
if (event.button != 0) return; if (event.button != 0) return;
@ -1226,7 +1226,7 @@ function attachmentListClick(event)
} }
// on command handlers for the attachment list context menu... // on command handlers for the attachment list context menu...
// commandPrefix matches one of our existing functions // commandPrefix matches one of our existing functions
// (openAttachment, saveAttachment, etc.) // (openAttachment, saveAttachment, etc.)
function handleAttachmentSelection(commandPrefix) function handleAttachmentSelection(commandPrefix)
{ {
@ -1235,7 +1235,7 @@ function handleAttachmentSelection(commandPrefix)
// loop over all of the selected attachments... // loop over all of the selected attachments...
// XXX hack alert. If we sit in tight loop and call doFunc for multiple attachments, // XXX hack alert. If we sit in tight loop and call doFunc for multiple attachments,
// we get chrome errors in layout as we start loading the first helper app dialog // we get chrome errors in layout as we start loading the first helper app dialog
// then before it loads, we kick off the next one and the next one. Subsequent helper app dialogs // then before it loads, we kick off the next one and the next one. Subsequent helper app dialogs
// were failing because we were still loading the chrome files for the first attempt (error about the xul cache // were failing because we were still loading the chrome files for the first attempt (error about the xul cache
@ -1271,7 +1271,7 @@ function createAttachmentDisplayName(aAttachment)
function displayAttachmentsForExpandedView() function displayAttachmentsForExpandedView()
{ {
var numAttachments = currentAttachments.length; var numAttachments = currentAttachments.length;
var expandedAttachmentBox = document.getElementById('attachmentView'); var expandedAttachmentBox = document.getElementById('attachmentView');
var attachmentSplitter = document.getElementById('attachment-splitter'); var attachmentSplitter = document.getElementById('attachment-splitter');
@ -1287,7 +1287,7 @@ function displayAttachmentsForExpandedView()
// the attachment view and we end up with a box that is too tall. // the attachment view and we end up with a box that is too tall.
expandedAttachmentBox.collapsed = false; expandedAttachmentBox.collapsed = false;
attachmentSplitter.collapsed = false; attachmentSplitter.collapsed = false;
if (gShowLargeAttachmentView) if (gShowLargeAttachmentView)
expandedAttachmentBox.setAttribute("largeView", "true"); expandedAttachmentBox.setAttribute("largeView", "true");
@ -1302,15 +1302,15 @@ function displayAttachmentsForExpandedView()
// Create a new attachment widget // Create a new attachment widget
var displayName = createAttachmentDisplayName(attachment); var displayName = createAttachmentDisplayName(attachment);
var attachmentView = attachmentList.appendItem(displayName); var attachmentView = attachmentList.appendItem(displayName);
attachmentView.setAttribute("class", "descriptionitem-iconic"); attachmentView.setAttribute("class", "descriptionitem-iconic");
if (gShowLargeAttachmentView) if (gShowLargeAttachmentView)
attachmentView.setAttribute("largeView", "true"); attachmentView.setAttribute("largeView", "true");
setApplicationIconForAttachment(attachment, attachmentView, gShowLargeAttachmentView); setApplicationIconForAttachment(attachment, attachmentView, gShowLargeAttachmentView);
attachmentView.setAttribute("tooltiptext", attachment.displayName); attachmentView.setAttribute("tooltiptext", attachment.displayName);
attachmentView.setAttribute("context", "attachmentListContext"); attachmentView.setAttribute("context", "attachmentListContext");
attachmentView.attachment = cloneAttachment(attachment); attachmentView.attachment = cloneAttachment(attachment);
attachmentView.setAttribute("attachmentUrl", attachment.url); attachmentView.setAttribute("attachmentUrl", attachment.url);
@ -1352,7 +1352,7 @@ function FillAttachmentListPopup(popup)
{ {
// the FE sometimes call this routine TWICE...I haven't been able to figure out why yet... // the FE sometimes call this routine TWICE...I haven't been able to figure out why yet...
// protect against it... // protect against it...
if (!gBuildAttachmentPopupForCurrentMsg) return; if (!gBuildAttachmentPopupForCurrentMsg) return;
var attachmentIndex = 0; var attachmentIndex = 0;
@ -1383,13 +1383,13 @@ function FillAttachmentListPopup(popup)
} }
// Public method used to clear the file attachment menu // Public method used to clear the file attachment menu
function ClearAttachmentMenu(popup) function ClearAttachmentMenu(popup)
{ {
if ( popup ) if ( popup )
{ {
while ( popup.childNodes[0].localName == 'menu' ) while ( popup.childNodes[0].localName == 'menu' )
popup.removeChild(popup.childNodes[0]); popup.removeChild(popup.childNodes[0]);
} }
} }
// Public method used to determine the number of attachments for the currently displayed message... // Public method used to determine the number of attachments for the currently displayed message...
@ -1399,20 +1399,20 @@ function GetNumberOfAttachmentsForDisplayedMessage()
} }
// private method used to build up a menu list of attachments // private method used to build up a menu list of attachments
function addAttachmentToPopup(popup, attachment, attachmentIndex) function addAttachmentToPopup(popup, attachment, attachmentIndex)
{ {
if (popup) if (popup)
{ {
var item = document.createElement('menu'); var item = document.createElement('menu');
if ( item ) if ( item )
{ {
if (!gMessengerBundle) if (!gMessengerBundle)
gMessengerBundle = document.getElementById("bundle_messenger"); gMessengerBundle = document.getElementById("bundle_messenger");
// insert the item just before the separator...the separator is the 2nd to last element in the popup. // insert the item just before the separator...the separator is the 2nd to last element in the popup.
item.setAttribute('class', 'menu-iconic'); item.setAttribute('class', 'menu-iconic');
setApplicationIconForAttachment(attachment,item, false); setApplicationIconForAttachment(attachment,item, false);
var numItemsInPopup = popup.childNodes.length; var numItemsInPopup = popup.childNodes.length;
// find the separator // find the separator
var indexOfSeparator = 0; var indexOfSeparator = 0;
@ -1424,10 +1424,10 @@ function addAttachmentToPopup(popup, attachment, attachmentIndex)
[attachmentIndex, displayName]); [attachmentIndex, displayName]);
item.setAttribute("crop", "center"); item.setAttribute("crop", "center");
item.setAttribute('label', formattedDisplayNameString); item.setAttribute('label', formattedDisplayNameString);
item.setAttribute('accesskey', attachmentIndex); item.setAttribute('accesskey', attachmentIndex);
// each attachment in the list gets its own menupopup with options for saving, deleting, detaching, etc. // each attachment in the list gets its own menupopup with options for saving, deleting, detaching, etc.
var openpopup = document.createElement('menupopup'); var openpopup = document.createElement('menupopup');
openpopup = item.appendChild(openpopup); openpopup = item.appendChild(openpopup);
@ -1438,7 +1438,7 @@ function addAttachmentToPopup(popup, attachment, attachmentIndex)
var menuitementry = document.createElement('menuitem'); var menuitementry = document.createElement('menuitem');
menuitementry.attachment = cloneAttachment(attachment); menuitementry.attachment = cloneAttachment(attachment);
menuitementry.setAttribute('oncommand', 'openAttachment(this.attachment)'); menuitementry.setAttribute('oncommand', 'openAttachment(this.attachment)');
if (!gSaveLabel) if (!gSaveLabel)
gSaveLabel = gMessengerBundle.getString("saveLabel"); gSaveLabel = gMessengerBundle.getString("saveLabel");
@ -1465,28 +1465,28 @@ function addAttachmentToPopup(popup, attachment, attachmentIndex)
if ("content-type" in currentHeaderData) if ("content-type" in currentHeaderData)
{ {
var contentType = currentHeaderData["content-type"].headerValue; var contentType = currentHeaderData["content-type"].headerValue;
signedOrEncrypted = contentType.indexOf("application/x-pkcs7-mime") >= 0 || signedOrEncrypted = contentType.indexOf("application/x-pkcs7-mime") >= 0 ||
contentType.indexOf("application/x-pkcs7-signature") >= 0; contentType.indexOf("application/x-pkcs7-signature") >= 0;
} }
var canDetach = !(/news-message:/.test(attachment.uri)) && var canDetach = !(/news-message:/.test(attachment.uri)) &&
!signedOrEncrypted && !signedOrEncrypted &&
(!(/imap-message/.test(attachment.uri)) || MailOfflineMgr.isOnline()); (!(/imap-message/.test(attachment.uri)) || MailOfflineMgr.isOnline());
menuitementry.setAttribute('label', gOpenLabel); menuitementry.setAttribute('label', gOpenLabel);
menuitementry.setAttribute('accesskey', gOpenLabelAccesskey); menuitementry.setAttribute('accesskey', gOpenLabelAccesskey);
menuitementry = openpopup.appendChild(menuitementry); menuitementry = openpopup.appendChild(menuitementry);
if (attachment.contentType == 'text/x-moz-deleted') if (attachment.contentType == 'text/x-moz-deleted')
menuitementry.setAttribute('disabled', true); menuitementry.setAttribute('disabled', true);
var menuseparator = document.createElement('menuseparator'); var menuseparator = document.createElement('menuseparator');
openpopup.appendChild(menuseparator); openpopup.appendChild(menuseparator);
menuitementry = document.createElement('menuitem'); menuitementry = document.createElement('menuitem');
menuitementry.attachment = cloneAttachment(attachment); menuitementry.attachment = cloneAttachment(attachment);
menuitementry.setAttribute('oncommand', 'saveAttachment(this.attachment)'); menuitementry.setAttribute('oncommand', 'saveAttachment(this.attachment)');
menuitementry.setAttribute('label', gSaveLabel); menuitementry.setAttribute('label', gSaveLabel);
menuitementry.setAttribute('accesskey', gSaveLabelAccesskey); menuitementry.setAttribute('accesskey', gSaveLabelAccesskey);
if (attachment.contentType == 'text/x-moz-deleted') if (attachment.contentType == 'text/x-moz-deleted')
menuitementry.setAttribute('disabled', true); menuitementry.setAttribute('disabled', true);
menuitementry = openpopup.appendChild(menuitementry); menuitementry = openpopup.appendChild(menuitementry);
var menuseparator = document.createElement('menuseparator'); var menuseparator = document.createElement('menuseparator');
@ -1494,28 +1494,28 @@ function addAttachmentToPopup(popup, attachment, attachmentIndex)
menuitementry = document.createElement('menuitem'); menuitementry = document.createElement('menuitem');
menuitementry.attachment = cloneAttachment(attachment); menuitementry.attachment = cloneAttachment(attachment);
menuitementry.setAttribute('oncommand', 'detachAttachment(this.attachment, true)'); menuitementry.setAttribute('oncommand', 'detachAttachment(this.attachment, true)');
menuitementry.setAttribute('label', gDetachLabel); menuitementry.setAttribute('label', gDetachLabel);
menuitementry.setAttribute('accesskey', gDetachLabelAccesskey); menuitementry.setAttribute('accesskey', gDetachLabelAccesskey);
if (attachment.contentType == 'text/x-moz-deleted' || !canDetach) if (attachment.contentType == 'text/x-moz-deleted' || !canDetach)
menuitementry.setAttribute('disabled', true); menuitementry.setAttribute('disabled', true);
menuitementry = openpopup.appendChild(menuitementry); menuitementry = openpopup.appendChild(menuitementry);
menuitementry = document.createElement('menuitem'); menuitementry = document.createElement('menuitem');
menuitementry.attachment = cloneAttachment(attachment); menuitementry.attachment = cloneAttachment(attachment);
menuitementry.setAttribute('oncommand', 'detachAttachment(this.attachment, false)'); menuitementry.setAttribute('oncommand', 'detachAttachment(this.attachment, false)');
menuitementry.setAttribute('label', gDeleteLabel); menuitementry.setAttribute('label', gDeleteLabel);
menuitementry.setAttribute('accesskey', gDeleteLabelAccesskey); menuitementry.setAttribute('accesskey', gDeleteLabelAccesskey);
if (attachment.contentType == 'text/x-moz-deleted' || !canDetach) if (attachment.contentType == 'text/x-moz-deleted' || !canDetach)
menuitementry.setAttribute('disabled', true); menuitementry.setAttribute('disabled', true);
menuitementry = openpopup.appendChild(menuitementry); menuitementry = openpopup.appendChild(menuitementry);
} // if we created a menu item for this attachment... } // if we created a menu item for this attachment...
} // if we have a popup } // if we have a popup
} }
function HandleAllAttachments(action) function HandleAllAttachments(action)
{ {
try try
{ {
// convert our attachment data into some c++ friendly structs // convert our attachment data into some c++ friendly structs
var attachmentContentTypeArray = new Array(); var attachmentContentTypeArray = new Array();
@ -1563,8 +1563,8 @@ function HandleAllAttachments(action)
} }
} }
function ClearAttachmentList() function ClearAttachmentList()
{ {
// we also have to disable the File/Attachments menuitem // we also have to disable the File/Attachments menuitem
var node = document.getElementById("fileAttachmentMenu"); var node = document.getElementById("fileAttachmentMenu");
if (node) if (node)
@ -1573,11 +1573,11 @@ function ClearAttachmentList()
// clear selection // clear selection
var list = document.getElementById('attachmentList'); var list = document.getElementById('attachmentList');
while (list.hasChildNodes()) while (list.hasChildNodes())
list.removeChild(list.lastChild); list.removeChild(list.lastChild);
} }
function ShowEditMessageButton() function ShowEditMessageButton()
{ {
// it would be nice if we passed in the msgHdr from the back end // it would be nice if we passed in the msgHdr from the back end
var msgHdr; var msgHdr;
@ -1592,10 +1592,10 @@ function ShowEditMessageButton()
if (IsSpecialFolder(msgHdr.folder, MSG_FOLDER_FLAG_DRAFTS, true)) if (IsSpecialFolder(msgHdr.folder, MSG_FOLDER_FLAG_DRAFTS, true))
document.getElementById("editMessageBox").collapsed = false; document.getElementById("editMessageBox").collapsed = false;
} }
function ClearEditMessageButton() function ClearEditMessageButton()
{ {
var editBox = document.getElementById("editMessageBox"); var editBox = document.getElementById("editMessageBox");
if (editBox) if (editBox)
editBox.collapsed = true; editBox.collapsed = true;
@ -1633,9 +1633,9 @@ var attachmentAreaDNDObserver = {
aAttachmentData.data.addDataForFlavour("text/x-moz-url", tmpurlWithExtraInfo + "\n" + attachmentDisplayName); aAttachmentData.data.addDataForFlavour("text/x-moz-url", tmpurlWithExtraInfo + "\n" + attachmentDisplayName);
aAttachmentData.data.addDataForFlavour("text/x-moz-url-data", tmpurl); aAttachmentData.data.addDataForFlavour("text/x-moz-url-data", tmpurl);
aAttachmentData.data.addDataForFlavour("text/x-moz-url-desc", attachmentDisplayName); aAttachmentData.data.addDataForFlavour("text/x-moz-url-desc", attachmentDisplayName);
aAttachmentData.data.addDataForFlavour("application/x-moz-file-promise-url", tmpurl); aAttachmentData.data.addDataForFlavour("application/x-moz-file-promise-url", tmpurl);
aAttachmentData.data.addDataForFlavour("application/x-moz-file-promise", new nsFlavorDataProvider(), 0, Components.interfaces.nsISupports); aAttachmentData.data.addDataForFlavour("application/x-moz-file-promise", new nsFlavorDataProvider(), 0, Components.interfaces.nsISupports);
} }
} }
} }
@ -1654,7 +1654,7 @@ nsFlavorDataProvider.prototype =
return this; return this;
throw Components.results.NS_NOINTERFACE; throw Components.results.NS_NOINTERFACE;
}, },
getFlavorData : function(aTransferable, aFlavor, aData, aDataLen) getFlavorData : function(aTransferable, aFlavor, aData, aDataLen)
{ {
// get the url for the attachment // get the url for the attachment

View File

@ -58,7 +58,7 @@ const kNumFolderViews = 4; // total number of folder views
// from nsMsgFolderFlags.h // from nsMsgFolderFlags.h
const MSG_FOLDER_FLAG_ELIDED = 0x10; const MSG_FOLDER_FLAG_ELIDED = 0x10;
var gFolderTree; var gFolderTree;
var gMessagePane; var gMessagePane;
var gThreadTree; var gThreadTree;
var gSearchInput; var gSearchInput;
@ -107,7 +107,7 @@ function SelectAndScrollToKey(aMsgKey)
// select the desired message // select the desired message
// if the key isn't found, we won't select anything // if the key isn't found, we won't select anything
gDBView.selectMsgByKey(aMsgKey); gDBView.selectMsgByKey(aMsgKey);
// is there a selection? // is there a selection?
// if not, bail out. // if not, bail out.
var indicies = GetSelectedIndices(gDBView); var indicies = GetSelectedIndices(gDBView);
@ -127,7 +127,7 @@ function ScrollToMessageAfterFolderLoad (folder)
{ {
var scrolled = pref.getBoolPref("mailnews.scroll_to_new_message") && var scrolled = pref.getBoolPref("mailnews.scroll_to_new_message") &&
ScrollToMessage(nsMsgNavigationType.firstNew, true, false /* selectMessage */); ScrollToMessage(nsMsgNavigationType.firstNew, true, false /* selectMessage */);
if (!scrolled && folder && pref.getBoolPref("mailnews.remember_selected_message")) if (!scrolled && folder && pref.getBoolPref("mailnews.remember_selected_message"))
{ {
// if we failed to scroll to a new message, // if we failed to scroll to a new message,
// reselect the last selected message // reselect the last selected message
@ -135,31 +135,31 @@ function ScrollToMessageAfterFolderLoad (folder)
if (lastMessageLoaded != nsMsgKey_None) if (lastMessageLoaded != nsMsgKey_None)
scrolled = SelectAndScrollToKey(lastMessageLoaded); scrolled = SelectAndScrollToKey(lastMessageLoaded);
} }
if (!scrolled) if (!scrolled)
{ {
// if we still haven't scrolled, // if we still haven't scrolled,
// scroll to the newest, which might be the top or the bottom // scroll to the newest, which might be the top or the bottom
// depending on our sort order and sort type // depending on our sort order and sort type
if (gDBView.sortOrder == nsMsgViewSortOrder.ascending) if (gDBView.sortOrder == nsMsgViewSortOrder.ascending)
{ {
switch (gDBView.sortType) switch (gDBView.sortType)
{ {
case nsMsgViewSortType.byDate: case nsMsgViewSortType.byDate:
case nsMsgViewSortType.byReceived: case nsMsgViewSortType.byReceived:
case nsMsgViewSortType.byId: case nsMsgViewSortType.byId:
case nsMsgViewSortType.byThread: case nsMsgViewSortType.byThread:
scrolled = ScrollToMessage(nsMsgNavigationType.lastMessage, true, false /* selectMessage */); scrolled = ScrollToMessage(nsMsgNavigationType.lastMessage, true, false /* selectMessage */);
break; break;
} }
} }
// if still we haven't scrolled, // if still we haven't scrolled,
// scroll to the top. // scroll to the top.
if (!scrolled) if (!scrolled)
EnsureRowInThreadTreeIsVisible(0); EnsureRowInThreadTreeIsVisible(0);
} }
return scrolled; return scrolled;
} }
@ -176,7 +176,7 @@ var folderListener = {
if(property.toString() == "TotalMessages" || property.toString() == "TotalUnreadMessages") { if(property.toString() == "TotalMessages" || property.toString() == "TotalUnreadMessages") {
UpdateStatusMessageCounts(gMsgFolderSelected); UpdateStatusMessageCounts(gMsgFolderSelected);
UpdateFolderLocationPicker(item); UpdateFolderLocationPicker(item);
} }
} }
}, },
@ -213,9 +213,9 @@ var folderListener = {
RerootFolder(uri, msgFolder, gCurrentLoadingFolderViewType, gCurrentLoadingFolderViewFlags, gCurrentLoadingFolderSortType, gCurrentLoadingFolderSortOrder); RerootFolder(uri, msgFolder, gCurrentLoadingFolderViewType, gCurrentLoadingFolderViewFlags, gCurrentLoadingFolderSortType, gCurrentLoadingFolderSortOrder);
var db = msgFolder.getMsgDatabase(msgWindow); var db = msgFolder.getMsgDatabase(msgWindow);
if (db) if (db)
db.resetHdrCacheSize(100); db.resetHdrCacheSize(100);
if (gDBView) { if (gDBView) {
gDBView.suppressCommandUpdating = false; gDBView.suppressCommandUpdating = false;
} }
@ -247,7 +247,7 @@ var folderListener = {
viewDebug("uri == current loading folder uri\n"); viewDebug("uri == current loading folder uri\n");
gCurrentLoadingFolderURI = ""; gCurrentLoadingFolderURI = "";
scrolled = ScrollToMessageAfterFolderLoad(msgFolder); scrolled = ScrollToMessageAfterFolderLoad(msgFolder);
SetBusyCursor(window, false); SetBusyCursor(window, false);
} }
@ -271,7 +271,7 @@ var folderListener = {
{ {
Search(gSearchEmailAddress); Search(gSearchEmailAddress);
gSearchEmailAddress = null; gSearchEmailAddress = null;
} }
else if (gVirtualFolderTerms) else if (gVirtualFolderTerms)
{ {
gDefaultSearchViewTerms = null; gDefaultSearchViewTerms = null;
@ -285,7 +285,7 @@ var folderListener = {
gDefaultSearchViewTerms = null; gDefaultSearchViewTerms = null;
} }
else else
{ {
// get the view value from the folder // get the view value from the folder
if (msgFolder) if (msgFolder)
{ {
@ -306,7 +306,7 @@ var folderListener = {
} }
} }
} }
} }
else if (eventType == "ImapHdrDownloaded") { else if (eventType == "ImapHdrDownloaded") {
if (folder) { if (folder) {
var imapFolder = folder.QueryInterface(Components.interfaces.nsIMsgImapMailFolder); var imapFolder = folder.QueryInterface(Components.interfaces.nsIMsgImapMailFolder);
@ -330,7 +330,7 @@ var folderListener = {
} }
else if (eventType == "DeleteOrMoveMsgCompleted") { else if (eventType == "DeleteOrMoveMsgCompleted") {
HandleDeleteOrMoveMsgCompleted(folder); HandleDeleteOrMoveMsgCompleted(folder);
} }
else if (eventType == "DeleteOrMoveMsgFailed") { else if (eventType == "DeleteOrMoveMsgFailed") {
HandleDeleteOrMoveMsgFailed(folder); HandleDeleteOrMoveMsgFailed(folder);
} }
@ -428,8 +428,8 @@ function HandleDeleteOrMoveMsgFailed(folder)
// WARNING // WARNING
// this is a fragile and complicated function. // this is a fragile and complicated function.
// be careful when hacking on it. // be careful when hacking on it.
// don't forget about things like different imap // don't forget about things like different imap
// delete models, multiple views (from multiple thread panes, // delete models, multiple views (from multiple thread panes,
// search windows, stand alone message windows) // search windows, stand alone message windows)
function HandleDeleteOrMoveMsgCompleted(folder) function HandleDeleteOrMoveMsgCompleted(folder)
{ {
@ -448,7 +448,7 @@ function HandleDeleteOrMoveMsgCompleted(folder)
var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView); var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView);
var treeSelection = treeView.selection; var treeSelection = treeView.selection;
if (gNextMessageViewIndexAfterDelete == -2) { if (gNextMessageViewIndexAfterDelete == -2) {
// a move or delete can cause our selection can change underneath us. // a move or delete can cause our selection can change underneath us.
// this can happen when the user // this can happen when the user
@ -471,12 +471,12 @@ function HandleDeleteOrMoveMsgCompleted(folder)
var startIndex = {}; var startIndex = {};
var endIndex = {}; var endIndex = {};
treeSelection.getRangeAt(0, startIndex, endIndex); treeSelection.getRangeAt(0, startIndex, endIndex);
// select the selected item, so we'll load it // select the selected item, so we'll load it
treeSelection.select(startIndex.value); treeSelection.select(startIndex.value);
treeView.selectionChanged(); treeView.selectionChanged();
EnsureRowInThreadTreeIsVisible(startIndex.value); EnsureRowInThreadTreeIsVisible(startIndex.value);
UpdateMailToolbar("delete from another view, 1 row now selected"); UpdateMailToolbar("delete from another view, 1 row now selected");
} }
@ -488,15 +488,15 @@ function HandleDeleteOrMoveMsgCompleted(folder)
} }
} }
else { else {
if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None)
{ {
var viewSize = treeView.rowCount; var viewSize = treeView.rowCount;
if (gNextMessageViewIndexAfterDelete >= viewSize) if (gNextMessageViewIndexAfterDelete >= viewSize)
{ {
if (viewSize > 0) if (viewSize > 0)
gNextMessageViewIndexAfterDelete = viewSize - 1; gNextMessageViewIndexAfterDelete = viewSize - 1;
else else
{ {
gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None; gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None;
// there is nothing to select since viewSize is 0 // there is nothing to select since viewSize is 0
@ -512,13 +512,13 @@ function HandleDeleteOrMoveMsgCompleted(folder)
// the selection then add the next message to select. This just generates // the selection then add the next message to select. This just generates
// an extra round of command updating notifications that we are trying to // an extra round of command updating notifications that we are trying to
// optimize away. // optimize away.
if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None)
{ {
// when deleting a message we don't update the commands // when deleting a message we don't update the commands
// when the selection goes to 0 // when the selection goes to 0
// (we have a hack in nsMsgDBView which prevents that update) // (we have a hack in nsMsgDBView which prevents that update)
// so there is no need to // so there is no need to
// update commands when we select the next message after the delete; // update commands when we select the next message after the delete;
// the commands already // the commands already
// have the right update state... // have the right update state...
gDBView.suppressCommandUpdating = true; gDBView.suppressCommandUpdating = true;
@ -528,24 +528,24 @@ function HandleDeleteOrMoveMsgCompleted(folder)
// be thrown. // be thrown.
if (gNextMessageViewIndexAfterDelete >= 0) if (gNextMessageViewIndexAfterDelete >= 0)
treeSelection.select(gNextMessageViewIndexAfterDelete); treeSelection.select(gNextMessageViewIndexAfterDelete);
// if gNextMessageViewIndexAfterDelete has the same value // if gNextMessageViewIndexAfterDelete has the same value
// as the last index we had selected, the tree won't generate a // as the last index we had selected, the tree won't generate a
// selectionChanged notification for the tree view. So force a manual // selectionChanged notification for the tree view. So force a manual
// selection changed call. // selection changed call.
// (don't worry it's cheap if we end up calling it twice). // (don't worry it's cheap if we end up calling it twice).
if (treeView) if (treeView)
treeView.selectionChanged(); treeView.selectionChanged();
EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete); EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete);
gDBView.suppressCommandUpdating = false; gDBView.suppressCommandUpdating = false;
// hook for extra toolbar items // hook for extra toolbar items
// XXX TODO // XXX TODO
// I think there is a bug in the suppression code above. // I think there is a bug in the suppression code above.
// what if I have two rows selected, and I hit delete, // what if I have two rows selected, and I hit delete,
// and so we load the next row. // and so we load the next row.
// what if I have commands that only enable where // what if I have commands that only enable where
// exactly one row is selected? // exactly one row is selected?
UpdateMailToolbar("delete from current view, at least one row selected"); UpdateMailToolbar("delete from current view, at least one row selected");
} }
@ -576,7 +576,7 @@ function HandleCompactCompleted(folder)
viewType = dbFolderInfo.viewType; viewType = dbFolderInfo.viewType;
dbFolderInfo = null; dbFolderInfo = null;
} }
RerootFolder(uri, msgFolder, viewType, viewFlags, sortType, sortOrder); RerootFolder(uri, msgFolder, viewType, viewFlags, sortType, sortOrder);
LoadCurrentlyDisplayedMessage(); LoadCurrentlyDisplayedMessage();
} }
@ -654,7 +654,7 @@ var gThreePaneIncomingServerListener = {
return; return;
} }
} }
// if nothing is selected at this point, better go select the default // if nothing is selected at this point, better go select the default
// this could happen if nothing was selected when the server was removed // this could happen if nothing was selected when the server was removed
selectedFolders = GetSelectedMsgFolders(); selectedFolders = GetSelectedMsgFolders();
@ -664,8 +664,8 @@ var gThreePaneIncomingServerListener = {
}, },
onServerChanged: function(server) { onServerChanged: function(server) {
// if the current selected folder is on the server that changed // if the current selected folder is on the server that changed
// and that server is an imap or news server, // and that server is an imap or news server,
// we need to update the selection. // we need to update the selection.
// on those server types, we'll be reconnecting to the server // on those server types, we'll be reconnecting to the server
// and our currently selected folder will need to be reloaded // and our currently selected folder will need to be reloaded
// or worse, be invalid. // or worse, be invalid.
@ -694,7 +694,7 @@ function UpdateMailPaneConfig(aMsgWindowInitialized) {
ClearAttachmentList(); ClearAttachmentList();
var messagePaneSplitter = GetThreadAndMessagePaneSplitter(); var messagePaneSplitter = GetThreadAndMessagePaneSplitter();
var desiredParent = document.getElementById(desiredId); var desiredParent = document.getElementById(desiredId);
// See Bug 381992. The ctor for the browser element will fire again when we re-insert the messagePaneBox back into the document. // See Bug 381992. The ctor for the browser element will fire again when we re-insert the messagePaneBox back into the document.
// But the dtor doesn't fire when the element is removed from the document. Manually call destroy here to avoid a nasty leak. // But the dtor doesn't fire when the element is removed from the document. Manually call destroy here to avoid a nasty leak.
getMessageBrowser().destroy(); getMessageBrowser().destroy();
desiredParent.appendChild(messagePaneSplitter); desiredParent.appendChild(messagePaneSplitter);
@ -731,18 +731,18 @@ function OnLoadMessenger()
document.loadBindingDocument('chrome://global/content/bindings/textbox.xml'); document.loadBindingDocument('chrome://global/content/bindings/textbox.xml');
// Set a sane starting width/height for all resolutions on new profiles. Do this before the window loads // Set a sane starting width/height for all resolutions on new profiles. Do this before the window loads
if (!document.documentElement.hasAttribute("width")) if (!document.documentElement.hasAttribute("width"))
{ {
var defaultWidth, defaultHeight; var defaultWidth, defaultHeight;
if (screen.availHeight <= 600) if (screen.availHeight <= 600)
{ {
document.documentElement.setAttribute("sizemode", "maximized"); document.documentElement.setAttribute("sizemode", "maximized");
defaultWidth = 800; defaultWidth = 800;
defaultHeight = 565; defaultHeight = 565;
} }
else // for higher resolution displays, use larger values for height and width else // for higher resolution displays, use larger values for height and width
{ {
defaultWidth = screen.availWidth <= 1024 ? screen.availWidth * .95 : screen.availWidth * .8; defaultWidth = screen.availWidth <= 1024 ? screen.availWidth * .95 : screen.availWidth * .8;
defaultHeight = screen.availHeight * .8; defaultHeight = screen.availHeight * .8;
} }
@ -766,7 +766,7 @@ function delayedOnLoadMessenger()
accountCentralBox = document.getElementById("accountCentralBox"); accountCentralBox = document.getElementById("accountCentralBox");
GetMessagePane().collapsed = true; GetMessagePane().collapsed = true;
verifyAccounts(null); verifyAccounts(null);
InitMsgWindow(); InitMsgWindow();
messenger.setWindow(window, msgWindow); messenger.setWindow(window, msgWindow);
@ -779,16 +779,16 @@ function delayedOnLoadMessenger()
accountManager.setSpecialFolders(); accountManager.setSpecialFolders();
accountManager.loadVirtualFolders(); accountManager.loadVirtualFolders();
accountManager.addIncomingServerListener(gThreePaneIncomingServerListener); accountManager.addIncomingServerListener(gThreePaneIncomingServerListener);
gPhishingDetector.init(); gPhishingDetector.init();
AddToSession(); AddToSession();
//need to add to session before trying to load start folder otherwise listeners aren't //need to add to session before trying to load start folder otherwise listeners aren't
//set up correctly. //set up correctly.
// argument[0] --> folder uri // argument[0] --> folder uri
// argument[1] --> optional message key // argument[1] --> optional message key
// argument[2] --> optional email address; //will come from aim; needs to show msgs from buddy's email address // argument[2] --> optional email address; //will come from aim; needs to show msgs from buddy's email address
if ("arguments" in window) if ("arguments" in window)
{ {
// filter our any feed urls that came in as arguments to the new window... // filter our any feed urls that came in as arguments to the new window...
@ -813,13 +813,13 @@ function delayedOnLoadMessenger()
shellService = Components.classes["@mozilla.org/mail/shell-service;1"].getService(nsIShellService); shellService = Components.classes["@mozilla.org/mail/shell-service;1"].getService(nsIShellService);
defaultAccount = accountManager.defaultAccount; defaultAccount = accountManager.defaultAccount;
} catch (ex) {} } catch (ex) {}
// show the default client dialog only if we have at least one account, // show the default client dialog only if we have at least one account,
// if we should check for the default client, // if we should check for the default client,
// and we aren't already the default for mail) // and we aren't already the default for mail)
if (shellService && defaultAccount && shellService.shouldCheckDefaultClient if (shellService && defaultAccount && shellService.shouldCheckDefaultClient
&& !shellService.isDefaultClient(true, nsIShellService.MAIL)) && !shellService.isDefaultClient(true, nsIShellService.MAIL))
window.openDialog("chrome://messenger/content/defaultClientDialog.xul", "DefaultClient", window.openDialog("chrome://messenger/content/defaultClientDialog.xul", "DefaultClient",
"modal,centerscreen,chrome,resizable=no"); "modal,centerscreen,chrome,resizable=no");
#endif #endif
@ -834,7 +834,7 @@ function delayedOnLoadMessenger()
//Set focus to the Thread Pane the first time the window is opened. //Set focus to the Thread Pane the first time the window is opened.
SetFocusThreadPane(); SetFocusThreadPane();
// initialize the customizeDone method on the customizeable toolbar // initialize the customizeDone method on the customizeable toolbar
var toolbox = document.getElementById("mail-toolbox"); var toolbox = document.getElementById("mail-toolbox");
toolbox.customizeDone = MailToolboxCustomizeDone; toolbox.customizeDone = MailToolboxCustomizeDone;
@ -889,8 +889,8 @@ function loadStartFolder(initialUri)
startFolderResource = rootMsgFolder.QueryInterface(Components.interfaces.nsIRDFResource); startFolderResource = rootMsgFolder.QueryInterface(Components.interfaces.nsIRDFResource);
// Enable checknew mail once by turning checkmail pref 'on' to bring // Enable checknew mail once by turning checkmail pref 'on' to bring
// all users to one plane. This allows all users to go to Inbox. User can // all users to one plane. This allows all users to go to Inbox. User can
// always go to server settings panel and turn off "Check for new mail at startup" // always go to server settings panel and turn off "Check for new mail at startup"
if (!pref.getBoolPref(kMailCheckOncePrefName)) if (!pref.getBoolPref(kMailCheckOncePrefName))
{ {
@ -901,12 +901,12 @@ function loadStartFolder(initialUri)
// Get the user pref to see if the login at startup is enabled for default account // Get the user pref to see if the login at startup is enabled for default account
isLoginAtStartUpEnabled = defaultServer.loginAtStartUp; isLoginAtStartUpEnabled = defaultServer.loginAtStartUp;
// Get Inbox only if when we have to login // Get Inbox only if when we have to login
if (isLoginAtStartUpEnabled) if (isLoginAtStartUpEnabled)
{ {
//now find Inbox //now find Inbox
var outNumFolders = new Object(); var outNumFolders = new Object();
var inboxFolder = rootMsgFolder.getFoldersWithFlag(0x1000, 1, outNumFolders); var inboxFolder = rootMsgFolder.getFoldersWithFlag(0x1000, 1, outNumFolders);
if (!inboxFolder) return; if (!inboxFolder) return;
startFolderResource = inboxFolder.QueryInterface(Components.interfaces.nsIRDFResource); startFolderResource = inboxFolder.QueryInterface(Components.interfaces.nsIRDFResource);
@ -917,7 +917,7 @@ function loadStartFolder(initialUri)
// it is possible we were given an initial uri and we need to subscribe or try to add // it is possible we were given an initial uri and we need to subscribe or try to add
// the folder. i.e. the user just clicked on a news folder they aren't subscribed to from a browser // the folder. i.e. the user just clicked on a news folder they aren't subscribed to from a browser
// the news url comes in here. // the news url comes in here.
// Perform biff on the server to check for new mail, except for imap // Perform biff on the server to check for new mail, except for imap
// or a pop3 account that is deferred or deferred to, // or a pop3 account that is deferred or deferred to,
@ -925,7 +925,7 @@ function loadStartFolder(initialUri)
if (!initialUri && isLoginAtStartUpEnabled && gLoadStartFolder if (!initialUri && isLoginAtStartUpEnabled && gLoadStartFolder
&& !defaultServer.isDeferredTo && !gNewAccountToLoad && && !defaultServer.isDeferredTo && !gNewAccountToLoad &&
defaultServer.rootFolder == defaultServer.rootMsgFolder) defaultServer.rootFolder == defaultServer.rootMsgFolder)
defaultServer.performBiff(msgWindow); defaultServer.performBiff(msgWindow);
SelectFolder(startFolder.URI); SelectFolder(startFolder.URI);
} }
@ -976,14 +976,14 @@ function InitPanes()
function InitializeDataSources() function InitializeDataSources()
{ {
//Setup common mailwindow stuff. //Setup common mailwindow stuff.
AddDataSources(); AddDataSources();
//To threadpane move context menu //To threadpane move context menu
SetupMoveCopyMenus('threadPaneContext-moveMenu', accountManagerDataSource, folderDataSource); SetupMoveCopyMenus('threadPaneContext-moveMenu', accountManagerDataSource, folderDataSource);
//To threadpane copy content menu //To threadpane copy content menu
SetupMoveCopyMenus('threadPaneContext-copyMenu', accountManagerDataSource, folderDataSource); SetupMoveCopyMenus('threadPaneContext-copyMenu', accountManagerDataSource, folderDataSource);
} }
function OnFolderUnreadColAttrModified(event) function OnFolderUnreadColAttrModified(event)
@ -1000,7 +1000,7 @@ function UpdateFolderColumnVisibility()
{ {
var folderNameCol = document.getElementById("folderNameCol"); var folderNameCol = document.getElementById("folderNameCol");
var showColumns = pref.getBoolPref("mail.showFolderPaneColumns"); var showColumns = pref.getBoolPref("mail.showFolderPaneColumns");
var folderUnreadCol = document.getElementById("folderUnreadCol"); var folderUnreadCol = document.getElementById("folderUnreadCol");
var folderColumnLabel = document.getElementById("folderColumnLabel"); var folderColumnLabel = document.getElementById("folderColumnLabel");
if (!showColumns) if (!showColumns)
{ {
@ -1025,7 +1025,7 @@ function UpdateFolderColumnVisibility()
var folderNameCell = document.getElementById("folderNameCell"); var folderNameCell = document.getElementById("folderNameCell");
folderNameCell.setAttribute("label", "?folderTreeSimpleName"); folderNameCell.setAttribute("label", "?folderTreeSimpleName");
} }
} }
// loadFolderViewForTree -- a helper routine split away from // loadFolderViewForTree -- a helper routine split away from
// loadFolderView. // loadFolderView.
@ -1036,12 +1036,12 @@ function loadFolderViewForTree(aNewFolderView, aFolderTree)
var database = aFolderTree.database; var database = aFolderTree.database;
var nsIRDFDataSource = Components.interfaces.nsIRDFDataSource; var nsIRDFDataSource = Components.interfaces.nsIRDFDataSource;
// Each folder pane view has the following properties: // Each folder pane view has the following properties:
// ref-> the ref attribute for the folderTree // ref-> the ref attribute for the folderTree
// label -> the UI label associated with the folder view // label -> the UI label associated with the folder view
// datasources -> array of the data sources associated with the view // datasources -> array of the data sources associated with the view
var folderViews = [ var folderViews = [
{ref:"msgaccounts:/", label:"folderPaneHeader", dataSources: [accountManagerDataSource.QueryInterface(nsIRDFDataSource), {ref:"msgaccounts:/", label:"folderPaneHeader", dataSources: [accountManagerDataSource.QueryInterface(nsIRDFDataSource),
folderDataSource.QueryInterface(nsIRDFDataSource)] }, folderDataSource.QueryInterface(nsIRDFDataSource)] },
{ref:"mailnewsunreadfolders:/", label:"folderPaneHeader_unread", dataSources: [unreadFolderDataSource.QueryInterface(nsIRDFDataSource)]}, {ref:"mailnewsunreadfolders:/", label:"folderPaneHeader_unread", dataSources: [unreadFolderDataSource.QueryInterface(nsIRDFDataSource)]},
@ -1074,18 +1074,18 @@ function loadFolderView(aNewFolderView)
{ {
if (gCurrentFolderView && (gCurrentFolderView == aNewFolderView)) if (gCurrentFolderView && (gCurrentFolderView == aNewFolderView))
return; return;
var folderTree = GetFolderTree(); var folderTree = GetFolderTree();
var folderPaneHeader = document.getElementById('folderpane-title'); var folderPaneHeader = document.getElementById('folderpane-title');
var folderTree = GetFolderTree(); var folderTree = GetFolderTree();
var database = GetFolderDatasource(); var database = GetFolderDatasource();
// load the folder view into the folder pane // load the folder view into the folder pane
folderPaneHeader.value = loadFolderViewForTree(aNewFolderView, GetFolderTree()); folderPaneHeader.value = loadFolderViewForTree(aNewFolderView, GetFolderTree());
// if the folder location picker is visible, load the folder view into the location // if the folder location picker is visible, load the folder view into the location
// picker as well. // picker as well.
var folderLocationPicker = document.getElementById('folder-location-container'); var folderLocationPicker = document.getElementById('folder-location-container');
if (folderLocationPicker) if (folderLocationPicker)
loadFolderViewForTree(aNewFolderView, document.getElementById('folderLocationPopup').tree); loadFolderViewForTree(aNewFolderView, document.getElementById('folderLocationPopup').tree);
@ -1136,7 +1136,7 @@ function OnUnloadFolderPane()
// in the thread pane. so if a user ran an old build, and then // in the thread pane. so if a user ran an old build, and then
// upgraded, they get the new column, and this causes problems. // upgraded, they get the new column, and this causes problems.
// We're trying to avoid a similar problem to bug #96979. // We're trying to avoid a similar problem to bug #96979.
// to work around this, we hide the column once, using the // to work around this, we hide the column once, using the
// "mailnews.ui.threadpane.version" pref. // "mailnews.ui.threadpane.version" pref.
function UpgradeThreadPaneUI() function UpgradeThreadPaneUI()
{ {
@ -1155,21 +1155,21 @@ function UpgradeThreadPaneUI()
var receivedCol = document.getElementById("receivedCol"); var receivedCol = document.getElementById("receivedCol");
var junkCol = document.getElementById("junkStatusCol"); var junkCol = document.getElementById("junkStatusCol");
if (threadPaneUIVersion < 5) if (threadPaneUIVersion < 5)
{ {
if (threadPaneUIVersion < 4) if (threadPaneUIVersion < 4)
{ {
if (threadPaneUIVersion < 3) if (threadPaneUIVersion < 3)
{ {
// in thunderbird, we are inserting the junk column just before the // in thunderbird, we are inserting the junk column just before the
// date column. // date column.
threadTree._reorderColumn(junkCol, dateCol, true); threadTree._reorderColumn(junkCol, dateCol, true);
} }
var senderCol = document.getElementById("senderCol"); var senderCol = document.getElementById("senderCol");
var recipientCol = document.getElementById("recipientCol"); var recipientCol = document.getElementById("recipientCol");
threadTree._reorderColumn(recipientCol, junkCol, true); threadTree._reorderColumn(recipientCol, junkCol, true);
threadTree._reorderColumn(senderCol, recipientCol, true); threadTree._reorderColumn(senderCol, recipientCol, true);
} // version 4 upgrades } // version 4 upgrades
@ -1177,7 +1177,7 @@ function UpgradeThreadPaneUI()
// version 5 adds a new column called attachments // version 5 adds a new column called attachments
var attachmentCol = document.getElementById("attachmentCol"); var attachmentCol = document.getElementById("attachmentCol");
var subjectCol = document.getElementById("subjectCol"); var subjectCol = document.getElementById("subjectCol");
threadTree._reorderColumn(attachmentCol, subjectCol, true); threadTree._reorderColumn(attachmentCol, subjectCol, true);
} // version 5 upgrades } // version 5 upgrades
@ -1206,9 +1206,9 @@ function OnLoadThreadPane()
function folderLocationPickerOnLoad() function folderLocationPickerOnLoad()
{ {
var folderLocationPicker = document.getElementById('folder-location-container'); var folderLocationPicker = document.getElementById('folder-location-container');
if (!folderLocationPicker) if (!folderLocationPicker)
return; return;
var locationTree = document.getElementById('folderLocationPopup').tree; var locationTree = document.getElementById('folderLocationPopup').tree;
locationTree.database.AddDataSource(accountManagerDataSource); locationTree.database.AddDataSource(accountManagerDataSource);
locationTree.database.AddDataSource(folderDataSource); locationTree.database.AddDataSource(folderDataSource);
@ -1223,16 +1223,16 @@ function OnLocationTreeSelect(menulist)
function UpdateFolderLocationPicker(resource) function UpdateFolderLocationPicker(resource)
{ {
var folderLocationPicker = document.getElementById('folder-location-container'); var folderLocationPicker = document.getElementById('folder-location-container');
if (!folderLocationPicker) if (!folderLocationPicker)
return; return;
var tree = GetFolderTree(); var tree = GetFolderTree();
var folders = document.getElementById('locationFolders'); var folders = document.getElementById('locationFolders');
var properties = ['BiffState', 'NewMessages', 'HasUnreadMessages', var properties = ['BiffState', 'NewMessages', 'HasUnreadMessages',
'SpecialFolder', 'IsServer', 'IsSecure', 'ServerType', 'NoSelect']; 'SpecialFolder', 'IsServer', 'IsSecure', 'ServerType', 'NoSelect'];
var label = GetFolderAttribute(tree, resource, 'FolderTreeName'); var label = GetFolderAttribute(tree, resource, 'FolderTreeName');
folders.setAttribute("label", label); folders.setAttribute("label", label);
for (var i in properties) for (var i in properties)
{ {
var property = properties[i]; var property = properties[i];
var value = GetFolderAttribute(tree, resource, property); var value = GetFolderAttribute(tree, resource, property);
@ -1264,7 +1264,7 @@ function GetSearchInput()
function GetMessagePane() function GetMessagePane()
{ {
if (!gMessagePane) if (!gMessagePane)
gMessagePane = document.getElementById("messagepanebox"); gMessagePane = document.getElementById("messagepanebox");
return gMessagePane; return gMessagePane;
} }
@ -1276,41 +1276,41 @@ function GetMessagePaneFrame()
function FindInSidebar(currentWindow, id) function FindInSidebar(currentWindow, id)
{ {
var item = currentWindow.document.getElementById(id); var item = currentWindow.document.getElementById(id);
if(item) if(item)
return item; return item;
for(var i = 0; i < currentWindow.frames.length; i++) for(var i = 0; i < currentWindow.frames.length; i++)
{ {
var frameItem = FindInSidebar(currentWindow.frames[i], id); var frameItem = FindInSidebar(currentWindow.frames[i], id);
if(frameItem) if(frameItem)
return frameItem; return frameItem;
} }
return null; return null;
} }
function GetThreadAndMessagePaneSplitter() function GetThreadAndMessagePaneSplitter()
{ {
if(gThreadAndMessagePaneSplitter) return gThreadAndMessagePaneSplitter; if(gThreadAndMessagePaneSplitter) return gThreadAndMessagePaneSplitter;
var splitter = document.getElementById('threadpane-splitter'); var splitter = document.getElementById('threadpane-splitter');
gThreadAndMessagePaneSplitter = splitter; gThreadAndMessagePaneSplitter = splitter;
return splitter; return splitter;
} }
function GetUnreadCountElement() function GetUnreadCountElement()
{ {
if(gUnreadCount) return gUnreadCount; if(gUnreadCount) return gUnreadCount;
var unreadCount = document.getElementById('unreadMessageCount'); var unreadCount = document.getElementById('unreadMessageCount');
gUnreadCount = unreadCount; gUnreadCount = unreadCount;
return unreadCount; return unreadCount;
} }
function GetTotalCountElement() function GetTotalCountElement()
{ {
if(gTotalCount) return gTotalCount; if(gTotalCount) return gTotalCount;
var totalCount = document.getElementById('totalMessageCount'); var totalCount = document.getElementById('totalMessageCount');
gTotalCount = totalCount; gTotalCount = totalCount;
return totalCount; return totalCount;
} }
function IsMessagePaneCollapsed() function IsMessagePaneCollapsed()
@ -1334,8 +1334,8 @@ function ClearThreadPaneSelection()
if (gDBView) { if (gDBView) {
var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView); var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView);
var treeSelection = treeView.selection; var treeSelection = treeView.selection;
if (treeSelection) if (treeSelection)
treeSelection.clearSelection(); treeSelection.clearSelection();
} }
} }
catch (ex) { catch (ex) {
@ -1440,7 +1440,7 @@ function FolderPaneDoubleClick(folderIndex, event)
if (!pref.getBoolPref("mailnews.reuse_thread_window2")) if (!pref.getBoolPref("mailnews.reuse_thread_window2"))
{ {
var folderResource = GetFolderResource(GetFolderTree(), folderIndex); var folderResource = GetFolderResource(GetFolderTree(), folderIndex);
// Open a new msg window only if we are double clicking on // Open a new msg window only if we are double clicking on
// folders or newsgroups. // folders or newsgroups.
MsgOpenNewWindowForFolder(folderResource.Value, -1 /* key */); MsgOpenNewWindowForFolder(folderResource.Value, -1 /* key */);
@ -1496,7 +1496,7 @@ function GetSelectedMsgFolders()
folderTree.view.selection.getRangeAt(i, startIndex, endIndex); folderTree.view.selection.getRangeAt(i, startIndex, endIndex);
for (var j = startIndex.value; j <= endIndex.value; j++) for (var j = startIndex.value; j <= endIndex.value; j++)
{ {
var folderResource = GetFolderResource(folderTree, j); var folderResource = GetFolderResource(folderTree, j);
if (folderResource.Value != "http://home.netscape.com/NC-rdf#PageTitleFakeAccount") { if (folderResource.Value != "http://home.netscape.com/NC-rdf#PageTitleFakeAccount") {
var msgFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder); var msgFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder);
if(msgFolder) if(msgFolder)
@ -1521,7 +1521,7 @@ function GetFirstSelectedMessage()
function GetSelectedIndices(dbView) function GetSelectedIndices(dbView)
{ {
try { try {
var indicesArray = {}; var indicesArray = {};
var length = {}; var length = {};
dbView.getIndicesForSelection(indicesArray,length); dbView.getIndicesForSelection(indicesArray,length);
return indicesArray.value; return indicesArray.value;
@ -1535,13 +1535,13 @@ function GetSelectedIndices(dbView)
function GetSelectedMessages() function GetSelectedMessages()
{ {
try { try {
var messageArray = {}; var messageArray = {};
var length = {}; var length = {};
var view = GetDBView(); var view = GetDBView();
view.getURIsForSelection(messageArray,length); view.getURIsForSelection(messageArray,length);
if (length.value) if (length.value)
return messageArray.value; return messageArray.value;
else else
return null; return null;
} }
catch (ex) { catch (ex) {
@ -1574,10 +1574,10 @@ function ClearMessageSelection()
function GetCompositeDataSource(command) function GetCompositeDataSource(command)
{ {
if (command == "GetNewMessages" || command == "NewFolder" || command == "MarkAllMessagesRead") if (command == "GetNewMessages" || command == "NewFolder" || command == "MarkAllMessagesRead")
return GetFolderDatasource(); return GetFolderDatasource();
return null; return null;
} }
// Figures out how many messages are selected (hilighted - does not necessarily // Figures out how many messages are selected (hilighted - does not necessarily
@ -1697,7 +1697,7 @@ function LoadNavigatedToMessage(msgHdr, folder, folderUri)
gStartMsgKey = msgHdr.messageKey; gStartMsgKey = msgHdr.messageKey;
SelectFolder(folderUri); SelectFolder(folderUri);
} }
} }
// Some of the per account junk mail settings have been // Some of the per account junk mail settings have been
@ -1708,7 +1708,7 @@ function MigrateJunkMailSettings()
var junkMailSettingsVersion = pref.getIntPref("mail.spam.version"); var junkMailSettingsVersion = pref.getIntPref("mail.spam.version");
if (!junkMailSettingsVersion) if (!junkMailSettingsVersion)
{ {
// get the default account, check to see if we have values for our // get the default account, check to see if we have values for our
// globally migrated prefs. // globally migrated prefs.
var defaultAccount; var defaultAccount;
try { try {
@ -1726,7 +1726,7 @@ function MigrateJunkMailSettings()
pref.setBoolPref("mail.spam.logging.enabled", pref.getBoolPref(prefix + "spamLoggingEnabled")); pref.setBoolPref("mail.spam.logging.enabled", pref.getBoolPref(prefix + "spamLoggingEnabled"));
if (pref.prefHasUserValue(prefix + "markAsReadOnSpam")) if (pref.prefHasUserValue(prefix + "markAsReadOnSpam"))
pref.setBoolPref("mail.spam.markAsReadOnSpam", pref.getBoolPref(prefix + "markAsReadOnSpam")); pref.setBoolPref("mail.spam.markAsReadOnSpam", pref.getBoolPref(prefix + "markAsReadOnSpam"));
} }
// bump the version so we don't bother doing this again. // bump the version so we don't bother doing this again.
pref.setIntPref("mail.spam.version", 1); pref.setIntPref("mail.spam.version", 1);
} }
@ -1756,8 +1756,8 @@ function MigrateFolderViews()
} }
} }
// Thunderbird has been storing old attachment download meta data in downloads.rdf // 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 // 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. // 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. // To migrate to the new download manager, remove downloads.rdf.
function MigrateAttachmentDownloadStore() function MigrateAttachmentDownloadStore()
@ -1770,9 +1770,9 @@ function MigrateAttachmentDownloadStore()
var downloadsFile = dirService.get("DLoads", Components.interfaces.nsIFile); var downloadsFile = dirService.get("DLoads", Components.interfaces.nsIFile);
if (downloadsFile && downloadsFile.exists()) if (downloadsFile && downloadsFile.exists())
downloadsFile.remove(false); downloadsFile.remove(false);
// bump the version so we don't bother doing this again. // bump the version so we don't bother doing this again.
pref.setIntPref("mail.attachment.store.version", 1); pref.setIntPref("mail.attachment.store.version", 1);
} }
} }

View File

@ -41,10 +41,10 @@
<!DOCTYPE dialog SYSTEM "chrome://messenger/locale/msgSynchronize.dtd" > <!DOCTYPE dialog SYSTEM "chrome://messenger/locale/msgSynchronize.dtd" >
<dialog xmlns:nc="http://home.netscape.com/NC-rdf#" <dialog xmlns:nc="http://home.netscape.com/NC-rdf#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="select-offline" id="select-offline"
title="&MsgSelect.label;" title="&MsgSelect.label;"
width="450" height="400" width="450" height="400"
persist="width height" persist="width height"
@ -54,7 +54,7 @@
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/> <stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
<stringbundle id="bundle_brand" src="chrome://branding/locale/brand.properties"/> <stringbundle id="bundle_brand" src="chrome://branding/locale/brand.properties"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/> <script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailWindowOverlay.js"/> <script type="application/x-javascript" src="chrome://messenger/content/mailWindowOverlay.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/commandglue.js"/> <script type="application/x-javascript" src="chrome://messenger/content/commandglue.js"/>
@ -62,7 +62,7 @@
<script type="application/x-javascript" src="chrome://messenger/content/mailWindow.js"/> <script type="application/x-javascript" src="chrome://messenger/content/mailWindow.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgMail3PaneWindow.js"/> <script type="application/x-javascript" src="chrome://messenger/content/msgMail3PaneWindow.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgSynchronize.js"/> <script type="application/x-javascript" src="chrome://messenger/content/msgSynchronize.js"/>
<description class="desc">&MsgSelectDesc.label;</description> <description class="desc">&MsgSelectDesc.label;</description>
<tree id="synchronizeTree" flex="1" hidecolumnpicker="true" <tree id="synchronizeTree" flex="1" hidecolumnpicker="true"
@ -100,7 +100,7 @@
predicate="http://home.netscape.com/NC-rdf#Synchronize" predicate="http://home.netscape.com/NC-rdf#Synchronize"
object="?synchronize"/> object="?synchronize"/>
</bindings> </bindings>
<action> <action>
<treechildren> <treechildren>
<treeitem uri="?member"> <treeitem uri="?member">
@ -116,7 +116,7 @@
</template> </template>
<treecols> <treecols>
<treecol id="folderNameCol" flex="5" persist="hidden width" label="&MsgSelectItems.label;" primary="true"/> <treecol id="folderNameCol" flex="5" persist="hidden width" label="&MsgSelectItems.label;" primary="true"/>
<splitter class="tree-splitter"/> <splitter class="tree-splitter"/>
<treecol id="syncCol" flex="1" persist="hidden width" label="&MsgSelectInd.label;" cycler="true"/> <treecol id="syncCol" flex="1" persist="hidden width" label="&MsgSelectInd.label;" cycler="true"/>
</treecols> </treecols>
</tree> </tree>

View File

@ -36,7 +36,7 @@
* the terms of any one of the MPL, the GPL or the LGPL. * the terms of any one of the MPL, the GPL or the LGPL.
* *
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
var gSubscribeTree = null; var gSubscribeTree = null;
var gSearchTree; var gSearchTree;
var okCallback = null; var okCallback = null;
@ -109,23 +109,23 @@ function onServerClick(event)
function SetUpServerMenu() function SetUpServerMenu()
{ {
//dump("SetUpServerMenu()\n"); //dump("SetUpServerMenu()\n");
var serverMenu = document.getElementById("serverMenu"); var serverMenu = document.getElementById("serverMenu");
var menuitems = serverMenu.getElementsByAttribute("id", gServerURI); var menuitems = serverMenu.getElementsByAttribute("id", gServerURI);
try { try {
//dump("gServerURI="+gServerURI+"\n"); //dump("gServerURI="+gServerURI+"\n");
//dump("menuitems="+menuitems+"\n"); //dump("menuitems="+menuitems+"\n");
//dump("menuitems[0]="+menuitems[0]+"\n"); //dump("menuitems[0]="+menuitems[0]+"\n");
//dump("serverMenu="+serverMenu+"\n"); //dump("serverMenu="+serverMenu+"\n");
serverMenu.selectedItem = menuitems[0]; serverMenu.selectedItem = menuitems[0];
} }
catch (ex) { catch (ex) {
//dump("failed to set the selected server: " + ex + "\n"); //dump("failed to set the selected server: " + ex + "\n");
} }
SetServerTypeSpecificTextValues(); SetServerTypeSpecificTextValues();
} }
var MySubscribeListener = { var MySubscribeListener = {
@ -145,7 +145,7 @@ var MySubscribeListener = {
document.getElementById("refreshButton").disabled = false; document.getElementById("refreshButton").disabled = false;
document.getElementById("currentListTab").disabled = false; document.getElementById("currentListTab").disabled = false;
document.getElementById("newGroupsTab").disabled = false; document.getElementById("newGroupsTab").disabled = false;
} }
}; };
function SetUpTree(forceToServer, getOnlyNew) function SetUpTree(forceToServer, getOnlyNew)
@ -156,7 +156,7 @@ function SetUpTree(forceToServer, getOnlyNew)
var server = GetMsgFolderFromUri(gServerURI, true).server; var server = GetMsgFolderFromUri(gServerURI, true).server;
try try
{ {
CleanUpSearchView(); CleanUpSearchView();
gSubscribableServer = server.QueryInterface(Components.interfaces.nsISubscribableServer); gSubscribableServer = server.QueryInterface(Components.interfaces.nsISubscribableServer);
gSubscribeTree.setAttribute('ref',null); gSubscribeTree.setAttribute('ref',null);
@ -186,7 +186,7 @@ function SetUpTree(forceToServer, getOnlyNew)
gSubscribableServer.startPopulating(msgWindow, forceToServer, getOnlyNew); gSubscribableServer.startPopulating(msgWindow, forceToServer, getOnlyNew);
} }
catch (ex) catch (ex)
{ {
dump("failed to populate subscribe ds: " + ex + "\n"); dump("failed to populate subscribe ds: " + ex + "\n");
} }
@ -221,7 +221,7 @@ function SubscribeOnLoad()
//dump("SubscribeOnLoad()\n"); //dump("SubscribeOnLoad()\n");
gSubscribeBundle = document.getElementById("bundle_subscribe"); gSubscribeBundle = document.getElementById("bundle_subscribe");
gMessengerBundle = document.getElementById("bundle_messenger"); gMessengerBundle = document.getElementById("bundle_messenger");
gSubscribeTree = document.getElementById("subscribeTree"); gSubscribeTree = document.getElementById("subscribeTree");
gSearchTree = document.getElementById("searchTree"); gSearchTree = document.getElementById("searchTree");
gSearchTreeBoxObject = document.getElementById("searchTree").treeBoxObject; gSearchTreeBoxObject = document.getElementById("searchTree").treeBoxObject;
@ -231,57 +231,57 @@ function SubscribeOnLoad()
gSubscribeDeck = document.getElementById("subscribedeck"); gSubscribeDeck = document.getElementById("subscribedeck");
msgWindow = Components.classes[msgWindowContractID].createInstance(Components.interfaces.nsIMsgWindow); msgWindow = Components.classes[msgWindowContractID].createInstance(Components.interfaces.nsIMsgWindow);
msgWindow.domWindow = window; msgWindow.domWindow = window;
msgWindow.statusFeedback = gStatusFeedback; msgWindow.statusFeedback = gStatusFeedback;
msgWindow.rootDocShell.allowAuth = true; msgWindow.rootDocShell.allowAuth = true;
msgWindow.rootDocShell.appType = Components.interfaces.nsIDocShell.APP_TYPE_MAIL; msgWindow.rootDocShell.appType = Components.interfaces.nsIDocShell.APP_TYPE_MAIL;
// look in arguments[0] for parameters // look in arguments[0] for parameters
if (window.arguments && window.arguments[0]) { if (window.arguments && window.arguments[0]) {
if ( window.arguments[0].okCallback ) { if ( window.arguments[0].okCallback ) {
top.okCallback = window.arguments[0].okCallback; top.okCallback = window.arguments[0].okCallback;
} }
} }
gServerURI = null; gServerURI = null;
if (window.arguments[0].preselectedURI) { if (window.arguments[0].preselectedURI) {
var uri = window.arguments[0].preselectedURI; var uri = window.arguments[0].preselectedURI;
//dump("subscribe: got a uri," + uri + "\n"); //dump("subscribe: got a uri," + uri + "\n");
var folder = GetMsgFolderFromUri(uri, true); var folder = GetMsgFolderFromUri(uri, true);
//dump("folder="+folder+"\n"); //dump("folder="+folder+"\n");
//dump("folder.server="+folder.server+"\n"); //dump("folder.server="+folder.server+"\n");
try { try {
CleanUpSearchView(); CleanUpSearchView();
gSubscribableServer = folder.server.QueryInterface(Components.interfaces.nsISubscribableServer); gSubscribableServer = folder.server.QueryInterface(Components.interfaces.nsISubscribableServer);
// enable (or disable) the search related UI // enable (or disable) the search related UI
EnableSearchUI(); EnableSearchUI();
gServerURI = folder.server.serverURI; gServerURI = folder.server.serverURI;
} }
catch (ex) { catch (ex) {
//dump("not a subscribable server\n"); //dump("not a subscribable server\n");
CleanUpSearchView(); CleanUpSearchView();
gSubscribableServer = null; gSubscribableServer = null;
gServerURI = null; gServerURI = null;
} }
} }
if (!gServerURI) { if (!gServerURI) {
//dump("subscribe: no uri\n"); //dump("subscribe: no uri\n");
//dump("xxx todo: use the default news server. right now, I'm just using the first server\n"); //dump("xxx todo: use the default news server. right now, I'm just using the first server\n");
var serverMenu = document.getElementById("serverMenu"); var serverMenu = document.getElementById("serverMenu");
var menuitems = serverMenu.getElementsByTagName("menuitem"); var menuitems = serverMenu.getElementsByTagName("menuitem");
if (menuitems.length > 1) {
gServerURI = menuitems[1].id;
}
else {
//dump("xxx todo none of your servers are subscribable\n");
//dump("xxx todo fix this by disabling subscribe if no subscribable server or, add a CREATE SERVER button, like in 4.x\n");
return;
}
}
SetUpServerMenu(); if (menuitems.length > 1) {
gServerURI = menuitems[1].id;
}
else {
//dump("xxx todo none of your servers are subscribable\n");
//dump("xxx todo fix this by disabling subscribe if no subscribable server or, add a CREATE SERVER button, like in 4.x\n");
return;
}
}
SetUpServerMenu();
ShowCurrentList(); ShowCurrentList();
@ -290,15 +290,15 @@ function SubscribeOnLoad()
function subscribeOK() function subscribeOK()
{ {
//dump("in subscribeOK()\n") //dump("in subscribeOK()\n")
if (top.okCallback) { if (top.okCallback) {
top.okCallback(top.gChangeTable); top.okCallback(top.gChangeTable);
} }
Stop(); Stop();
if (gSubscribableServer) { if (gSubscribableServer) {
gSubscribableServer.subscribeCleanup(); gSubscribableServer.subscribeCleanup();
} }
return true; return true;
} }
function subscribeCancel() function subscribeCancel()
@ -317,7 +317,7 @@ function SetState(name,state)
StateChanged(name,state); StateChanged(name,state);
} }
function changeTableRecord(server, name, state) function changeTableRecord(server, name, state)
{ {
this.server = server; this.server = server;
this.name = name; this.name = name;
@ -360,7 +360,7 @@ function SearchOnClick(event)
if (col.value.id == "subscribedColumn2") { if (col.value.id == "subscribedColumn2") {
if (event.detail != 2) { if (event.detail != 2) {
// single clicked on the check box // single clicked on the check box
// (in the "subscribedColumn2" column) reverse state // (in the "subscribedColumn2" column) reverse state
// if double click, do nothing // if double click, do nothing
ReverseStateFromRow(row.value); ReverseStateFromRow(row.value);
@ -399,12 +399,12 @@ function SetStateFromRow(row, state)
function SetSubscribeState(state) function SetSubscribeState(state)
{ {
try { try {
// we need to iterate over the tree selection, and set the state for // we need to iterate over the tree selection, and set the state for
// all rows in the selection // all rows in the selection
var inSearchMode = InSearchMode(); var inSearchMode = InSearchMode();
var view = inSearchMode ? gSearchView : gSubscribeTree.view; var view = inSearchMode ? gSearchView : gSubscribeTree.view;
var colId = inSearchMode ? "nameColumn2" : "nameColumn"; var colId = inSearchMode ? "nameColumn2" : "nameColumn";
var sel = view.selection; var sel = view.selection;
for (var i = 0; i < sel.getRangeCount(); ++i) { for (var i = 0; i < sel.getRangeCount(); ++i) {
var start = {}, end = {}; var start = {}, end = {};
@ -419,7 +419,7 @@ function SetSubscribeState(state)
} }
} }
} }
if (inSearchMode) { if (inSearchMode) {
// force a repaint // force a repaint
InvalidateSearchTree(); InvalidateSearchTree();
@ -451,7 +451,7 @@ function SubscribeOnClick(event)
// we only care about button 0 (left click) events // we only care about button 0 (left click) events
if (event.button != 0 || event.originalTarget.localName != "treechildren") if (event.button != 0 || event.originalTarget.localName != "treechildren")
return; return;
var row = {}, col = {}, obj = {}; var row = {}, col = {}, obj = {};
gSubscribeTree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, col, obj); gSubscribeTree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, col, obj);
if (row.value == -1 || row.value > (gSubscribeTree.view.rowCount - 1)) if (row.value == -1 || row.value > (gSubscribeTree.view.rowCount - 1))
@ -463,7 +463,7 @@ function SubscribeOnClick(event)
if (!gSubscribeTree.view.isContainer(row.value)) { if (!gSubscribeTree.view.isContainer(row.value)) {
ReverseStateFromNode(row.value); ReverseStateFromNode(row.value);
return; return;
} }
} }
else if (event.detail == 1) else if (event.detail == 1)
{ {
@ -572,7 +572,7 @@ function onSearchTreeKeyPress(event)
if (event.charCode != KeyEvent.DOM_VK_SPACE) if (event.charCode != KeyEvent.DOM_VK_SPACE)
return; return;
var treeSelection = gSearchView.selection; var treeSelection = gSearchView.selection;
for (var i=0;i<treeSelection.getRangeCount();i++) { for (var i=0;i<treeSelection.getRangeCount();i++) {
var start = {}, end = {}; var start = {}, end = {};
treeSelection.getRangeAt(i,start,end); treeSelection.getRangeAt(i,start,end);
@ -590,7 +590,7 @@ function onSubscribeTreeKeyPress(event)
if (event.charCode != KeyEvent.DOM_VK_SPACE) if (event.charCode != KeyEvent.DOM_VK_SPACE)
return; return;
var treeSelection = gSubscribeTree.view.selection; var treeSelection = gSubscribeTree.view.selection;
for (var i=0;i<treeSelection.getRangeCount();i++) { for (var i=0;i<treeSelection.getRangeCount();i++) {
var start = {}, end = {}; var start = {}, end = {};
treeSelection.getRangeAt(i,start,end); treeSelection.getRangeAt(i,start,end);
@ -600,7 +600,7 @@ function onSubscribeTreeKeyPress(event)
} }
function doHelpButton() function doHelpButton()
{ {
openHelp("mail-subscribe"); openHelp("mail-subscribe");
} }

View File

@ -43,7 +43,7 @@
* widget/menu item, which gets some context (like the current selection) * widget/menu item, which gets some context (like the current selection)
* and then calls a function/command in commandglue * and then calls a function/command in commandglue
*/ */
//The eventual goal is for this file to go away and its contents to be brought into //The eventual goal is for this file to go away and its contents to be brought into
//mailWindowOverlay.js. This is currently being done. //mailWindowOverlay.js. This is currently being done.
@ -76,20 +76,20 @@ function GetSelectedFolderURI()
return null; return null;
} }
function MsgRenameFolder() function MsgRenameFolder()
{ {
var preselectedURI = GetSelectedFolderURI(); var preselectedURI = GetSelectedFolderURI();
var folderTree = GetFolderTree(); var folderTree = GetFolderTree();
var name = GetFolderNameFromUri(preselectedURI, folderTree); var name = GetFolderNameFromUri(preselectedURI, folderTree);
dump("preselectedURI = " + preselectedURI + "\n"); dump("preselectedURI = " + preselectedURI + "\n");
var dialog = window.openDialog( var dialog = window.openDialog(
"chrome://messenger/content/renameFolderDialog.xul", "chrome://messenger/content/renameFolderDialog.xul",
"newFolder", "newFolder",
"chrome,titlebar,modal", "chrome,titlebar,modal",
{preselectedURI: preselectedURI, {preselectedURI: preselectedURI,
okCallback: RenameFolder, name: name}); okCallback: RenameFolder, name: name});
} }
function RenameFolder(name,uri) function RenameFolder(name,uri)
@ -98,7 +98,7 @@ function RenameFolder(name,uri)
var folderTree = GetFolderTree(); var folderTree = GetFolderTree();
if (folderTree) if (folderTree)
{ {
if (uri && (uri != "") && name && (name != "")) if (uri && (uri != "") && name && (name != ""))
{ {
var selectedFolder = GetResourceFromUri(uri); var selectedFolder = GetResourceFromUri(uri);
if (gDBView) if (gDBView)
@ -119,18 +119,18 @@ function RenameFolder(name,uri)
dump ("Exception : RenameFolder \n"); dump ("Exception : RenameFolder \n");
} }
} }
else else
{ {
dump("no name or nothing selected\n"); dump("no name or nothing selected\n");
} }
} }
else else
{ {
dump("no folder tree\n"); dump("no folder tree\n");
} }
} }
function MsgEmptyTrash() function MsgEmptyTrash()
{ {
var folderTree = GetFolderTree(); var folderTree = GetFolderTree();
var startIndex = {}; var startIndex = {};
@ -143,13 +143,13 @@ function MsgEmptyTrash()
messenger.emptyTrash(GetFolderDatasource(), folderResource); messenger.emptyTrash(GetFolderDatasource(), folderResource);
} }
catch(e) catch(e)
{ {
dump ("Exception : messenger.emptyTrash \n"); dump ("Exception : messenger.emptyTrash \n");
} }
} }
} }
function MsgCompactFolder(isAll) function MsgCompactFolder(isAll)
{ {
// Get the selected folders. // Get the selected folders.
var selectedFolders = GetSelectedMsgFolders(); var selectedFolders = GetSelectedMsgFolders();
@ -165,7 +165,7 @@ function MsgCompactFolder(isAll)
var expungedBytes = msgfolder.expungedBytes; var expungedBytes = msgfolder.expungedBytes;
if (expungedBytes > 0) if (expungedBytes > 0)
{ {
if (gDBView) if (gDBView)
gCurrentlyDisplayedMessage = gDBView.currentlyDisplayedMessage; gCurrentlyDisplayedMessage = gDBView.currentlyDisplayedMessage;
@ -178,7 +178,7 @@ function MsgCompactFolder(isAll)
if (!isAll) //you have one local folder with no room to compact if (!isAll) //you have one local folder with no room to compact
return; return;
} }
} }
try try
{ {
messenger.compactFolder(GetFolderDatasource(), resource, isAll); messenger.compactFolder(GetFolderDatasource(), resource, isAll);
@ -248,7 +248,7 @@ function MsgFolderProperties(tabID)
} }
if (msgFolder.flags & MSG_FOLDER_FLAG_VIRTUAL) if (msgFolder.flags & MSG_FOLDER_FLAG_VIRTUAL)
{ {
// virtual folders get there own property dialog that contains all of the // virtual folders get there own property dialog that contains all of the
// search information related to the virtual folder. // search information related to the virtual folder.
MsgVirtualFolderProperties(true); MsgVirtualFolderProperties(true);
@ -265,7 +265,7 @@ function MsgFolderProperties(tabID)
"chrome,centerscreen,titlebar,modal", "chrome,centerscreen,titlebar,modal",
{preselectedURI:preselectedURI, serverType:serverType, {preselectedURI:preselectedURI, serverType:serverType,
msgWindow:msgWindow, title:windowTitle, msgWindow:msgWindow, title:windowTitle,
okCallback:FolderProperties, okCallback:FolderProperties,
tabID:tabID, name:name, tabID:tabID, name:name,
rebuildSummaryCallback:RebuildSummaryFile}); rebuildSummaryCallback:RebuildSummaryFile});
} }
@ -305,15 +305,15 @@ function MsgToggleMessagePane()
ChangeMessagePaneVisibility(IsMessagePaneCollapsed()); ChangeMessagePaneVisibility(IsMessagePaneCollapsed());
} }
function MsgSetFolderCharset() function MsgSetFolderCharset()
{ {
MsgFolderProperties(); MsgFolderProperties();
} }
// Given a URI we would like to return corresponding message folder here. // Given a URI we would like to return corresponding message folder here.
// An additonal input param which specifies whether or not to check folder // An additonal input param which specifies whether or not to check folder
// attributes (like if there exists a parent or is it a server) is also passed // attributes (like if there exists a parent or is it a server) is also passed
// to this routine. Qualifying against those checks would return an existing // to this routine. Qualifying against those checks would return an existing
// folder. Callers who don't want to check those attributes will specify the // folder. Callers who don't want to check those attributes will specify the
// same and then this routine will simply return a msgfolder. This scenario // same and then this routine will simply return a msgfolder. This scenario
// applies to a new imap account creation where special folders are created // applies to a new imap account creation where special folders are created
@ -344,5 +344,5 @@ function GetResourceFromUri(uri)
var resource = RDF.GetResource(uri); var resource = RDF.GetResource(uri);
return resource; return resource;
} }

View File

@ -10,28 +10,28 @@ function abNameOnLoad()
gOkButton = document.documentElement.getButton('accept'); gOkButton = document.documentElement.getButton('accept');
// look in arguments[0] for parameters // look in arguments[0] for parameters
if ("arguments" in window && window.arguments[0]) if ("arguments" in window && window.arguments[0])
{ {
if ("title" in window.arguments[0]) if ("title" in window.arguments[0])
document.title = window.arguments[0].title; document.title = window.arguments[0].title;
if ("okCallback" in window.arguments[0]) if ("okCallback" in window.arguments[0])
top.okCallback = window.arguments[0].okCallback; top.okCallback = window.arguments[0].okCallback;
if ("name" in window.arguments[0]) if ("name" in window.arguments[0])
abName = window.arguments[0].name; abName = window.arguments[0].name;
if ("canRename" in window.arguments[0]) if ("canRename" in window.arguments[0])
gCanRename = window.arguments[0].canRename; gCanRename = window.arguments[0].canRename;
} }
// focus on input // focus on input
gNameInput = document.getElementById('name'); gNameInput = document.getElementById('name');
if (gNameInput) { if (gNameInput) {
if (abName) if (abName)
gNameInput.value = abName; gNameInput.value = abName;
if (gCanRename) if (gCanRename)
gNameInput.focus(); gNameInput.focus();
else else
@ -40,15 +40,15 @@ function abNameOnLoad()
abNameDoOkEnabling() abNameDoOkEnabling()
moveToAlertPosition(); moveToAlertPosition();
} }
function abNameOKButton() function abNameOKButton()
{ {
if (top.okCallback && gCanRename) if (top.okCallback && gCanRename)
top.okCallback(gNameInput.value.replace(/^\s+|\s+$/g, '')); top.okCallback(gNameInput.value.replace(/^\s+|\s+$/g, ''));
return true; return true;
} }
function abNameDoOkEnabling() function abNameDoOkEnabling()

View File

@ -47,7 +47,7 @@ gPrefs = gPrefs.QueryInterface(Components.interfaces.nsIPrefBranch);
var gProfileDirURL; var gProfileDirURL;
var gMapItURLFormat = gPrefs.getComplexValue("mail.addr_book.mapit_url.format", var gMapItURLFormat = gPrefs.getComplexValue("mail.addr_book.mapit_url.format",
Components.interfaces.nsIPrefLocalizedString).data; Components.interfaces.nsIPrefLocalizedString).data;
var gAddrbookSession = Components.classes["@mozilla.org/addressbook/services/session;1"].getService().QueryInterface(Components.interfaces.nsIAddrBookSession); var gAddrbookSession = Components.classes["@mozilla.org/addressbook/services/session;1"].getService().QueryInterface(Components.interfaces.nsIAddrBookSession);
@ -91,83 +91,83 @@ function OnLoadCardView()
zCustom3 = gAddressBookBundle.getString("propertyCustom3"); zCustom3 = gAddressBookBundle.getString("propertyCustom3");
zCustom4 = gAddressBookBundle.getString("propertyCustom4"); zCustom4 = gAddressBookBundle.getString("propertyCustom4");
var doc = document; var doc = document;
/* data for address book, prefixes: "cvb" = card view box
"cvh" = crad view header
"cv" = card view (normal fields) */
cvData = new Object;
// Card View Box /* data for address book, prefixes: "cvb" = card view box
cvData.CardViewBox = doc.getElementById("CardViewInnerBox"); "cvh" = crad view header
// Title "cv" = card view (normal fields) */
cvData.CardTitle = doc.getElementById("CardTitle"); cvData = new Object;
// Name section
cvData.cvbContact = doc.getElementById("cvbContact"); // Card View Box
cvData.cvhContact = doc.getElementById("cvhContact"); cvData.CardViewBox = doc.getElementById("CardViewInnerBox");
cvData.cvNickname = doc.getElementById("cvNickname"); // Title
cvData.cvDisplayName = doc.getElementById("cvDisplayName"); cvData.CardTitle = doc.getElementById("CardTitle");
cvData.cvEmail1Box = doc.getElementById("cvEmail1Box"); // Name section
cvData.cvEmail1 = doc.getElementById("cvEmail1"); cvData.cvbContact = doc.getElementById("cvbContact");
cvData.cvScreennameBox = doc.getElementById("cvScreennameBox"); cvData.cvhContact = doc.getElementById("cvhContact");
cvData.cvNickname = doc.getElementById("cvNickname");
cvData.cvDisplayName = doc.getElementById("cvDisplayName");
cvData.cvEmail1Box = doc.getElementById("cvEmail1Box");
cvData.cvEmail1 = doc.getElementById("cvEmail1");
cvData.cvScreennameBox = doc.getElementById("cvScreennameBox");
cvData.cvAimPresence = doc.getElementById("cvAimPresence"); cvData.cvAimPresence = doc.getElementById("cvAimPresence");
cvData.cvScreenname = doc.getElementById("cvScreenname"); cvData.cvScreenname = doc.getElementById("cvScreenname");
cvData.cvBuddyIcon = doc.getElementById("cvBuddyIcon"); cvData.cvBuddyIcon = doc.getElementById("cvBuddyIcon");
cvData.cvListNameBox = doc.getElementById("cvListNameBox"); cvData.cvListNameBox = doc.getElementById("cvListNameBox");
cvData.cvListName = doc.getElementById("cvListName"); cvData.cvListName = doc.getElementById("cvListName");
cvData.cvEmail2Box = doc.getElementById("cvEmail2Box"); cvData.cvEmail2Box = doc.getElementById("cvEmail2Box");
cvData.cvEmail2 = doc.getElementById("cvEmail2"); cvData.cvEmail2 = doc.getElementById("cvEmail2");
// Home section // Home section
cvData.cvbHome = doc.getElementById("cvbHome"); cvData.cvbHome = doc.getElementById("cvbHome");
cvData.cvhHome = doc.getElementById("cvhHome"); cvData.cvhHome = doc.getElementById("cvhHome");
cvData.cvHomeAddress = doc.getElementById("cvHomeAddress"); cvData.cvHomeAddress = doc.getElementById("cvHomeAddress");
cvData.cvHomeAddress2 = doc.getElementById("cvHomeAddress2"); cvData.cvHomeAddress2 = doc.getElementById("cvHomeAddress2");
cvData.cvHomeCityStZip = doc.getElementById("cvHomeCityStZip"); cvData.cvHomeCityStZip = doc.getElementById("cvHomeCityStZip");
cvData.cvHomeCountry = doc.getElementById("cvHomeCountry"); cvData.cvHomeCountry = doc.getElementById("cvHomeCountry");
cvData.cvbHomeMapItBox = doc.getElementById("cvbHomeMapItBox"); cvData.cvbHomeMapItBox = doc.getElementById("cvbHomeMapItBox");
cvData.cvHomeMapIt = doc.getElementById("cvHomeMapIt"); cvData.cvHomeMapIt = doc.getElementById("cvHomeMapIt");
cvData.cvHomeWebPageBox = doc.getElementById("cvHomeWebPageBox"); cvData.cvHomeWebPageBox = doc.getElementById("cvHomeWebPageBox");
cvData.cvHomeWebPage = doc.getElementById("cvHomeWebPage"); cvData.cvHomeWebPage = doc.getElementById("cvHomeWebPage");
// Other section // Other section
cvData.cvbOther = doc.getElementById("cvbOther"); cvData.cvbOther = doc.getElementById("cvbOther");
cvData.cvhOther = doc.getElementById("cvhOther"); cvData.cvhOther = doc.getElementById("cvhOther");
cvData.cvCustom1 = doc.getElementById("cvCustom1"); cvData.cvCustom1 = doc.getElementById("cvCustom1");
cvData.cvCustom2 = doc.getElementById("cvCustom2"); cvData.cvCustom2 = doc.getElementById("cvCustom2");
cvData.cvCustom3 = doc.getElementById("cvCustom3"); cvData.cvCustom3 = doc.getElementById("cvCustom3");
cvData.cvCustom4 = doc.getElementById("cvCustom4"); cvData.cvCustom4 = doc.getElementById("cvCustom4");
cvData.cvNotes = doc.getElementById("cvNotes"); cvData.cvNotes = doc.getElementById("cvNotes");
// Description section (mailing lists only) // Description section (mailing lists only)
cvData.cvbDescription = doc.getElementById("cvbDescription"); cvData.cvbDescription = doc.getElementById("cvbDescription");
cvData.cvhDescription = doc.getElementById("cvhDescription"); cvData.cvhDescription = doc.getElementById("cvhDescription");
cvData.cvDescription = doc.getElementById("cvDescription"); cvData.cvDescription = doc.getElementById("cvDescription");
// Addresses section (mailing lists only) // Addresses section (mailing lists only)
cvData.cvbAddresses = doc.getElementById("cvbAddresses"); cvData.cvbAddresses = doc.getElementById("cvbAddresses");
cvData.cvhAddresses = doc.getElementById("cvhAddresses"); cvData.cvhAddresses = doc.getElementById("cvhAddresses");
cvData.cvAddresses = doc.getElementById("cvAddresses"); cvData.cvAddresses = doc.getElementById("cvAddresses");
// Phone section // Phone section
cvData.cvbPhone = doc.getElementById("cvbPhone"); cvData.cvbPhone = doc.getElementById("cvbPhone");
cvData.cvhPhone = doc.getElementById("cvhPhone"); cvData.cvhPhone = doc.getElementById("cvhPhone");
cvData.cvPhWork = doc.getElementById("cvPhWork"); cvData.cvPhWork = doc.getElementById("cvPhWork");
cvData.cvPhHome = doc.getElementById("cvPhHome"); cvData.cvPhHome = doc.getElementById("cvPhHome");
cvData.cvPhFax = doc.getElementById("cvPhFax"); cvData.cvPhFax = doc.getElementById("cvPhFax");
cvData.cvPhCellular = doc.getElementById("cvPhCellular"); cvData.cvPhCellular = doc.getElementById("cvPhCellular");
cvData.cvPhPager = doc.getElementById("cvPhPager"); cvData.cvPhPager = doc.getElementById("cvPhPager");
// Work section // Work section
cvData.cvbWork = doc.getElementById("cvbWork"); cvData.cvbWork = doc.getElementById("cvbWork");
cvData.cvhWork = doc.getElementById("cvhWork"); cvData.cvhWork = doc.getElementById("cvhWork");
cvData.cvJobTitle = doc.getElementById("cvJobTitle"); cvData.cvJobTitle = doc.getElementById("cvJobTitle");
cvData.cvDepartment = doc.getElementById("cvDepartment"); cvData.cvDepartment = doc.getElementById("cvDepartment");
cvData.cvCompany = doc.getElementById("cvCompany"); cvData.cvCompany = doc.getElementById("cvCompany");
cvData.cvWorkAddress = doc.getElementById("cvWorkAddress"); cvData.cvWorkAddress = doc.getElementById("cvWorkAddress");
cvData.cvWorkAddress2 = doc.getElementById("cvWorkAddress2"); cvData.cvWorkAddress2 = doc.getElementById("cvWorkAddress2");
cvData.cvWorkCityStZip = doc.getElementById("cvWorkCityStZip"); cvData.cvWorkCityStZip = doc.getElementById("cvWorkCityStZip");
cvData.cvWorkCountry = doc.getElementById("cvWorkCountry"); cvData.cvWorkCountry = doc.getElementById("cvWorkCountry");
cvData.cvbWorkMapItBox = doc.getElementById("cvbWorkMapItBox"); cvData.cvbWorkMapItBox = doc.getElementById("cvbWorkMapItBox");
cvData.cvWorkMapIt = doc.getElementById("cvWorkMapIt"); cvData.cvWorkMapIt = doc.getElementById("cvWorkMapIt");
cvData.cvWorkWebPageBox = doc.getElementById("cvWorkWebPageBox"); cvData.cvWorkWebPageBox = doc.getElementById("cvWorkWebPageBox");
cvData.cvWorkWebPage = doc.getElementById("cvWorkWebPage"); cvData.cvWorkWebPage = doc.getElementById("cvWorkWebPage");
} }
// XXX todo // XXX todo
// some similar code (in spirit) already exists, see OnLoadEditList() // some similar code (in spirit) already exists, see OnLoadEditList()
// perhaps we could combine and put in abCommon.js? // perhaps we could combine and put in abCommon.js?
@ -196,7 +196,7 @@ function GoIM()
function DisplayCardViewPane(card) function DisplayCardViewPane(card)
{ {
var generatedName = gAddrbookSession.generateNameFromCard(card, gPrefs.getIntPref("mail.addr_book.lastnamefirst")); var generatedName = gAddrbookSession.generateNameFromCard(card, gPrefs.getIntPref("mail.addr_book.lastnamefirst"));
var data = top.cvData; var data = top.cvData;
var visible; var visible;
@ -211,7 +211,7 @@ function DisplayCardViewPane(card)
cvSetNode(data.CardTitle, gAddressBookBundle.getFormattedString("viewListTitle", [generatedName])); cvSetNode(data.CardTitle, gAddressBookBundle.getFormattedString("viewListTitle", [generatedName]));
else else
cvSetNode(data.CardTitle, gAddressBookBundle.getFormattedString("viewCardTitle", [titleString])); cvSetNode(data.CardTitle, gAddressBookBundle.getFormattedString("viewCardTitle", [titleString]));
// Contact section // Contact section
cvSetNodeWithLabel(data.cvNickname, zNickname, card.nickName); cvSetNodeWithLabel(data.cvNickname, zNickname, card.nickName);
@ -223,7 +223,7 @@ function DisplayCardViewPane(card)
visible = HandleLink(data.cvListName, zListName, card.displayName, data.cvListNameBox, "mailto:" + encodeURIComponent(GenerateAddressFromCard(card))) || visible; visible = HandleLink(data.cvListName, zListName, card.displayName, data.cvListNameBox, "mailto:" + encodeURIComponent(GenerateAddressFromCard(card))) || visible;
} }
else { else {
// listname always hidden if not a mailing list // listname always hidden if not a mailing list
cvSetVisible(data.cvListNameBox, false); cvSetVisible(data.cvListNameBox, false);
@ -234,15 +234,15 @@ function DisplayCardViewPane(card)
var goimURL = "aim:goim?screenname=" + card.aimScreenName; var goimURL = "aim:goim?screenname=" + card.aimScreenName;
var hasScreenName = HandleLink(data.cvScreenname, zScreenName, card.aimScreenName, data.cvScreennameBox, goimURL); var hasScreenName = HandleLink(data.cvScreenname, zScreenName, card.aimScreenName, data.cvScreennameBox, goimURL);
data.cvAimPresence.removeAttribute("src"); data.cvAimPresence.removeAttribute("src");
data.cvAimPresence.removeAttribute("url"); data.cvAimPresence.removeAttribute("url");
data.cvAimPresence.setAttribute("width","0"); data.cvAimPresence.setAttribute("width","0");
#if 0 #if 0
// for now, disable the presence check since we don't really support this anymore but we may again in the future. // for now, disable the presence check since we don't really support this anymore but we may again in the future.
// I'm leaving the code here for historical reference. See Bug #295726. // I'm leaving the code here for historical reference. See Bug #295726.
data.cvAimPresence.setAttribute("src","http://big.oscar.aol.com:80/" + card.aimScreenName + "?on_url=http://ncmail.netscape.com/include/nc/images/online.gif&off_url=http://ncmail.netscape.com/include/nc/images/offline.gif"); data.cvAimPresence.setAttribute("src","http://big.oscar.aol.com:80/" + card.aimScreenName + "?on_url=http://ncmail.netscape.com/include/nc/images/online.gif&off_url=http://ncmail.netscape.com/include/nc/images/offline.gif");
data.cvAimPresence.setAttribute("url", goimURL); data.cvAimPresence.setAttribute("url", goimURL);
data.cvAimPresence.setAttribute("width","16"); data.cvAimPresence.setAttribute("width","16");
#endif #endif
@ -250,48 +250,48 @@ function DisplayCardViewPane(card)
visible = hasScreenName || visible; visible = hasScreenName || visible;
visible = HandleLink(data.cvEmail2, zSecondaryEmail, card.secondEmail, data.cvEmail2Box, "mailto:" + card.secondEmail) || visible; visible = HandleLink(data.cvEmail2, zSecondaryEmail, card.secondEmail, data.cvEmail2Box, "mailto:" + card.secondEmail) || visible;
// Home section // Home section
visible = cvSetNode(data.cvHomeAddress, card.homeAddress); visible = cvSetNode(data.cvHomeAddress, card.homeAddress);
visible = cvSetNode(data.cvHomeAddress2, card.homeAddress2) || visible; visible = cvSetNode(data.cvHomeAddress2, card.homeAddress2) || visible;
visible = cvSetCityStateZip(data.cvHomeCityStZip, card.homeCity, card.homeState, card.homeZipCode) || visible; visible = cvSetCityStateZip(data.cvHomeCityStZip, card.homeCity, card.homeState, card.homeZipCode) || visible;
visible = cvSetNode(data.cvHomeCountry, card.homeCountry) || visible; visible = cvSetNode(data.cvHomeCountry, card.homeCountry) || visible;
if (visible) { if (visible) {
var homeMapItUrl = CreateMapItURL(card.homeAddress, card.homeAddress2, card.homeCity, card.homeState, card.homeZipCode, card.homeCountry); var homeMapItUrl = CreateMapItURL(card.homeAddress, card.homeAddress2, card.homeCity, card.homeState, card.homeZipCode, card.homeCountry);
if (homeMapItUrl) { if (homeMapItUrl) {
cvSetVisible(data.cvbHomeMapItBox, true); cvSetVisible(data.cvbHomeMapItBox, true);
data.cvHomeMapIt.setAttribute('url', homeMapItUrl); data.cvHomeMapIt.setAttribute('url', homeMapItUrl);
} }
else { else {
cvSetVisible(data.cvbHomeMapItBox, false); cvSetVisible(data.cvbHomeMapItBox, false);
} }
} }
else { else {
cvSetVisible(data.cvbHomeMapItBox, false); cvSetVisible(data.cvbHomeMapItBox, false);
} }
visible = HandleLink(data.cvHomeWebPage, "", card.webPage2, data.cvHomeWebPageBox, card.webPage2) || visible; visible = HandleLink(data.cvHomeWebPage, "", card.webPage2, data.cvHomeWebPageBox, card.webPage2) || visible;
cvSetVisible(data.cvhHome, visible); cvSetVisible(data.cvhHome, visible);
cvSetVisible(data.cvbHome, visible); cvSetVisible(data.cvbHome, visible);
if (card.isMailList) { if (card.isMailList) {
// Description section // Description section
visible = cvSetNode(data.cvDescription, card.notes) visible = cvSetNode(data.cvDescription, card.notes)
cvSetVisible(data.cvbDescription, visible); cvSetVisible(data.cvbDescription, visible);
// Addresses section // Addresses section
visible = cvAddAddressNodes(data.cvAddresses, card.mailListURI); visible = cvAddAddressNodes(data.cvAddresses, card.mailListURI);
cvSetVisible(data.cvbAddresses, visible); cvSetVisible(data.cvbAddresses, visible);
// Other section, not shown for mailing lists. // Other section, not shown for mailing lists.
cvSetVisible(data.cvbOther, false); cvSetVisible(data.cvbOther, false);
} }
else { else {
// Other section // Other section
visible = cvSetNodeWithLabel(data.cvCustom1, zCustom1, card.custom1); visible = cvSetNodeWithLabel(data.cvCustom1, zCustom1, card.custom1);
visible = cvSetNodeWithLabel(data.cvCustom2, zCustom2, card.custom2) || visible; visible = cvSetNodeWithLabel(data.cvCustom2, zCustom2, card.custom2) || visible;
visible = cvSetNodeWithLabel(data.cvCustom3, zCustom3, card.custom3) || visible; visible = cvSetNodeWithLabel(data.cvCustom3, zCustom3, card.custom3) || visible;
visible = cvSetNodeWithLabel(data.cvCustom4, zCustom4, card.custom4) || visible; visible = cvSetNodeWithLabel(data.cvCustom4, zCustom4, card.custom4) || visible;
visible = cvSetNode(data.cvNotes, card.notes) || visible; visible = cvSetNode(data.cvNotes, card.notes) || visible;
visible = setBuddyIcon(card, data.cvBuddyIcon) || visible; visible = setBuddyIcon(card, data.cvBuddyIcon) || visible;
cvSetVisible(data.cvhOther, visible); cvSetVisible(data.cvhOther, visible);
@ -304,46 +304,46 @@ function DisplayCardViewPane(card)
cvSetVisible(data.cvbAddresses, false); cvSetVisible(data.cvbAddresses, false);
} }
// Phone section // Phone section
visible = cvSetNodeWithLabel(data.cvPhWork, zWork, card.workPhone); visible = cvSetNodeWithLabel(data.cvPhWork, zWork, card.workPhone);
visible = cvSetNodeWithLabel(data.cvPhHome, zHome, card.homePhone) || visible; visible = cvSetNodeWithLabel(data.cvPhHome, zHome, card.homePhone) || visible;
visible = cvSetNodeWithLabel(data.cvPhFax, zFax, card.faxNumber) || visible; visible = cvSetNodeWithLabel(data.cvPhFax, zFax, card.faxNumber) || visible;
visible = cvSetNodeWithLabel(data.cvPhCellular, zCellular, card.cellularNumber) || visible; visible = cvSetNodeWithLabel(data.cvPhCellular, zCellular, card.cellularNumber) || visible;
visible = cvSetNodeWithLabel(data.cvPhPager, zPager, card.pagerNumber) || visible; visible = cvSetNodeWithLabel(data.cvPhPager, zPager, card.pagerNumber) || visible;
cvSetVisible(data.cvhPhone, visible); cvSetVisible(data.cvhPhone, visible);
cvSetVisible(data.cvbPhone, visible); cvSetVisible(data.cvbPhone, visible);
// Work section // Work section
visible = cvSetNode(data.cvJobTitle, card.jobTitle); visible = cvSetNode(data.cvJobTitle, card.jobTitle);
visible = cvSetNode(data.cvDepartment, card.department) || visible; visible = cvSetNode(data.cvDepartment, card.department) || visible;
visible = cvSetNode(data.cvCompany, card.company) || visible; visible = cvSetNode(data.cvCompany, card.company) || visible;
var addressVisible = cvSetNode(data.cvWorkAddress, card.workAddress); var addressVisible = cvSetNode(data.cvWorkAddress, card.workAddress);
addressVisible = cvSetNode(data.cvWorkAddress2, card.workAddress2) || addressVisible; addressVisible = cvSetNode(data.cvWorkAddress2, card.workAddress2) || addressVisible;
addressVisible = cvSetCityStateZip(data.cvWorkCityStZip, card.workCity, card.workState, card.workZipCode) || addressVisible; addressVisible = cvSetCityStateZip(data.cvWorkCityStZip, card.workCity, card.workState, card.workZipCode) || addressVisible;
addressVisible = cvSetNode(data.cvWorkCountry, card.workCountry) || addressVisible; addressVisible = cvSetNode(data.cvWorkCountry, card.workCountry) || addressVisible;
if (addressVisible) { if (addressVisible) {
var workMapItUrl = CreateMapItURL(card.workAddress, card.workAddress2, card.workCity, card.workState, card.workZipCode, card.workCountry); var workMapItUrl = CreateMapItURL(card.workAddress, card.workAddress2, card.workCity, card.workState, card.workZipCode, card.workCountry);
data.cvWorkMapIt.setAttribute('url', workMapItUrl); data.cvWorkMapIt.setAttribute('url', workMapItUrl);
if (workMapItUrl) { if (workMapItUrl) {
cvSetVisible(data.cvbWorkMapItBox, true); cvSetVisible(data.cvbWorkMapItBox, true);
data.cvWorkMapIt.setAttribute('url', workMapItUrl); data.cvWorkMapIt.setAttribute('url', workMapItUrl);
} }
else { else {
cvSetVisible(data.cvbWorkMapItBox, false); cvSetVisible(data.cvbWorkMapItBox, false);
} }
} }
else { else {
cvSetVisible(data.cvbWorkMapItBox, false); cvSetVisible(data.cvbWorkMapItBox, false);
} }
visible = HandleLink(data.cvWorkWebPage, "", card.webPage1, data.cvWorkWebPageBox, card.webPage1) || addressVisible || visible; visible = HandleLink(data.cvWorkWebPage, "", card.webPage1, data.cvWorkWebPageBox, card.webPage1) || addressVisible || visible;
cvSetVisible(data.cvhWork, visible); cvSetVisible(data.cvhWork, visible);
cvSetVisible(data.cvbWork, visible); cvSetVisible(data.cvbWork, visible);
// make the card view box visible // make the card view box visible
cvSetVisible(top.cvData.CardViewBox, true); cvSetVisible(top.cvData.CardViewBox, true);
} }
function setBuddyIcon(card, buddyIcon) function setBuddyIcon(card, buddyIcon)
@ -364,7 +364,7 @@ function setBuddyIcon(card, buddyIcon)
// check if the file exists // check if the file exists
var file = gFileHandler.getFileFromURLSpec(iconURLStr); var file = gFileHandler.getFileFromURLSpec(iconURLStr);
// check if the file exists // check if the file exists
// is this a perf hit? (how expensive is stat()?) // is this a perf hit? (how expensive is stat()?)
if (file.exists()) { if (file.exists()) {
@ -376,14 +376,14 @@ function setBuddyIcon(card, buddyIcon)
catch (ex) { catch (ex) {
// can get here if no screenname // can get here if no screenname
} }
buddyIcon.setAttribute("src", ""); buddyIcon.setAttribute("src", "");
return false; return false;
} }
function ClearCardViewPane() function ClearCardViewPane()
{ {
cvSetVisible(top.cvData.CardViewBox, false); cvSetVisible(top.cvData.CardViewBox, false);
} }
function cvSetNodeWithLabel(node, label, text) function cvSetNodeWithLabel(node, label, text)
@ -400,58 +400,58 @@ function cvSetNodeWithLabel(node, label, text)
function cvSetCityStateZip(node, city, state, zip) function cvSetCityStateZip(node, city, state, zip)
{ {
var text = ""; var text = "";
if ( city ) if ( city )
{ {
text = city; text = city;
if ( state || zip ) if ( state || zip )
text += ", "; text += ", ";
} }
if ( state ) if ( state )
text += state + " "; text += state + " ";
if ( zip ) if ( zip )
text += zip; text += zip;
return cvSetNode(node, text); return cvSetNode(node, text);
} }
function cvSetNode(node, text) function cvSetNode(node, text)
{ {
if ( node ) if ( node )
{ {
if ( !node.hasChildNodes() ) if ( !node.hasChildNodes() )
{ {
var textNode = document.createTextNode(text); var textNode = document.createTextNode(text);
node.appendChild(textNode); node.appendChild(textNode);
} }
else if ( node.childNodes.length == 1 ) else if ( node.childNodes.length == 1 )
node.childNodes[0].nodeValue = text; node.childNodes[0].nodeValue = text;
var visible; var visible;
if ( text )
visible = true;
else
visible = false;
cvSetVisible(node, visible);
}
return visible; if ( text )
visible = true;
else
visible = false;
cvSetVisible(node, visible);
}
return visible;
} }
function cvAddAddressNodes(node, uri) function cvAddAddressNodes(node, uri)
{ {
var visible = false; var visible = false;
if ( node ) if ( node )
{ {
var displayName = ""; var displayName = "";
var address = ""; var address = "";
var editList = GetDirectoryFromURI(uri); var editList = GetDirectoryFromURI(uri);
var addressList = editList.addressLists; var addressList = editList.addressLists;
if (addressList) { if (addressList) {
var total = addressList.Count(); var total = addressList.Count();
if (total > 0) { if (total > 0) {
@ -459,34 +459,34 @@ function cvAddAddressNodes(node, uri)
node.removeChild(node.lastChild); node.removeChild(node.lastChild);
} }
for (i = 0; i < total; i++ ) { for (i = 0; i < total; i++ ) {
var descNode = document.createElement("description"); var descNode = document.createElement("description");
address = addressList.GetElementAt(i).QueryInterface(Components.interfaces.nsIAbCard).primaryEmail; address = addressList.GetElementAt(i).QueryInterface(Components.interfaces.nsIAbCard).primaryEmail;
displayName = addressList.GetElementAt(i).QueryInterface(Components.interfaces.nsIAbCard).displayName; displayName = addressList.GetElementAt(i).QueryInterface(Components.interfaces.nsIAbCard).displayName;
descNode.setAttribute("class", "CardViewLink"); descNode.setAttribute("class", "CardViewLink");
node.appendChild(descNode); node.appendChild(descNode);
var linkNode = document.createElementNS("http://www.w3.org/1999/xhtml", "a"); var linkNode = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
linkNode.setAttribute("id", "addr#" + i); linkNode.setAttribute("id", "addr#" + i);
linkNode.setAttribute("href", "mailto:" + address); linkNode.setAttribute("href", "mailto:" + address);
descNode.appendChild(linkNode); descNode.appendChild(linkNode);
var textNode = document.createTextNode(displayName + " <" + address + ">"); var textNode = document.createTextNode(displayName + " <" + address + ">");
linkNode.appendChild(textNode); linkNode.appendChild(textNode);
} }
visible = true; visible = true;
} }
} }
cvSetVisible(node, visible); cvSetVisible(node, visible);
} }
return visible; return visible;
} }
function cvSetVisible(node, visible) function cvSetVisible(node, visible)
{ {
if ( visible ) if ( visible )
node.removeAttribute("collapsed"); node.removeAttribute("collapsed");
else else
node.setAttribute("collapsed", "true"); node.setAttribute("collapsed", "true");
} }
function HandleLink(node, label, value, box, link) function HandleLink(node, label, value, box, link)
@ -505,7 +505,7 @@ function MapIt(id)
try { try {
var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance(); var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger); messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
messenger.launchExternalURL(button.getAttribute('url')); messenger.launchExternalURL(button.getAttribute('url'));
} catch (ex) {} } catch (ex) {}
} }
@ -520,7 +520,7 @@ function CreateMapItURL(address1, address2, city, state, zip, country)
urlFormat = urlFormat.replace("@CI", encodeURIComponent(city)); urlFormat = urlFormat.replace("@CI", encodeURIComponent(city));
urlFormat = urlFormat.replace("@ST", encodeURIComponent(state)); urlFormat = urlFormat.replace("@ST", encodeURIComponent(state));
urlFormat = urlFormat.replace("@ZI", encodeURIComponent(zip)); urlFormat = urlFormat.replace("@ZI", encodeURIComponent(zip));
return urlFormat; return urlFormat;
} }
@ -530,7 +530,7 @@ function openLink(id)
try { try {
var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance(); var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger); messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
messenger.launchExternalURL(document.getElementById(id).getAttribute("href")); messenger.launchExternalURL(document.getElementById(id).getAttribute("href"));
} catch (ex) {} } catch (ex) {}
// return false, so we don't load the href in the addressbook window // return false, so we don't load the href in the addressbook window

View File

@ -93,11 +93,11 @@ var ResultsPaneController =
var numSelected; var numSelected;
var enabled = false; var enabled = false;
if (gAbView && gAbView.selection) { if (gAbView && gAbView.selection) {
if (gAbView.directory) if (gAbView.directory)
enabled = gAbView.directory.operations & gAbView.directory.opWrite; enabled = gAbView.directory.operations & gAbView.directory.opWrite;
numSelected = gAbView.selection.count; numSelected = gAbView.selection.count;
} }
else else
numSelected = 0; numSelected = 0;
// fix me, don't update on isCommandEnabled // fix me, don't update on isCommandEnabled
@ -196,9 +196,9 @@ var DirPaneController =
case "button_delete": case "button_delete":
if (command == "cmd_delete") if (command == "cmd_delete")
goSetMenuValue(command, "valueAddressBook"); goSetMenuValue(command, "valueAddressBook");
selectedDir = GetSelectedDirectory(); selectedDir = GetSelectedDirectory();
if (selectedDir == kPersonalAddressbookURI || selectedDir == kCollectedAddressbookURI) if (selectedDir == kPersonalAddressbookURI || selectedDir == kCollectedAddressbookURI)
return false; return false;
@ -317,7 +317,7 @@ function GetParentRow(aTree, aRow)
} }
return row; return row;
} }
function InitCommonJS() function InitCommonJS()
{ {
dirTree = document.getElementById("dirTree"); dirTree = document.getElementById("dirTree");
@ -349,7 +349,7 @@ function GetSelectedCardTypes()
var mailingListCnt = 0; var mailingListCnt = 0;
var cardCnt = 0; var cardCnt = 0;
for (var i = 0; i < count; i++) { for (var i = 0; i < count; i++) {
if (cards[i].isMailList) if (cards[i].isMailList)
mailingListCnt++; mailingListCnt++;
else else
@ -503,11 +503,11 @@ function goToggleSplitter( id, elementID )
} }
} }
// Generate a list of cards from the selected mailing list // Generate a list of cards from the selected mailing list
// and get a comma separated list of card addresses. If the // and get a comma separated list of card addresses. If the
// item selected in the directory pane is not a mailing list, // item selected in the directory pane is not a mailing list,
// an empty string is returned. // an empty string is returned.
function GetSelectedAddressesFromDirTree() function GetSelectedAddressesFromDirTree()
{ {
var addresses = ""; var addresses = "";
@ -544,7 +544,7 @@ function GetAddressesForCards(cards)
if (count > 0) if (count > 0)
addresses += GenerateAddressFromCard(cards[0]); addresses += GenerateAddressFromCard(cards[0]);
for (var i = 1; i < count; i++) { for (var i = 1; i < count; i++) {
var generatedAddress = GenerateAddressFromCard(cards[i]); var generatedAddress = GenerateAddressFromCard(cards[i]);
if (generatedAddress) if (generatedAddress)
@ -566,7 +566,7 @@ function GetNumSelectedCards()
} }
// XXX todo // XXX todo
// an optimization might be to make this return // an optimization might be to make this return
// the selected ranges, which would be faster // the selected ranges, which would be faster
// when the user does large selections, but for now, let's keep it simple. // when the user does large selections, but for now, let's keep it simple.
function GetSelectedRows() function GetSelectedRows()
@ -601,9 +601,9 @@ function GetSelectedAbCards()
// then use the ab view from sidebar (gCurFrame is from sidebarOverlay.js) // then use the ab view from sidebar (gCurFrame is from sidebarOverlay.js)
const abPanelUrl = "chrome://messenger/content/addressbook/addressbook-panel.xul"; const abPanelUrl = "chrome://messenger/content/addressbook/addressbook-panel.xul";
if (document.getElementById("sidebar-box")) { if (document.getElementById("sidebar-box")) {
if (gCurFrame && if (gCurFrame &&
gCurFrame.getAttribute("src") == abPanelUrl && gCurFrame.getAttribute("src") == abPanelUrl &&
document.commandDispatcher.focusedWindow == gCurFrame.contentDocument.defaultView) document.commandDispatcher.focusedWindow == gCurFrame.contentDocument.defaultView)
{ {
abView = gCurFrame.contentDocument.defaultView.gAbView; abView = gCurFrame.contentDocument.defaultView.gAbView;
} }
@ -705,7 +705,7 @@ function CloseAbView()
function SetAbView(uri, searchView, sortColumn, sortDirection) function SetAbView(uri, searchView, sortColumn, sortDirection)
{ {
var actualSortColumn; var actualSortColumn;
// make sure sortColumn and sortDirection have non null values before calling gAbView.init // make sure sortColumn and sortDirection have non null values before calling gAbView.init
if (!sortColumn) if (!sortColumn)
sortColumn = kDefaultSortColumn; sortColumn = kDefaultSortColumn;
@ -732,7 +732,7 @@ function SetAbView(uri, searchView, sortColumn, sortDirection)
boxObject.view = gAbView.QueryInterface(Components.interfaces.nsITreeView); boxObject.view = gAbView.QueryInterface(Components.interfaces.nsITreeView);
UpdateSortIndicators(sortColumn, sortDirection); UpdateSortIndicators(sortColumn, sortDirection);
return actualSortColumn; return actualSortColumn;
} }
@ -748,14 +748,14 @@ function ChangeDirectoryByURI(uri)
if (gAbView && gAbView.URI == uri) if (gAbView && gAbView.URI == uri)
return; return;
var sortColumn = gAbResultsTree.getAttribute("sortCol"); var sortColumn = gAbResultsTree.getAttribute("sortCol");
var sortDirection = document.getElementById(sortColumn).getAttribute("sortDirection"); var sortDirection = document.getElementById(sortColumn).getAttribute("sortDirection");
var actualSortColumn = SetAbView(uri, false, sortColumn, sortDirection); var actualSortColumn = SetAbView(uri, false, sortColumn, sortDirection);
UpdateSortIndicators(actualSortColumn, sortDirection); UpdateSortIndicators(actualSortColumn, sortDirection);
// only select the first card if there is a first card // only select the first card if there is a first card
if (gAbView && gAbView.getCardFromRow(0)) { if (gAbView && gAbView.getCardFromRow(0)) {
SelectFirstCard(); SelectFirstCard();
@ -795,7 +795,7 @@ function SortAndUpdateIndicators(sortColumn, sortDirection)
// XXX todo remove once #116341 is fixed // XXX todo remove once #116341 is fixed
if (!sortColumn) if (!sortColumn)
return; return;
UpdateSortIndicators(sortColumn, sortDirection); UpdateSortIndicators(sortColumn, sortDirection);
if (gAbView) if (gAbView)
@ -862,9 +862,9 @@ function goNewCardDialog(selectedAB)
function goEditCardDialog(abURI, card, okCallback) function goEditCardDialog(abURI, card, okCallback)
{ {
window.openDialog("chrome://messenger/content/addressbook/abEditCardDialog.xul", window.openDialog("chrome://messenger/content/addressbook/abEditCardDialog.xul",
"", "",
"chrome,resizable=no,modal,titlebar,centerscreen", "chrome,resizable=no,modal,titlebar,centerscreen",
{abURI:abURI, card:card, okCallback:okCallback}); {abURI:abURI, card:card, okCallback:okCallback});
} }
@ -905,12 +905,12 @@ function GenerateAddressFromCard(card)
var email; var email;
if (card.isMailList) if (card.isMailList)
{ {
var directory = GetDirectoryFromURI(card.mailListURI); var directory = GetDirectoryFromURI(card.mailListURI);
email = directory.description || card.displayName; email = directory.description || card.displayName;
} }
else else
email = card.primaryEmail; email = card.primaryEmail;
return gHeaderParser.makeFullAddressWString(card.displayName, email); return gHeaderParser.makeFullAddressWString(card.displayName, email);
@ -936,7 +936,7 @@ function GetParentDirectoryFromMailingListURI(abURI)
} }
return null; return null;
} }
function DirPaneHasFocus() function DirPaneHasFocus()
{ {
@ -959,10 +959,10 @@ function GetSelectedDirectory()
function onAbSearchKeyPress(event) function onAbSearchKeyPress(event)
{ {
// 13 == return // 13 == return
if (event && event.keyCode == 13) if (event && event.keyCode == 13)
onAbSearchInput(true); onAbSearchInput(true);
} }
function onAbSearchInput(returnKeyHit) function onAbSearchInput(returnKeyHit)
{ {
if (gSearchInput.showingSearchCriteria && !(returnKeyHit && gSearchInput.value == "")) if (gSearchInput.showingSearchCriteria && !(returnKeyHit && gSearchInput.value == ""))
@ -984,7 +984,7 @@ function onAbSearchInput(returnKeyHit)
} }
} }
function SearchInputChanged() function SearchInputChanged()
{ {
var clearButton = document.getElementById("clear"); var clearButton = document.getElementById("clear");
if (clearButton) { if (clearButton) {
@ -995,9 +995,9 @@ function SearchInputChanged()
} }
} }
function onAbClearSearch() function onAbClearSearch()
{ {
if (gSearchInput) if (gSearchInput)
gSearchInput.value =""; //on input does not get fired for some reason gSearchInput.value =""; //on input does not get fired for some reason
onAbSearchInput(true); onAbSearchInput(true);
} }
@ -1028,18 +1028,18 @@ function QuickSearchFocus()
} }
function onSearchInputBlur(event) function onSearchInputBlur(event)
{ {
// if (gQuickSearchFocusEl && gQuickSearchFocusEl.id == 'searchInput') // ignore the blur if we are in the middle of processing the clear button // if (gQuickSearchFocusEl && gQuickSearchFocusEl.id == 'searchInput') // ignore the blur if we are in the middle of processing the clear button
// return; // return;
if (!gSearchInput.value) if (!gSearchInput.value)
gSearchInput.showingSearchCriteria = true; gSearchInput.showingSearchCriteria = true;
if (gSearchInput.showingSearchCriteria) if (gSearchInput.showingSearchCriteria)
gSearchInput.setSearchCriteriaText(); gSearchInput.setSearchCriteriaText();
} }
var gQuickSearchFocusEl = null; var gQuickSearchFocusEl = null;
function onClearSearch() function onClearSearch()
{ {
@ -1047,7 +1047,7 @@ function onClearSearch()
{ {
onAbClearSearch(); onAbClearSearch();
// this needs to be on a timer otherwise we end up messing up the focus while the Search("") is still happening // this needs to be on a timer otherwise we end up messing up the focus while the Search("") is still happening
setTimeout("restoreSearchFocusAfterClear();", 0); setTimeout("restoreSearchFocusAfterClear();", 0);
} }
} }
@ -1091,12 +1091,12 @@ function setupLdapAutocompleteSession()
"@mozilla.org/autocompleteSession;1?type=ldap"].createInstance() "@mozilla.org/autocompleteSession;1?type=ldap"].createInstance()
.QueryInterface(Components.interfaces.nsILDAPAutoCompleteSession); .QueryInterface(Components.interfaces.nsILDAPAutoCompleteSession);
} }
if (autocompleteDirectory && !gIsOffline) { if (autocompleteDirectory && !gIsOffline) {
// the compose window code adds an observer on the directory server // the compose window code adds an observer on the directory server
// prefs, but I don't think we need this here. // prefs, but I don't think we need this here.
gCurrentAutocompleteDirectory = autocompleteDirectory; gCurrentAutocompleteDirectory = autocompleteDirectory;
// fill in the session params if there is a session // fill in the session params if there is a session
// //
if (LDAPSession) { if (LDAPSession) {
@ -1133,9 +1133,9 @@ function setupLdapAutocompleteSession()
var windowWatcherSvc = Components.classes[ var windowWatcherSvc = Components.classes[
"@mozilla.org/embedcomp/window-watcher;1"] "@mozilla.org/embedcomp/window-watcher;1"]
.getService(Components.interfaces.nsIWindowWatcher); .getService(Components.interfaces.nsIWindowWatcher);
var domWin = var domWin =
window.QueryInterface(Components.interfaces.nsIDOMWindow); window.QueryInterface(Components.interfaces.nsIDOMWindow);
var authPrompter = var authPrompter =
windowWatcherSvc.getNewAuthPrompter(domWin); windowWatcherSvc.getNewAuthPrompter(domWin);
LDAPSession.authPrompter = authPrompter; LDAPSession.authPrompter = authPrompter;
@ -1143,7 +1143,7 @@ function setupLdapAutocompleteSession()
// don't search on non-CJK strings shorter than this // don't search on non-CJK strings shorter than this
// //
try { try {
LDAPSession.minStringLength = gPrefs.getIntPref( LDAPSession.minStringLength = gPrefs.getIntPref(
autocompleteDirectory + ".autoComplete.minStringLength"); autocompleteDirectory + ".autoComplete.minStringLength");
} catch (ex) { } catch (ex) {
@ -1153,7 +1153,7 @@ function setupLdapAutocompleteSession()
// don't search on CJK strings shorter than this // don't search on CJK strings shorter than this
// //
try { try {
LDAPSession.cjkMinStringLength = gPrefs.getIntPref( LDAPSession.cjkMinStringLength = gPrefs.getIntPref(
autocompleteDirectory + ".autoComplete.cjkMinStringLength"); autocompleteDirectory + ".autoComplete.cjkMinStringLength");
} catch (ex) { } catch (ex) {
@ -1171,8 +1171,8 @@ function setupLdapAutocompleteSession()
// override autocomplete name format? // override autocomplete name format?
// //
try { try {
ldapFormatter.nameFormat = ldapFormatter.nameFormat =
gPrefs.getComplexValue(autocompleteDirectory + gPrefs.getComplexValue(autocompleteDirectory +
".autoComplete.nameFormat", ".autoComplete.nameFormat",
Components.interfaces.nsISupportsString).data; Components.interfaces.nsISupportsString).data;
} catch (ex) { } catch (ex) {
@ -1183,8 +1183,8 @@ function setupLdapAutocompleteSession()
// override autocomplete mail address format? // override autocomplete mail address format?
// //
try { try {
ldapFormatter.addressFormat = ldapFormatter.addressFormat =
gPrefs.getComplexValue(autocompleteDirectory + gPrefs.getComplexValue(autocompleteDirectory +
".autoComplete.addressFormat", ".autoComplete.addressFormat",
Components.interfaces.nsISupportsString).data; Components.interfaces.nsISupportsString).data;
} catch (ex) { } catch (ex) {
@ -1217,8 +1217,8 @@ function setupLdapAutocompleteSession()
// override ldap-specific autocomplete entry? // override ldap-specific autocomplete entry?
// //
try { try {
ldapFormatter.commentFormat = ldapFormatter.commentFormat =
gPrefs.getComplexValue(autocompleteDirectory + gPrefs.getComplexValue(autocompleteDirectory +
".autoComplete.commentFormat", ".autoComplete.commentFormat",
Components.interfaces.nsISupportsString).data; Components.interfaces.nsISupportsString).data;
} catch (innerException) { } catch (innerException) {
@ -1247,8 +1247,8 @@ function setupLdapAutocompleteSession()
// override autocomplete entry formatting? // override autocomplete entry formatting?
// //
try { try {
LDAPSession.outputFormat = LDAPSession.outputFormat =
gPrefs.getComplexValue(autocompleteDirectory + gPrefs.getComplexValue(autocompleteDirectory +
".autoComplete.outputFormat", ".autoComplete.outputFormat",
Components.interfaces.nsISupportsString).data; Components.interfaces.nsISupportsString).data;
@ -1259,7 +1259,7 @@ function setupLdapAutocompleteSession()
// override default search filter template? // override default search filter template?
// //
try { try {
LDAPSession.filterTemplate = gPrefs.getComplexValue( LDAPSession.filterTemplate = gPrefs.getComplexValue(
autocompleteDirectory + ".autoComplete.filterTemplate", autocompleteDirectory + ".autoComplete.filterTemplate",
Components.interfaces.nsISupportsString).data; Components.interfaces.nsISupportsString).data;
@ -1271,20 +1271,20 @@ function setupLdapAutocompleteSession()
// override default maxHits (currently 100) // override default maxHits (currently 100)
// //
try { try {
// XXXdmose should really use .autocomplete.maxHits, // XXXdmose should really use .autocomplete.maxHits,
// but there's no UI for that yet // but there's no UI for that yet
// //
LDAPSession.maxHits = LDAPSession.maxHits =
gPrefs.getIntPref(autocompleteDirectory + ".maxHits"); gPrefs.getIntPref(autocompleteDirectory + ".maxHits");
} catch (ex) { } catch (ex) {
// if this pref isn't there, or is out of range, no big deal. // if this pref isn't there, or is out of range, no big deal.
// just let nsLDAPAutoCompleteSession use its default. // just let nsLDAPAutoCompleteSession use its default.
} }
if (!gSessionAdded) { if (!gSessionAdded) {
// if we make it here, we know that session initialization has // if we make it here, we know that session initialization has
// succeeded; add the session for all recipients, and // succeeded; add the session for all recipients, and
// remember that we've done so // remember that we've done so
var autoCompleteWidget; var autoCompleteWidget;
for (i=1; i <= awGetMaxRecipients(); i++) for (i=1; i <= awGetMaxRecipients(); i++)
@ -1294,7 +1294,7 @@ function setupLdapAutocompleteSession()
{ {
autoCompleteWidget.addSession(LDAPSession); autoCompleteWidget.addSession(LDAPSession);
// ldap searches don't insert a default entry with the default domain appended to it // ldap searches don't insert a default entry with the default domain appended to it
// so reduce the minimum results for a popup to 2 in this case. // so reduce the minimum results for a popup to 2 in this case.
autoCompleteWidget.minResultsForPopup = 2; autoCompleteWidget.minResultsForPopup = 2;
} }
@ -1307,7 +1307,7 @@ function setupLdapAutocompleteSession()
gCurrentAutocompleteDirectory = null; gCurrentAutocompleteDirectory = null;
} }
if (gLDAPSession && gSessionAdded) { if (gLDAPSession && gSessionAdded) {
for (i=1; i <= awGetMaxRecipients(); i++) for (i=1; i <= awGetMaxRecipients(); i++)
document.getElementById("addressCol1#" + i). document.getElementById("addressCol1#" + i).
removeSession(gLDAPSession); removeSession(gLDAPSession);
gSessionAdded = false; gSessionAdded = false;

View File

@ -79,16 +79,16 @@
<menuitem label="&addtoCcFieldMenu.label;" oncommand="addSelectedAddresses('addr_cc');"/> <menuitem label="&addtoCcFieldMenu.label;" oncommand="addSelectedAddresses('addr_cc');"/>
<menuitem label="&addtoBccFieldMenu.label;" oncommand="addSelectedAddresses('addr_bcc');"/> <menuitem label="&addtoBccFieldMenu.label;" oncommand="addSelectedAddresses('addr_bcc');"/>
</popup> </popup>
<vbox id="results_box" flex="1"> <vbox id="results_box" flex="1">
<separator class="thin"/> <separator class="thin"/>
<label value="&addressbookPicker.label;" accesskey="&addressbookPicker.accesskey;" control="addressbookList"/> <label value="&addressbookPicker.label;" accesskey="&addressbookPicker.accesskey;" control="addressbookList"/>
<hbox id="panel-bar" class="toolbar" align="center"> <hbox id="panel-bar" class="toolbar" align="center">
<menulist id="addressbookList" <menulist id="addressbookList"
oncommand="AddressBookMenuListChange();" flex="1" oncommand="AddressBookMenuListChange();" flex="1"
persist="value"> persist="value">
<menupopup id="addressbookList-menupopup" <menupopup id="addressbookList-menupopup"
datasources="rdf:addressdirectory" datasources="rdf:addressdirectory"
ref="moz-abdirectory://" ref="moz-abdirectory://"
sortActive="true" sortActive="true"
sortDirection="ascending" sortDirection="ascending"
@ -104,11 +104,11 @@
</menulist> </menulist>
</hbox> </hbox>
<separator class="thin"/> <separator class="thin"/>
<vbox> <vbox>
<label value="&searchInput.label;" accesskey="&searchInput.accesskey;" control="searchInput"/> <label value="&searchInput.label;" accesskey="&searchInput.accesskey;" control="searchInput"/>
<textbox id="searchInput" flex="1" onfocus="onSearchInputFocus(event);" onblur="onSearchInputBlur(event);" <textbox id="searchInput" flex="1" onfocus="onSearchInputFocus(event);" onblur="onSearchInputBlur(event);"
onclick="this.select();" oninput="onAbSearchInput(false);" onclick="this.select();" oninput="onAbSearchInput(false);"
onkeypress="onAbSearchKeyPress(event);"> onkeypress="onAbSearchKeyPress(event);">
<button id="quick-search-button" type="menu"> <button id="quick-search-button" type="menu">
@ -117,39 +117,39 @@
</menupopup> </menupopup>
</button> </button>
</textbox> </textbox>
</vbox> </vbox>
<separator class="thin"/> <separator class="thin"/>
<tree id="abResultsTree" flex="1" context="cardProperties" class="plain" sortCol="GeneratedName" persist="sortCol" ondblclick="contactsListDoubleClick(event);"> <tree id="abResultsTree" flex="1" context="cardProperties" class="plain" sortCol="GeneratedName" persist="sortCol" ondblclick="contactsListDoubleClick(event);">
<treecols> <treecols>
<!-- these column ids must match up to the mork column names, see nsIAddrDatabase.idl --> <!-- these column ids must match up to the mork column names, see nsIAddrDatabase.idl -->
<treecol id="GeneratedName" class="sortDirectionIndicator" <treecol id="GeneratedName" class="sortDirectionIndicator"
persist="hidden ordinal width sortDirection" flex="1" label="&GeneratedName.label;" primary="true"/> persist="hidden ordinal width sortDirection" flex="1" label="&GeneratedName.label;" primary="true"/>
<splitter class="tree-splitter"/> <splitter class="tree-splitter"/>
<treecol id="PrimaryEmail" class="sortDirectionIndicator" <treecol id="PrimaryEmail" class="sortDirectionIndicator"
persist="hidden ordinal width sortDirection" hidden="true" persist="hidden ordinal width sortDirection" hidden="true"
flex="1" label="&PrimaryEmail.label;"/> flex="1" label="&PrimaryEmail.label;"/>
</treecols> </treecols>
<treechildren ondraggesture="nsDragAndDrop.startDrag(event, abResultsPaneObserver);"/> <treechildren ondraggesture="nsDragAndDrop.startDrag(event, abResultsPaneObserver);"/>
</tree> </tree>
<separator class="thin"/> <separator class="thin"/>
<hbox> <hbox>
<spring flex="1"/> <spring flex="1"/>
<button id="toButton" label="&toButton.label;" accesskey="&toButton.accesskey;" oncommand="addSelectedAddresses('addr_to')"/> <button id="toButton" label="&toButton.label;" accesskey="&toButton.accesskey;" oncommand="addSelectedAddresses('addr_to')"/>
<spring flex="1"/> <spring flex="1"/>
</hbox> </hbox>
<hbox> <hbox>
<spring flex="1"/> <spring flex="1"/>
<button id="ccButton" label="&ccButton.label;" accesskey="&ccButton.accesskey;" oncommand="addSelectedAddresses('addr_cc')"/> <button id="ccButton" label="&ccButton.label;" accesskey="&ccButton.accesskey;" oncommand="addSelectedAddresses('addr_cc')"/>
<spacer class="thin"/> <spacer class="thin"/>
<button id="bccButton" label="&bccButton.label;" accesskey="&bccButton.accesskey;" oncommand="addSelectedAddresses('addr_bcc')"/> <button id="bccButton" label="&bccButton.label;" accesskey="&bccButton.accesskey;" oncommand="addSelectedAddresses('addr_bcc')"/>
<spring flex="1"/> <spring flex="1"/>
</hbox> </hbox>
<separator class="thin"/> <separator class="thin"/>
</vbox> </vbox>
</page> </page>

View File

@ -1,4 +1,4 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
@ -36,7 +36,7 @@
# the terms of any one of the MPL, the GPL or the LGPL. # the terms of any one of the MPL, the GPL or the LGPL.
# #
# ***** END LICENSE BLOCK ***** # ***** END LICENSE BLOCK *****
<?xml-stylesheet href="chrome://messenger/skin/addressbook/cardDialog.css" type="text/css"?> <?xml-stylesheet href="chrome://messenger/skin/addressbook/cardDialog.css" type="text/css"?>
<!DOCTYPE dialog SYSTEM "chrome://messenger/locale/addressbook/abMailListDialog.dtd"> <!DOCTYPE dialog SYSTEM "chrome://messenger/locale/addressbook/abMailListDialog.dtd">
@ -90,18 +90,18 @@
<listcell class="addressingWidgetCell"> <listcell class="addressingWidgetCell">
<textbox id="addressCol1#1" class="plain textbox-addressingWidget uri-element" <textbox id="addressCol1#1" class="plain textbox-addressingWidget uri-element"
type="autocomplete" allowevents="true" flex="1" type="autocomplete" allowevents="true" flex="1"
searchSessions="addrbook" timeout="300" maxrows="4" searchSessions="addrbook" timeout="300" maxrows="4"
autoFill="true" autoFillAfterMatch="true" forceComplete="true" autoFill="true" autoFillAfterMatch="true" forceComplete="true"
minResultsForPopup="3" minResultsForPopup="3"
ontextentered="awRecipientTextCommand(eventParam, this)" ontextentered="awRecipientTextCommand(eventParam, this)"
oninput="setupLdapAutocompleteSession();" oninput="setupLdapAutocompleteSession();"
onkeypress="handleKeyPress(this, event);" onkeypress="handleKeyPress(this, event);"
onkeydown="awRecipientKeyDown(event, this);" onkeydown="awRecipientKeyDown(event, this);"
onclick="awNotAnEmptyArea(event);"> onclick="awNotAnEmptyArea(event);">
<image onclick="awNotAnEmptyArea(event)" class="person-icon"/> <image onclick="awNotAnEmptyArea(event)" class="person-icon"/>
</textbox> </textbox>
</listcell> </listcell>
</listitem> </listitem>
</listbox> </listbox>
</vbox> </vbox>
</dialog> </dialog>

View File

@ -37,7 +37,7 @@
# the provisions above, a recipient may use your version of this file under # the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL. # the terms of any one of the MPL, the GPL or the LGPL.
# #
# ***** END LICENSE BLOCK ***** # ***** END LICENSE BLOCK *****
var cvPrefs = 0; var cvPrefs = 0;
var addressbook = 0; var addressbook = 0;
@ -116,7 +116,7 @@ var gAddressBookAbListener = {
}; };
function OnUnloadAddressBook() function OnUnloadAddressBook()
{ {
var addrbookSession = var addrbookSession =
Components.classes["@mozilla.org/addressbook/services/session;1"] Components.classes["@mozilla.org/addressbook/services/session;1"]
.getService(Components.interfaces.nsIAddrBookSession); .getService(Components.interfaces.nsIAddrBookSession);
@ -177,7 +177,7 @@ function delayedOnLoadAddressBook()
{ {
gSearchInput = document.getElementById("searchInput"); gSearchInput = document.getElementById("searchInput");
verifyAccounts(null); // this will do migration, if we need to. verifyAccounts(null); // this will do migration, if we need to.
top.addressbook = Components.classes["@mozilla.org/addressbook;1"].createInstance(Components.interfaces.nsIAddressBook); top.addressbook = Components.classes["@mozilla.org/addressbook;1"].createInstance(Components.interfaces.nsIAddressBook);
@ -238,35 +238,35 @@ function OnLoadDirTree() {
function GetCurrentPrefs() function GetCurrentPrefs()
{ {
// prefs // prefs
if ( cvPrefs == 0 ) if ( cvPrefs == 0 )
cvPrefs = new Object; cvPrefs = new Object;
cvPrefs.prefs = gPrefs; cvPrefs.prefs = gPrefs;
// check "Show Name As" menu item based on pref
var menuitemID;
switch (gPrefs.getIntPref("mail.addr_book.lastnamefirst"))
{
case kFirstNameFirst:
menuitemID = 'firstLastCmd';
break;
case kLastNameFirst:
menuitemID = 'lastFirstCmd';
break;
case kDisplayName:
default:
menuitemID = 'displayNameCmd';
break;
}
var menuitem = top.document.getElementById(menuitemID); // check "Show Name As" menu item based on pref
if ( menuitem ) var menuitemID;
menuitem.setAttribute('checked', 'true'); switch (gPrefs.getIntPref("mail.addr_book.lastnamefirst"))
{
case kFirstNameFirst:
menuitemID = 'firstLastCmd';
break;
case kLastNameFirst:
menuitemID = 'lastFirstCmd';
break;
case kDisplayName:
default:
menuitemID = 'displayNameCmd';
break;
}
// initialize phonetic var menuitem = top.document.getElementById(menuitemID);
if ( menuitem )
menuitem.setAttribute('checked', 'true');
// initialize phonetic
var showPhoneticFields = var showPhoneticFields =
gPrefs.getComplexValue("mail.addr_book.show_phonetic_fields", gPrefs.getComplexValue("mail.addr_book.show_phonetic_fields",
Components.interfaces.nsIPrefLocalizedString).data; Components.interfaces.nsIPrefLocalizedString).data;
// show phonetic fields if indicated by the pref // show phonetic fields if indicated by the pref
if (showPhoneticFields == "true") if (showPhoneticFields == "true")
@ -278,27 +278,27 @@ function GetCurrentPrefs()
function SetNameColumn(cmd) function SetNameColumn(cmd)
{ {
var prefValue; var prefValue;
switch ( cmd ) switch ( cmd )
{ {
case 'firstLastCmd': case 'firstLastCmd':
prefValue = kFirstNameFirst; prefValue = kFirstNameFirst;
break; break;
case 'lastFirstCmd': case 'lastFirstCmd':
prefValue = kLastNameFirst; prefValue = kLastNameFirst;
break; break;
case 'displayNameCmd': case 'displayNameCmd':
prefValue = kDisplayName; prefValue = kDisplayName;
break; break;
} }
cvPrefs.prefs.setIntPref("mail.addr_book.lastnamefirst", prefValue); cvPrefs.prefs.setIntPref("mail.addr_book.lastnamefirst", prefValue);
} }
function onFileMenuInit() function onFileMenuInit()
{ {
goUpdateCommand('cmd_printcard'); goUpdateCommand('cmd_printcard');
goUpdateCommand('cmd_printcardpreview'); goUpdateCommand('cmd_printcardpreview');
} }
@ -322,13 +322,13 @@ function UpdateCardView()
// either no cards, or more than one card is selected, clear the pane. // either no cards, or more than one card is selected, clear the pane.
if (cards.length == 1) if (cards.length == 1)
OnClickedCard(cards[0]) OnClickedCard(cards[0])
else else
ClearCardViewPane(); ClearCardViewPane();
} }
function OnClickedCard(card) function OnClickedCard(card)
{ {
if (card) if (card)
DisplayCardViewPane(card); DisplayCardViewPane(card);
else else
ClearCardViewPane(); ClearCardViewPane();
@ -341,9 +341,9 @@ function AbClose()
function AbNewLDAPDirectory() function AbNewLDAPDirectory()
{ {
window.openDialog("chrome://messenger/content/addressbook/pref-directory-add.xul", window.openDialog("chrome://messenger/content/addressbook/pref-directory-add.xul",
"", "",
"chrome,modal=yes,resizable=no,centerscreen", "chrome,modal=yes,resizable=no,centerscreen",
null); null);
} }
@ -355,14 +355,14 @@ function AbNewAddressBook()
var dialogTitle = bundle.GetStringFromName('newAddressBookTitle'); var dialogTitle = bundle.GetStringFromName('newAddressBookTitle');
var dialog = window.openDialog( var dialog = window.openDialog(
"chrome://messenger/content/addressbook/abAddressBookNameDialog.xul", "chrome://messenger/content/addressbook/abAddressBookNameDialog.xul",
"", "chrome,modal=yes,resizable=no,centerscreen", {title: dialogTitle, okCallback:AbOnCreateNewAddressBook}); "", "chrome,modal=yes,resizable=no,centerscreen", {title: dialogTitle, okCallback:AbOnCreateNewAddressBook});
} }
function AbRenameAddressBook() function AbRenameAddressBook()
{ {
var selectedABURI = GetSelectedDirectory(); var selectedABURI = GetSelectedDirectory();
// the rdf service // the rdf service
var RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); var RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
@ -378,7 +378,7 @@ function AbRenameAddressBook()
var canRename = (selectedABURI != kCollectedAddressbookURI && selectedABURI != kPersonalAddressbookURI); var canRename = (selectedABURI != kCollectedAddressbookURI && selectedABURI != kPersonalAddressbookURI);
var dialog = window.openDialog( var dialog = window.openDialog(
"chrome://messenger/content/addressbook/abAddressBookNameDialog.xul", "chrome://messenger/content/addressbook/abAddressBookNameDialog.xul",
"", "chrome,modal=yes,resizable=no,centerscreen", {title: dialogTitle, canRename: canRename, name: selectedABDirectory.dirName, "", "chrome,modal=yes,resizable=no,centerscreen", {title: dialogTitle, canRename: canRename, name: selectedABDirectory.dirName,
okCallback:AbOnRenameAddressBook}); okCallback:AbOnRenameAddressBook});
} }
@ -445,7 +445,7 @@ function AbPrintCardInternal(doPrintPreview, msgType)
printEngineWindow = window.openDialog("chrome://messenger/content/msgPrintEngine.xul", printEngineWindow = window.openDialog("chrome://messenger/content/msgPrintEngine.xul",
"", "",
"chrome,dialog=no,all", "chrome,dialog=no,all",
totalCard, selectionArray, statusFeedback, totalCard, selectionArray, statusFeedback,
gPrintSettings, doPrintPreview, msgType); gPrintSettings, doPrintPreview, msgType);
return; return;
@ -475,8 +475,8 @@ function AbPrintAddressBookInternal(doPrintPreview, msgType)
return; return;
var statusFeedback; var statusFeedback;
statusFeedback = Components.classes["@mozilla.org/messenger/statusfeedback;1"].createInstance(); statusFeedback = Components.classes["@mozilla.org/messenger/statusfeedback;1"].createInstance();
statusFeedback = statusFeedback.QueryInterface(Components.interfaces.nsIMsgStatusFeedback); statusFeedback = statusFeedback.QueryInterface(Components.interfaces.nsIMsgStatusFeedback);
/* /*
turn "moz-abmdbdirectory://abook.mab" into turn "moz-abmdbdirectory://abook.mab" into
@ -490,12 +490,12 @@ function AbPrintAddressBookInternal(doPrintPreview, msgType)
gPrintSettings = PrintUtils.getPrintSettings(); gPrintSettings = PrintUtils.getPrintSettings();
} }
printEngineWindow = window.openDialog("chrome://messenger/content/msgPrintEngine.xul", printEngineWindow = window.openDialog("chrome://messenger/content/msgPrintEngine.xul",
"", "",
"chrome,dialog=no,all", "chrome,dialog=no,all",
1, [printUrl], statusFeedback, gPrintSettings, doPrintPreview, msgType); 1, [printUrl], statusFeedback, gPrintSettings, doPrintPreview, msgType);
return; return;
} }
function AbPrintAddressBook() function AbPrintAddressBook()
@ -513,7 +513,7 @@ function AbExport()
try { try {
var selectedABURI = GetSelectedDirectory(); var selectedABURI = GetSelectedDirectory();
if (!selectedABURI) return; if (!selectedABURI) return;
var directory = GetDirectoryFromURI(selectedABURI); var directory = GetDirectoryFromURI(selectedABURI);
addressbook.exportAddressBook(window, directory); addressbook.exportAddressBook(window, directory);
} }
@ -535,7 +535,7 @@ function AbExport()
} }
promptService.alert(window, promptService.alert(window,
gAddressBookBundle.getString("failedToExportTitle"), gAddressBookBundle.getString("failedToExportTitle"),
message); message);
} }
} }
@ -548,16 +548,16 @@ function AbDeleteDirectory()
return; return;
var parentArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray); var parentArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
if (!parentArray) if (!parentArray)
return; return;
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
var parentRow = GetParentRow(dirTree, dirTree.currentIndex); var parentRow = GetParentRow(dirTree, dirTree.currentIndex);
var parentId = (parentRow == -1) ? "moz-abdirectory://" : dirTree.builderView.getResourceAtIndex(parentRow).Value; var parentId = (parentRow == -1) ? "moz-abdirectory://" : dirTree.builderView.getResourceAtIndex(parentRow).Value;
var parentDir = GetDirectoryFromURI(parentId); var parentDir = GetDirectoryFromURI(parentId);
parentArray.AppendElement(parentDir); parentArray.AppendElement(parentDir);
var directory = GetDirectoryFromURI(selectedABURI); var directory = GetDirectoryFromURI(selectedABURI);
var confirmDeleteMessage; var confirmDeleteMessage;
var clearPrefsRequired = false; var clearPrefsRequired = false;
@ -619,12 +619,12 @@ function SetStatusText(total)
{ {
if (total == 1) if (total == 1)
statusText = gAddressBookBundle.getString("matchFound"); statusText = gAddressBookBundle.getString("matchFound");
else else
statusText = gAddressBookBundle.getFormattedString("matchesFound", [total]); statusText = gAddressBookBundle.getFormattedString("matchesFound", [total]);
} }
} }
else else
statusText = gAddressBookBundle.getFormattedString("totalCardStatus", [gAbView.directory.dirName, total]); statusText = gAddressBookBundle.getFormattedString("totalCardStatus", [gAbView.directory.dirName, total]);
gStatusText.setAttribute("label", statusText); gStatusText.setAttribute("label", statusText);
} }
@ -655,17 +655,17 @@ function onAdvancedAbSearch()
if (existingSearchWindow) if (existingSearchWindow)
existingSearchWindow.focus(); existingSearchWindow.focus();
else else
window.openDialog("chrome://messenger/content/ABSearchDialog.xul", "", window.openDialog("chrome://messenger/content/ABSearchDialog.xul", "",
"chrome,resizable,status,centerscreen,dialog=no", "chrome,resizable,status,centerscreen,dialog=no",
{directory: selectedABURI}); {directory: selectedABURI});
} }
function onEnterInSearchBar() function onEnterInSearchBar()
{ {
ClearCardViewPane(); ClearCardViewPane();
if (!gQueryURIFormat) if (!gQueryURIFormat)
gQueryURIFormat = gPrefs.getComplexValue("mail.addr_book.quicksearchquery.format", gQueryURIFormat = gPrefs.getComplexValue("mail.addr_book.quicksearchquery.format",
Components.interfaces.nsIPrefLocalizedString).data; Components.interfaces.nsIPrefLocalizedString).data;
var searchURI = GetSelectedDirectory(); var searchURI = GetSelectedDirectory();
@ -676,7 +676,7 @@ function onEnterInSearchBar()
/* /*
XXX todo, handle the case where the LDAP url XXX todo, handle the case where the LDAP url
already has a query, like already has a query, like
moz-abldapdirectory://nsdirectory.netscape.com:389/ou=People,dc=netscape,dc=com?(or(Department,=,Applications)) moz-abldapdirectory://nsdirectory.netscape.com:389/ou=People,dc=netscape,dc=com?(or(Department,=,Applications))
*/ */
if (gSearchInput.value != "") { if (gSearchInput.value != "") {
@ -686,9 +686,9 @@ function onEnterInSearchBar()
} }
SetAbView(searchURI, gSearchInput.value != "", sortColumn, sortDirection); SetAbView(searchURI, gSearchInput.value != "", sortColumn, sortDirection);
// XXX todo // XXX todo
// this works for synchronous searches of local addressbooks, // this works for synchronous searches of local addressbooks,
// but not for LDAP searches // but not for LDAP searches
SelectFirstCard(); SelectFirstCard();
} }
@ -713,9 +713,9 @@ function SwitchPaneFocus(event)
if(cardViewBoxEmail1) if(cardViewBoxEmail1)
cardViewBoxEmail1.focus(); cardViewBoxEmail1.focus();
else else
cardViewBox.focus(); cardViewBox.focus();
} }
else else
gAbResultsTree.focus(); gAbResultsTree.focus();
} }
else else
@ -727,7 +727,7 @@ function SwitchPaneFocus(event)
if(cardViewBoxEmail1) if(cardViewBoxEmail1)
cardViewBoxEmail1.focus(); cardViewBoxEmail1.focus();
else else
cardViewBox.focus(); cardViewBox.focus();
} }
else if (focusedElement != dirTree && !IsDirPaneCollapsed()) else if (focusedElement != dirTree && !IsDirPaneCollapsed())
dirTree.focus(); dirTree.focus();
@ -743,7 +743,7 @@ function WhichPaneHasFocus()
var cardViewBox = GetCardViewBox(); var cardViewBox = GetCardViewBox();
var searchBox = document.getElementById('search-container'); var searchBox = document.getElementById('search-container');
var dirTree = GetDirTree(); var dirTree = GetDirTree();
var currentNode = top.document.commandDispatcher.focusedElement; var currentNode = top.document.commandDispatcher.focusedElement;
while (currentNode) while (currentNode)
{ {

View File

@ -103,7 +103,7 @@ function awGetSelectItemIndex(itemData)
selectElementIndexTable[aData] = i; selectElementIndexTable[aData] = i;
} }
} }
return selectElementIndexTable[itemData]; return selectElementIndexTable[itemData];
} }
@ -161,7 +161,7 @@ function Recipients2CompFields(msgCompFields)
case "addr_to" : addrTo += to_Sep + recipient; to_Sep = ","; break; case "addr_to" : addrTo += to_Sep + recipient; to_Sep = ","; break;
case "addr_cc" : addrCc += cc_Sep + recipient; cc_Sep = ","; break; case "addr_cc" : addrCc += cc_Sep + recipient; cc_Sep = ","; break;
case "addr_bcc" : addrBcc += bcc_Sep + recipient; bcc_Sep = ","; break; case "addr_bcc" : addrBcc += bcc_Sep + recipient; bcc_Sep = ","; break;
case "addr_reply" : addrReply += reply_Sep + recipient; reply_Sep = ","; break; case "addr_reply" : addrReply += reply_Sep + recipient; reply_Sep = ","; break;
case "addr_newsgroups" : addrNg += ng_Sep + fieldValue; ng_Sep = ","; break; case "addr_newsgroups" : addrNg += ng_Sep + fieldValue; ng_Sep = ","; break;
case "addr_followup" : addrFollow += follow_Sep + fieldValue; follow_Sep = ","; break; case "addr_followup" : addrFollow += follow_Sep + fieldValue; follow_Sep = ","; break;
// do CRLF, same as PUSH_NEWLINE() in nsMsgSend.h / nsMsgCompUtils.cpp // do CRLF, same as PUSH_NEWLINE() in nsMsgSend.h / nsMsgCompUtils.cpp
@ -198,7 +198,7 @@ function CompFields2Recipients(msgCompFields)
var templateNode = listbox.getElementsByTagName("listitem")[0]; var templateNode = listbox.getElementsByTagName("listitem")[0];
// dump("replacing child in comp fields 2 recips \n"); // dump("replacing child in comp fields 2 recips \n");
listbox.parentNode.replaceChild(newListBoxNode, listbox); listbox.parentNode.replaceChild(newListBoxNode, listbox);
top.MAX_RECIPIENTS = 0; top.MAX_RECIPIENTS = 0;
var msgReplyTo = msgCompFields.replyTo; var msgReplyTo = msgCompFields.replyTo;
var msgTo = msgCompFields.to; var msgTo = msgCompFields.to;
@ -208,10 +208,10 @@ function CompFields2Recipients(msgCompFields)
var msgNewsgroups = msgCompFields.newsgroups; var msgNewsgroups = msgCompFields.newsgroups;
var msgFollowupTo = msgCompFields.followupTo; var msgFollowupTo = msgCompFields.followupTo;
if(msgReplyTo) if(msgReplyTo)
awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgReplyTo, false), awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgReplyTo, false),
"addr_reply", newListBoxNode, templateNode); "addr_reply", newListBoxNode, templateNode);
if(msgTo) if(msgTo)
awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgTo, false), awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgTo, false),
"addr_to", newListBoxNode, templateNode); "addr_to", newListBoxNode, templateNode);
if(msgCC) if(msgCC)
awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCC, false), awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCC, false),
@ -232,7 +232,7 @@ function CompFields2Recipients(msgCompFields)
awFitDummyRows(2); awFitDummyRows(2);
// CompFields2Recipients is called whenever a user replies or edits an existing message. We want to // CompFields2Recipients is called whenever a user replies or edits an existing message. We want to
// add all of the recipients for this message to the ignore list for spell check // add all of the recipients for this message to the ignore list for spell check
addRecipientsToIgnoreList((gCurrentIdentity ? gCurrentIdentity.identityName + ', ' : '') + msgTo + ', ' + msgCC + ', ' + msgBCC); addRecipientsToIgnoreList((gCurrentIdentity ? gCurrentIdentity.identityName + ', ' : '') + msgTo + ', ' + msgCC + ', ' + msgBCC);
gMimeHeaderParser = null; //Release the mime parser gMimeHeaderParser = null; //Release the mime parser
@ -344,25 +344,25 @@ function awAddRecipients(msgCompFields, recipientType, recipientsList)
// this was broken out of awAddRecipients so it can be re-used...adds a new row matching recipientType and // this was broken out of awAddRecipients so it can be re-used...adds a new row matching recipientType and
// drops in the single address. // drops in the single address.
function awAddRecipient(recipientType, address) function awAddRecipient(recipientType, address)
{ {
for (var row = 1; row <= top.MAX_RECIPIENTS; row ++) for (var row = 1; row <= top.MAX_RECIPIENTS; row ++)
{ {
if (awGetInputElement(row).value == "") if (awGetInputElement(row).value == "")
break; break;
} }
if (row > top.MAX_RECIPIENTS) if (row > top.MAX_RECIPIENTS)
awAppendNewRow(false); awAppendNewRow(false);
awSetInputAndPopupValue(awGetInputElement(row), address, awGetPopupElement(row), recipientType, row); awSetInputAndPopupValue(awGetInputElement(row), address, awGetPopupElement(row), recipientType, row);
/* be sure we still have an empty row left at the end */ /* be sure we still have an empty row left at the end */
if (row == top.MAX_RECIPIENTS) if (row == top.MAX_RECIPIENTS)
{ {
awAppendNewRow(true); awAppendNewRow(true);
awSetInputAndPopupValue(awGetInputElement(top.MAX_RECIPIENTS), "", awGetPopupElement(top.MAX_RECIPIENTS), "addr_to", top.MAX_RECIPIENTS); awSetInputAndPopupValue(awGetInputElement(top.MAX_RECIPIENTS), "", awGetPopupElement(top.MAX_RECIPIENTS), "addr_to", top.MAX_RECIPIENTS);
} }
// add the recipient to our spell check ignore list // add the recipient to our spell check ignore list
addRecipientsToIgnoreList(address); addRecipientsToIgnoreList(address);
} }
@ -410,7 +410,7 @@ function awTestRowSequence()
function awResetAllRows() function awResetAllRows()
{ {
var maxRecipients = top.MAX_RECIPIENTS; var maxRecipients = top.MAX_RECIPIENTS;
for (var row = 1; row <= maxRecipients ; row ++) for (var row = 1; row <= maxRecipients ; row ++)
{ {
awGetInputElement(row).value = ""; awGetInputElement(row).value = "";
@ -552,14 +552,14 @@ function awAppendNewRow(setFocus)
{ {
input[0].setAttribute("value", ""); input[0].setAttribute("value", "");
input[0].setAttribute("id", "addressCol2#" + top.MAX_RECIPIENTS); input[0].setAttribute("id", "addressCol2#" + top.MAX_RECIPIENTS);
//this copies the autocomplete sessions list from recipient#1 //this copies the autocomplete sessions list from recipient#1
input[0].syncSessions(document.getElementById('addressCol2#1')); input[0].syncSessions(document.getElementById('addressCol2#1'));
// also clone the showCommentColumn setting // also clone the showCommentColumn setting
// //
input[0].showCommentColumn = input[0].showCommentColumn =
document.getElementById("addressCol2#1").showCommentColumn; document.getElementById("addressCol2#1").showCommentColumn;
// We always clone the first row. The problem is that the first row // We always clone the first row. The problem is that the first row
// could be focused. When we clone that row, we end up with a cloned // could be focused. When we clone that row, we end up with a cloned
@ -576,7 +576,7 @@ function awAppendNewRow(setFocus)
var select = newNode.getElementsByTagName(awSelectElementName()); var select = newNode.getElementsByTagName(awSelectElementName());
if ( select && select.length == 1 ) if ( select && select.length == 1 )
{ {
// It only makes sense to clone some field types; others // It only makes sense to clone some field types; others
// should not be cloned, since it just makes the user have // should not be cloned, since it just makes the user have
// to go to the trouble of selecting something else. In such // to go to the trouble of selecting something else. In such
// cases let's default to 'To' (a reasonable default since // cases let's default to 'To' (a reasonable default since
@ -587,7 +587,7 @@ function awAppendNewRow(setFocus)
case "addr_reply": case "addr_reply":
case "addr_other": case "addr_other":
select[0].selectedIndex = awGetSelectItemIndex("addr_to"); select[0].selectedIndex = awGetSelectItemIndex("addr_to");
break; break;
case "addr_followup": case "addr_followup":
select[0].selectedIndex = awGetSelectItemIndex("addr_newsgroups"); select[0].selectedIndex = awGetSelectItemIndex("addr_newsgroups");
break; break;
@ -595,7 +595,7 @@ function awAppendNewRow(setFocus)
// e.g. "addr_to","addr_cc","addr_bcc","addr_newsgroups": // e.g. "addr_to","addr_cc","addr_bcc","addr_newsgroups":
select[0].selectedIndex = awGetSelectItemIndex(lastRecipientType); select[0].selectedIndex = awGetSelectItemIndex(lastRecipientType);
} }
select[0].setAttribute("id", "addressCol1#" + top.MAX_RECIPIENTS); select[0].setAttribute("id", "addressCol1#" + top.MAX_RECIPIENTS);
if (input) if (input)
_awSetAutoComplete(select[0], input[0]); _awSetAutoComplete(select[0], input[0]);
@ -762,7 +762,7 @@ function DragOverAddressingWidget(event)
var validFlavor = false; var validFlavor = false;
var dragSession = dragSession = gDragService.getCurrentSession(); var dragSession = dragSession = gDragService.getCurrentSession();
if (dragSession.isDataFlavorSupported("text/x-moz-address")) if (dragSession.isDataFlavorSupported("text/x-moz-address"))
validFlavor = true; validFlavor = true;
if (validFlavor) if (validFlavor)
@ -772,7 +772,7 @@ function DragOverAddressingWidget(event)
function DropOnAddressingWidget(event) function DropOnAddressingWidget(event)
{ {
var dragSession = gDragService.getCurrentSession(); var dragSession = gDragService.getCurrentSession();
var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable); var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);
trans.addDataFlavor("text/x-moz-address"); trans.addDataFlavor("text/x-moz-address");
@ -783,9 +783,9 @@ function DropOnAddressingWidget(event)
var bestFlavor = new Object(); var bestFlavor = new Object();
var len = new Object(); var len = new Object();
trans.getAnyTransferData ( bestFlavor, dataObj, len ); trans.getAnyTransferData ( bestFlavor, dataObj, len );
if ( dataObj ) if ( dataObj )
dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsString); dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsString);
if ( !dataObj ) if ( !dataObj )
continue; continue;
// pull the address out of the data object // pull the address out of the data object
@ -824,7 +824,7 @@ function awRecipientTextCommand(userAction, element)
// Called when an autocomplete session item is selected and the status of // Called when an autocomplete session item is selected and the status of
// the session it was selected from is nsIAutoCompleteStatus::failureItems. // the session it was selected from is nsIAutoCompleteStatus::failureItems.
// //
// As of this writing, the only way that can happen is when an LDAP // As of this writing, the only way that can happen is when an LDAP
// autocomplete session returns an error to be displayed to the user. // autocomplete session returns an error to be displayed to the user.
// //
// There are hardcoded messages in here, but these are just fallbacks for // There are hardcoded messages in here, but these are just fallbacks for
@ -832,37 +832,37 @@ function awRecipientTextCommand(userAction, element)
// //
function awRecipientErrorCommand(errItem, element) function awRecipientErrorCommand(errItem, element)
{ {
// remove the angle brackets from the general error message to construct // remove the angle brackets from the general error message to construct
// the title for the alert. someday we'll pass this info using a real // the title for the alert. someday we'll pass this info using a real
// exception object, and then this code can go away. // exception object, and then this code can go away.
// //
var generalErrString; var generalErrString;
if (errItem.value != "") if (errItem.value != "")
generalErrString = errItem.value.slice(1, errItem.value.length-1); generalErrString = errItem.value.slice(1, errItem.value.length-1);
else else
generalErrString = "Unknown LDAP server problem encountered"; generalErrString = "Unknown LDAP server problem encountered";
// try and get the string of the specific error to contruct the complete // try and get the string of the specific error to contruct the complete
// err msg, otherwise fall back to something generic. This message is // err msg, otherwise fall back to something generic. This message is
// handed to us as an nsISupportsString in the param slot of the // handed to us as an nsISupportsString in the param slot of the
// autocomplete error item, by agreement documented in // autocomplete error item, by agreement documented in
// nsILDAPAutoCompFormatter.idl // nsILDAPAutoCompFormatter.idl
// //
var specificErrString = ""; var specificErrString = "";
try try
{ {
var specificError = errItem.param.QueryInterface(Components.interfaces.nsISupportsString); var specificError = errItem.param.QueryInterface(Components.interfaces.nsISupportsString);
specificErrString = specificError.data; specificErrString = specificError.data;
} catch (ex) } catch (ex)
{} {}
if (specificErrString == "")
specificErrString = "Internal error";
if (gPromptService) if (specificErrString == "")
specificErrString = "Internal error";
if (gPromptService)
gPromptService.alert(window, generalErrString, specificErrString); gPromptService.alert(window, generalErrString, specificErrString);
else else
window.alert(generalErrString + ": " + specificErrString); window.alert(generalErrString + ": " + specificErrString);
} }
function awRecipientKeyPress(event, element) function awRecipientKeyPress(event, element)
@ -876,7 +876,7 @@ function awRecipientKeyPress(event, element)
break; break;
case KeyEvent.DOM_VK_RETURN: case KeyEvent.DOM_VK_RETURN:
case KeyEvent.DOM_VK_TAB: case KeyEvent.DOM_VK_TAB:
// if the user text contains a comma or a line return, ignore // if the user text contains a comma or a line return, ignore
if (element.value.search(',') != -1) if (element.value.search(',') != -1)
{ {
var addresses = element.value; var addresses = element.value;
@ -885,7 +885,7 @@ function awRecipientKeyPress(event, element)
} }
else if (event.keyCode == KeyEvent.DOM_VK_TAB) else if (event.keyCode == KeyEvent.DOM_VK_TAB)
awTabFromRecipient(element, event); awTabFromRecipient(element, event);
break; break;
} }
} }
@ -1066,8 +1066,8 @@ function awDocumentKeyPress(event)
function awRecipientInputCommand(event, inputElement) function awRecipientInputCommand(event, inputElement)
{ {
gContentChanged=true; gContentChanged=true;
setupAutocomplete(); setupAutocomplete();
} }
// Given an arbitrary block of text like a comma delimited list of names or a names separated by spaces, // Given an arbitrary block of text like a comma delimited list of names or a names separated by spaces,
@ -1103,8 +1103,8 @@ function AutomatedAutoCompleteHandler()
{ {
} }
// state driven self contained object which will autocomplete a block of addresses without any UI. // state driven self contained object which will autocomplete a block of addresses without any UI.
// force picks the first match and adds it to the addressing widget, then goes on to the next // force picks the first match and adds it to the addressing widget, then goes on to the next
// name to complete. // name to complete.
AutomatedAutoCompleteHandler.prototype = AutomatedAutoCompleteHandler.prototype =
@ -1144,7 +1144,7 @@ AutomatedAutoCompleteHandler.prototype =
if (this.namesToComplete[this.indexIntoNames].search('@') == -1) // don't autocomplete if address has an @ sign in it if (this.namesToComplete[this.indexIntoNames].search('@') == -1) // don't autocomplete if address has an @ sign in it
{ {
// make sure total session count is updated before we kick off ANY actual searches // make sure total session count is updated before we kick off ANY actual searches
if (gAutocompleteSession) if (gAutocompleteSession)
this.numSessionsToSearch++; this.numSessionsToSearch++;
if (gLDAPSession && gCurrentAutocompleteDirectory) if (gLDAPSession && gCurrentAutocompleteDirectory)
@ -1174,17 +1174,17 @@ AutomatedAutoCompleteHandler.prototype =
} }
}, },
onStatus:function(aStatus) onStatus:function(aStatus)
{ {
return; return;
}, },
onAutoComplete: function(aResults, aStatus) onAutoComplete: function(aResults, aStatus)
{ {
// store the results until all sessions are done and have reported in // store the results until all sessions are done and have reported in
if (aResults) if (aResults)
this.searchResults[this.numSessionsSearched] = aResults; this.searchResults[this.numSessionsSearched] = aResults;
this.numSessionsSearched++; // bump our counter this.numSessionsSearched++; // bump our counter
if (this.numSessionsToSearch <= this.numSessionsSearched) if (this.numSessionsToSearch <= this.numSessionsSearched)
@ -1197,7 +1197,7 @@ AutomatedAutoCompleteHandler.prototype =
var addressToAdd; var addressToAdd;
// loop through the results looking for the non default case (default case is the address book with only one match, the default domain) // loop through the results looking for the non default case (default case is the address book with only one match, the default domain)
var sessionIndex; var sessionIndex;
var searchResultsForSession; var searchResultsForSession;
@ -1230,8 +1230,8 @@ AutomatedAutoCompleteHandler.prototype =
addressToAdd = this.namesToComplete[this.indexIntoNames]; addressToAdd = this.namesToComplete[this.indexIntoNames];
// that will automatically set the focus on a new available row, and make sure it is visible // that will automatically set the focus on a new available row, and make sure it is visible
awAddRecipient(this.recipientType ? this.recipientType : "addr_to", addressToAdd); awAddRecipient(this.recipientType ? this.recipientType : "addr_to", addressToAdd);
this.indexIntoNames++; this.indexIntoNames++;
this.autoCompleteNextAddress(); this.autoCompleteNextAddress();
}, },

View File

@ -54,30 +54,30 @@ var MigrationWizard = {
os.addObserver(this, "Migration:ItemAfterMigrate", false); os.addObserver(this, "Migration:ItemAfterMigrate", false);
os.addObserver(this, "Migration:Ended", false); os.addObserver(this, "Migration:Ended", false);
os.addObserver(this, "Migration:Progress", false); os.addObserver(this, "Migration:Progress", false);
this._wiz = document.documentElement; this._wiz = document.documentElement;
if ("arguments" in window) { if ("arguments" in window) {
this._source = window.arguments[0]; this._source = window.arguments[0];
this._migrator = window.arguments[1] ? window.arguments[1].QueryInterface(kIMig) : null; this._migrator = window.arguments[1] ? window.arguments[1].QueryInterface(kIMig) : null;
this._autoMigrate = window.arguments[2].QueryInterface(kIPStartup); this._autoMigrate = window.arguments[2].QueryInterface(kIPStartup);
// Show the "nothing" option in the automigrate case to provide an // Show the "nothing" option in the automigrate case to provide an
// easily identifiable way to avoid migration and create a new profile. // easily identifiable way to avoid migration and create a new profile.
var nothing = document.getElementById("nothing"); var nothing = document.getElementById("nothing");
nothing.hidden = false; nothing.hidden = false;
} }
this.onImportSourcePageShow(); this.onImportSourcePageShow();
// Behavior alert! If we were given a migrator already, then we are going to perform migration // Behavior alert! If we were given a migrator already, then we are going to perform migration
// with that migrator, skip the wizard screen where we show all of the migration sources and // with that migrator, skip the wizard screen where we show all of the migration sources and
// jump right into migration. // jump right into migration.
if (this._migrator) if (this._migrator)
{ {
if (this._migrator.sourceHasMultipleProfiles) if (this._migrator.sourceHasMultipleProfiles)
this._wiz.goTo("selectProfile"); this._wiz.goTo("selectProfile");
else else
{ {
var sourceProfiles = this._migrator.sourceProfiles; var sourceProfiles = this._migrator.sourceProfiles;
var profileName = sourceProfiles.QueryElementAt(0, Components.interfaces.nsISupportsString); var profileName = sourceProfiles.QueryElementAt(0, Components.interfaces.nsISupportsString);
@ -86,7 +86,7 @@ var MigrationWizard = {
} }
} }
}, },
uninit: function () uninit: function ()
{ {
var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
@ -96,12 +96,12 @@ var MigrationWizard = {
os.removeObserver(this, "Migration:Ended"); os.removeObserver(this, "Migration:Ended");
os.removeObserver(this, "Migration:Progress"); os.removeObserver(this, "Migration:Progress");
}, },
// 1 - Import Source // 1 - Import Source
onImportSourcePageShow: function () onImportSourcePageShow: function ()
{ {
this._wiz.canRewind = false; this._wiz.canRewind = false;
// Figure out what source apps are are available to import from: // Figure out what source apps are are available to import from:
var group = document.getElementById("importSourceGroup"); var group = document.getElementById("importSourceGroup");
for (var i = 0; i < group.childNodes.length; ++i) { for (var i = 0; i < group.childNodes.length; ++i) {
@ -115,26 +115,26 @@ var MigrationWizard = {
} }
} }
} }
var firstNonDisabled = null; var firstNonDisabled = null;
for (var i = 0; i < group.childNodes.length; ++i) { for (var i = 0; i < group.childNodes.length; ++i) {
if (!group.childNodes[i].hidden) { if (!group.childNodes[i].hidden) {
firstNonDisabled = group.childNodes[i]; firstNonDisabled = group.childNodes[i];
break; break;
} }
} }
group.selectedItem = this._source == "" ? firstNonDisabled : document.getElementById(this._source); group.selectedItem = this._source == "" ? firstNonDisabled : document.getElementById(this._source);
}, },
onImportSourcePageAdvanced: function () onImportSourcePageAdvanced: function ()
{ {
var newSource = document.getElementById("importSourceGroup").selectedItem.id; var newSource = document.getElementById("importSourceGroup").selectedItem.id;
if (newSource == "nothing") { if (newSource == "nothing") {
document.documentElement.cancel(); document.documentElement.cancel();
return; return;
} }
if (!this._migrator || (newSource != this._source)) { if (!this._migrator || (newSource != this._source)) {
// Create the migrator for the selected source. // Create the migrator for the selected source.
var contractID = kProfileMigratorContractIDPrefix + newSource; var contractID = kProfileMigratorContractIDPrefix + newSource;
@ -143,9 +143,9 @@ var MigrationWizard = {
this._itemsFlags = kIMig.ALL; this._itemsFlags = kIMig.ALL;
this._selectedProfile = null; this._selectedProfile = null;
} }
this._source = newSource; this._source = newSource;
// check for more than one source profile // check for more than one source profile
if (this._migrator.sourceHasMultipleProfiles) if (this._migrator.sourceHasMultipleProfiles)
this._wiz.currentPage.next = "selectProfile"; this._wiz.currentPage.next = "selectProfile";
@ -160,7 +160,7 @@ var MigrationWizard = {
this._selectedProfile = ""; this._selectedProfile = "";
} }
}, },
// 2 - [Profile Selection] // 2 - [Profile Selection]
onSelectProfilePageShow: function () onSelectProfilePageShow: function ()
{ {
@ -168,11 +168,11 @@ var MigrationWizard = {
// too and don't want to disable the back button // too and don't want to disable the back button
// if (this._autoMigrate) // if (this._autoMigrate)
// document.documentElement.getButton("back").disabled = true; // document.documentElement.getButton("back").disabled = true;
var profiles = document.getElementById("profiles"); var profiles = document.getElementById("profiles");
while (profiles.hasChildNodes()) while (profiles.hasChildNodes())
profiles.removeChild(profiles.firstChild); profiles.removeChild(profiles.firstChild);
var sourceProfiles = this._migrator.sourceProfiles; var sourceProfiles = this._migrator.sourceProfiles;
var count = sourceProfiles.Count(); var count = sourceProfiles.Count();
for (var i = 0; i < count; ++i) { for (var i = 0; i < count; ++i) {
@ -182,35 +182,35 @@ var MigrationWizard = {
item.setAttribute("label", str.data); item.setAttribute("label", str.data);
profiles.appendChild(item); profiles.appendChild(item);
} }
profiles.selectedItem = this._selectedProfile ? document.getElementById(this._selectedProfile) : profiles.firstChild; profiles.selectedItem = this._selectedProfile ? document.getElementById(this._selectedProfile) : profiles.firstChild;
}, },
onSelectProfilePageRewound: function () onSelectProfilePageRewound: function ()
{ {
var profiles = document.getElementById("profiles"); var profiles = document.getElementById("profiles");
this._selectedProfile = profiles.selectedItem.id; this._selectedProfile = profiles.selectedItem.id;
}, },
onSelectProfilePageAdvanced: function () onSelectProfilePageAdvanced: function ()
{ {
var profiles = document.getElementById("profiles"); var profiles = document.getElementById("profiles");
this._selectedProfile = profiles.selectedItem.id; this._selectedProfile = profiles.selectedItem.id;
// If we're automigrating, don't show the item selection page, just grab everything. // If we're automigrating, don't show the item selection page, just grab everything.
if (this._autoMigrate) if (this._autoMigrate)
this._wiz.currentPage.next = "migrating"; this._wiz.currentPage.next = "migrating";
}, },
// 3 - ImportItems // 3 - ImportItems
onImportItemsPageShow: function () onImportItemsPageShow: function ()
{ {
var dataSources = document.getElementById("dataSources"); var dataSources = document.getElementById("dataSources");
while (dataSources.hasChildNodes()) while (dataSources.hasChildNodes())
dataSources.removeChild(dataSources.firstChild); dataSources.removeChild(dataSources.firstChild);
var bundle = document.getElementById("bundle"); var bundle = document.getElementById("bundle");
var items = this._migrator.getMigrateData(this._selectedProfile, this._autoMigrate); var items = this._migrator.getMigrateData(this._selectedProfile, this._autoMigrate);
for (var i = 0; i < 16; ++i) { for (var i = 0; i < 16; ++i) {
var itemID = (items >> i) & 0x1 ? Math.pow(2, i) : 0; var itemID = (items >> i) & 0x1 ? Math.pow(2, i) : 0;
@ -235,7 +235,7 @@ var MigrationWizard = {
this._itemsFlags |= parseInt(checkbox.id); this._itemsFlags |= parseInt(checkbox.id);
} }
}, },
onImportItemCommand: function (aEvent) onImportItemCommand: function (aEvent)
{ {
var items = document.getElementById("dataSources"); var items = document.getElementById("dataSources");
@ -251,14 +251,14 @@ var MigrationWizard = {
this._wiz.canAdvance = oneChecked; this._wiz.canAdvance = oneChecked;
}, },
// 4 - Migrating // 4 - Migrating
onMigratingPageShow: function () onMigratingPageShow: function ()
{ {
this._wiz.getButton("cancel").disabled = true; this._wiz.getButton("cancel").disabled = true;
this._wiz.canRewind = false; this._wiz.canRewind = false;
this._wiz.canAdvance = false; this._wiz.canAdvance = false;
// When automigrating, show all of the data that can be received from this source. // When automigrating, show all of the data that can be received from this source.
if (this._autoMigrate) if (this._autoMigrate)
this._itemsFlags = this._migrator.getMigrateData(this._selectedProfile, this._autoMigrate); this._itemsFlags = this._migrator.getMigrateData(this._selectedProfile, this._autoMigrate);
@ -266,18 +266,18 @@ var MigrationWizard = {
this._listItems("migratingItems"); this._listItems("migratingItems");
setTimeout(this.onMigratingMigrate, 0, this); setTimeout(this.onMigratingMigrate, 0, this);
}, },
onMigratingMigrate: function (aOuter) onMigratingMigrate: function (aOuter)
{ {
aOuter._migrator.migrate(aOuter._itemsFlags, aOuter._autoMigrate, aOuter._selectedProfile); aOuter._migrator.migrate(aOuter._itemsFlags, aOuter._autoMigrate, aOuter._selectedProfile);
}, },
_listItems: function (aID) _listItems: function (aID)
{ {
var items = document.getElementById(aID); var items = document.getElementById(aID);
while (items.hasChildNodes()) while (items.hasChildNodes())
items.removeChild(items.firstChild); items.removeChild(items.firstChild);
var bundle = document.getElementById("bundle"); var bundle = document.getElementById("bundle");
var itemID; var itemID;
for (var i = 0; i < 16; ++i) { for (var i = 0; i < 16; ++i) {
@ -291,13 +291,13 @@ var MigrationWizard = {
} }
catch (e) { catch (e) {
// if the block above throws, we've enumerated all the import data types we // if the block above throws, we've enumerated all the import data types we
// currently support and are now just wasting time, break. // currently support and are now just wasting time, break.
break; break;
} }
} }
} }
}, },
observe: function (aSubject, aTopic, aData) observe: function (aSubject, aTopic, aData)
{ {
switch (aTopic) { switch (aTopic) {
@ -335,7 +335,7 @@ var MigrationWizard = {
break; break;
} }
}, },
onDonePageShow: function () onDonePageShow: function ()
{ {
this._wiz.getButton("cancel").disabled = true; this._wiz.getButton("cancel").disabled = true;

View File

@ -70,3 +70,10 @@ function PROT_Application() {
PROT_Application.prototype.getReportPhishingURL = function() { PROT_Application.prototype.getReportPhishingURL = function() {
return gDataProvider.getReportPhishURL(); return gDataProvider.getReportPhishURL();
} }
/**
* @return String the report error URL (localized).
*/
PROT_Application.prototype.getReportErrorURL = function() {
return gDataProvider.getReportErrorURL();
}

View File

@ -46,7 +46,7 @@
<overlay id="AdvancedPaneOverlay" <overlay id="AdvancedPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneAdvanced" onpaneload="gAdvancedPane.init();" <prefpane id="paneAdvanced" onpaneload="gAdvancedPane.init();"
xmlns:xhtml2="http://www.w3.org/TR/xhtml2" xmlns:xhtml2="http://www.w3.org/TR/xhtml2"
xmlns:wairole="http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#" xmlns:wairole="http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#"
@ -64,7 +64,7 @@
<preference id="mailnews.reuse_message_window" name="mailnews.reuse_message_window" type="bool"/> <preference id="mailnews.reuse_message_window" name="mailnews.reuse_message_window" type="bool"/>
<preference id="mailnews.tcptimeout" name="mailnews.tcptimeout" type="int"/> <preference id="mailnews.tcptimeout" name="mailnews.tcptimeout" type="int"/>
<preference id="mail.prompt_purge_threshhold" name="mail.prompt_purge_threshhold" type="bool"/> <preference id="mail.prompt_purge_threshhold" name="mail.prompt_purge_threshhold" type="bool"/>
<preference id="mail.purge_threshhold" name="mail.purge_threshhold" type="int"/> <preference id="mail.purge_threshhold" name="mail.purge_threshhold" type="int"/>
<preference id="app.update.enabled" name="app.update.enabled" type="bool" <preference id="app.update.enabled" name="app.update.enabled" type="bool"
onchange="gAdvancedPane.updateAppUpdateItems(); onchange="gAdvancedPane.updateAppUpdateItems();
gAdvancedPane.updateAutoItems(); gAdvancedPane.updateAutoItems();
@ -86,7 +86,7 @@
type="bool"/> type="bool"/>
<preference id="security.disable_button.openDeviceManager" <preference id="security.disable_button.openDeviceManager"
name="security.disable_button.openDeviceManager" name="security.disable_button.openDeviceManager"
type="bool"/> type="bool"/>
</preferences> </preferences>
<tabbox id="advancedPrefs" flex="1" onselect="gAdvancedPane.tabSelectionChanged();"> <tabbox id="advancedPrefs" flex="1" onselect="gAdvancedPane.tabSelectionChanged();">
@ -96,15 +96,15 @@
<tab label="&itemUpdate.label;"/> <tab label="&itemUpdate.label;"/>
<tab label="&itemCertificates.label;"/> <tab label="&itemCertificates.label;"/>
</tabs> </tabs>
<tabpanels flex="1"> <tabpanels flex="1">
<!-- General --> <!-- General -->
<tabpanel orient="vertical"> <tabpanel orient="vertical">
<hbox align="center" pack="start"> <hbox align="center" pack="start">
<checkbox id="showCondensedAddresses" label="&showCondensedAddresses.label;" <checkbox id="showCondensedAddresses" label="&showCondensedAddresses.label;"
accesskey="&showCondensedAddresses.accesskey;" preference="mail.showCondensedAddresses"/> accesskey="&showCondensedAddresses.accesskey;" preference="mail.showCondensedAddresses"/>
</hbox> </hbox>
<hbox align="center" pack="start"> <hbox align="center" pack="start">
<checkbox id="markAsRead" label="&markAsRead.label;" accesskey="&markAsRead.accesskey;" <checkbox id="markAsRead" label="&markAsRead.label;" accesskey="&markAsRead.accesskey;"
preference="mailnews.mark_message_read.delay" preference="mailnews.mark_message_read.delay"
@ -120,25 +120,25 @@
</hbox> </hbox>
<hbox align="center" pack="start"> <hbox align="center" pack="start">
<checkbox id="showFolderPaneColumns" label="&showFolderColumns.label;" <checkbox id="showFolderPaneColumns" label="&showFolderColumns.label;"
accesskey="&showFolderColumns.accesskey;" preference="mail.showFolderPaneColumns"/> accesskey="&showFolderColumns.accesskey;" preference="mail.showFolderPaneColumns"/>
</hbox> </hbox>
<separator class="thin"/> <separator class="thin"/>
<vbox> <vbox>
<hbox align="center" pack="start"> <hbox align="center" pack="start">
<label value="&openMsgIn.label;"/> <label value="&openMsgIn.label;"/>
</hbox> </hbox>
<hbox class="indent"> <hbox class="indent">
<radiogroup id="mailnewsDoubleClick2NewWindow" preference="mailnews.reuse_message_window" orient="horizontal"> <radiogroup id="mailnewsDoubleClick2NewWindow" preference="mailnews.reuse_message_window" orient="horizontal">
<radio value="false" label="&reuseExpRadio0.label;" accesskey="&reuseExpRadio0.accesskey;" id="new"/> <radio value="false" label="&reuseExpRadio0.label;" accesskey="&reuseExpRadio0.accesskey;" id="new"/>
<radio value="true" label="&reuseExpRadio1.label;" accesskey="&reuseExpRadio1.accesskey;" id="existing"/> <radio value="true" label="&reuseExpRadio1.label;" accesskey="&reuseExpRadio1.accesskey;" id="existing"/>
</radiogroup> </radiogroup>
</hbox> </hbox>
</vbox> </vbox>
<separator class="thin"/> <separator class="thin"/>
<hbox align="center"> <hbox align="center">
@ -150,10 +150,10 @@
<hbox align="center" pack="start"> <hbox align="center" pack="start">
<description flex="1">&configEditDesc.label;</description> <description flex="1">&configEditDesc.label;</description>
<button id="configEditor" label="&configEdit.label;" <button id="configEditor" label="&configEdit.label;"
accesskey="&configEdit.accesskey;" oncommand="gAdvancedPane.showConfigEdit();"/> accesskey="&configEdit.accesskey;" oncommand="gAdvancedPane.showConfigEdit();"/>
</hbox> </hbox>
</tabpanel> </tabpanel>
<tabpanel orient="vertical"> <tabpanel orient="vertical">
@ -162,8 +162,8 @@
<caption label="&connectionsInfo.caption;"/> <caption label="&connectionsInfo.caption;"/>
<hbox align="center"> <hbox align="center">
<description flex="1" control="catProxiesButton">&proxiesInfo.label;</description> <description flex="1" control="catProxiesButton">&proxiesInfo.label;</description>
<button id="catProxiesButton" label="&showConnections.label;" <button id="catProxiesButton" label="&showConnections.label;"
accesskey="&showConnections.accesskey;" accesskey="&showConnections.accesskey;"
oncommand="gAdvancedPane.showConnections();"/> oncommand="gAdvancedPane.showConnections();"/>
</hbox> </hbox>
@ -171,31 +171,31 @@
<label value="&connectionTimeout.label;" accesskey="&connectionTimeout.accesskey;" control="connectionTimeoutBox" /> <label value="&connectionTimeout.label;" accesskey="&connectionTimeout.accesskey;" control="connectionTimeoutBox" />
<textbox id="connectionTimeoutBox" size="3" preference="mailnews.tcptimeout"/> <textbox id="connectionTimeoutBox" size="3" preference="mailnews.tcptimeout"/>
<label value="&connectionSeconds.label;"/> <label value="&connectionSeconds.label;"/>
</hbox> </hbox>
</groupbox> </groupbox>
<groupbox> <groupbox>
<caption label="&offlineInfo.caption;"/> <caption label="&offlineInfo.caption;"/>
<hbox align="center"> <hbox align="center">
<description flex="1" control="offlineSettingsButton">&offlineInfo.label;</description> <description flex="1" control="offlineSettingsButton">&offlineInfo.label;</description>
<button id="offlineSettingsButton" label="&showOffline.label;" <button id="offlineSettingsButton" label="&showOffline.label;"
accesskey="&showOffline.accesskey;" accesskey="&showOffline.accesskey;"
oncommand="gAdvancedPane.showOffline();"/> oncommand="gAdvancedPane.showOffline();"/>
</hbox> </hbox>
</groupbox> </groupbox>
<groupbox> <groupbox>
<caption label="&Diskspace;"/> <caption label="&Diskspace;"/>
<hbox align="center"> <hbox align="center">
<checkbox id="offlineCompactFolder" label="&offlineCompact.label;" accesskey="&offlineCompact.accesskey;" <checkbox id="offlineCompactFolder" label="&offlineCompact.label;" accesskey="&offlineCompact.accesskey;"
preference="mail.prompt_purge_threshhold"/> preference="mail.prompt_purge_threshhold"/>
<textbox id="offlineCompactFolderMin" size="5" value="100" preference="mail.purge_threshhold"/> <textbox id="offlineCompactFolderMin" size="5" value="100" preference="mail.purge_threshhold"/>
<label value="&kb.label;"/> <label value="&kb.label;"/>
</hbox> </hbox>
</groupbox> </groupbox>
</tabpanel> </tabpanel>
<!-- Update --> <!-- Update -->
<tabpanel orient="vertical" align="start"> <tabpanel orient="vertical" align="start">
<label>&autoCheck.label;</label> <label>&autoCheck.label;</label>
@ -222,7 +222,7 @@
label="&modeAutomatic.label;" label="&modeAutomatic.label;"
accesskey="&modeAutomatic.accesskey;"/> accesskey="&modeAutomatic.accesskey;"/>
<hbox class="indent"> <hbox class="indent">
<checkbox id="warnIncompatible" <checkbox id="warnIncompatible"
label="&modeAutoAddonWarn.label;" accesskey="&modeAutoAddonWarn.accesskey;" label="&modeAutoAddonWarn.label;" accesskey="&modeAutoAddonWarn.accesskey;"
preference="app.update.mode" preference="app.update.mode"
onsyncfrompreference="return gAdvancedPane.addonWarnSyncFrom();" onsyncfrompreference="return gAdvancedPane.addonWarnSyncFrom();"
@ -231,31 +231,31 @@
</radiogroup> </radiogroup>
<separator/> <separator/>
<hbox> <hbox>
<button id="showUpdateHistory" <button id="showUpdateHistory"
label="&showUpdates.label;" accesskey="&showUpdates.accesskey;" label="&showUpdates.label;" accesskey="&showUpdates.accesskey;"
preference="app.update.disable_button.showUpdateHistory" preference="app.update.disable_button.showUpdateHistory"
oncommand="gAdvancedPane.showUpdates();"/> oncommand="gAdvancedPane.showUpdates();"/>
</hbox> </hbox>
</tabpanel> </tabpanel>
<!-- Certificates --> <!-- Certificates -->
<tabpanel orient="vertical"> <tabpanel orient="vertical">
<description>&certificatesInfo.label;</description> <description>&certificatesInfo.label;</description>
<separator class="thin"/> <separator class="thin"/>
<description class="indent"> <description class="indent">
<button label="&viewCertificates.label;" accesskey="&viewCertificates.accesskey;" <button label="&viewCertificates.label;" accesskey="&viewCertificates.accesskey;"
oncommand="gAdvancedPane.showCertificates();" oncommand="gAdvancedPane.showCertificates();"
preference="security.disable_button.openCertManager"/> preference="security.disable_button.openCertManager"/>
<button label="&viewCRLs.label;" accesskey="&viewCRLs.accesskey;" <button label="&viewCRLs.label;" accesskey="&viewCRLs.accesskey;"
oncommand="gAdvancedPane.showCRLs();" oncommand="gAdvancedPane.showCRLs();"
preference="security.OCSP.disable_button.managecrl"/> preference="security.OCSP.disable_button.managecrl"/>
<button label="&viewOCSP.label;" accesskey="&viewOCSP.accesskey;" <button label="&viewOCSP.label;" accesskey="&viewOCSP.accesskey;"
oncommand="gAdvancedPane.showOCSP();"/> oncommand="gAdvancedPane.showOCSP();"/>
<button label="&viewSecurityDevices.label;" accesskey="&viewSecurityDevices.accesskey;" <button label="&viewSecurityDevices.label;" accesskey="&viewSecurityDevices.accesskey;"
oncommand="gAdvancedPane.showSecurityDevices();" oncommand="gAdvancedPane.showSecurityDevices();"
preference="security.disable_button.openDeviceManager"/> preference="security.disable_button.openDeviceManager"/>
</description> </description>
</tabpanel> </tabpanel>
</tabpanels> </tabpanels>
</tabbox> </tabbox>
<separator/> <separator/>

View File

@ -43,13 +43,13 @@ var gPrivacyPane = {
init: function () init: function ()
{ {
this.mPane = document.getElementById("panePrivacy"); this.mPane = document.getElementById("panePrivacy");
this.updateManualMarkMode(document.getElementById('manualMark').checked); this.updateManualMarkMode(document.getElementById('manualMark').checked);
this.updateJunkLogButton(document.getElementById('enableJunkLogging').checked); this.updateJunkLogButton(document.getElementById('enableJunkLogging').checked);
// Update the MP buttons // Update the MP buttons
this.updateMasterPasswordButton(); this.updateMasterPasswordButton();
// update the checkbox for downloading phishing url tables // update the checkbox for downloading phishing url tables
// this.updateDownloadedPhishingListState(); // this.updateDownloadedPhishingListState();
@ -70,18 +70,18 @@ var gPrivacyPane = {
{ {
document.getElementById('manualMarkMode').disabled = !aEnableRadioGroup; document.getElementById('manualMarkMode').disabled = !aEnableRadioGroup;
}, },
updateJunkLogButton: function(aEnableButton) updateJunkLogButton: function(aEnableButton)
{ {
document.getElementById('openJunkLogButton').disabled = !aEnableButton; document.getElementById('openJunkLogButton').disabled = !aEnableButton;
}, },
openJunkLog: function() openJunkLog: function()
{ {
document.documentElement.openWindow("mailnews:junklog", "chrome://messenger/content/preferences/junkLog.xul", document.documentElement.openWindow("mailnews:junklog", "chrome://messenger/content/preferences/junkLog.xul",
"", null); "", null);
}, },
resetTrainingData: function() resetTrainingData: function()
{ {
// make sure the user really wants to do this // make sure the user really wants to do this
@ -97,10 +97,10 @@ var gPrivacyPane = {
// otherwise go ahead and remove the training data // otherwise go ahead and remove the training data
var junkmailPlugin = Components.classes["@mozilla.org/messenger/filter-plugin;1?name=bayesianfilter"] var junkmailPlugin = Components.classes["@mozilla.org/messenger/filter-plugin;1?name=bayesianfilter"]
.getService(Components.interfaces.nsIJunkMailPlugin); .getService(Components.interfaces.nsIJunkMailPlugin);
if (junkmailPlugin) if (junkmailPlugin)
junkmailPlugin.resetTrainingData(); junkmailPlugin.resetTrainingData();
}, },
initReencryptCallback: function() initReencryptCallback: function()
@ -122,7 +122,7 @@ var gPrivacyPane = {
"", null); "", null);
this.updateMasterPasswordButton(); this.updateMasterPasswordButton();
}, },
updateMasterPasswordButton: function () updateMasterPasswordButton: function ()
{ {
// See if there's a master password and set the button label accordingly // See if there's a master password and set the button label accordingly
@ -132,13 +132,13 @@ var gPrivacyPane = {
if (slot) { if (slot) {
const nsIPKCS11Slot = Components.interfaces.nsIPKCS11Slot; const nsIPKCS11Slot = Components.interfaces.nsIPKCS11Slot;
var status = slot.status; var status = slot.status;
var noMP = status == nsIPKCS11Slot.SLOT_UNINITIALIZED || var noMP = status == nsIPKCS11Slot.SLOT_UNINITIALIZED ||
status == nsIPKCS11Slot.SLOT_READY; status == nsIPKCS11Slot.SLOT_READY;
var bundle = document.getElementById("bundlePreferences"); var bundle = document.getElementById("bundlePreferences");
document.getElementById("setMasterPassword").label = document.getElementById("setMasterPassword").label =
bundle.getString(noMP ? "setMasterPassword" : "changeMasterPassword"); bundle.getString(noMP ? "setMasterPassword" : "changeMasterPassword");
document.getElementById("removeMasterPassword").disabled = noMP; document.getElementById("removeMasterPassword").disabled = noMP;
} }
}, },
@ -146,15 +146,15 @@ var gPrivacyPane = {
removeMasterPassword: function () removeMasterPassword: function ()
{ {
var secmodDB = Components.classes["@mozilla.org/security/pkcs11moduledb;1"] var secmodDB = Components.classes["@mozilla.org/security/pkcs11moduledb;1"]
.getService(Components.interfaces.nsIPKCS11ModuleDB); .getService(Components.interfaces.nsIPKCS11ModuleDB);
if (secmodDB.isFIPSEnabled) if (secmodDB.isFIPSEnabled)
{ {
var bundle = document.getElementById("bundlePreferences"); var bundle = document.getElementById("bundlePreferences");
promptService.alert(window, promptService.alert(window,
bundle.getString("pw_change_failed_title"), bundle.getString("pw_change_failed_title"),
bundle.getString("pw_change2empty_in_fips_mode")); bundle.getString("pw_change2empty_in_fips_mode"));
} }
else else
{ {
document.documentElement.openSubDialog("chrome://mozapps/content/preferences/removemp.xul", document.documentElement.openSubDialog("chrome://mozapps/content/preferences/removemp.xul",
"", null); "", null);

View File

@ -98,14 +98,14 @@ const LOCAL_CONTENT_TEMPLATE = "\n\
// no local style overrides at this time // no local style overrides at this time
const LOCAL_STYLE = "\n"; const LOCAL_STYLE = "\n";
function FeedItem() function FeedItem()
{ {
this.mDate = new Date().toString(); this.mDate = new Date().toString();
this.mUnicodeConverter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"] this.mUnicodeConverter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
.createInstance(Components.interfaces.nsIScriptableUnicodeConverter); .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
} }
FeedItem.prototype = FeedItem.prototype =
{ {
isStoredWithId: false, // we currently only do this for IETF Atom. RSS2 with GUIDs should do this as well. isStoredWithId: false, // we currently only do this for IETF Atom. RSS2 with GUIDs should do this as well.
xmlContentBase: null, // only for IETF Atom xmlContentBase: null, // only for IETF Atom
@ -177,26 +177,26 @@ FeedItem.prototype =
return this.mURL; return this.mURL;
}, },
store: function() store: function()
{ {
this.mUnicodeConverter.charset = this.characterSet; this.mUnicodeConverter.charset = this.characterSet;
if (this.isStored()) if (this.isStored())
debug(this.identity + " already stored; ignoring"); debug(this.identity + " already stored; ignoring");
else if (this.content) else if (this.content)
{ {
debug(this.identity + " has content; storing"); debug(this.identity + " has content; storing");
var content = MESSAGE_TEMPLATE; var content = MESSAGE_TEMPLATE;
content = content.replace(/%CONTENT_TEMPLATE%/, LOCAL_CONTENT_TEMPLATE); content = content.replace(/%CONTENT_TEMPLATE%/, LOCAL_CONTENT_TEMPLATE);
content = content.replace(/%STYLE%/, LOCAL_STYLE); content = content.replace(/%STYLE%/, LOCAL_STYLE);
content = content.replace(/%TITLE%/, this.title); content = content.replace(/%TITLE%/, this.title);
content = content.replace(/%BASE%/, this.contentBase); content = content.replace(/%BASE%/, this.contentBase);
content = content.replace(/%URL%/g, this.mURL); content = content.replace(/%URL%/g, this.mURL);
content = content.replace(/%CONTENT%/, this.content); content = content.replace(/%CONTENT%/, this.content);
this.content = content; // XXX store it elsewhere, f.e. this.page this.content = content; // XXX store it elsewhere, f.e. this.page
this.writeToFolder(); this.writeToFolder();
} }
else if (this.feed.quickMode) else if (this.feed.quickMode)
{ {
debug(this.identity + " in quick mode; storing"); debug(this.identity + " in quick mode; storing");
@ -205,14 +205,14 @@ FeedItem.prototype =
var content = MESSAGE_TEMPLATE; var content = MESSAGE_TEMPLATE;
content = content.replace(/%CONTENT_TEMPLATE%/, LOCAL_CONTENT_TEMPLATE); content = content.replace(/%CONTENT_TEMPLATE%/, LOCAL_CONTENT_TEMPLATE);
content = content.replace(/%STYLE%/, LOCAL_STYLE); content = content.replace(/%STYLE%/, LOCAL_STYLE);
content = content.replace(/%BASE%/, this.contentBase); content = content.replace(/%BASE%/, this.contentBase);
content = content.replace(/%TITLE%/, this.title); content = content.replace(/%TITLE%/, this.title);
content = content.replace(/%URL%/g, this.mURL); content = content.replace(/%URL%/g, this.mURL);
content = content.replace(/%CONTENT%/, this.content); content = content.replace(/%CONTENT%/, this.content);
this.content = content; // XXX store it elsewhere, f.e. this.page this.content = content; // XXX store it elsewhere, f.e. this.page
this.writeToFolder(); this.writeToFolder();
} }
else else
{ {
//debug(this.identity + " needs content; downloading"); //debug(this.identity + " needs content; downloading");
debug(this.identity + " needs content; creating and storing"); debug(this.identity + " needs content; creating and storing");
@ -220,7 +220,7 @@ FeedItem.prototype =
content = content.replace(/%CONTENT_TEMPLATE%/, REMOTE_CONTENT_TEMPLATE); content = content.replace(/%CONTENT_TEMPLATE%/, REMOTE_CONTENT_TEMPLATE);
content = content.replace(/%STYLE%/, REMOTE_STYLE); content = content.replace(/%STYLE%/, REMOTE_STYLE);
content = content.replace(/%TITLE%/, this.title); content = content.replace(/%TITLE%/, this.title);
content = content.replace(/%BASE%/, this.contentBase); content = content.replace(/%BASE%/, this.contentBase);
content = content.replace(/%URL%/g, this.mURL); content = content.replace(/%URL%/g, this.mURL);
content = content.replace(/%DESCRIPTION%/, this.description || this.title); content = content.replace(/%DESCRIPTION%/, this.description || this.title);
this.content = content; // XXX store it elsewhere, f.e. this.page this.content = content; // XXX store it elsewhere, f.e. this.page
@ -237,10 +237,10 @@ FeedItem.prototype =
var server = this.feed.server; var server = this.feed.server;
var folder = this.feed.folder; var folder = this.feed.folder;
if (!folder) if (!folder)
{ {
debug(this.feed.name + " folder doesn't exist; creating"); debug(this.feed.name + " folder doesn't exist; creating");
debug("creating " + this.feed.name + "as child of " + server.rootMsgFolder + "\n"); debug("creating " + this.feed.name + "as child of " + server.rootMsgFolder + "\n");
server.rootMsgFolder.createSubfolder(this.feed.name, null /* supposed to be a msg window */); server.rootMsgFolder.createSubfolder(this.feed.name, null /* supposed to be a msg window */);
folder = server.rootMsgFolder.FindSubFolder(this.feed.name); folder = server.rootMsgFolder.FindSubFolder(this.feed.name);
debug(this.identity + " not stored (folder didn't exist)"); debug(this.identity + " not stored (folder didn't exist)");
@ -262,21 +262,21 @@ FeedItem.prototype =
downloaded = ds.GetTarget(itemResource, FZ_STORED, true); downloaded = ds.GetTarget(itemResource, FZ_STORED, true);
} }
if (!downloaded || downloaded.QueryInterface(Components.interfaces.nsIRDFLiteral).Value == "false") if (!downloaded || downloaded.QueryInterface(Components.interfaces.nsIRDFLiteral).Value == "false")
{ {
// HACK ALERT: before we give up, try to work around an entity escaping bug in RDF // HACK ALERT: before we give up, try to work around an entity escaping bug in RDF
// See Bug #258465 for more details // See Bug #258465 for more details
itemURI = itemURI.replace(/&lt;/g, '<'); itemURI = itemURI.replace(/&lt;/g, '<');
itemURI = itemURI.replace(/&gt;/g, '>'); itemURI = itemURI.replace(/&gt;/g, '>');
itemURI = itemURI.replace(/&quot;/g, '"'); itemURI = itemURI.replace(/&quot;/g, '"');
itemURI = itemURI.replace(/&amp;/g, '&'); itemURI = itemURI.replace(/&amp;/g, '&');
debug('Failed to find item, trying entity replacement version: ' + itemURI); debug('Failed to find item, trying entity replacement version: ' + itemURI);
itemResource = rdf.GetResource(itemURI); itemResource = rdf.GetResource(itemURI);
downloaded = ds.GetTarget(itemResource, FZ_STORED, true); downloaded = ds.GetTarget(itemResource, FZ_STORED, true);
if (downloaded) if (downloaded)
{ {
debug(this.identity + " not stored"); debug(this.identity + " not stored");
return true; return true;
} }
@ -284,21 +284,21 @@ FeedItem.prototype =
debug(this.identity + " not stored"); debug(this.identity + " not stored");
return false; return false;
} }
else else
{ {
debug(this.identity + " stored"); debug(this.identity + " stored");
return true; return true;
} }
}, },
markValid: function() markValid: function()
{ {
debug("validating " + this.mURL); debug("validating " + this.mURL);
var ds = getItemsDS(this.feed.server); var ds = getItemsDS(this.feed.server);
var itemURI = this.itemUniqueURI; var itemURI = this.itemUniqueURI;
var resource = rdf.GetResource(itemURI); var resource = rdf.GetResource(itemURI);
// Backward compatibility: we might have stored this item before isStoredWithId // Backward compatibility: we might have stored this item before isStoredWithId
// has been turned on for RSS 2.0 (bug 354345). Check whether this item has been // has been turned on for RSS 2.0 (bug 354345). Check whether this item has been
// stored with its URL. // stored with its URL.
@ -307,59 +307,59 @@ FeedItem.prototype =
if (!ds.HasAssertion(resource, FZ_FEED, rdf.GetResource(this.feed.url), true)) if (!ds.HasAssertion(resource, FZ_FEED, rdf.GetResource(this.feed.url), true))
ds.Assert(resource, FZ_FEED, rdf.GetResource(this.feed.url), true); ds.Assert(resource, FZ_FEED, rdf.GetResource(this.feed.url), true);
if (ds.hasArcOut(resource, FZ_VALID)) if (ds.hasArcOut(resource, FZ_VALID))
{ {
var currentValue = ds.GetTarget(resource, FZ_VALID, true); var currentValue = ds.GetTarget(resource, FZ_VALID, true);
ds.Change(resource, FZ_VALID, currentValue, RDF_LITERAL_TRUE); ds.Change(resource, FZ_VALID, currentValue, RDF_LITERAL_TRUE);
} }
else else
ds.Assert(resource, FZ_VALID, RDF_LITERAL_TRUE, true); ds.Assert(resource, FZ_VALID, RDF_LITERAL_TRUE, true);
}, },
markStored: function() markStored: function()
{ {
var ds = getItemsDS(this.feed.server); var ds = getItemsDS(this.feed.server);
var itemURI = this.itemUniqueURI; var itemURI = this.itemUniqueURI;
var resource = rdf.GetResource(itemURI); var resource = rdf.GetResource(itemURI);
if (!ds.HasAssertion(resource, FZ_FEED, rdf.GetResource(this.feed.url), true)) if (!ds.HasAssertion(resource, FZ_FEED, rdf.GetResource(this.feed.url), true))
ds.Assert(resource, FZ_FEED, rdf.GetResource(this.feed.url), true); ds.Assert(resource, FZ_FEED, rdf.GetResource(this.feed.url), true);
var currentValue; var currentValue;
if (ds.hasArcOut(resource, FZ_STORED)) if (ds.hasArcOut(resource, FZ_STORED))
{ {
currentValue = ds.GetTarget(resource, FZ_STORED, true); currentValue = ds.GetTarget(resource, FZ_STORED, true);
ds.Change(resource, FZ_STORED, currentValue, RDF_LITERAL_TRUE); ds.Change(resource, FZ_STORED, currentValue, RDF_LITERAL_TRUE);
} }
else else
ds.Assert(resource, FZ_STORED, RDF_LITERAL_TRUE, true); ds.Assert(resource, FZ_STORED, RDF_LITERAL_TRUE, true);
}, },
mimeEncodeSubject: function(aSubject, aCharset) mimeEncodeSubject: function(aSubject, aCharset)
{ {
// get the mime header encoder service // get the mime header encoder service
var mimeEncoder = Components.classes["@mozilla.org/messenger/mimeconverter;1"].getService(Components.interfaces.nsIMimeConverter); var mimeEncoder = Components.classes["@mozilla.org/messenger/mimeconverter;1"].getService(Components.interfaces.nsIMimeConverter);
// this routine sometimes throws exceptions for mis-encoded data so wrap it // this routine sometimes throws exceptions for mis-encoded data so wrap it
// with a try catch for now.. // with a try catch for now..
var newSubject; var newSubject;
try try
{ {
newSubject = mimeEncoder.encodeMimePartIIStr(this.mUnicodeConverter.ConvertFromUnicode(aSubject), false, aCharset, 9, 72); newSubject = mimeEncoder.encodeMimePartIIStr(this.mUnicodeConverter.ConvertFromUnicode(aSubject), false, aCharset, 9, 72);
} }
catch (ex) catch (ex)
{ {
newSubject = aSubject; newSubject = aSubject;
} }
return newSubject; return newSubject;
}, },
writeToFolder: function() writeToFolder: function()
{ {
debug(this.identity + " writing to message folder" + this.feed.name + "\n"); debug(this.identity + " writing to message folder" + this.feed.name + "\n");
var server = this.feed.server; var server = this.feed.server;
this.mUnicodeConverter.charset = this.characterSet; this.mUnicodeConverter.charset = this.characterSet;
@ -369,7 +369,7 @@ FeedItem.prototype =
// Convert the title to UTF-16 before performing our HTML entity replacement // Convert the title to UTF-16 before performing our HTML entity replacement
// reg expressions. // reg expressions.
var title = this.title; var title = this.title;
// the subject may contain HTML entities. // the subject may contain HTML entities.
// Convert these to their unencoded state. i.e. &amp; becomes '&' // Convert these to their unencoded state. i.e. &amp; becomes '&'
@ -377,7 +377,7 @@ FeedItem.prototype =
title = title.replace(/&gt;/g, '>'); title = title.replace(/&gt;/g, '>');
title = title.replace(/&quot;/g, '"'); title = title.replace(/&quot;/g, '"');
title = title.replace(/&amp;/g, '&'); title = title.replace(/&amp;/g, '&');
// Compress white space in the subject to make it look better. // Compress white space in the subject to make it look better.
title = title.replace(/[\t\r\n]+/g, " "); title = title.replace(/[\t\r\n]+/g, " ");
@ -420,7 +420,7 @@ FeedItem.prototype =
source += 'Content-Type: multipart/mixed;\n boundary="' + ENCLOSURE_HEADER_BOUNDARY_PREFIX + boundaryID + '"' + '\n\n' + source += 'Content-Type: multipart/mixed;\n boundary="' + ENCLOSURE_HEADER_BOUNDARY_PREFIX + boundaryID + '"' + '\n\n' +
'This is a multi-part message in MIME format.\n' + ENCLOSURE_BOUNDARY_PREFIX + boundaryID + '\n' + 'This is a multi-part message in MIME format.\n' + ENCLOSURE_BOUNDARY_PREFIX + boundaryID + '\n' +
'Content-Type: text/html; charset=' + this.characterSet + '\n' + 'Content-Type: text/html; charset=' + this.characterSet + '\n' +
'Content-Transfer-Encoding: 8bit\n' + 'Content-Transfer-Encoding: 8bit\n' +
this.content; this.content;
source += this.enclosure.convertToAttachment(boundaryID); source += this.enclosure.convertToAttachment(boundaryID);
} }
@ -428,7 +428,7 @@ FeedItem.prototype =
{ {
source += 'Content-Type: text/html; charset=' + this.characterSet + '\n' + source += 'Content-Type: text/html; charset=' + this.characterSet + '\n' +
'\n' + this.content; '\n' + this.content;
} }
debug(this.identity + " is " + source.length + " characters long"); debug(this.identity + " is " + source.length + " characters long");
@ -448,7 +448,7 @@ FeedItem.prototype =
// A feed enclosure is to RSS what an attachment is for e-mail. We make enclosures look // A feed enclosure is to RSS what an attachment is for e-mail. We make enclosures look
// like attachments in the UI. // like attachments in the UI.
function FeedEnclosure(aURL, aContentType, aLength) function FeedEnclosure(aURL, aContentType, aLength)
{ {
this.mURL = aURL; this.mURL = aURL;
this.mContentType = aContentType; this.mContentType = aContentType;
@ -464,7 +464,7 @@ function FeedEnclosure(aURL, aContentType, aLength)
} }
} }
FeedEnclosure.prototype = FeedEnclosure.prototype =
{ {
mURL: "", mURL: "",
mContentType: "", mContentType: "",
@ -477,9 +477,9 @@ FeedEnclosure.prototype =
{ {
return '\n' + return '\n' +
ENCLOSURE_BOUNDARY_PREFIX + aBoundaryID + '\n' + ENCLOSURE_BOUNDARY_PREFIX + aBoundaryID + '\n' +
'Content-Type: ' + this.mContentType + '; name="' + this.mFileName + '"\n' + 'Content-Type: ' + this.mContentType + '; name="' + this.mFileName + '"\n' +
'X-Mozilla-External-Attachment-URL: ' + this.mURL + '\n' + 'X-Mozilla-External-Attachment-URL: ' + this.mURL + '\n' +
'Content-Disposition: attachment; filename="' + this.mFileName + '"\n\n' + 'Content-Disposition: attachment; filename="' + this.mFileName + '"\n\n' +
'This MIME attachment is stored separately from the message.\n' + 'This MIME attachment is stored separately from the message.\n' +
ENCLOSURE_BOUNDARY_PREFIX + aBoundaryID + '--' + '\n'; ENCLOSURE_BOUNDARY_PREFIX + aBoundaryID + '--' + '\n';

View File

@ -36,7 +36,7 @@
# the terms of any one of the MPL, the GPL or the LGPL. # the terms of any one of the MPL, the GPL or the LGPL.
# #
# ***** END LICENSE BLOCK ****** # ***** END LICENSE BLOCK ******
<?xml-stylesheet href="chrome://messenger/skin/" type="text/css"?> <?xml-stylesheet href="chrome://messenger/skin/" type="text/css"?>
<!DOCTYPE dialog SYSTEM "chrome://messenger-newsblog/locale/feed-properties.dtd"> <!DOCTYPE dialog SYSTEM "chrome://messenger-newsblog/locale/feed-properties.dtd">
@ -75,7 +75,7 @@
<column flex="1"/> <column flex="1"/>
</columns> </columns>
<rows> <rows>
<row> <row>
<label value="&feedLocation.label;" accesskey="&feedLocation.accesskey;" control="feedLocation"/> <label value="&feedLocation.label;" accesskey="&feedLocation.accesskey;" control="feedLocation"/>
<textbox id="feedLocation"/> <textbox id="feedLocation"/>
@ -97,8 +97,8 @@
<menuitem id="rssAccountMenuItem"/> <menuitem id="rssAccountMenuItem"/>
<menuseparator/> <menuseparator/>
</menupopup> </menupopup>
<template> <template>
<!-- cheat and use the CanRename property to make sure we don't list the Trash folder as a possible feed folder --> <!-- cheat and use the CanRename property to make sure we don't list the Trash folder as a possible feed folder -->
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false" nc:CanRename="true"> <rule nc:CanFileMessages="true" iscontainer="true" isempty="false" nc:CanRename="true">
<menupopup> <menupopup>
@ -110,7 +110,7 @@
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure" IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType" ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
label="rdf:http://home.netscape.com/NC-rdf#Name"> label="rdf:http://home.netscape.com/NC-rdf#Name">
<menupopup class="menulist-menupopup"> <menupopup class="menulist-menupopup">
<menuitem label="&choosethisfolder.label;" <menuitem label="&choosethisfolder.label;"
oncommand="PickedMsgFolder(event.target.parentNode.parentNode,'selectFolder')"/> oncommand="PickedMsgFolder(event.target.parentNode.parentNode,'selectFolder')"/>
<menuseparator/> <menuseparator/>
@ -120,7 +120,7 @@
</rule> </rule>
<rule nc:CanFileMessages="true" nc:CanRename="true"> <rule nc:CanFileMessages="true" nc:CanRename="true">
<menupopup> <menupopup>
<menuitem uri="..." value="..." <menuitem uri="..." value="..."
class="folderMenuItem menuitem-iconic" class="folderMenuItem menuitem-iconic"
oncommand="PickedMsgFolder(event.target,'selectFolder')" oncommand="PickedMsgFolder(event.target,'selectFolder')"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder" SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
@ -139,6 +139,6 @@
<separator class="thin"/> <separator class="thin"/>
<checkbox id="quickMode" accesskey="&quickMode.accesskey;" label="&quickMode.label;"/> <checkbox id="quickMode" accesskey="&quickMode.accesskey;" label="&quickMode.label;"/>
</dialog> </dialog>

View File

@ -1,4 +1,4 @@
<?xml version="1.0"?> <?xml version="1.0"?>
# -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- # -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
@ -64,7 +64,7 @@
<script type="application/x-javascript" src="FeedItem.js"/> <script type="application/x-javascript" src="FeedItem.js"/>
<script type="application/x-javascript" src="feed-parser.js"/> <script type="application/x-javascript" src="feed-parser.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/> <script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
<keyset id="extensionsKeys"> <keyset id="extensionsKeys">
<key id="key_close" key="&cmd.close.commandKey;" modifiers="accel" oncommand="window.close();"/> <key id="key_close" key="&cmd.close.commandKey;" modifiers="accel" oncommand="window.close();"/>
<key id="key_close2" keycode="VK_ESCAPE" oncommand="window.close();"/> <key id="key_close2" keycode="VK_ESCAPE" oncommand="window.close();"/>
@ -111,32 +111,32 @@
</hbox> </hbox>
<hbox id="statusContainerBox" align="center"> <hbox id="statusContainerBox" align="center">
<label id="statusText" class="statusbarpanel-text" crop="right" flex="1"/> <label id="statusText" class="statusbarpanel-text" crop="right" flex="1"/>
<progressmeter id="progressMeter" collapsed="true" class="progressmeter-statusbar" style="margin-right: 5px;" mode="normal" value="0"/> <progressmeter id="progressMeter" collapsed="true" class="progressmeter-statusbar" style="margin-right: 5px;" mode="normal" value="0"/>
</hbox> </hbox>
<hbox align="end"> <hbox align="end">
<hbox class="actionButtons" flex="1"> <hbox class="actionButtons" flex="1">
<button id="addFeed" <button id="addFeed"
label="&button.addFeed.label;" accesskey="&button.addFeed.accesskey;" label="&button.addFeed.label;" accesskey="&button.addFeed.accesskey;"
oncommand="gFeedSubscriptionsWindow.addFeed();"/> oncommand="gFeedSubscriptionsWindow.addFeed();"/>
<button id="editFeed" disabled="true" <button id="editFeed" disabled="true"
label="&button.editFeed.label;" accesskey="&button.editFeed.accesskey;" label="&button.editFeed.label;" accesskey="&button.editFeed.accesskey;"
oncommand="gFeedSubscriptionsWindow.editFeed();"/> oncommand="gFeedSubscriptionsWindow.editFeed();"/>
<button id="removeFeed" disabled="true" <button id="removeFeed" disabled="true"
label="&button.removeFeed.label;" accesskey="&button.removeFeed.accesskey;" label="&button.removeFeed.label;" accesskey="&button.removeFeed.accesskey;"
oncommand="gFeedSubscriptionsWindow.removeFeed();"/> oncommand="gFeedSubscriptionsWindow.removeFeed();"/>
<button id="importOPML" <button id="importOPML"
label="&button.importOPML.label;" accesskey="&button.importOPML.accesskey;" label="&button.importOPML.label;" accesskey="&button.importOPML.accesskey;"
oncommand="gFeedSubscriptionsWindow.importOPML();"/> oncommand="gFeedSubscriptionsWindow.importOPML();"/>
<button id="exportOPML" <button id="exportOPML"
label="&button.exportOPML.label;" accesskey="&button.exportOPML.accesskey;" label="&button.exportOPML.label;" accesskey="&button.exportOPML.accesskey;"
oncommand="gFeedSubscriptionsWindow.exportOPML();"/> oncommand="gFeedSubscriptionsWindow.exportOPML();"/>
<spacer flex="1"/> <spacer flex="1"/>
</hbox> </hbox>
</hbox> </hbox>

View File

@ -92,7 +92,7 @@ var containerUtils = Components.classes["@mozilla.org/rdf/container-utils;1"]
var fileHandler = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService) var fileHandler = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService)
.getProtocolHandler("file").QueryInterface(Components.interfaces.nsIFileProtocolHandler); .getProtocolHandler("file").QueryInterface(Components.interfaces.nsIFileProtocolHandler);
// helper routine that checks our subscriptions list array and returns true if the url // helper routine that checks our subscriptions list array and returns true if the url
// is already in our list. This is used to prevent the user from subscribing to the same // is already in our list. This is used to prevent the user from subscribing to the same
// feed multiple times for the same server... // feed multiple times for the same server...
function feedAlreadyExists(aUrl, aServer) function feedAlreadyExists(aUrl, aServer)
@ -101,7 +101,7 @@ function feedAlreadyExists(aUrl, aServer)
return feeds.IndexOf(rdf.GetResource(aUrl)) != -1; return feeds.IndexOf(rdf.GetResource(aUrl)) != -1;
} }
function addFeed(url, title, destFolder) function addFeed(url, title, destFolder)
{ {
var ds = getSubscriptionsDS(destFolder.server); var ds = getSubscriptionsDS(destFolder.server);
var feeds = getSubscriptionsList(destFolder.server); var feeds = getSubscriptionsList(destFolder.server);
@ -121,7 +121,7 @@ function addFeed(url, title, destFolder)
ds.Assert(id, DC_IDENTIFIER, rdf.GetLiteral(url), true); ds.Assert(id, DC_IDENTIFIER, rdf.GetLiteral(url), true);
if (title) if (title)
ds.Assert(id, DC_TITLE, rdf.GetLiteral(title), true); ds.Assert(id, DC_TITLE, rdf.GetLiteral(title), true);
ds.Assert(id, FZ_DESTFOLDER, destFolder, true); ds.Assert(id, FZ_DESTFOLDER, destFolder, true);
ds = ds.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); ds = ds.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
ds.Flush(); ds.Flush();
} }
@ -137,26 +137,26 @@ function updateFolderFeedUrl(aFolder, aFeedUrl, aRemoveUrl)
var oldFeedUrl = folderInfo.getCharPtrProperty("feedUrl"); var oldFeedUrl = folderInfo.getCharPtrProperty("feedUrl");
if (aRemoveUrl) if (aRemoveUrl)
{ {
// remove our feed url string from the list of feed urls // remove our feed url string from the list of feed urls
var newFeedUrl = oldFeedUrl.replace(kFeedUrlDelimiter + aFeedUrl, ""); var newFeedUrl = oldFeedUrl.replace(kFeedUrlDelimiter + aFeedUrl, "");
folderInfo.setCharPtrProperty("feedUrl", newFeedUrl); folderInfo.setCharPtrProperty("feedUrl", newFeedUrl);
} }
else else
folderInfo.setCharPtrProperty("feedUrl", oldFeedUrl + kFeedUrlDelimiter + aFeedUrl); folderInfo.setCharPtrProperty("feedUrl", oldFeedUrl + kFeedUrlDelimiter + aFeedUrl);
// commit the db to preserve our changes // commit the db to preserve our changes
msgdb.Close(true); msgdb.Close(true);
} }
function getNodeValue(node) function getNodeValue(node)
{ {
if (node && node.textContent) if (node && node.textContent)
return node.textContent; return node.textContent;
else if (node && node.firstChild) else if (node && node.firstChild)
{ {
var ret = ""; var ret = "";
for (var child = node.firstChild; child; child = child.nextSibling) for (var child = node.firstChild; child; child = child.nextSibling)
{ {
var value = getNodeValue(child); var value = getNodeValue(child);
if (value) if (value)
@ -170,10 +170,10 @@ function getNodeValue(node)
return null; return null;
} }
function getRDFTargetValue(ds, source, property) function getRDFTargetValue(ds, source, property)
{ {
var node = ds.GetTarget(source, property, true); var node = ds.GetTarget(source, property, true);
if (node) if (node)
{ {
try{ try{
node = node.QueryInterface(Components.interfaces.nsIRDFLiteral); node = node.QueryInterface(Components.interfaces.nsIRDFLiteral);
@ -181,16 +181,16 @@ function getRDFTargetValue(ds, source, property)
return node.Value; return node.Value;
}catch(e){ }catch(e){
// if the RDF was bogus, do nothing. rethrow if it's some other problem // if the RDF was bogus, do nothing. rethrow if it's some other problem
if(!((e instanceof Components.interfaces.nsIXPCException) if(!((e instanceof Components.interfaces.nsIXPCException)
&& (e.result==Components.results.NS_ERROR_NO_INTERFACE))) && (e.result==Components.results.NS_ERROR_NO_INTERFACE)))
throw e; throw e;
} }
} }
return null; return null;
} }
function getSubscriptionsDS(server) function getSubscriptionsDS(server)
{ {
var file = getSubscriptionsFile(server); var file = getSubscriptionsFile(server);
var url = fileHandler.getURLSpecFromFile(file); var url = fileHandler.getURLSpecFromFile(file);
@ -205,7 +205,7 @@ function getSubscriptionsDS(server)
return ds; return ds;
} }
function getSubscriptionsList(server) function getSubscriptionsList(server)
{ {
var ds = getSubscriptionsDS(server); var ds = getSubscriptionsDS(server);
var list = ds.GetTarget(FZ_ROOT, FZ_FEEDS, true); var list = ds.GetTarget(FZ_ROOT, FZ_FEEDS, true);
@ -215,7 +215,7 @@ function getSubscriptionsList(server)
return list; return list;
} }
function getSubscriptionsFile(server) function getSubscriptionsFile(server)
{ {
server.QueryInterface(Components.interfaces.nsIRssIncomingServer); server.QueryInterface(Components.interfaces.nsIRssIncomingServer);
var file = server.subscriptionsDataSourcePath; var file = server.subscriptionsDataSourcePath;
@ -227,7 +227,7 @@ function getSubscriptionsFile(server)
return file; return file;
} }
function createSubscriptionsFile(file) function createSubscriptionsFile(file)
{ {
file = new LocalFile(file, MODE_WRONLY | MODE_CREATE); file = new LocalFile(file, MODE_WRONLY | MODE_CREATE);
file.write('\ file.write('\
@ -246,7 +246,7 @@ function createSubscriptionsFile(file)
file.close(); file.close();
} }
function getItemsDS(server) function getItemsDS(server)
{ {
var file = getItemsFile(server); var file = getItemsFile(server);
var url = fileHandler.getURLSpecFromFile(file); var url = fileHandler.getURLSpecFromFile(file);
@ -264,13 +264,13 @@ function getItemsDS(server)
return ds; return ds;
} }
function getItemsFile(server) function getItemsFile(server)
{ {
server.QueryInterface(Components.interfaces.nsIRssIncomingServer); server.QueryInterface(Components.interfaces.nsIRssIncomingServer);
var file = server.feedItemsDataSourcePath; var file = server.feedItemsDataSourcePath;
// If the file doesn't exist, create it. // If the file doesn't exist, create it.
if (!file.exists()) if (!file.exists())
{ {
var newfile = new LocalFile(file, MODE_WRONLY | MODE_CREATE); var newfile = new LocalFile(file, MODE_WRONLY | MODE_CREATE);
newfile.write('\ newfile.write('\
@ -285,16 +285,16 @@ function getItemsFile(server)
return file; return file;
} }
function removeAssertions(ds, resource) function removeAssertions(ds, resource)
{ {
var properties = ds.ArcLabelsOut(resource); var properties = ds.ArcLabelsOut(resource);
var property; var property;
while (properties.hasMoreElements()) while (properties.hasMoreElements())
{ {
property = properties.getNext(); property = properties.getNext();
var values = ds.GetTargets(resource, property, true); var values = ds.GetTargets(resource, property, true);
var value; var value;
while (values.hasMoreElements()) while (values.hasMoreElements())
{ {
value = values.getNext(); value = values.getNext();
ds.Unassert(resource, property, value, true); ds.Unassert(resource, property, value, true);
@ -317,7 +317,7 @@ function isValidRFC822Date(pubDate)
function dateRescue(dateString) function dateRescue(dateString)
{ {
// Deal with various kinds of invalid dates // Deal with various kinds of invalid dates
if(!isNaN(parseInt(dateString))) if(!isNaN(parseInt(dateString)))
{ // It's an integer, so maybe it's a timestamp { // It's an integer, so maybe it's a timestamp
var d = new Date(parseInt(dateString)*1000); var d = new Date(parseInt(dateString)*1000);
var now = new Date(); var now = new Date();
@ -331,10 +331,10 @@ function dateRescue(dateString)
} }
if(dateString.search(/^\d\d\d\d/) != -1) //Could be a ISO8601/W3C date if(dateString.search(/^\d\d\d\d/) != -1) //Could be a ISO8601/W3C date
return W3CToIETFDate(dateString); return W3CToIETFDate(dateString);
// Can't help. Set to current time. // Can't help. Set to current time.
return (new Date()).toString(); return (new Date()).toString();
} }
// Could be a prototype on String, but I don't know the policy on that // Could be a prototype on String, but I don't know the policy on that
function trimString(s) function trimString(s)