Bug 643788 - Move cmd_exportToText, cmd_preview and cmd_editSendPage out of editorOverlay r=neil/bienvenu
authorIan Neal <iann_cvs@blueyonder.co.uk>
Wed, 20 Apr 2011 00:33:28 +0100
changeset 7581 aba7f1706d4c77a2e9271c11627bd3326bae8d2d
parent 7580 f0b51d8d048a3405f8982f539ded9f338653ebb1
child 7582 c23f1d292860b6af26751395530e9d300bdbf63c
push idunknown
push userunknown
push dateunknown
reviewersneil, bienvenu
bugs643788
Bug 643788 - Move cmd_exportToText, cmd_preview and cmd_editSendPage out of editorOverlay r=neil/bienvenu
editor/ui/composer/content/composerOverlay.xul
editor/ui/composer/content/editor.xul
editor/ui/composer/content/editorOverlay.xul
editor/ui/locales/en-US/chrome/composer/editor.dtd
editor/ui/locales/en-US/chrome/composer/editorOverlay.dtd
suite/mailnews/jar.mn
suite/mailnews/mailEditorOverlay.xul
--- a/editor/ui/composer/content/composerOverlay.xul
+++ b/editor/ui/composer/content/composerOverlay.xul
@@ -32,12 +32,31 @@
    - use your version of this file under the terms of the MPL, indicate your
    - decision by deleting the provisions above and replace them with the notice
    - and other provisions required by the GPL or the LGPL. If you do not delete
    - 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.
    -
    - ***** END LICENSE BLOCK ***** -->
 
+<!DOCTYPE overlay [
+<!ENTITY % editorDTD SYSTEM "chrome://editor/locale/editor.dtd">
+%editorDTD;
+]>
+
 <overlay id="composerOverlay"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
-</overlay>    
+  <!-- Items in the File menu used only by Composer app -->
+  <menupopup id="menu_FilePopup">
+    <menuitem id="fileExportToText"
+              insertafter="fileMenuAfterFileRevertSeparator"
+              command="cmd_exportToText"/>
+    <menuitem id="previewInBrowser"
+              label="&previewCmd.label;"
+              accesskey="&previewCmd.accesskey;"
+              insertafter="fileExportToText"
+              command="cmd_preview"/>
+    <!-- menuitem id="menu_SendPage" is merged here from mailEditorOverlay.xul,
+         where "position" is assumed to be just after 'previewInBrowser' -->
+  </menupopup>
+
+</overlay>
--- a/editor/ui/composer/content/editor.xul
+++ b/editor/ui/composer/content/editor.xul
@@ -97,16 +97,27 @@
 
   <commandset id="editorCommands">
     <commandset id="commonEditorMenuItems"/>
     <commandset id="composerMenuItems"/>
     <commandset id="composerOnlyMenuItems"
                 commandupdater="true"
                 events="create, mode_switch"
                 oncommandupdate="goUpdateComposerMenuItems(this);">
+      <!-- file menu -->
+      <command id="cmd_exportToText"
+               label="&exportToTextCmd.label;"
+               accesskey="&exportToTextCmd.accesskey;"
+               oncommand="goDoCommand('cmd_exportToText');"/>
+      <command id="cmd_preview"
+               oncommand="goDoCommand('cmd_preview');"/>
+      <command id="cmd_editSendPage"
+               label="&sendPageCmd.label;"
+               accesskey="&sendPageCmd.accesskey;"
+               oncommand="goDoCommand('cmd_editSendPage');"/>
       <!-- format menu -->
       <command id="cmd_pageProperties"
                oncommand="goDoCommand('cmd_pageProperties');"/>
       <!-- tools menu -->
       <command id="cmd_validate"
                oncommand="goDoCommand('cmd_validate');"/>
       <!-- toolbars -->
       <command id="cmd_NormalMode"
@@ -237,25 +248,29 @@
     <menu id="windowMenu"/>
 
     <!-- help menu filled from globalOverlay -->
     <menu id="menu_Help"/>
 
     <spacer flex="1"/>
   </menubar>
 
-  <!-- toolbar filled out from editorOverlay -->
+  <!-- toolbar mostly filled out from editorOverlay -->
   <!-- add  class="standard" for dark blue background (icons need rework first) -->
   <toolbar class="chromeclass-toolbar toolbar-primary" id="EditToolbar" persist="collapsed" 
            grippytooltiptext="&compositionToolbar.tooltip;">
     <toolbarbutton id="newButton"/>
     <toolbarbutton id="openButton"/>
     <toolbarbutton id="saveButton"/>
     <toolbarbutton id="publishButton"/>
-    <toolbarbutton id="previewButton"/>
+    <toolbarbutton id="previewButton"
+                   class="toolbarbutton-1"
+                   label="&previewToolbarCmd.label;"
+                   command="cmd_preview"
+                   tooltiptext="&previewToolbarCmd.tooltip;"/>
     <toolbarbutton id="cutButton"/>
     <toolbarbutton id="copyButton"/>
     <toolbarbutton id="pasteButton"/>
     <toolbarbutton id="printButton"/>
     <toolbarbutton id="findButton"/>
     <toolbarseparator class="toolbarseparator-primary"/>
     <toolbarbutton id="linkButton"/>
     <toolbarbutton id="namedAnchorButton"/>
--- a/editor/ui/composer/content/editorOverlay.xul
+++ b/editor/ui/composer/content/editorOverlay.xul
@@ -235,24 +235,20 @@
   </commandset>
   
   <commandset id="composerSaveMenuItems"
           commandupdater="true"
           events="create, save"
           oncommandupdate="goUpdateComposerMenuItems(this)">
     <command id="cmd_save"           label="&saveCmd.label;"           oncommand="goDoCommand('cmd_save')"/>
     <command id="cmd_saveAs"         label="&saveAsCmd.label;"         oncommand="goDoCommand('cmd_saveAs')"/>
-    <command id="cmd_exportToText"   label="&exportToTextCmd.label;"   oncommand="goDoCommand('cmd_exportToText')"/>
     <command id="cmd_saveAndChangeEncoding"  label="&saveAsChangeEncodingCmd.label;"  oncommand="goDoCommand('cmd_saveAndChangeEncoding')"/>
     <command id="cmd_publish"        label="&publishCmd.label;"        oncommand="goDoCommand('cmd_publish')"/>
     <command id="cmd_publishAs"      label="&publishAsCmd.label;"      oncommand="goDoCommand('cmd_publishAs')"/>
     <command id="cmd_revert"         label="&fileRevert.label;"        oncommand="goDoCommand('cmd_revert')"/>
-    <command id="cmd_preview"                                          oncommand="goDoCommand('cmd_preview')"/>
-    <command id="cmd_editSendPage"   label="&sendPageCmd.label;"
-                                     accesskey="&sendPageCmd.accesskey;"  oncommand="goDoCommand('cmd_editSendPage')"/>
   </commandset>
 
   <!-- edit menu commands. These get updated by code in globalOverlay.js -->
   <commandset id="composerEditMenuItems"
           commandupdater="true"
           events="create, mode_switch"
           oncommandupdate="goUpdateComposerMenuItems(this)">
     <command id="cmd_undo"/>
@@ -441,25 +437,17 @@
       <menuitem id="menu_publishAs"
                 accesskey="&publishAsCmd.accesskey;"
                 command="cmd_publishAs"/>
       <menuseparator id="fileMenuAfterPublishAsSeparator"/>
       <menuitem id="menu_fileRevert"
                 accesskey="&fileRevert.accesskey;"
                 command="cmd_revert"/>
       <menuseparator id="fileMenuAfterFileRevertSeparator"/>
-      <menuitem id="fileExportToText"
-                accesskey="&exportToTextCmd.accesskey;"
-                command="cmd_exportToText"/>
-      <menuitem id="previewInBrowser"
-                label="&previewCmd.label;"
-                accesskey="&previewCmd.accesskey;"
-                command="cmd_preview"/>
-      <!-- menuitem id="menu_SendPage" is merged here from mailEditorOverlay.xul,
-           where "position" is assumed to be just after 'previewInBrowser'  -->
+      <!-- menuitems are merged in here from composerOverlay.xul -->
       <menuitem id="printSetupMenuItem"
                 label="&printSetupCmd.label;"
                 accesskey="&printSetupCmd.accesskey;"
                 command="cmd_printSetup"/>
       <menuitem id="printMenuItem"
                 label="&printCmd.label;"
                 accesskey="&printCmd.accesskey;"
                 key="printkb"
@@ -1182,21 +1170,16 @@
   <toolbarbutton id="saveButton"
                  class="toolbarbutton-1"
                  command="cmd_save"
                  tooltiptext="&saveToolbarCmd.tooltip;"/>
   <toolbarbutton id="publishButton"
                  class="toolbarbutton-1"
                  command="cmd_publish"
                  tooltiptext="&publishToolbarCmd.tooltip;"/>
-  <toolbarbutton id="previewButton"
-                 class="toolbarbutton-1"
-                 label="&previewToolbarCmd.label;"
-                 command="cmd_preview"
-                 tooltiptext="&previewToolbarCmd.tooltip;"/>
   <toolbarbutton id="cutButton" class="toolbarbutton-1"
                  label="&cutCmd.label;" command="cmd_cut"
                  tooltiptext="&cutCmd.label;"/>
   <toolbarbutton id="copyButton" class="toolbarbutton-1"
                  label="&copyCmd.label;" command="cmd_copy"
                  tooltiptext="&copyCmd.label;"/>
   <toolbarbutton id="pasteButton" class="toolbarbutton-1"
                  label="&pasteCmd.label;" command="cmd_paste"
--- a/editor/ui/locales/en-US/chrome/composer/editor.dtd
+++ b/editor/ui/locales/en-US/chrome/composer/editor.dtd
@@ -39,16 +39,26 @@
 <!-- LOCALIZATION NOTE  (editorWindow.titlemodifier): DONT_TRANSLATE -->
 <!ENTITY editorWindow.titlemodifier "Composer"> 
 <!ENTITY editorWindow.titlemodifiermenuseparator " - ">
 
 <!-- Menu items:  the . means that the menu item isn't implemented yet -->
 
 <!-- Toolbar-only items -->
 <!ENTITY compositionToolbar.tooltip "Composition Toolbar">
+<!ENTITY previewToolbarCmd.label "Browse">
+<!ENTITY previewToolbarCmd.tooltip "Load this page in the browser">
+
+<!-- File menu items -->
+<!ENTITY exportToTextCmd.label "Export to Text…">
+<!ENTITY exportToTextCmd.accesskey "T">
+<!ENTITY previewCmd.label "Browse Page">
+<!ENTITY previewCmd.accesskey "w">
+<!ENTITY sendPageCmd.label "Send Page…">
+<!ENTITY sendPageCmd.accesskey "d">
 
 <!-- View menu items -->
 <!ENTITY viewMenu.label "View">
 <!ENTITY viewMenu.accesskey "V">
 <!ENTITY compositionToolbarCmd.label "Composition Toolbar">
 <!ENTITY compositionToolbarCmd.accesskey "C">
 <!ENTITY formattingToolbarCmd.label "Format Toolbar">
 <!ENTITY formattingToolbarCmd.accesskey "F">
--- a/editor/ui/locales/en-US/chrome/composer/editorOverlay.dtd
+++ b/editor/ui/locales/en-US/chrome/composer/editorOverlay.dtd
@@ -64,24 +64,18 @@
 <!ENTITY saveAsCmd.label "Save As…">
 <!ENTITY saveAsCmd.accesskey "A">
 
 <!ENTITY publishCmd.label "Publish">
 <!ENTITY publishCmd.accesskey "b">
 <!ENTITY publishCmd.key "S">
 <!ENTITY publishAsCmd.label "Publish As…">
 <!ENTITY publishAsCmd.accesskey "h">
-<!ENTITY exportToTextCmd.label "Export to Text…">
-<!ENTITY exportToTextCmd.accesskey "T">
 <!ENTITY saveAsChangeEncodingCmd.label "Save And Change Character Encoding">
 <!ENTITY saveAsChangeEncodingCmd.accesskey "E">
-<!ENTITY previewCmd.label "Browse Page">
-<!ENTITY previewCmd.accesskey "w">
-<!ENTITY sendPageCmd.label "Send Page…">
-<!ENTITY sendPageCmd.accesskey "d">
 <!ENTITY printSetupCmd.label "Page Setup…">
 <!ENTITY printSetupCmd.accesskey "u">
 <!ENTITY printCmd.label "Print…">
 <!ENTITY printCmd.accesskey "P">
 <!ENTITY printCmd.key "P">
 <!ENTITY closeCmd.label "Close">
 <!ENTITY closeCmd.accesskey "C">
 <!ENTITY closeCmd.key "W">
@@ -399,18 +393,16 @@
 <!-- Toolbar-only items -->
 <!ENTITY menuBar.tooltip "Menu Bar">
 <!ENTITY formatToolbar.tooltip "Formatting Toolbar">
 <!ENTITY newToolbarCmd.tooltip "Create a new Composer page">
 <!ENTITY openToolbarCmd.label "Open">
 <!ENTITY openToolbarCmd.tooltip "Open a local file">
 <!ENTITY saveToolbarCmd.tooltip "Save file to a local location">
 <!ENTITY publishToolbarCmd.tooltip "Upload file to a remote location">
-<!ENTITY previewToolbarCmd.label "Browse">
-<!ENTITY previewToolbarCmd.tooltip "Load this page in the browser">
 <!ENTITY printToolbarCmd.label "Print">
 <!ENTITY printToolbarCmd.tooltip "Print this page">
 <!ENTITY findToolbarCmd.label "Find">
 <!ENTITY findToolbarCmd.tooltip "Find text in page">
 <!ENTITY spellToolbarCmd.label "Spell">
 <!ENTITY spellToolbarCmd.tooltip "Check spelling of selection or entire page">
 <!ENTITY imageToolbarCmd.label "Image">
 <!ENTITY imageToolbarCmd.tooltip "Insert new image or edit selected image's properties">
--- a/suite/mailnews/jar.mn
+++ b/suite/mailnews/jar.mn
@@ -8,17 +8,17 @@ messenger.jar:
 % overlay chrome://communicator/content/pref/pref-scripts.xul                  chrome://messenger/content/mailPrefsOverlay.xul
 % overlay chrome://communicator/content/pref/pref-cookies.xul                  chrome://messenger/content/mailPrefsOverlay.xul
 % overlay chrome://editor/content/editorTasksOverlay.xul                       chrome://messenger/content/mailTasksOverlay.xul
 % overlay chrome://navigator/content/navigatorOverlay.xul                      chrome://messenger/content/mailOverlay.xul
 % overlay chrome://messenger/content/messenger.xul                             chrome://messenger/content/mailMessengerOverlay.xul
 % overlay chrome://messenger/content/messengercompose/messengercompose.xul     chrome://messenger/content/mailMessengerComposeOverlay.xul
 % overlay chrome://messenger/content/addressbook/addressbook.xul               chrome://messenger/content/mailABOverlay.xul
 % overlay chrome://messenger/content/addressbook/abSelectAddressesDialog.xul   chrome://messenger/content/mailOverlay.xul
-% overlay chrome://editor/content/editor.xul                                   chrome://messenger/content/mailEditorOverlay.xul
+% overlay chrome://editor/content/composerOverlay.xul                          chrome://messenger/content/mailEditorOverlay.xul
 % overlay chrome://editor/content/EdImageOverlay.xul                           chrome://messenger/content/messengercompose/mailComposeEditorOverlay.xul
 % overlay chrome://editor/content/EdLinkProps.xul                              chrome://messenger/content/messengercompose/mailComposeEditorOverlay.xul
     content/messenger/msgViewPickerOverlay.js
     content/messenger/mailViewSetup.js
     content/messenger/mailViewSetup.xul
     content/messenger/mailViewList.xul
     content/messenger/mailViewList.js
     content/messenger/mailWidgets.xml
--- a/suite/mailnews/mailEditorOverlay.xul
+++ b/suite/mailnews/mailEditorOverlay.xul
@@ -42,16 +42,16 @@
   <!-- editor specific UI items -->
   <menupopup id="menu_NewPopup">
     <!-- Command nodes and implemention are in mailOverlay.xul -->
     <menuitem id="menu_newMessage" insertafter="menu_newNavigator"/>
     <menuitem id="menu_newCard" insertafter="menu_newNavigator"/>
   </menupopup>
 
   <menupopup id="menu_FilePopup">
-    <!-- The command node cmd_editSendPage is in editorOverlay.xul. 
+    <!-- The command node cmd_editSendPage is in editor.xul. 
          Implementation is in ComposerCommands.js
     -->
     <menuitem id="menu_sendPage" label="&sendPage.label;" accesskey="&sendPage.accesskey;" observes="cmd_editSendPage" insertafter="previewInBrowser"/>
   </menupopup>
 
 </overlay>