Bug 508250 - Add Forward as Inline/Attachment context menu. r=squib
authorRichard Marti <richard.marti@gmail.com>
Mon, 08 Apr 2013 10:28:26 +0200
changeset 15610 b6566a522eaaea6e30d19a59b724c38ce63db776
parent 15609 e232ca630f82686909fe4c427b52045af2049769
child 15611 ae206f9f23c99a188d61b7c1b28f087b933e4d43
push id942
push userbugzilla@standard8.plus.com
push dateMon, 05 Aug 2013 19:15:38 +0000
treeherdercomm-beta@0e1a1c4a9f0c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssquib
bugs508250
Bug 508250 - Add Forward as Inline/Attachment context menu. r=squib
mail/base/content/mailWindowOverlay.xul
mail/base/content/nsContextMenu.js
mail/locales/en-US/chrome/messenger/messenger.dtd
--- a/mail/base/content/mailWindowOverlay.xul
+++ b/mail/base/content/mailWindowOverlay.xul
@@ -678,19 +678,33 @@
     <menuitem id="mailContext-replyList"
               label="&contextReplyList.label;"
               accesskey="&contextReplyList.accesskey;"
               oncommand="MsgReplyToListMessage(event);"/>
     <menuitem id="mailContext-forward"
               label="&contextForward.label;"
               accesskey="&contextForward.accesskey;"
               oncommand="MsgForwardMessage(event);"/>
-    <menuitem id="mailContext-forwardAsAttachment"
-              label="&contextForwardAsAttachment.label;"
-              accesskey="&contextForwardAsAttachment.accesskey;"
+    <menu id="mailContext-forwardAsMenu"
+          label="&contextForwardAsMenu.label;"
+          accesskey="&contextForwardAsMenu.accesskey;">
+      <menupopup id="mailContext-forwardAsPopup">
+        <menuitem id="mailContext-forwardAsInline"
+                  label="&contextForwardAsInline.label;"
+                  accesskey="&contextForwardAsInline.accesskey;"
+                  command="cmd_forwardInline"/>
+        <menuitem id="mailContext-forwardAsAttachment"
+                  label="&contextForwardAsAttachmentItem.label;"
+                  accesskey="&contextForwardAsAttachmentItem.accesskey;"
+                  command="cmd_forwardAttachment"/>
+      </menupopup>
+    </menu>
+    <menuitem id="mailContext-multiForwardAsAttachment"
+              label="&contextMultiForwardAsAttachment.label;"
+              accesskey="&contextMultiForwardAsAttachment.accesskey;"
               oncommand="MsgForwardAsAttachment(event);"/>
     <menuitem id="mailContext-editAsNew"
               label="&contextEditAsNew.label;"
               accesskey="&contextEditAsNew.accesskey;"
               oncommand="MsgEditMessageAsNew();"/>
     <menuseparator id="mailContext-sep-reply"/>
     <menu id="mailContext-tags" label="&tagMenu.label;" accesskey="&tagMenu.accesskey;">
       <menupopup id="mailContext-tagpopup"
--- a/mail/base/content/nsContextMenu.js
+++ b/mail/base/content/nsContextMenu.js
@@ -244,17 +244,18 @@ nsContextMenu.prototype = {
     // items as this simplifies the logic below.
     if (!this.inMessageArea) {
       const messageTabSpecificItems = [
         "mailContext-openNewWindow", "threadPaneContext-openNewTab",
         "mailContext-openConversation",
         "mailContext-archive", "mailContext-replySender",
         "mailContext-editAsNew", "mailContext-replyNewsgroup",
         "mailContext-replyAll", "mailContext-replyList",
-        "mailContext-forward", "mailContext-forwardAsAttachment",
+        "mailContext-forward", "mailContext-forwardAsMenu",
+        "mailContext-multiForwardAsAttachment",
         "mailContext-copyMessageUrl", "mailContext-moveMenu",
         "mailContext-copyMenu", "mailContext-moveToFolderAgain",
         "mailContext-tags", "mailContext-mark", "mailContext-saveAs",
         "mailContext-printpreview", "mailContext-print", "mailContext-delete",
         "downloadSelected", "mailContext-reportPhishingURL"
       ];
       for (let i = 0; i < messageTabSpecificItems.length; ++i)
         this.showItem(messageTabSpecificItems[i], false);
@@ -275,18 +276,19 @@ nsContextMenu.prototype = {
                   gConversationOpener.isSelectedMessageIndexed());
 
     this.setSingleSelection("mailContext-replySender");
     this.setSingleSelection("mailContext-editAsNew");
     this.setSingleSelection("mailContext-replyNewsgroup", this.isNewsgroup);
     this.setSingleSelection("mailContext-replyAll");
     this.setSingleSelection("mailContext-replyList");
     this.setSingleSelection("mailContext-forward");
+    this.setSingleSelection("mailContext-forwardAsMenu");
 
-    this.showItem("mailContext-forwardAsAttachment",
+    this.showItem("mailContext-multiForwardAsAttachment",
                   this.numSelectedMessages > 1 && this.inThreadPane &&
                   !this.hideMailItems);
 
     this.setSingleSelection("mailContext-copyMessageUrl", this.isNewsgroup);
 
     let msgModifyItems = this.numSelectedMessages > 0 && !this.hideMailItems &&
       !this.onPlayableMedia &&
       !(this.numSelectedMessages == 1 && gMessageDisplay.isDummy);
--- a/mail/locales/en-US/chrome/messenger/messenger.dtd
+++ b/mail/locales/en-US/chrome/messenger/messenger.dtd
@@ -692,18 +692,24 @@
 <!ENTITY contextReplyNewsgroup2.label "Followup to Newsgroup">
 <!ENTITY contextReplyNewsgroup2.accesskey "u">
 <!ENTITY contextReplyAll.label "Reply to All">
 <!ENTITY contextReplyAll.accesskey "A">
 <!ENTITY contextReplyList.label "Reply to List">
 <!ENTITY contextReplyList.accesskey "L">
 <!ENTITY contextForward.label "Forward">
 <!ENTITY contextForward.accesskey "F">
-<!ENTITY contextForwardAsAttachment.label "Forward as Attachments">
-<!ENTITY contextForwardAsAttachment.accesskey "o">
+<!ENTITY contextForwardAsMenu.label "Forward As">
+<!ENTITY contextForwardAsMenu.accesskey "o">
+<!ENTITY contextForwardAsInline.label "Inline">
+<!ENTITY contextForwardAsInline.accesskey "I">
+<!ENTITY contextForwardAsAttachmentItem.label "Attachment">
+<!ENTITY contextForwardAsAttachmentItem.accesskey "A">
+<!ENTITY contextMultiForwardAsAttachment.label "Forward as Attachments">
+<!ENTITY contextMultiForwardAsAttachment.accesskey "o">
 <!ENTITY contextMoveMsgMenu.label "Move To">
 <!ENTITY contextMoveMsgMenu.accesskey "M">
 <!ENTITY contextMoveCopyMsgRecentMenu.label "Recent">
 <!ENTITY contextMoveCopyMsgRecentMenu.accesskey "R">
 <!ENTITY contextCopyMsgMenu.label "Copy To">
 <!ENTITY contextCopyMsgMenu.accesskey "C">
 <!ENTITY contextSaveAs.label "Save As…">
 <!ENTITY contextSaveAs.accesskey "S">