From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- comm/suite/mailnews/content/ABSearchDialog.js | 327 +++ comm/suite/mailnews/content/ABSearchDialog.xul | 99 + comm/suite/mailnews/content/FilterListDialog.js | 1037 ++++++++ comm/suite/mailnews/content/FilterListDialog.xul | 197 ++ comm/suite/mailnews/content/SearchDialog.js | 729 ++++++ comm/suite/mailnews/content/SearchDialog.xul | 178 ++ comm/suite/mailnews/content/browserRequest.js | 107 + comm/suite/mailnews/content/browserRequest.xul | 34 + comm/suite/mailnews/content/commandglue.js | 989 +++++++ comm/suite/mailnews/content/folderDisplay.js | 142 ++ comm/suite/mailnews/content/folderPane.js | 2221 ++++++++++++++++ comm/suite/mailnews/content/folderPane.xul | 169 ++ comm/suite/mailnews/content/mail-offline.js | 164 ++ .../mailnews/content/mail3PaneWindowCommands.js | 1057 ++++++++ comm/suite/mailnews/content/mailCommands.js | 415 +++ comm/suite/mailnews/content/mailContextMenus.js | 828 ++++++ comm/suite/mailnews/content/mailEditorOverlay.xul | 61 + comm/suite/mailnews/content/mailKeysOverlay.xul | 64 + comm/suite/mailnews/content/mailOverlay.js | 30 + comm/suite/mailnews/content/mailOverlay.xul | 29 + comm/suite/mailnews/content/mailTasksOverlay.js | 250 ++ comm/suite/mailnews/content/mailTasksOverlay.xul | 64 + comm/suite/mailnews/content/mailViewList.js | 161 ++ comm/suite/mailnews/content/mailViewList.xul | 79 + comm/suite/mailnews/content/mailViewSetup.js | 119 + comm/suite/mailnews/content/mailViewSetup.xul | 51 + comm/suite/mailnews/content/mailWidgets.xml | 1946 ++++++++++++++ comm/suite/mailnews/content/mailWindow.js | 593 +++++ comm/suite/mailnews/content/mailWindowOverlay.js | 2695 ++++++++++++++++++++ comm/suite/mailnews/content/mailWindowOverlay.xul | 1929 ++++++++++++++ comm/suite/mailnews/content/messageWindow.js | 1044 ++++++++ comm/suite/mailnews/content/messageWindow.xul | 141 + comm/suite/mailnews/content/messenger.css | 236 ++ comm/suite/mailnews/content/messenger.xul | 275 ++ .../mailnews/content/msgFolderPickerOverlay.js | 100 + comm/suite/mailnews/content/msgHdrViewOverlay.js | 1971 ++++++++++++++ comm/suite/mailnews/content/msgHdrViewOverlay.xul | 273 ++ comm/suite/mailnews/content/msgMail3PaneWindow.js | 1265 +++++++++ comm/suite/mailnews/content/msgViewNavigation.js | 243 ++ .../suite/mailnews/content/msgViewPickerOverlay.js | 413 +++ comm/suite/mailnews/content/nsDragAndDrop.js | 595 +++++ comm/suite/mailnews/content/phishingDetector.js | 173 ++ comm/suite/mailnews/content/searchBar.js | 432 ++++ comm/suite/mailnews/content/searchTermOverlay.xul | 64 + comm/suite/mailnews/content/start.xhtml | 69 + comm/suite/mailnews/content/tabmail.js | 969 +++++++ comm/suite/mailnews/content/tabmail.xml | 1583 ++++++++++++ comm/suite/mailnews/content/threadPane.js | 598 +++++ comm/suite/mailnews/content/threadPane.xul | 91 + 49 files changed, 27299 insertions(+) create mode 100644 comm/suite/mailnews/content/ABSearchDialog.js create mode 100644 comm/suite/mailnews/content/ABSearchDialog.xul create mode 100644 comm/suite/mailnews/content/FilterListDialog.js create mode 100644 comm/suite/mailnews/content/FilterListDialog.xul create mode 100644 comm/suite/mailnews/content/SearchDialog.js create mode 100644 comm/suite/mailnews/content/SearchDialog.xul create mode 100644 comm/suite/mailnews/content/browserRequest.js create mode 100644 comm/suite/mailnews/content/browserRequest.xul create mode 100644 comm/suite/mailnews/content/commandglue.js create mode 100644 comm/suite/mailnews/content/folderDisplay.js create mode 100644 comm/suite/mailnews/content/folderPane.js create mode 100644 comm/suite/mailnews/content/folderPane.xul create mode 100644 comm/suite/mailnews/content/mail-offline.js create mode 100644 comm/suite/mailnews/content/mail3PaneWindowCommands.js create mode 100644 comm/suite/mailnews/content/mailCommands.js create mode 100644 comm/suite/mailnews/content/mailContextMenus.js create mode 100644 comm/suite/mailnews/content/mailEditorOverlay.xul create mode 100644 comm/suite/mailnews/content/mailKeysOverlay.xul create mode 100644 comm/suite/mailnews/content/mailOverlay.js create mode 100644 comm/suite/mailnews/content/mailOverlay.xul create mode 100644 comm/suite/mailnews/content/mailTasksOverlay.js create mode 100644 comm/suite/mailnews/content/mailTasksOverlay.xul create mode 100644 comm/suite/mailnews/content/mailViewList.js create mode 100644 comm/suite/mailnews/content/mailViewList.xul create mode 100644 comm/suite/mailnews/content/mailViewSetup.js create mode 100644 comm/suite/mailnews/content/mailViewSetup.xul create mode 100644 comm/suite/mailnews/content/mailWidgets.xml create mode 100644 comm/suite/mailnews/content/mailWindow.js create mode 100644 comm/suite/mailnews/content/mailWindowOverlay.js create mode 100644 comm/suite/mailnews/content/mailWindowOverlay.xul create mode 100644 comm/suite/mailnews/content/messageWindow.js create mode 100644 comm/suite/mailnews/content/messageWindow.xul create mode 100644 comm/suite/mailnews/content/messenger.css create mode 100644 comm/suite/mailnews/content/messenger.xul create mode 100644 comm/suite/mailnews/content/msgFolderPickerOverlay.js create mode 100644 comm/suite/mailnews/content/msgHdrViewOverlay.js create mode 100644 comm/suite/mailnews/content/msgHdrViewOverlay.xul create mode 100644 comm/suite/mailnews/content/msgMail3PaneWindow.js create mode 100644 comm/suite/mailnews/content/msgViewNavigation.js create mode 100644 comm/suite/mailnews/content/msgViewPickerOverlay.js create mode 100644 comm/suite/mailnews/content/nsDragAndDrop.js create mode 100644 comm/suite/mailnews/content/phishingDetector.js create mode 100644 comm/suite/mailnews/content/searchBar.js create mode 100644 comm/suite/mailnews/content/searchTermOverlay.xul create mode 100644 comm/suite/mailnews/content/start.xhtml create mode 100644 comm/suite/mailnews/content/tabmail.js create mode 100644 comm/suite/mailnews/content/tabmail.xml create mode 100644 comm/suite/mailnews/content/threadPane.js create mode 100644 comm/suite/mailnews/content/threadPane.xul (limited to 'comm/suite/mailnews/content') diff --git a/comm/suite/mailnews/content/ABSearchDialog.js b/comm/suite/mailnews/content/ABSearchDialog.js new file mode 100644 index 0000000000..15d85b6234 --- /dev/null +++ b/comm/suite/mailnews/content/ABSearchDialog.js @@ -0,0 +1,327 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +const {encodeABTermValue} = ChromeUtils.import("resource:///modules/ABQueryUtils.jsm"); +const {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm"); +const {PluralForm} = ChromeUtils.import("resource://gre/modules/PluralForm.jsm"); + +var searchSessionContractID = "@mozilla.org/messenger/searchSession;1"; +var gSearchSession; + +var nsMsgSearchScope = Ci.nsMsgSearchScope; +var nsMsgSearchOp = Ci.nsMsgSearchOp; +var nsMsgSearchAttrib = Ci.nsMsgSearchAttrib; +var nsIAbDirectory = Ci.nsIAbDirectory; + +var gStatusText; +var gSearchBundle; +var gAddressBookBundle; + +var gSearchStopButton; +var gPropertiesButton; +var gComposeButton; +var gSearchPhoneticName = "false"; + +var gSearchAbViewListener = { + onSelectionChanged: function() { + UpdateCardView(); + }, + onCountChanged: function(aTotal) { + let statusText; + if (aTotal == 0) { + statusText = gAddressBookBundle.getString("noMatchFound"); + } else { + statusText = PluralForm + .get(aTotal, gAddressBookBundle.getString("matchesFound1")) + .replace("#1", aTotal); + } + + gStatusText.setAttribute("label", statusText); + } +}; + +function searchOnLoad() +{ + setHelpFileURI("chrome://communicator/locale/help/suitehelp.rdf"); + UpgradeAddressBookResultsPaneUI("mailnews.ui.advanced_directory_search_results.version"); + + initializeSearchWidgets(); + initializeSearchWindowWidgets(); + + gSearchBundle = document.getElementById("bundle_search"); + gSearchStopButton.setAttribute("label", gSearchBundle.getString("labelForSearchButton")); + gSearchStopButton.setAttribute("accesskey", gSearchBundle.getString("labelForSearchButton.accesskey")); + gAddressBookBundle = document.getElementById("bundle_addressBook"); + gSearchSession = Cc[searchSessionContractID].createInstance(Ci.nsIMsgSearchSession); + + // initialize a flag for phonetic name search + gSearchPhoneticName = + GetLocalizedStringPref("mail.addr_book.show_phonetic_fields"); + + if (window.arguments && window.arguments[0]) + SelectDirectory(window.arguments[0].directory); + else + SelectDirectory(document.getElementById("abPopup-menupopup") + .firstChild.value); + + // initialize globals, see abCommon.js, InitCommonJS() + abList = document.getElementById("abPopup"); + + onMore(null); +} + +function searchOnUnload() +{ + CloseAbView(); +} + +function initializeSearchWindowWidgets() +{ + gSearchStopButton = document.getElementById("search-button"); + gPropertiesButton = document.getElementById("propertiesButton"); + gComposeButton = document.getElementById("composeButton"); + gStatusText = document.getElementById('statusText'); + // matchAll doesn't make sense for address book search + hideMatchAllItem(); +} + +function onSearchStop() +{ +} + +function onAbSearchReset(event) +{ + gPropertiesButton.setAttribute("disabled","true"); + gComposeButton.setAttribute("disabled","true"); + + CloseAbView(); + + onReset(event); + gStatusText.setAttribute("label", ""); +} + +function SelectDirectory(aURI) +{ + var selectedAB = aURI; + + if (!selectedAB) + selectedAB = kPersonalAddressbookURI; + + // set popup with address book names + var abPopup = document.getElementById('abPopup'); + if ( abPopup ) + abPopup.value = selectedAB; + + setSearchScope(GetScopeForDirectoryURI(selectedAB)); +} + +function GetScopeForDirectoryURI(aURI) +{ + var directory = MailServices.ab.getDirectory(aURI); + var booleanAnd = gSearchBooleanRadiogroup.selectedItem.value == "and"; + + if (directory.isRemote) { + if (booleanAnd) + return nsMsgSearchScope.LDAPAnd; + else + return nsMsgSearchScope.LDAP; + } + else { + if (booleanAnd) + return nsMsgSearchScope.LocalABAnd; + else + return nsMsgSearchScope.LocalAB; + } +} + +function onEnterInSearchTerm() +{ + // on enter + // if not searching, start the search + // if searching, stop and then start again + if (gSearchStopButton.getAttribute("label") == gSearchBundle.getString("labelForSearchButton")) { + onSearch(); + } + else { + onSearchStop(); + onSearch(); + } +} + +function onSearch() +{ + gStatusText.setAttribute("label", ""); + gPropertiesButton.setAttribute("disabled","true"); + gComposeButton.setAttribute("disabled","true"); + + gSearchSession.clearScopes(); + + var currentAbURI = document.getElementById('abPopup').getAttribute('value'); + + gSearchSession.addDirectoryScopeTerm(GetScopeForDirectoryURI(currentAbURI)); + gSearchSession.searchTerms = saveSearchTerms(gSearchSession.searchTerms, gSearchSession); + + var searchUri = currentAbURI + "?("; + + for (let i = 0; i < gSearchSession.searchTerms.length; i++) { + let searchTerm = gSearchSession.searchTerms[i]; + + // get the "and" / "or" value from the first term + if (i == 0) { + if (searchTerm.booleanAnd) + searchUri += "and"; + else + searchUri += "or"; + } + + var attrs; + + switch (searchTerm.attrib) { + case nsMsgSearchAttrib.Name: + if (gSearchPhoneticName != "true") + attrs = ["DisplayName","FirstName","LastName","NickName"]; + else + attrs = ["DisplayName","FirstName","LastName","NickName","PhoneticFirstName","PhoneticLastName"]; + break; + case nsMsgSearchAttrib.DisplayName: + attrs = ["DisplayName"]; + break; + case nsMsgSearchAttrib.Email: + attrs = ["PrimaryEmail"]; + break; + case nsMsgSearchAttrib.PhoneNumber: + attrs = ["HomePhone","WorkPhone","FaxNumber","PagerNumber","CellularNumber"]; + break; + case nsMsgSearchAttrib.Organization: + attrs = ["Company"]; + break; + case nsMsgSearchAttrib.Department: + attrs = ["Department"]; + break; + case nsMsgSearchAttrib.City: + attrs = ["WorkCity"]; + break; + case nsMsgSearchAttrib.Street: + attrs = ["WorkAddress"]; + break; + case nsMsgSearchAttrib.Nickname: + attrs = ["NickName"]; + break; + case nsMsgSearchAttrib.WorkPhone: + attrs = ["WorkPhone"]; + break; + case nsMsgSearchAttrib.HomePhone: + attrs = ["HomePhone"]; + break; + case nsMsgSearchAttrib.Fax: + attrs = ["FaxNumber"]; + break; + case nsMsgSearchAttrib.Pager: + attrs = ["PagerNumber"]; + break; + case nsMsgSearchAttrib.Mobile: + attrs = ["CellularNumber"]; + break; + case nsMsgSearchAttrib.Title: + attrs = ["JobTitle"]; + break; + case nsMsgSearchAttrib.AdditionalEmail: + attrs = ["SecondEmail"]; + break; + default: + dump("XXX " + searchTerm.attrib + " not a supported search attr!\n"); + attrs = ["DisplayName"]; + break; + } + + var opStr; + + switch (searchTerm.op) { + case nsMsgSearchOp.Contains: + opStr = "c"; + break; + case nsMsgSearchOp.DoesntContain: + opStr = "!c"; + break; + case nsMsgSearchOp.Is: + opStr = "="; + break; + case nsMsgSearchOp.Isnt: + opStr = "!="; + break; + case nsMsgSearchOp.BeginsWith: + opStr = "bw"; + break; + case nsMsgSearchOp.EndsWith: + opStr = "ew"; + break; + case nsMsgSearchOp.SoundsLike: + opStr = "~="; + break; + default: + opStr = "c"; + break; + } + + // currently, we can't do "and" and "or" searches at the same time + // (it's either all "and"s or all "or"s) + var max_attrs = attrs.length; + + for (var j=0;j + + + + + + + + +%abResultsPaneOverlayDTD; + +%SearchDialogDTD; +]> + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/comm/suite/mailnews/content/mailKeysOverlay.xul b/comm/suite/mailnews/content/mailKeysOverlay.xul new file mode 100644 index 0000000000..e89cee3968 --- /dev/null +++ b/comm/suite/mailnews/content/mailKeysOverlay.xul @@ -0,0 +1,64 @@ + + + + + + + + + + +#ifdef XP_MACOSX + + + +#else + +#endif + + + + + + + + + + + + + + + + + + + + + + + diff --git a/comm/suite/mailnews/content/mailOverlay.js b/comm/suite/mailnews/content/mailOverlay.js new file mode 100644 index 0000000000..fd812eaa54 --- /dev/null +++ b/comm/suite/mailnews/content/mailOverlay.js @@ -0,0 +1,30 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +function openNewCardDialog() +{ + window.openDialog("chrome://messenger/content/addressbook/abNewCardDialog.xul", + "", "chrome,modal,resizable=no,centerscreen"); +} + +function goOpenNewMessage() +{ + // if there is a MsgNewMessage function in scope + // and we should use it, so that we choose the proper + // identity, based on the selected message or folder + // if not, bring up the compose window to the default identity + if ("MsgNewMessage" in window) + { + MsgNewMessage(null); + return; + } + + Cc["@mozilla.org/messengercompose;1"] + .getService(Ci.nsIMsgComposeService) + .OpenComposeWindow(null, null, null, + Ci.nsIMsgCompType.New, + Ci.nsIMsgCompFormat.Default, + null, null, null); +} diff --git a/comm/suite/mailnews/content/mailOverlay.xul b/comm/suite/mailnews/content/mailOverlay.xul new file mode 100644 index 0000000000..b1379f6824 --- /dev/null +++ b/comm/suite/mailnews/content/mailOverlay.xul @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#ifndef XP_MACOSX + +#endif + + +#ifndef XP_MACOSX + +#else + +#endif + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#ifndef XP_MACOSX + +#endif + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +