Bug 688765 - Move file menu from editorOverlay to editingOverlay r=neil/standard8 a/rs=callek for CLOSED TREE
authorIan Neal <iann_cvs@blueyonder.co.uk>
Mon, 31 Oct 2011 22:35:53 +0000
changeset 9589 b5ccd380ba512401765ce093f88439ef4dfd502b
parent 9588 cd6be6781ce7b210e55f9094d7f20a1f9680c051
child 9590 c63ad16c02bcc15aea1469c0f0dc7e1fd9dc353f
push id281
push userbugzilla@standard8.plus.com
push dateWed, 21 Dec 2011 12:08:36 +0000
treeherdercomm-beta@6d973fa5c2e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil, standard8
bugs688765
Bug 688765 - Move file menu from editorOverlay to editingOverlay r=neil/standard8 a/rs=callek for CLOSED TREE
editor/ui/composer/content/composerOverlay.xul
editor/ui/composer/content/editingOverlay.js
editor/ui/composer/content/editingOverlay.xul
editor/ui/composer/content/editor.js
editor/ui/composer/content/editor.xul
editor/ui/composer/content/editorOverlay.xul
editor/ui/jar.mn
editor/ui/locales/en-US/chrome/composer/editingOverlay.dtd
editor/ui/locales/en-US/chrome/composer/editorOverlay.dtd
suite/debugQA/content/debugQATextEditorShell.xul
--- a/editor/ui/composer/content/composerOverlay.xul
+++ b/editor/ui/composer/content/composerOverlay.xul
@@ -43,17 +43,17 @@
 ]>
 
 <overlay id="composerOverlay"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <!-- Items in the File menu used only by Composer app -->
   <menupopup id="menu_FilePopup">
     <menuitem id="fileExportToText"
-              insertafter="fileMenuAfterFileRevertSeparator"
+              insertafter="sep_print"
               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' -->
new file mode 100644
--- /dev/null
+++ b/editor/ui/composer/content/editingOverlay.js
@@ -0,0 +1,123 @@
+/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998-1999
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Ryan Cassin (rcassin@supernova.org)
+ *   Neil Rashbrook (neil@parkwaycc.co.uk)
+ *   Charles Manske (cmanske@netscape.com)
+ *   Ian Neal (iann_bugzilla@blueyonder.co.uk)
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * 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 ***** */
+
+function BuildRecentPagesMenu()
+{
+  var editor = GetCurrentEditor();
+  if (!editor)
+    return;
+
+  var popup = document.getElementById("menupopup_RecentFiles");
+  if (!popup || !editor.document)
+    return;
+
+  // Delete existing menu
+  while (popup.firstChild)
+    popup.removeChild(popup.firstChild);
+
+  // Current page is the "0" item in the list we save in prefs,
+  //  but we don't include it in the menu.
+  var curUrl = StripPassword(GetDocumentUrl());
+  var historyCount = GetIntPref("editor.history.url_maximum", 10);
+
+  var menuIndex = 1;
+  for (var i = 0; i < historyCount; i++)
+  {
+    var url = GetStringPref("editor.history_url_" + i);
+
+    // Skip over current url
+    if (url && url != curUrl)
+    {
+      // Build the menu
+      var title = GetStringPref("editor.history_title_" + i);
+      var fileType = GetStringPref("editor.history_type_" + i);
+      AppendRecentMenuitem(popup, title, url, fileType, menuIndex);
+      menuIndex++;
+    }
+  }
+}
+
+function AppendRecentMenuitem(aPopup, aTitle, aUrl, aFileType, aIndex)
+{
+  if (!aPopup)
+    return;
+
+  var menuItem = document.createElement("menuitem");
+  if (!menuItem)
+    return;
+
+  var accessKey = aIndex <= 10 ? String(aIndex % 10) : " ";
+
+  // Show "title [url]" or just the URL.
+  var itemString = aTitle ? aTitle + " [" + aUrl + "]" : aUrl;
+
+  menuItem.setAttribute("label", accessKey + " " + itemString);
+  menuItem.setAttribute("crop", "center");
+  menuItem.setAttribute("tooltiptext", aUrl);
+  menuItem.setAttribute("value", aUrl);
+  menuItem.setAttribute("fileType", aFileType);
+  if (accessKey != " ")
+    menuItem.setAttribute("accesskey", accessKey);
+  aPopup.appendChild(menuItem);
+}
+
+function EditorInitFileMenu()
+{
+  // Disable "Save" menuitem when editing remote url. User should use "Save As"
+
+  var docUrl = GetDocumentUrl();
+  var scheme = GetScheme(docUrl);
+  if (scheme && scheme != "file")
+    SetElementEnabledById("menu_saveCmd", false);
+
+  // Enable recent pages submenu if there are any history entries in prefs.
+  var historyUrl = "";
+
+  if (GetIntPref("editor.history.url_maximum", 10))
+  {
+    historyUrl = GetStringPref("editor.history_url_0");
+
+    // See if there's more if current file is only entry in history list.
+    if (historyUrl && historyUrl == docUrl)
+      historyUrl = GetStringPref("editor.history_url_1");
+  }
+  SetElementEnabledById("menu_RecentFiles", historyUrl != "");
+}
--- a/editor/ui/composer/content/editingOverlay.xul
+++ b/editor/ui/composer/content/editingOverlay.xul
@@ -39,22 +39,135 @@
    -
    - ***** END LICENSE BLOCK ***** -->
 
 <!DOCTYPE overlay SYSTEM "chrome://editor/locale/editingOverlay.dtd">
 
 <overlay id="editingOverlay"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
+  <script type="application/javascript"
+          src="chrome://editor/content/editingOverlay.js"/>
+
+  <keyset id="editorKeys">
+    <key id="key_openRemoteEditor"
+         key="&openRemoteCmd.key;"
+         command="cmd_openRemote"
+         modifiers="accel,shift"/>
+    <key id="key_openEditor"
+         key="&openFileCmd.key;"
+         command="cmd_open"
+         modifiers="accel"/>
+    <key id="key_publish"
+         key="&publishCmd.key;"
+         command="cmd_publish"
+         modifiers="accel,shift"/>
+  </keyset>
+
   <!-- commands updated when the editor gets created -->
+  <commandset id="commonEditorMenuItems">
+    <command id="cmd_open"
+             oncommand="goDoCommand('cmd_open');"/>
+    <command id="cmd_openRemote"
+             oncommand="goDoCommand('cmd_openRemote');"/>
+    <command id="cmd_printpreview"
+             oncommand="goDoCommand('cmd_printpreview');"/> 
+  </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"
+             oncommand="goDoCommand('cmd_saveAs');"/>
+    <command id="cmd_saveAndChangeEncoding"
+             oncommand="goDoCommand('cmd_saveAndChangeEncoding');"/>
+    <command id="cmd_publish"
+             label="&publishCmd.label;"
+             oncommand="goDoCommand('cmd_publish');"/>
+    <command id="cmd_publishAs"
+             oncommand="goDoCommand('cmd_publishAs');"/>
+    <command id="cmd_revert"
+             oncommand="goDoCommand('cmd_revert');"/>
+  </commandset>
+
   <commandset id="composerEditMenuItems">
     <command id="cmd_publishSettings"
              oncommand="goDoCommand('cmd_publishSettings');"/>
   </commandset>
 
+  <!-- File menu items -->
+  <menu id="menu_File">
+    <menupopup id="menu_FilePopup" onpopupshowing="EditorInitFileMenu();">
+      <menu id="menu_New">
+        <menupopup id="menu_NewPopup">
+          <menuitem id="menu_newEditor"/>
+          <menuseparator id="sep_NewPopup"/>
+          <menuitem id="menu_newNavigator"/>
+        </menupopup>
+      </menu>
+      <menuitem id="menu_openRemote"
+                label="&openRemoteCmd.label;"
+                accesskey="&openRemoteCmd.accesskey;"
+                key="key_openRemoteEditor"
+                command="cmd_openRemote"/>
+      <menuitem id="menu_openFile"
+                label="&openFileCmd.label;"
+                accesskey="&openFileCmd.accesskey;"
+                key="key_openEditor"
+                command="cmd_open"/>
+      <menu id="menu_RecentFiles"
+            label="&fileRecentMenu.label;"
+            accesskey="&fileRecentMenu.accesskey;"
+            onpopupshowing="BuildRecentPagesMenu();">
+        <menupopup id="menupopup_RecentFiles"
+                   oncommand="editPage(event.target.getAttribute('value'),
+                                       event.target.getAttribute('fileType'));"/>
+          <!-- menuitems appended at runtime -->
+      </menu>
+      <menuitem id="menu_close"/>
+      <menuseparator id="sep_close"/>
+      <menuitem id="menu_saveCmd"
+                accesskey="&saveCmd.accesskey;"
+                key="key_save"
+                command="cmd_save"/>
+      <menuitem id="menu_saveAsCmd"
+                label="&saveAsCmd.label;"
+                accesskey="&saveAsCmd.accesskey;"
+                command="cmd_saveAs"/>
+      <menuitem id="menu_saveAsChangeEncoding"
+                label="&saveAsChangeEncodingCmd.label;"
+                accesskey="&saveAsChangeEncodingCmd.accesskey;"
+                command="cmd_saveAndChangeEncoding"/>
+      <menuseparator id="sep_saveCmd"/>
+      <menuitem id="menu_publish"
+                accesskey="&publishCmd.accesskey;"
+                key="key_publish"
+                command="cmd_publish"/>
+      <menuitem id="menu_publishAs"
+                label="&publishAsCmd.label;"
+                accesskey="&publishAsCmd.accesskey;"
+                command="cmd_publishAs"/>
+      <menuseparator id="sep_publishAs"/>
+      <menuitem id="menu_fileRevert"
+                label="&fileRevert.label;"
+                accesskey="&fileRevert.accesskey;"
+                command="cmd_revert"/>
+      <menuseparator id="sep_print"/>
+      <!-- menuitems are merged in here from composerOverlay.xul -->
+      <menuitem id="menu_printSetup"/>
+      <menuitem id="menu_printPreview"/>
+      <menuitem id="menu_print"/>
+      <!-- The Exit/Quit item is merged from platformGlobalOverlay.xul -->
+    </menupopup>
+  </menu>
+
   <!-- Edit menu items -->
   <menupopup id="menu_EditPopup">
     <menuitem id="menu_inlineSpellCheck"
               oncommand="InlineSpellCheckerUI.enabled = !InlineSpellCheckerUI.enabled"/>
     <menuitem id="menu_publishSettings"
               insertafter="sep_preferences"
               label="&publishSettings.label;"
               accesskey="&publishSettings.accesskey;"
--- a/editor/ui/composer/content/editor.js
+++ b/editor/ui/composer/content/editor.js
@@ -2095,55 +2095,16 @@ function UpdateWindowTitle()
     var xulWin = document.documentElement;
     document.title = (title || filename || GetString("untitled")) +
                      windowTitle +
                      xulWin.getAttribute("titlemenuseparator") + 
                      xulWin.getAttribute("titlemodifier");
   } catch (e) { dump(e); }
 }
 
-function BuildRecentPagesMenu()
-{
-  var editor = GetCurrentEditor();
-  if (!editor || !gPrefs)
-    return;
-
-  var popup = document.getElementById("menupopup_RecentFiles");
-  if (!popup || !editor.document)
-    return;
-
-  // Delete existing menu
-  while (popup.firstChild)
-    popup.removeChild(popup.firstChild);
-
-  // Current page is the "0" item in the list we save in prefs,
-  //  but we don't include it in the menu.
-  var curUrl = StripPassword(GetDocumentUrl());
-  var historyCount = 10;
-  try {
-    historyCount = gPrefs.getIntPref("editor.history.url_maximum");
-  } catch(e) {}
-  var menuIndex = 1;
-
-  for (var i = 0; i < historyCount; i++)
-  {
-    var url = GetUnicharPref("editor.history_url_"+i);
-
-    // Skip over current url
-    if (url && url != curUrl)
-    {
-      // Build the menu
-      var title = GetUnicharPref("editor.history_title_"+i);
-      var fileType = GetUnicharPref("editor.history_type_" + i);
-      AppendRecentMenuitem(popup, title, url, fileType, menuIndex);
-      menuIndex++;
-    }
-  }
-}
-
 function SaveRecentFilesPrefs(aTitle, aFileType)
 {
   // Can't do anything if no prefs
   if (!gPrefs) return;
 
   var curUrl = StripPassword(GetDocumentUrl());
   var historyCount = 10;
   try {
@@ -2183,79 +2144,16 @@ function SaveRecentFilesPrefs(aTitle, aF
   for (i = 0; i < urlArray.length; i++)
   {
     SetUnicharPref("editor.history_title_"+i, titleArray[i]);
     SetUnicharPref("editor.history_url_"+i, urlArray[i]);
     SetUnicharPref("editor.history_type_" + i, typeArray[i]);
   }
 }
 
-function AppendRecentMenuitem(menupopup, title, url, aFileType, menuIndex)
-{
-  if (menupopup)
-  {
-    var menuItem = document.createElementNS(XUL_NS, "menuitem");
-    if (menuItem)
-    {
-      var accessKey;
-      if (menuIndex <= 9)
-        accessKey = String(menuIndex);
-      else if (menuIndex == 10)
-        accessKey = "0";
-      else
-        accessKey = " ";
-
-      var itemString = accessKey+" ";
-
-      // Show "title [url]" or just the URL
-      if (title)
-      {
-       itemString += title;
-       itemString += " [";
-      }
-      itemString += url;
-      if (title)
-        itemString += "]";
-
-      menuItem.setAttribute("label", itemString);
-      menuItem.setAttribute("crop", "center");
-      menuItem.setAttribute("tooltiptext", url);
-      menuItem.setAttribute("value", url);
-      menuItem.setAttribute("fileType", aFileType);
-      if (accessKey != " ")
-        menuItem.setAttribute("accesskey", accessKey);
-      menupopup.appendChild(menuItem);
-    }
-  }
-}
-
-function EditorInitFileMenu()
-{
-  // Disable "Save" menuitem when editing remote url. User should use "Save As"
-  var docUrl = GetDocumentUrl();
-  var scheme = GetScheme(docUrl);
-  if (scheme && scheme != "file")
-    SetElementEnabledById("saveMenuitem", false);
-
-  // Enable recent pages submenu if there are any history entries in prefs
-  var historyUrl = "";
-
-  var historyCount = 10;
-  try { historyCount = gPrefs.getIntPref("editor.history.url_maximum"); } catch(e) {}
-  if (historyCount)
-  {
-    historyUrl = GetUnicharPref("editor.history_url_0");
-    
-    // See if there's more if current file is only entry in history list
-    if (historyUrl && historyUrl == docUrl)
-      historyUrl = GetUnicharPref("editor.history_url_1");
-  }
-  SetElementEnabledById("menu_RecentFiles", historyUrl != "");
-}
-
 function EditorInitFormatMenu()
 {
   try {
     InitObjectPropertiesMenuitem();
     InitRemoveStylesMenuitems("removeStylesMenuitem", "removeLinksMenuitem", "removeNamedAnchorsMenuitem");
   } catch(ex) {}
 }
 
--- a/editor/ui/composer/content/editor.xul
+++ b/editor/ui/composer/content/editor.xul
@@ -164,17 +164,17 @@
     <key keycode="VK_TAB" oncommand="return true;"/>
     <key keycode="VK_TAB" modifiers="shift" oncommand="return true;"/>
     <key keycode="VK_TAB" modifiers="control" oncommand="return true;"/>
     <key keycode="VK_TAB" modifiers="control,shift" oncommand="return true;"/>
   </keyset>
 
   <toolbox class="toolbox-top" id="EditorToolbox">
   <menubar id="main-menubar" class="chromeclass-menubar" persist="collapsed" grippytooltiptext="&menuBar.tooltip;">
-    <menu id="fileMenu"/>
+    <menu id="menu_File"/>
     <menu id="menu_Edit"/>
 
     <menu id="menu_View">
     <!-- id pulls in "Show Sidebar" item from sidebarOverlay -->
     <menupopup id="menu_View_Popup">
       <menu id="menu_Toolbars">
         <menupopup id="view_toolbars_popup"> 
           <menuitem id="viewComposerToolbar" label="&compositionToolbarCmd.label;" type="checkbox" accesskey="&compositionToolbarCmd.accesskey;" command="cmd_viewCompToolbar"  />
--- a/editor/ui/composer/content/editorOverlay.xul
+++ b/editor/ui/composer/content/editorOverlay.xul
@@ -53,30 +53,20 @@
 
 <script type="application/javascript" src="chrome://editor/content/editorUtilities.js"/>
 <script type="application/javascript" src="chrome://editor/content/ComposerCommands.js"/>
 
   <keyset id="editorKeys">
     <!-- defined in globalOverlay -->
     <key id="key_newNavigator"/>
     <key id="key_newBlankPage"/>
-    <key id="openeditorkb"
-         key="&openFileCmd.key;"
-         command="cmd_open"  modifiers="accel"/>
-    <key id="openremoteeditorkb"
-         key="&openRemoteCmd.key;"
-         command="cmd_openRemote"  modifiers="accel,shift"/>
     <key id="key_save"
          key="&saveCmd.key;"
          command="cmd_save"
          modifiers="accel"/>
-    <key id="publishkb"
-         key="&publishCmd.key;"
-         command="cmd_publish"
-         modifiers="accel,shift"/>
     <key id="key_print"/>
     <key id="key_close"/>
     <key id="key_quit"/>
     <key id="key_undo"/>
     <key id="key_redo"/>
     <key id="key_cut"/>
     <key id="key_copy"/>
     <key id="key_paste"/>
@@ -160,20 +150,17 @@
          modifiers="accel"/>
   </keyset>
 
   <!-- commands updated when the editor gets created -->
   <commandset id="commonEditorMenuItems"
           commandupdater="true"
           events="create"
           oncommandupdate="goUpdateComposerMenuItems(this)">
-    <command id="cmd_open"                                          oncommand="goDoCommand('cmd_open')"/>
-    <command id="cmd_openRemote"   label="&openRemoteCmd.label;"    oncommand="goDoCommand('cmd_openRemote')"/>
     <command id="cmd_printSetup"   oncommand="goDoCommand('cmd_printSetup')"/>
-    <command id="cmd_printpreview" oncommand="goDoCommand('cmd_printpreview');"/>
     <command id="cmd_print"        oncommand="goDoCommand('cmd_print')"/>
     <command id="cmd_close"        oncommand="goDoCommand('cmd_close');"/>
     <command id="cmd_quit"         oncommand="goDoCommand('cmd_quit')"/>
   </commandset>
 
   <commandset id="composerMenuItems"
           commandupdater="true"
           events="create, mode_switch"
@@ -204,28 +191,16 @@
 
     <!-- only used in context popup menu -->
     <command id="cmd_editLink"         oncommand="goDoCommand('cmd_editLink')"/>
 
     <!-- dummy command used just to disable things in non-HTML modes -->
     <command id="cmd_renderedHTMLEnabler"/>
   </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_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')"/>
-  </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"/>
     <command id="cmd_redo"/>
     <command id="cmd_cut"/>
@@ -348,77 +323,16 @@
     <command id="cmd_newEditor"/>
     <command id="cmd_newEditorTemplate"/>
     <command id="cmd_newEditorDraft"/>
     <!-- view menu -->
     <command id="cmd_viewCompToolbar"     oncommand="goToggleToolbar('EditToolbar','cmd_viewCompToolbar');"         checked="true"/>
     <command id="cmd_viewFormatToolbar"   oncommand="goToggleToolbar('FormatToolbar','cmd_viewFormatToolbar');"     checked="true"/>
   </commandset>
 
-  <!-- File  menu items -->
-  <menu id="fileMenu" label="&fileMenu.label;" accesskey="&fileMenu.accesskey;">
-    <menupopup id="menu_FilePopup" onpopupshowing="EditorInitFileMenu();">
-      <menu id="menu_New">
-        <menupopup id="menu_NewPopup">
-          <menuitem id="menu_newEditor"/>
-          <menuseparator id="composerBeginGlobalNewItems"/>
-          <menuitem id="menu_newNavigator"/>
-        </menupopup>
-      </menu>
-      <menuitem id="menu_openRemote"
-                accesskey="&openRemoteCmd.accesskey;"
-                key="openremoteeditorkb"
-                command="cmd_openRemote"/>
-      <menuitem id="menu_openFile"
-                label="&openFileCmd.label;"
-                accesskey="&openFileCmd.accesskey;"
-                key="openeditorkb"
-                command="cmd_open"/>
-      <menu id="menu_RecentFiles"
-            label="&fileRecentMenu.label;"
-            accesskey="&fileRecentMenu.accesskey;"
-            onpopupshowing="BuildRecentPagesMenu();">
-        <menupopup id="menupopup_RecentFiles"
-                   oncommand="editPage(event.target.getAttribute('value'),
-                                       event.target.getAttribute('fileType'));"/>
-          <!-- menuitems appended at runtime -->
-      </menu>
-      <menuitem id="menu_close"/>
-      <menuseparator id="fileMenuAfterCloseSeparator"/>
-      <menuitem id="saveMenuitem"
-                accesskey="&saveCmd.accesskey;"
-                key="key_save"
-                command="cmd_save"/>
-      <menuitem id="menu_saveAs"
-                accesskey="&saveAsCmd.accesskey;"
-                command="cmd_saveAs"/>
-      <menuitem id="menu_saveAsChangeEncoding"
-                accesskey="&saveAsChangeEncodingCmd.accesskey;"
-                command="cmd_saveAndChangeEncoding"/>
-      <menuseparator id="fileMenuAfterSaveAsChangeEncodingSeparator"/>
-      <menuitem id="publishMenuitem"
-                accesskey="&publishCmd.accesskey;"
-                key="publishkb"
-                command="cmd_publish"/>
-      <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"/>
-      <!-- menuitems are merged in here from composerOverlay.xul -->
-      <menuitem id="menu_printSetup"/>
-      <menuitem id="menu_printPreview"/>
-      <menuitem id="menu_print"/>
-      <!-- The Exit/Quit item is merged from platformGlobalOverlay.xul -->
-    </menupopup>
-  </menu>
-
   <menu id="menu_Edit">
     <menupopup id="menu_EditPopup">
       <!-- from utilityOverlay.xul -->
       <menuitem id="menu_undo"/>
       <menuitem id="menu_redo"/>
       <menuseparator id="sep_cut"/>
       <menuitem id="menu_cut"/>
       <menuitem id="menu_copy"/>
--- a/editor/ui/jar.mn
+++ b/editor/ui/jar.mn
@@ -75,16 +75,17 @@ comm.jar:
       content/editor/EdAECSSAttributes.js                      (dialogs/content/EdAECSSAttributes.js) 
       content/editor/EdAEHTMLAttributes.js                     (dialogs/content/EdAEHTMLAttributes.js) 
       content/editor/EdAEJSEAttributes.js                      (dialogs/content/EdAEJSEAttributes.js) 
       content/editor/EdAEAttributes.js                         (dialogs/content/EdAEAttributes.js) 
       content/editor/EdConvertToTable.xul                      (dialogs/content/EdConvertToTable.xul) 
       content/editor/EdConvertToTable.js                       (dialogs/content/EdConvertToTable.js) 
 #ifdef MOZ_SUITE
       content/editor/editor.xul                                (composer/content/editor.xul)
+      content/editor/editingOverlay.js                         (composer/content/editingOverlay.js)
       content/editor/publishprefs.js                           (composer/content/publishprefs.js)
       content/editor/EditorContextMenu.js                      (composer/content/EditorContextMenu.js)
       content/editor/EditorContextMenuOverlay.xul              (composer/content/EditorContextMenuOverlay.xul)
       content/editor/EditorAllTags.css                         (composer/content/EditorAllTags.css)
       content/editor/EditorParagraphMarks.css                  (composer/content/EditorParagraphMarks.css)
       content/editor/editorOverlay.xul                         (composer/content/editorOverlay.xul) 
       content/editor/editingOverlay.xul                        (composer/content/editingOverlay.xul)
       content/editor/composerOverlay.xul                       (composer/content/composerOverlay.xul)
--- a/editor/ui/locales/en-US/chrome/composer/editingOverlay.dtd
+++ b/editor/ui/locales/en-US/chrome/composer/editingOverlay.dtd
@@ -15,27 +15,56 @@
    - March 31, 1998.
    -
    - The Initial Developer of the Original Code is
    - Netscape Communications Corporation.
    - Portions created by the Initial Developer are Copyright (C) 1999-2000
    - the Initial Developer. All Rights Reserved.
    -
    - Contributor(s):
+   -   Sammy Ford
+   -   Blake Ross
+   -   Ryan Cassin (rcassin@supernova.org)
+   -   Daniel Glazman (glazman@netscape.com)
+   -   Stephen Donner (technutz@netscape.net)
    -   Charles Manske (cmanske@netscape.com)
+   -   Ian Neal (iann_bugzilla@blueyonder.co.uk)
    -
    - Alternatively, the contents of this file may be used under the terms of
    - either of the GNU General Public License Version 2 or later (the "GPL"),
    - or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    - in which case the provisions of the GPL or the LGPL are applicable instead
    - of those above. If you wish to allow use of your version of this file only
    - under the terms of either the GPL or the LGPL, and not to allow others to
    - 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 ***** -->
 
+<!-- File menu items -->
+<!ENTITY openFileCmd.label "Open File…">
+<!ENTITY openFileCmd.accesskey "O">
+<!ENTITY openFileCmd.key "O">
+<!ENTITY openRemoteCmd.label "Open Web Location…">
+<!ENTITY openRemoteCmd.accesskey "L">
+<!ENTITY openRemoteCmd.key "L">
+<!ENTITY fileRecentMenu.label "Recent Pages">
+<!ENTITY fileRecentMenu.accesskey "R">
+<!ENTITY saveCmd.label "Save">
+<!ENTITY saveCmd.accesskey "S">
+<!ENTITY saveAsCmd.label "Save As…">
+<!ENTITY saveAsCmd.accesskey "A">
+<!ENTITY saveAsChangeEncodingCmd.label "Save And Change Character Encoding">
+<!ENTITY saveAsChangeEncodingCmd.accesskey "E">
+<!ENTITY publishCmd.label "Publish">
+<!ENTITY publishCmd.accesskey "b">
+<!ENTITY publishCmd.key "S">
+<!ENTITY publishAsCmd.label "Publish As…">
+<!ENTITY publishAsCmd.accesskey "h">
+<!ENTITY fileRevert.label "Revert">
+<!ENTITY fileRevert.accesskey "t">
+
 <!-- Edit menu items -->
 <!ENTITY publishSettings.label "Publishing Site Settings…">
 <!ENTITY publishSettings.accesskey "b">
--- a/editor/ui/locales/en-US/chrome/composer/editorOverlay.dtd
+++ b/editor/ui/locales/en-US/chrome/composer/editorOverlay.dtd
@@ -38,41 +38,17 @@
    - 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 ***** -->
 
 <!-- Attn: Localization - some of the menus in this dialog directly affect mail also. -->
 
 <!-- File menu items -->
-<!ENTITY fileMenu.label "File">
-<!ENTITY fileMenu.accesskey "F">
-<!ENTITY openFileCmd.label "Open File…">
-<!ENTITY openFileCmd.accesskey "O">
-<!ENTITY openFileCmd.key "O">
-<!ENTITY openRemoteCmd.label "Open Web Location…">
-<!ENTITY openRemoteCmd.accesskey "L">
-<!ENTITY openRemoteCmd.key "L">
-<!ENTITY fileRecentMenu.label "Recent Pages">
-<!ENTITY fileRecentMenu.accesskey "R">
-<!ENTITY fileRevert.label "Revert">
-<!ENTITY fileRevert.accesskey "t">
-<!ENTITY saveCmd.label "Save">
-<!ENTITY saveCmd.accesskey "S">
 <!ENTITY saveCmd.key "S">
-<!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 saveAsChangeEncodingCmd.label "Save And Change Character Encoding">
-<!ENTITY saveAsChangeEncodingCmd.accesskey "E">
 
 <!-- Edit menu items -->
 <!ENTITY pasteNoFormatting.label "Paste Without Formatting">
 <!ENTITY pasteNoFormatting.accesskey "n">
 <!ENTITY pasteNoFormatting.key "V">
 <!ENTITY pasteAs.label "Paste As">
 <!ENTITY pasteAs.accesskey "a">
 <!ENTITY pasteAsQuotationCmd.label "Paste As Quotation">
--- a/suite/debugQA/content/debugQATextEditorShell.xul
+++ b/suite/debugQA/content/debugQATextEditorShell.xul
@@ -109,17 +109,17 @@
     <keyset id="tasksKeys"/>
     <key id="showHideSidebar"/>
   </keyset>
 
   <popupset id="contentAreaContextSet"/>
 
   <toolbox id="EditorToolbox">
     <menubar id="main-menubar" class="chromeclass-menubar">
-      <menu id="fileMenu"/>
+      <menu id="menu_File"/>
       <menu id="menu_Edit"/>
 
       <menu id="menu_View">
         <!-- id pulls in "Show Sidebar" item from sidebarOverlay -->
         <menupopup id="menu_View_Popup">
           <menu id="menu_Toolbars">
             <menupopup id="view_toolbars_popup">
               <menuitem id="viewComposerToolbar"