From 236a617d06384b08167296afffeed1ec0cda15c4 Mon Sep 17 00:00:00 2001 From: Richard Marti Date: Sun, 11 Sep 2022 20:48:30 +1000 Subject: [PATCH] Bug 1790175 - Remove the Message menu item in the new App Menu. r=aleca Differential Revision: https://phabricator.services.mozilla.com/D157026 --HG-- extra : amend_source : b536e8ba736b50ee8564546756a00c6b22cef202 --- mail/base/content/hiddenWindowMac.js | 18 -- mail/base/content/mailWindowOverlay.js | 81 ----- .../customizableui/content/panelUI.inc.xhtml | 304 ------------------ .../customizableui/content/panelUI.js | 9 +- mail/locales/en-US/messenger/messenger.ftl | 3 - 5 files changed, 1 insertion(+), 414 deletions(-) diff --git a/mail/base/content/hiddenWindowMac.js b/mail/base/content/hiddenWindowMac.js index b018e45c59..9a40f81687 100644 --- a/mail/base/content/hiddenWindowMac.js +++ b/mail/base/content/hiddenWindowMac.js @@ -86,10 +86,7 @@ function hiddenWindowStartup() { "filtersCmd", "cmd_close", "minimizeWindow", - "appmenu_markMenu", "zoomWindow", - "appmenu_replyMainMenu", - "appmenu_replyNewsgroupMainMenu", "appmenu_newFolder", "appmenu_newMailAccountMenuItem", "appmenu_close", @@ -121,7 +118,6 @@ function hiddenWindowStartup() { "appmenu_viewHeadersMenu", "appmenu_find", "appmenu_viewAttachmentsInlineMenuitem", - "appmenu_replySenderMainMenu", "appmenu_nextMsg", "appmenu_nextUnreadMsg", "appmenu_nextUnreadThread", @@ -131,22 +127,8 @@ function hiddenWindowStartup() { "appmenu_goForward", "appmenu_goBack", "appmenu_goStartPage", - "appmenu_newMsgCmd", "appmenu_viewFullZoomMenu", - "appmenu_replyToAll", - "appmenu_replyToList", - "appmenu_forwardMsg", - "appmenu_forwardAsMenu", - "appmenu_editMsgAsNew", - "appmenu_tagMenu", - "appmenu_moveToFolderAgain", "appmenu_openMessageWindowMenuitem", - "appmenu_openConversationMenuitem", - "appmenu_moveMenu", - "appmenu_copyMenu", - "appmenu_createFilter", - "appmenu_killThread", - "appmenu_killSubthread", ]; let element; diff --git a/mail/base/content/mailWindowOverlay.js b/mail/base/content/mailWindowOverlay.js index 610fdf038d..3eb7b73a0a 100644 --- a/mail/base/content/mailWindowOverlay.js +++ b/mail/base/content/mailWindowOverlay.js @@ -901,87 +901,6 @@ function InitMessageMenu() { document.commandDispatcher.updateCommands("create-menu-message"); } -function InitAppMessageMenu() { - let selectedMsg = gFolderDisplay.selectedMessage; - let isNews = gFolderDisplay.selectedMessageIsNews; - let isFeed = gFolderDisplay.selectedMessageIsFeed; - - // We show reply to Newsgroups only for news messages. - document.getElementById("appmenu_replyNewsgroupMainMenu").hidden = !isNews; - - // For mail messages we say reply. For news we say ReplyToSender. - document.getElementById("appmenu_replyMainMenu").hidden = isNews; - document.getElementById("appmenu_replySenderMainMenu").hidden = !isNews; - - document.getElementById("appmenu_cancel").hidden = !isNews; - - // Disable the move and copy menus if there are no messages selected or if - // the message is a dummy - e.g. opening a message in the standalone window. - let messageStoredInternally = selectedMsg && !gMessageDisplay.isDummy; - // Disable the move menu if we can't delete msgs from the folder. - let canMove = - messageStoredInternally && gFolderDisplay.canDeleteSelectedMessages; - document.getElementById("appmenu_moveMenu").disabled = !canMove; - - // Also disable copy when no folder is loaded (like for .eml files). - let canCopy = - selectedMsg && - (!gMessageDisplay.isDummy || window.arguments[0].scheme == "file"); - document.getElementById("appmenu_copyMenu").disabled = !canCopy; - - initMoveToFolderAgainMenu( - document.getElementById("appmenu_moveToFolderAgain") - ); - - // Disable the Forward As menu item if no message is selected. - document.getElementById("appmenu_forwardAsMenu").disabled = !selectedMsg; - - // Disable the Tag menu item if no message is selected or when we're - // not in a folder. - document.getElementById( - "appmenu_tagMenu" - ).disabled = !messageStoredInternally; - - // Show "Edit Draft Message" menus only in a drafts folder; otherwise hide them. - showCommandInSpecialFolder("cmd_editDraftMsg", Ci.nsMsgFolderFlags.Drafts); - // Show "New Message from Template" and "Edit Template" menus only in a - // templates folder; otherwise hide them. - showCommandInSpecialFolder( - ["cmd_newMsgFromTemplate", "cmd_editTemplateMsg"], - Ci.nsMsgFolderFlags.Templates - ); - - // Initialize the Open Message menuitem. - let winType = document.documentElement.getAttribute("windowtype"); - if (winType == "mail:3pane") { - document.getElementById( - "appmenu_openMessageWindowMenuitem" - ).hidden = isFeed; - } - - // Initialize the Open Feed Message handler menu. - const openFeedView = document - .getElementById("appMenu-messageOpenFeedView") - .querySelector(".panel-subview-body"); - - openFeedView.childNodes.forEach(node => node.removeAttribute("checked")); - openFeedView.childNodes[FeedMessageHandler.onOpenPref].setAttribute( - "checked", - true - ); - - let openRssMenu = document.getElementById("appmenu_openFeedMessage"); - openRssMenu.hidden = !isFeed; - if (winType != "mail:3pane") { - openRssMenu.hidden = true; - } - - // Disable mark menu when we're not in a folder. - document.getElementById("appmenu_markMenu").disabled = - gMessageDisplay.isDummy; - document.commandDispatcher.updateCommands("create-menu-message"); -} - /** * Show folder-specific menu items only for messages in special folders, e.g. * show 'cmd_editDraftMsg' in Drafts folder, or diff --git a/mail/components/customizableui/content/panelUI.inc.xhtml b/mail/components/customizableui/content/panelUI.inc.xhtml index 09635c5db7..ffdc27aad7 100644 --- a/mail/components/customizableui/content/panelUI.inc.xhtml +++ b/mail/components/customizableui/content/panelUI.inc.xhtml @@ -110,17 +110,11 @@ label="&fileMenu.label;" closemenu="none" oncommand="PanelUI.showSubView('appMenu-fileView', this)"/> - - #ifdef MAIN_WINDOW - - - - - - - - - - - - - - - - - - - -#ifdef MAIN_WINDOW - -#endif - -#ifdef MAIN_WINDOW - -#endif - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -