editor/ui/composer/content/editorOverlay.xul
author Martin Schroeder <mschroeder@mozilla.x-home.org>
Sun, 21 Jun 2009 21:28:11 +0200
changeset 2907 304b75390dd0ab6d7a60e29a065b8b6fda982667
parent 1652 f197c0bd1296efaa28ff285852efe894a3b649ca
child 3985 f6d7c851c905d6123df9f1f96643e91be5e62dcd
permissions -rw-r--r--
Bug 499500 - Error "GetFirstSelectedMessage is not defined" in messenger-overlay-sidebar.js. r=philipp

<?xml version="1.0"?> 
<!-- ***** 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 Communicator client code, released
   - March 31, 1998.
   -
   - The Initial Developer of the Original Code is
   - Netscape Communications Corporation.
   - Portions created by the Initial Developer are Copyright (C) 1999
   - the Initial Developer. All Rights Reserved.
   -
   - Contributor(s):
   -   Ryan Cassin (rcassin@supernova.org)
   -   Daniel Glazman (glazman@netscape.com)
   -   Aaron Kaluszka (ask@swva.net)
   -   Stephen Donner (technutz@netscape.net)
   -
   - 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 ***** -->

<!DOCTYPE overlay [
<!ENTITY % editorOverlayDTD SYSTEM "chrome://editor/locale/editorOverlay.dtd">
%editorOverlayDTD;
<!ENTITY % platformCommunicatorDTD SYSTEM
  "chrome://communicator-platform/locale/platformCommunicatorOverlay.dtd">
%platformCommunicatorDTD;
]>

<overlay id="editorOverlay"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<script type="application/x-javascript" src="chrome://editor/content/editorUtilities.js"/>
<script type="application/x-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;"          observes="cmd_open"  modifiers="accel"/>
    <key id="openremoteeditorkb"  key="&openRemoteCmd.key;"   observes="cmd_openRemote"  modifiers="accel,shift"/>
    <key id="savekb"         key="&saveCmd.key;"              observes="cmd_save"   modifiers="accel"/>
    <key id="publishkb"      key="&publishCmd.key;"           observes="cmd_publish" modifiers="accel,shift"/>
    <key id="closekb"        key="&closeCmd.key;"             observes="cmd_close"  modifiers="accel"/>
    <key id="printkb"        key="&printCmd.key;"             observes="cmd_print"  modifiers="accel"/>
    <key id="key_quit"/>
    <key id="key_undo"/>
    <key id="key_redo"/>
    <key id="key_cut"/>
    <key id="key_copy"/>
    <key id="key_paste"/>
    <key id="key_delete"/>
    <key id="key_selectAll"/>
    <key id="pastenoformattingkb" key="&pasteNoFormatting.key;"
         observes="cmd_pasteNoFormatting" modifiers="accel, shift"/>
    <key id="findkb"            key="&findCmd.key;"            observes="cmd_find"  modifiers="accel"/>
    <key id="findnextkb"        key="&findAgainCmd.key;"        observes="cmd_findNext"  modifiers="accel"/>
    <key id="findprevkb"        key="&findPrevCmd.key;"        observes="cmd_findPrev"  modifiers="accel,shift"/>
    <key keycode="&findAgainCmd.key2;" observes="cmd_findNext"/>
    <key keycode="&findPrevCmd.key2;" observes="cmd_findPrev" modifiers="shift"/>
#ifdef MOZ_X11
    <key keycode="&findCmd.key2;" observes="cmd_find"/>
#endif
    <key id="checkspellingkb"
         key="&checkSpellingCmd2.key;"
         observes="cmd_spelling"
         modifiers="accel,shift"
         disabled="true"/>

    <key id="boldkb"         key="&styleBoldCmd.key;"       observes="cmd_bold" modifiers="accel"/>
    <key id="italickb"       key="&styleItalicCmd.key;"     observes="cmd_italic" modifiers="accel"/>
    <key id="underlinekb"    key="&styleUnderlineCmd.key;"  observes="cmd_underline" modifiers="accel"/>
    <key id="fixedwidthkb"   key="&fontFixedWidth.key;" observes="cmd_tt" modifiers="accel"/>

    <key id="increaseindentkb"  key="&increaseIndent.key;"  observes="cmd_indent"  modifiers="accel"/>
    <key id="decreaseindentkb"  key="&decreaseIndent.key;"  observes="cmd_outdent"  modifiers="accel"/>

    <key id="removestyleskb"       key="&formatRemoveStyles.key;"   observes="cmd_removeStyles"  modifiers="accel, shift"/>
    <key id="removestyleskb2"       key=" "   observes="cmd_removeStyles"  modifiers="accel"/>
    <key id="removelinkskb"        key="&formatRemoveLinks.key;"    observes="cmd_removeLinks"  modifiers="accel, shift"/>
    <key id="removenamedanchorskb" key="&formatRemoveNamedAnchors.key;"    observes="cmd_removeNamedAnchors"  modifiers="accel, shift"/>
    <key id="decreasefontsizekb"   key="&decreaseFontSize.key;"     observes="cmd_decreaseFont"  modifiers="accel"/>
    <key id="increasefontsizekb"   key="&increaseFontSize.key;"     observes="cmd_increaseFont"  modifiers="accel"/>
    <key                           key="&increaseFontSize.key;"     observes="cmd_increaseFont"  modifiers="accel,shift"/>
    <key                           key="&increaseFontSize.key2;"    observes="cmd_increaseFont"  modifiers="accel"/>

    <key id="insertlinkkb"         key="&insertLinkCmd.key;"           observes="cmd_link"          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_close"        label="&closeCmd.label;"         oncommand="goDoCommand('cmd_close')"/>
    <command id="cmd_printSetup"   oncommand="goDoCommand('cmd_printSetup')"/>
    <command id="cmd_print"        oncommand="goDoCommand('cmd_print')"/>
    <command id="cmd_quit"         oncommand="goDoCommand('cmd_quit')"/>
  </commandset>

  <commandset id="composerMenuItems"
          commandupdater="true"
          events="create, mode_switch"
          oncommandupdate="goUpdateComposerMenuItems(this)">
    <!-- format menu -->
    <command id="cmd_listProperties"  oncommand="goDoCommand('cmd_listProperties')"/>
    <command id="cmd_pageProperties"  oncommand="goDoCommand('cmd_pageProperties')"/>
    <command id="cmd_colorProperties" oncommand="goDoCommand('cmd_colorProperties')"/>

    <command id="cmd_link"             oncommand="goDoCommand('cmd_link')"/>
    <command id="cmd_anchor"           oncommand="goDoCommand('cmd_anchor')"/>
    <command id="cmd_image"            oncommand="goDoCommand('cmd_image')"/>
    <command id="cmd_hline"            oncommand="goDoCommand('cmd_hline')"/>
    <command id="cmd_table"            oncommand="goDoCommand('cmd_table')"/>
    <command id="cmd_form"             oncommand="goDoCommand('cmd_form')"/>
    <command id="cmd_inputtag"         oncommand="goDoCommand('cmd_inputtag')"/>
    <command id="cmd_inputimage"       oncommand="goDoCommand('cmd_inputimage')"/>
    <command id="cmd_textarea"         oncommand="goDoCommand('cmd_textarea')"/>
    <command id="cmd_select"           oncommand="goDoCommand('cmd_select')"/>
    <command id="cmd_button"           oncommand="goDoCommand('cmd_button')"/>
    <command id="cmd_label"            oncommand="goDoCommand('cmd_label')"/>
    <command id="cmd_fieldset"         oncommand="goDoCommand('cmd_fieldset')"/>
    <command id="cmd_isindex"          oncommand="goDoCommand('cmd_isindex')"/>
    <command id="cmd_objectProperties" oncommand="goDoCommand('cmd_objectProperties')"/>
    <command id="cmd_insertChars"      oncommand="goDoCommand('cmd_insertChars')"    label="&insertCharsCmd.label;"/>
    <command id="cmd_insertHTMLWithDialog" oncommand="goDoCommand('cmd_insertHTMLWithDialog')"  label="&insertHTMLCmd.label;"/>
    <command id="cmd_insertBreak"      oncommand="goDoCommand('cmd_insertBreak')"/>
    <command id="cmd_insertBreakAll"   oncommand="goDoCommand('cmd_insertBreakAll')"/>
    <command id="cmd_NormalMode"       oncommand="goDoCommand('cmd_NormalMode')"     label="&NormalMode.label;"/>
    <command id="cmd_AllTagsMode"      oncommand="goDoCommand('cmd_AllTagsMode')"    label="&AllTagsMode.label;"/>
    <command id="cmd_HTMLSourceMode"   oncommand="goDoCommand('cmd_HTMLSourceMode')"/>
    <command id="cmd_PreviewMode"      oncommand="goDoCommand('cmd_PreviewMode')"    label="&PreviewMode.label;"/>

    <!-- 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_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"/>
    <command id="cmd_redo"/>
    <command id="cmd_cut"/>
    <command id="cmd_copy"/>
    <command id="cmd_paste"/>  
    <command id="cmd_pasteNoFormatting" oncommand="goDoCommand('cmd_pasteNoFormatting')"
             label="&pasteNoFormatting.label;" accesskey="&pasteNoFormatting.accesskey;"/>
    <command id="cmd_delete"/>
    <command id="cmd_selectAll"/>
    <command id="cmd_preferences"   oncommand="goDoCommand('cmd_preferences')"/>
    <command id="cmd_find"          oncommand="goDoCommand('cmd_find')"/>
    <command id="cmd_findNext"      oncommand="goDoCommand('cmd_findNext')"     label="&findAgainCmd.label;"/>
    <command id="cmd_findPrev"      oncommand="goDoCommand('cmd_findPrev')"     label="&findPrevCmd.label;"/>
    <command id="cmd_spelling"      oncommand="goDoCommand('cmd_spelling')"/>
    <command id="cmd_validate"      label="&validateCmd.label;" accesskey="&validateCmd.accesskey;" oncommand="goDoCommand('cmd_validate')"/>
    <command id="cmd_checkLinks"    oncommand="goDoCommand('cmd_checkLinks')"/>
    <command id="cmd_pasteQuote"    oncommand="goDoCommand('cmd_pasteQuote')" label="&pasteAsQuotationCmd.label;"/>
    <command id="cmd_publishSettings" label="&publishSettings.label;" accesskey="&publishSettings.accesskey;" oncommand="goDoCommand('cmd_publishSettings')"/>
  </commandset>

  <!-- style related commands that update on creation, and on selection change -->
  <commandset id="composerStyleMenuItems"
          commandupdater="true"
          events="create, style, mode_switch"
          oncommandupdate="goUpdateComposerMenuItems(this)">
    <command id="cmd_bold"          state="false"     oncommand="doStyleUICommand('cmd_bold')"/>
    <command id="cmd_italic"        state="false"     oncommand="doStyleUICommand('cmd_italic')"/>
    <command id="cmd_underline"     state="false"     oncommand="doStyleUICommand('cmd_underline')"/>
    <command id="cmd_tt"            state="false"     oncommand="doStyleUICommand('cmd_tt')"/>
    <command id="cmd_smiley"/>
    <command id="cmd_strikethrough" state="false"     oncommand="doStyleUICommand('cmd_strikethrough');"/>
    <command id="cmd_superscript"   state="false"     oncommand="doStyleUICommand('cmd_superscript');"/>
    <command id="cmd_subscript"     state="false"     oncommand="doStyleUICommand('cmd_subscript');"/>
    <command id="cmd_nobreak"       state="false"     oncommand="doStyleUICommand('cmd_nobreak');"/>
    <command id="cmd_em"            state="false"     oncommand="doStyleUICommand('cmd_em')"/>
    <command id="cmd_strong"        state="false"     oncommand="doStyleUICommand('cmd_strong')"/>
    <command id="cmd_cite"          state="false"     oncommand="doStyleUICommand('cmd_cite')"/>
    <command id="cmd_abbr"          state="false"     oncommand="doStyleUICommand('cmd_abbr')"/>
    <command id="cmd_acronym"       state="false"     oncommand="doStyleUICommand('cmd_acronym')"/>
    <command id="cmd_code"          state="false"     oncommand="doStyleUICommand('cmd_code')"/>
    <command id="cmd_samp"          state="false"     oncommand="doStyleUICommand('cmd_samp')"/>
    <command id="cmd_var"           state="false"     oncommand="doStyleUICommand('cmd_var')"/>
    <command id="cmd_ul"            state="false"     oncommand="doStyleUICommand('cmd_ul')"/>
    <command id="cmd_ol"            state="false"     oncommand="doStyleUICommand('cmd_ol')"/>
    <command id="cmd_indent"                          oncommand="goDoCommand('cmd_indent')"/>
    <command id="cmd_outdent"                         oncommand="goDoCommand('cmd_outdent')"/>

    <!-- the state attribute gets filled with the paragraph format before the command is exectued -->
    <command id="cmd_paragraphState"  state=""         oncommand="doStatefulCommand('cmd_paragraphState', event.target.value)"/>
    <command id="cmd_fontFace"        state=""         oncommand="doStatefulCommand('cmd_fontFace', event.target.value)"/>

    <!-- No "oncommand", use EditorSelectColor() to bring up color dialog -->
    <command id="cmd_fontColor"       state=""/>
    <command id="cmd_backgroundColor" state=""/>
    <command id="cmd_highlight"       state="transparent"  oncommand="EditorSelectColor('Highlight', event);"/>
    <command id="cmd_fontSize"                         oncommand="goDoCommand('cmd_fontSize')"/>
    <command id="cmd_align"           state=""/>
    <command id="cmd_absPos"          state=""        oncommand="goDoCommand('cmd_absPos')"/>
    <command id="cmd_increaseZIndex"  state=""        oncommand="goDoCommand('cmd_increaseZIndex')"/>
    <command id="cmd_decreaseZIndex"  state=""        oncommand="goDoCommand('cmd_decreaseZIndex')"/>
    <command id="cmd_advancedProperties"              oncommand="goDoCommand('cmd_advancedProperties')"/>
    <command id="cmd_increaseFont"                    oncommand="goDoCommand('cmd_increaseFont')"/>
    <command id="cmd_decreaseFont"                    oncommand="goDoCommand('cmd_decreaseFont')"/>
    <command id="cmd_removeStyles"                    oncommand="goDoCommand('cmd_removeStyles')"/>
    <command id="cmd_removeLinks"                     oncommand="goDoCommand('cmd_removeLinks')"/>
    <command id="cmd_removeNamedAnchors"              oncommand="goDoCommand('cmd_removeNamedAnchors')"/>
    <command id="cmd_updateStructToolbar"             oncommand="goDoCommand('cmd_updateStructToolbar')"/>
  </commandset>

  <!-- commands updated only when the menu gets created -->
  <commandset id="composerListMenuItems"
          commandupdater="true"
          events="create, mode_switch"
          oncommandupdate="goUpdateComposerMenuItems(this)">
    <!-- List menu  -->
    <command id="cmd_dt"                  oncommand="doStyleUICommand('cmd_dt')"/>
    <command id="cmd_dd"                  oncommand="doStyleUICommand('cmd_dd')"/>
    <command id="cmd_removeList"          oncommand="goDoCommand('cmd_removeList')"/>
    <!-- cmd_ul and cmd_ol are shared with toolbar and are in composerStyleMenuItems commandset -->
  </commandset>

  <commandset id="composerTableMenuItems"
          commandupdater="true"
          events="create, mode_switch"
          oncommandupdate="goUpdateTableMenuItems(this)">
    <!-- Table menu -->
    <command id="cmd_SelectTable"         oncommand="goDoCommand('cmd_SelectTable')"/>
    <command id="cmd_SelectRow"           oncommand="goDoCommand('cmd_SelectRow')"/>
    <command id="cmd_SelectColumn"        oncommand="goDoCommand('cmd_SelectColumn')"/>
    <command id="cmd_SelectCell"          oncommand="goDoCommand('cmd_SelectCell')"/>
    <command id="cmd_SelectAllCells"      oncommand="goDoCommand('cmd_SelectAllCells')"/>
    <command id="cmd_InsertTable"         oncommand="goDoCommand('cmd_InsertTable')"/>
    <command id="cmd_InsertRowAbove"      oncommand="goDoCommand('cmd_InsertRowAbove')"/>
    <command id="cmd_InsertRowBelow"      oncommand="goDoCommand('cmd_InsertRowBelow')"/>
    <command id="cmd_InsertColumnBefore"  oncommand="goDoCommand('cmd_InsertColumnBefore')"/>
    <command id="cmd_InsertColumnAfter"   oncommand="goDoCommand('cmd_InsertColumnAfter')"/>
    <command id="cmd_InsertCellBefore"    oncommand="goDoCommand('cmd_InsertCellBefore')"/>
    <command id="cmd_InsertCellAfter"     oncommand="goDoCommand('cmd_InsertCellAfter')"/>
    <command id="cmd_DeleteTable"         oncommand="goDoCommand('cmd_DeleteTable')"/>
    <command id="cmd_DeleteRow"           oncommand="goDoCommand('cmd_DeleteRow')"/>
    <command id="cmd_DeleteColumn"        oncommand="goDoCommand('cmd_DeleteColumn')"/>
    <command id="cmd_DeleteCell"          oncommand="goDoCommand('cmd_DeleteCell')"/>
    <command id="cmd_DeleteCellContents"  oncommand="goDoCommand('cmd_DeleteCellContents')"/>
    <command id="cmd_NormalizeTable"      oncommand="goDoCommand('cmd_NormalizeTable')"/>
    <command id="cmd_JoinTableCells"      oncommand="goDoCommand('cmd_JoinTableCells')"/>
    <command id="cmd_SplitTableCell"      oncommand="goDoCommand('cmd_SplitTableCell')"/>
    <command id="cmd_ConvertToTable"      oncommand="goDoCommand('cmd_ConvertToTable')"/>
    <command id="cmd_TableOrCellColor"    oncommand="goDoCommand('cmd_TableOrCellColor')"/>
    <command id="cmd_editTable"           oncommand="goDoCommand('cmd_editTable')"/>
  </commandset>

  <broadcasterset id="broadcasterset">
    <!-- Broadcasters/commands with no other home -->
    <!-- view menu -->
    <command id="cmd_newNavigator"/>
    <command id="cmd_newEditor"/>
    <command id="cmd_newEditorTemplate"/>
    <command id="cmd_newEditorDraft"/>
    <command id="cmd_viewCompToolbar"     oncommand="goToggleToolbar('EditToolbar','cmd_viewCompToolbar');"         checked="true"/>
    <command id="cmd_viewFormatToolbar"   oncommand="goToggleToolbar('FormatToolbar','cmd_viewFormatToolbar');"     checked="true"/>
    <command id="cmd_viewEditModeToolbar" oncommand="goToggleToolbar('EditModeToolbar','cmd_viewEditModeToolbar');" checked="true"/>

    <!-- Obsolete; these will go away -->
    <command id="Editor:Font:Size" fontsize=""/>
  </broadcasterset>

  <!-- File  menu items -->
  <!-- Note: globalOverlay.xul uses menu_newEditor, but we want different menu item text
             so we use our own id, label, and accesskey but connect to the same global key and broadcaster node
   -->
  <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_newBlankPage"
                    label="&newBlankPageCmd.label;"
                    accesskey="&newBlankPageCmd.accesskey;"
                    key="key_newBlankPage"
                    command="cmd_newEditor"/>
          <menuseparator id="composerBeginGlobalNewItems"/>
          <!-- From globalOverlay.xul -->
          <menuitem id="menu_newNavigator" observes="cmd_newNavigator"/>
        </menupopup>
      </menu>
      <menuitem id="menu_openRemote"
                accesskey="&openRemoteCmd.accesskey;"
                key="openremoteeditorkb"
                observes="cmd_openRemote"/>
      <menuitem id="menu_openFile"
                label="&openFileCmd.label;"
                accesskey="&openFileCmd.accesskey;"
                key="openeditorkb"
                observes="cmd_open"/>
      <menu id="menu_RecentFiles"
            label="&fileRecentMenu.label;"
            accesskey="&fileRecentMenu.accesskey;"
            onpopupshowing="BuildRecentPagesMenu();">
        <menupopup id="menupopup_RecentFiles"
                   oncommand="editPage(event.target.getAttribute('value'), window, false);"/>
          <!-- menuitems appended at runtime -->
      </menu>
      <menuitem id="menu_close"
                accesskey="&closeCmd.accesskey;"
                key="closekb"
                observes="cmd_close"/>
      <menuseparator id="fileMenuAfterCloseSeparator"/>
      <menuitem id="saveMenuitem"
                accesskey="&saveCmd.accesskey;"
                key="savekb"
                observes="cmd_save"/>
      <menuitem id="menu_saveAs"
                accesskey="&saveAsCmd.accesskey;"
                observes="cmd_saveAs"/>
      <menuitem id="menu_saveAsChangeEncoding"
                accesskey="&saveAsChangeEncodingCmd.accesskey;"
                observes="cmd_saveAndChangeEncoding"/>
      <menuseparator id="fileMenuAfterSaveAsChangeEncodingSeparator"/>
      <menuitem id="publishMenuitem"
                accesskey="&publishCmd.accesskey;"
                key="publishkb"
                observes="cmd_publish"/>
      <menuitem id="menu_publishAs"
                accesskey="&publishAsCmd.accesskey;"
                observes="cmd_publishAs"/>
      <menuseparator id="fileMenuAfterPublishAsSeparator"/>
      <menuitem id="menu_fileRevert"
                accesskey="&fileRevert.accesskey;"
                observes="cmd_revert"/>
      <menuseparator id="fileMenuAfterFileRevertSeparator"/>
      <menuitem id="fileExportToText"
                accesskey="&exportToTextCmd.accesskey;"
                observes="cmd_exportToText"/>
      <menuitem id="previewInBrowser"
                label="&previewCmd.label;"
                accesskey="&previewCmd.accesskey;"
                observes="cmd_preview"/>
      <!-- menuitem id="menu_SendPage" is merged here from mailEditorOverlay.xul,
           where "position" is assumed to be just after 'previewInBrowser'  -->
      <menuitem id="printSetupMenuItem"
                label="&printSetupCmd.label;"
                accesskey="&printSetupCmd.accesskey;"
                command="cmd_printSetup"/>
      <menuitem id="printMenuItem"
                label="&printCmd.label;"
                accesskey="&printCmd.accesskey;"
                key="printkb"
                observes="cmd_print"/>
      <!-- The Exit/Quit item is merged from platformGlobalOverlay.xul -->
    </menupopup>
  </menu>

  <menu id="editMenu" label="&editMenu.label;" accesskey="&editMenu.accesskey;">
    <menupopup id="edEditMenuPopup">
      <!-- from utilityOverlay.xul -->
      <menuitem id="menu_undo"/>
      <menuitem id="menu_redo"/>
      <menuseparator id="edEditMenuSep1" />
      <menuitem id="menu_cut"/>
      <menuitem id="menu_copy"/>
      <menuitem id="menu_paste"/>
      <menuitem id="menu_pasteNoFormatting" key="pastenoformattingkb"
                observes="cmd_pasteNoFormatting"/>
      <menuitem id="menu_delete"/>
      <menuseparator id="edEditMenuSep2" />
      <menuitem id="menu_selectAll"/>
      <menuseparator id="sep_find"/>
      <menuitem id="menu_find"
                label="&findCmd.label;"
                accesskey="&findCmd.accesskey;"
                key="findkb"
                observes="cmd_find"/>
      <menuitem id="menu_findnext"
                accesskey="&findAgainCmd.accesskey;"
                key="findnextkb"
                observes="cmd_findNext"/>
      <menuitem id="menu_findprev"
                accesskey="&findPrevCmd.accesskey;"
                key="findprevkb"
                observes="cmd_findPrev"/>
      <menuseparator id="sep_checkspelling"/>
      <menuitem id="menu_checkspelling"
                label="&checkSpellingCmd2.label;"
                accesskey="&checkSpellingCmd2.accesskey;"
                key="checkspellingkb"
                observes="cmd_spelling"
                disabled="true"/>
      <menuitem id="menu_inlinespellcheck"
                type="checkbox"
                label="&enableInlineSpellChecker.label;"
                accesskey="&enableInlineSpellChecker.accesskey;"
                oncommand="InlineSpellCheckerUI.enabled = !InlineSpellCheckerUI.enabled"/>
      <menuseparator id="menu_prefsSep"/>
      <menuitem id="menu_preferences"     observes="cmd_preferences"/>
      <!-- Note: other Edit items (menu_validate, menu_publishSettings) are inserted from composerOverlay.xul -->
    </menupopup>
  </menu>

  <menuitem id="viewNormalMode"
            type="radio"
            group="mode"
            accesskey="&NormalMode.accesskey;"
            observes="cmd_NormalMode"/>
  <menuitem id="viewAllTagsMode"
            type="radio"
            group="mode"
            accesskey="&AllTagsMode.accesskey;"
            observes="cmd_AllTagsMode"/>
  <menuitem id="viewSourceMode"
            type="radio"
            group="mode"
            label="&HTMLSourceMode.label;"
            accesskey="&HTMLSourceMode.accesskey;"
            observes="cmd_HTMLSourceMode"/>
  <menuitem id="viewPreviewMode"
            type="radio"
            group="mode"
            accesskey="&PreviewMode.accesskey;"
            observes="cmd_PreviewMode"/>

  <menupopup id = "composerCharsetMenuPopup"  onpopupshowing="updateCharsetPopupMenu(this)" />

  <!-- Insert menu -->
  <menu id="insertMenu"
        label="&insertMenu.label;"
        accesskey="&insertMenu.accesskey;">
    <menupopup id="insertMenuPopup">
      <menuitem id="insertImage"
                label="&insertImageCmd.label;"
                accesskey="&insertImageCmd.accesskey;"
                observes="cmd_image"/>
      <menuitem id="insertTable"
                label="&insertTableCmd.label;"
                accesskey="&insertTableCmd.accesskey;"
                observes="cmd_InsertTable"/>
      <menuitem id="insertLink"
                label="&insertLinkCmd.label;"
                accesskey="&insertLinkCmd.accesskey;"
                observes="cmd_link"
                key="insertlinkkb"/>
      <menuitem id="insertAnchor"
                label="&insertAnchorCmd.label;"
                accesskey="&insertAnchorCmd.accesskey;"
                observes="cmd_anchor"/>
      <menuitem id="insertHline"
                label="&insertHLineCmd.label;"
                accesskey="&insertHLineCmd.accesskey;"
                observes="cmd_hline"/>
      <menuitem id="insertHTMLSource"
                accesskey="&insertHTMLCmd.accesskey;"
                observes="cmd_insertHTMLWithDialog"
                key="inserthtmlkb"/>
      <menuitem id="insertChars"
                accesskey="&insertCharsCmd.accesskey;"
                observes="cmd_insertChars"/>
      <menu id="insertTOC" label="&tocMenu.label;" accesskey="&tocMenu.accesskey;">
        <menupopup id="insertTOCPopup" onpopupshowing="InitTOCMenu()">
          <menuitem id="insertTOCMenuitem"
                    label="&insertTOC.label;"
                    accesskey="&insertTOC.accesskey;"
                    oncommand="UpdateTOC()"/>
          <menuitem id="updateTOCMenuitem"
                    label="&updateTOC.label;"
                    accesskey="&updateTOC.accesskey;"
                    oncommand="UpdateTOC()"/>
          <menuitem id="removeTOCMenuitem"
                    label="&removeTOC.label;"
                    accesskey="&removeTOC.accesskey;"
                    oncommand="RemoveTOC()"/>
        </menupopup>
      </menu>
      <menuseparator id="insertMenuSeparator"/>
      <menuitem id="insertBreakAll" accesskey="&insertBreakAllCmd.accesskey;"   observes="cmd_insertBreakAll"   label="&insertBreakAllCmd.label;"/>
    </menupopup>
  </menu>

  <!-- Insert menu for PlainText editor -->
  <menu id="insertMenuPlainText"
        label="&insertMenu.label;"
        accesskey="&insertMenu.accesskey;">
    <menupopup id="insertMenuPlainTextPopup">
      <menuitem id="insertPlainTextChars"
                accesskey="&insertCharsCmd.accesskey;"
                observes="cmd_insertChars"/>
    </menupopup>
  </menu>

  <!-- Format Menu -->
  <menupopup id="formatMenuPopup" onpopupshowing="EditorInitFormatMenu()">
    <!-- Font face submenu -->
    <menu id="fontFaceMenu"
          label="&fontfaceMenu.label;"
          accesskey="&fontfaceMenu.accesskey;"
          position="1">
      <menupopup id="fontFaceMenuPopup"
                 oncommand="if (event.target.localName == 'menuitem')
                              doStatefulCommand('cmd_fontFace', event.target.getAttribute('value'));"
                 onpopupshowing="initFontFaceMenu(this);">
        <menuitem id="menu_fontFaceVarWidth"
                  label="&fontVarWidth.label;"
                  accesskey="&fontVarWidth.accesskey;"
                  value=""
                  type="radio"
                  name="1"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_fontFaceFixedWidth"
                  label="&fontFixedWidth.label;"
                  accesskey="&fontFixedWidth.accesskey;"
                  value="tt"
                  type="radio"
                  name="1"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuseparator id="fontFaceMenuAfterFixedWidthSeparator"/>
        <menuitem id="menu_fontFaceHelvetica"
                  label="&fontHelvetica.label;"
                  accesskey="&fontHelvetica.accesskey;"
                  value="Helvetica, Arial, sans-serif"
                  type="radio"
                  name="2"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_fontFaceTimes"
                  label="&fontTimes.label;"
                  accesskey="&fontTimes.accesskey;"
                  value="Times New Roman, Times, serif"
                  type="radio"
                  name="2"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_fontFaceCourier"
                  label="&fontCourier.label;"
                  accesskey="&fontCourier.accesskey;"
                  value="Courier New, Courier, monospace"
                  type="radio"
                  name="2"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuseparator id="fontFaceMenuAfterCourierSeparator"/>
          <!-- Local font face items added here by initLocalFontFaceMenu() -->
      </menupopup>
    </menu>

    <!-- Font size submenu -->
    <menu id="fontSizeMenu" label="&fontSizeMenu.label;"
          accesskey="&fontSizeMenu.accesskey;"
          position="2">
      <menupopup id="fontSizeMenuPopup" onpopupshowing="initFontSizeMenu(this)">
      <menuitem id="menu_decreaseFontSize"
                label="&decreaseFontSize.label;"
                accesskey="&decreaseFontSize.accesskey;"
                observes="cmd_decreaseFont" type="radio"
                name="1"
                key="decreasefontsizekb"/>
      <menuitem id="menu_increaseFontSize"
                label="&increaseFontSize.label;"
                accesskey="&increaseFontSize.accesskey;"
                observes="cmd_increaseFont"
                type="radio"
                name="1" key="increasefontsizekb"/>
        <menuseparator id="fontSizeMenuAfterIncreaseFontSizeSeparator"/>
        <menuitem id="menu_x-small"
                  label="&size-x-smallCmd.label;"
                  accesskey="&size-x-smallCmd.accesskey;"
                  oncommand="EditorSetFontSize('x-small')"
                  type="radio"
                  name="2"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_size-small"
                  label="&size-smallCmd.label;"
                  accesskey="&size-smallCmd.accesskey;"
                  oncommand="EditorSetFontSize('small')"
                  type="radio"
                  name="2"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_size-medium"
                  label="&size-mediumCmd.label;"
                  accesskey="&size-mediumCmd.accesskey;"
                  oncommand="EditorSetFontSize('medium')"
                  type="radio"
                  name="2"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_size-large"
                  label="&size-largeCmd.label;"
                  accesskey="&size-largeCmd.accesskey;"
                  oncommand="EditorSetFontSize('large')"
                  type="radio"
                  name="2"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_size-x-large"
                  label="&size-x-largeCmd.label;"
                  accesskey="&size-x-largeCmd.accesskey;"
                  oncommand="EditorSetFontSize('x-large')"
                  type="radio"
                  name="2"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_size-xx-large"
                  label="&size-xx-largeCmd.label;"
                  accesskey="&size-xx-largeCmd.accesskey;"
                  oncommand="EditorSetFontSize('xx-large')"
                  type="radio"
                  name="2"
                  observes="cmd_renderedHTMLEnabler"/>
      </menupopup>
    </menu>

    <!-- Font style submenu -->
    <menu id="fontStyleMenu" label="&fontStyleMenu.label;" 
          accesskey="&fontStyleMenu.accesskey;"
          position="3">
    <menupopup id="fontStyleMenuPopup" onpopupshowing="initFontStyleMenu(this)">
      <menuitem id="menu_styleBold"
                label="&styleBoldCmd.label;"
                accesskey="&styleBoldCmd.accesskey;"
                observes="cmd_bold"
                type="checkbox"
                key="boldkb"/>
      <menuitem id="menu_styleItalic"
                label="&styleItalicCmd.label;"
                accesskey="&styleItalicCmd.accesskey;"
                observes="cmd_italic"
                type="checkbox"
                key="italickb"/>
      <menuitem id="menu_styleUnderline"
                label="&styleUnderlineCmd.label;"
                accesskey="&styleUnderlineCmd.accesskey;"
                observes="cmd_underline"
                type="checkbox"
                key="underlinekb"/>
      <menuitem id="menu_styleStrikeThru"
                label="&styleStrikeThruCmd.label;"
                accesskey="&styleStrikeThruCmd.accesskey;"
                observes="cmd_strikethrough"
                type="checkbox"/>
      <menuitem id="menu_styleSuperscript"
                label="&styleSuperscriptCmd.label;"
                accesskey="&styleSuperscriptCmd.accesskey;"
                observes="cmd_superscript"
                type="checkbox"/>
      <menuitem id="menu_styleSubscript"
                label="&styleSubscriptCmd.label;"
                accesskey="&styleSubscriptCmd.accesskey;"
                observes="cmd_subscript"
                type="checkbox"/>
      <menuitem id="menu_fontFixedWidth"
                label="&fontFixedWidth.label;"
                accesskey="&fontFixedWidth.accesskey;"
                observes="cmd_tt"
                type="checkbox"
                key="fixedwidthkb"/>
      <menuitem id="menu_styleNonbreaking"
                label="&styleNonbreakingCmd.label;"
                accesskey="&styleNonbreakingCmd.accesskey;"
                observes="cmd_nobreak"
                type="checkbox"/>
      <menuseparator id="fontStyleMenuAfterNonbreakingSeparator"/>
      <menuitem id="menu_styleEm"
                label="&styleEm.label;"
                accesskey="&styleEm.accesskey;"
                observes="cmd_em"
                type="checkbox"/>
      <menuitem id="menu_styleStrong"
                label="&styleStrong.label;"
                accesskey="&styleStrong.accesskey;"
                observes="cmd_strong"
                type="checkbox"/>
      <menuitem id="menu_styleCite"
                label="&styleCite.label;"
                accesskey="&styleCite.accesskey;"
                observes="cmd_cite"
                type="checkbox"/>
      <menuitem id="menu_styleAbbr"
                label="&styleAbbr.label;"
                accesskey="&styleAbbr.accesskey;"
                observes="cmd_abbr"
                type="checkbox"/>
      <menuitem id="menu_styleAcronym"
                label="&styleAcronym.label;"
                accesskey="&styleAcronym.accesskey;"
                observes="cmd_acronym"
                type="checkbox"/>
      <menuitem id="menu_styleCode"
                label="&styleCode.label;"
                accesskey="&styleCode.accesskey;"
                observes="cmd_code"
                type="checkbox"/>
      <menuitem id="menu_styleSamp"
                label="&styleSamp.label;"
                accesskey="&styleSamp.accesskey;"
                observes="cmd_samp"
                type="checkbox"/>
      <menuitem id="menu_styleVar"
                label="&styleVar.label;"
                accesskey="&styleVar.accesskey;"
                observes="cmd_var"
                type="checkbox"/>
    </menupopup>
    </menu>
    
    <!-- Note: "cmd_fontColor" only monitors color state, it doesn't execute the command
         (We should use "cmd_fontColorState" and "cmd_backgroundColorState" ?) -->
    <menuitem id="fontColor" label="&formatFontColor.label;" 
          accesskey="&formatFontColor.accesskey;"
          observes="cmd_fontColor"
          oncommand="EditorSelectColor('Text', null);"
          position="4"/>
    <menuseparator id="removeSep" position="5"/>

    <!-- label and accesskey set at runtime from strings -->
    <menuitem id="removeStylesMenuitem" key="removestyleskb"
          observes="cmd_removeStyles"
          position="6"/>
    <menuitem id="removeLinksMenuitem" key="removelinkskb"
          observes="cmd_removeLinks"
          position="7"/>
    <menuitem id="removeNamedAnchorsMenuitem"  label="&formatRemoveNamedAnchors.label;"
          key="removenamedanchorskb"
          accesskey="&formatRemoveNamedAnchors.accesskey;"
          observes="cmd_removeNamedAnchors"
          position="8"/>
    <menuseparator id="tabSep" position="9"/>

    <!-- Note: the 'Init' menu methods for Paragraph, List, and Align
         assume that the id = 'menu_'+tagName (the 'value' label),
         except for the first ('none') item
     -->
    <!-- Paragraph Style submenu -->
    <menu id="paragraphMenu" label="&paragraphMenu.label;"
          accesskey="&paragraphMenu.accesskey;"
          position="10" onpopupshowing="InitParagraphMenu()">
      <menupopup id="paragraphMenuPopup"
                 oncommand="doStatefulCommand('cmd_paragraphState', event.target.getAttribute('value'))">
        <menuitem id="menu_bodyText"
                  type="radio"
                  name="1"
                  label="&bodyTextCmd.label;"
                  accesskey="&bodyTextCmd.accesskey;"
                  value=""
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_p"
                  type="radio"
                  name="1"
                  label="&paragraphParagraphCmd.label;"
                  accesskey="&paragraphParagraphCmd.accesskey;"
                  value="p"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_h1"
                  type="radio"
                  name="1"
                  label="&heading1Cmd.label;"
                  accesskey="&heading1Cmd.accesskey;"
                  value="h1"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_h2"
                  type="radio"
                  name="1"
                  label="&heading2Cmd.label;"
                  accesskey="&heading2Cmd.accesskey;"
                  value="h2"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_h3"
                  type="radio"
                  name="1" label="&heading3Cmd.label;"
                  accesskey="&heading3Cmd.accesskey;"
                  value="h3"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_h4"
                  type="radio"
                  name="1" label="&heading4Cmd.label;"
                  accesskey="&heading4Cmd.accesskey;"
                  value="h4"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_h5"
                  type="radio"
                  name="1" label="&heading5Cmd.label;"
                  accesskey="&heading5Cmd.accesskey;"
                  value="h5"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_h6"
                  type="radio"
                  name="1"
                  label="&heading6Cmd.label;"
                  accesskey="&heading6Cmd.accesskey;"
                  value="h6"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_address"
                  type="radio"
                  name="1"
                  label="&paragraphAddressCmd.label;"
                  accesskey="&paragraphAddressCmd.accesskey;"
                  value="address"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_pre"
                  type="radio"
                  name="1"
                  label="&paragraphPreformatCmd.label;"
                  accesskey="&paragraphPreformatCmd.accesskey;"
                  value="pre"
                  observes="cmd_renderedHTMLEnabler"/>
      </menupopup>
    </menu>

    <!-- List Style submenu -->
    <menu id="listMenu" label="&formatlistMenu.label;"
          accesskey="&formatlistMenu.accesskey;"
          position="11" onpopupshowing="InitListMenu()">
      <menupopup>
        <menuitem id="menu_noList"
                  type="radio"
                  name="1"
                  label="&noneCmd.label;"
                  accesskey="&noneCmd.accesskey;"
                  observes="cmd_removeList"/>
        <menuitem id="menu_ul"
                  type="radio"
                  name="1"
                  label="&listBulletCmd.label;"
                  accesskey="&listBulletCmd.accesskey;"
                  observes="cmd_ul"/>
        <menuitem id="menu_ol"
                  type="radio"
                  name="1"
                  label="&listNumberedCmd.label;"
                  accesskey="&listNumberedCmd.accesskey;"
                  observes="cmd_ol"/>
        <menuitem id="menu_dt"
                  type="radio"
                  name="1"
                  label="&listTermCmd.label;"
                  accesskey="&listTermCmd.accesskey;"
                  observes="cmd_dt"/>
        <menuitem id="menu_dd"
                  type="radio"
                  name="1"
                  label="&listDefinitionCmd.label;"
                  accesskey="&listDefinitionCmd.accesskey;"
                  observes="cmd_dd"/>
        <menuseparator/>
        <menuitem id="listProps"
                  label="&listPropsCmd.label;"
                  accesskey="&listPropsCmd.accesskey;"
                  observes="cmd_listProperties"/>
      </menupopup>
    </menu>
    <menuseparator id="identingSep" position="12"/>

    <menuitem id="increaseIndent"
              label="&increaseIndent.label;"
              accesskey="&increaseIndent.accesskey;"
              key="increaseindentkb"
              observes="cmd_indent"
              position="13"/>
    <menuitem id="decreaseIndent"
              label="&decreaseIndent.label;"
              accesskey="&decreaseIndent.accesskey;"
              key="decreaseindentkb"
              observes="cmd_outdent"
              position="14"/>

    <menu id="alignMenu" label="&alignMenu.label;" accesskey="&alignMenu.accesskey;"
        onpopupshowing="InitAlignMenu()"
        position="15">
      <!-- Align submenu -->
      <menupopup id="alignMenuPopup"
                 oncommand="doStatefulCommand('cmd_align', event.target.getAttribute('value'))">
        <menuitem id="menu_left"
                  label="&alignLeft.label;"
                  accesskey="&alignLeft.accesskey;"
                  type="radio"
                  name="1"
                  value="left"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_center"
                  label="&alignCenter.label;"
                  accesskey="&alignCenter.accesskey;"
                  type="radio"
                  name="1"
                  value="center"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_right"
                  label="&alignRight.label;"
                  accesskey="&alignRight.accesskey;"
                  type="radio"
                  name="1"
                  value="right"
                  observes="cmd_renderedHTMLEnabler"/>
        <menuitem id="menu_justify"
                  label="&alignJustify.label;"
                  accesskey="&alignJustify.accesskey;"
                  type="radio"
                  name="1"
                  value="justify"
                  observes="cmd_renderedHTMLEnabler"/>
      </menupopup>
    </menu>
    <menuseparator id="tableSep" position="16"/>
    <!-- Merge Table Menu and separator in Messenger Composer here -->
    <!-- Merge property items here -->
  </menupopup>

  <menuitem id="snapToGrid" label="&grid.label;" accesskey="&grid.accesskey;"
            oncommand="goDoCommand('cmd_grid')"   observes="cmd_renderedHTMLEnabler"/>

  <!-- Next 3 are items to append at the bottom of the formatMenuPopup -->
  <!-- label and accesskey filled in during menu creation -->
  <menuitem id="objectProperties"   oncommand="goDoCommand('cmd_objectProperties')"   observes="cmd_renderedHTMLEnabler"/>
  <!-- Don't use 'observes', must call command correctly -->
  <menuitem id="pageProperties"
            label="&pageProperties.label;"
            accesskey="&pageProperties.accesskey;"
            oncommand="goDoCommand('cmd_pageProperties')"
            observes="cmd_renderedHTMLEnabler"/>
  <menuitem id="colorsAndBackground"
            label="&colorsAndBackground.label;"
            accesskey="&colorsAndBackground.accesskey;"
            oncommand="goDoCommand('cmd_colorProperties')"
            observes="cmd_renderedHTMLEnabler"/>

  <menu id="tableMenu" label="&tableMenu.label;" accesskey="&tableMenu.accesskey;">
    <menupopup id="tableMenuPopup" onpopupshowing="EditorInitTableMenu()">
      <!-- From EditorCommandOverlay.xul (shared with context popup) -->
      <menu id="tableInsertMenu" label="&tableInsertMenu.label;" accesskey="&tableInsertMenu.accesskey;">
        <menupopup id="tableInsertMenuPopup">
          <menuitem id="menu_insertTable"
                    label="&insertTableCmd.label;"
                    accesskey="&insertTableCmd.accesskey;"
                    observes="cmd_InsertTable"/>
          <menuseparator id="tableMenuAfterInsertTableSeparator"/>
          <menuitem id="menu_tableRowAbove"
                    label="&tableRowAbove.label;"
                    accesskey="&tableRowAbove.accesskey;"
                    observes="cmd_InsertRowAbove"/>
          <menuitem id="menu_tableRowBelow"
                    label="&tableRowBelow.label;"
                    accesskey="&tableRowBelow.accesskey;"
                    observes="cmd_InsertRowBelow"/>
          <menuseparator id="tableMenuAfterTableRowSeparator"/>
          <menuitem id="menu_tableColumnBefore"
                    label="&tableColumnBefore.label;"
                    accesskey="&tableColumnBefore.accesskey;"
                    observes="cmd_InsertColumnBefore"/>
          <menuitem id="menu_tableColumnAfter"
                    label="&tableColumnAfter.label;"
                    accesskey="&tableColumnAfter.accesskey;"
                    observes="cmd_InsertColumnAfter"/>
          <menuseparator id="tableMenuAfterInsertColumnSeparator"/>
          <menuitem id="menu_tableCellBefore"
                    label="&tableCellBefore.label;"
                    accesskey="&tableCellBefore.accesskey;"
                    observes="cmd_InsertCellBefore"/>
          <menuitem id="menu_tableCellAfter"
                    label="&tableCellAfter.label;"
                    accesskey="&tableCellAfter.accesskey;"
                    observes="cmd_InsertCellAfter"/>
        </menupopup>
      </menu>
      <menu id="tableSelectMenu" label="&tableSelectMenu.label;" accesskey="&tableSelectMenu.accesskey;">
        <menupopup id="tableSelectPopup">
          <menuitem id="menu_SelectTable"
                    label="&tableTable.label;"
                    accesskey="&tableTable.accesskey;"
                    observes="cmd_SelectTable"/>
          <menuitem id="menu_SelectRow"
                    label="&tableRow.label;"
                    accesskey="&tableRow.accesskey;"
                    observes="cmd_SelectRow"/>
          <menuitem id="menu_SelectColumn"
                    label="&tableColumn.label;"
                    accesskey="&tableColumn.accesskey;"
                    observes="cmd_SelectColumn"/>
          <menuitem id="menu_SelectCell"
                    label="&tableCell.label;"
                    accesskey="&tableCell.accesskey;"
                    observes="cmd_SelectCell"/>
          <menuitem id="menu_SelectAllCells"
                    label="&tableAllCells.label;"
                    accesskey="&tableAllCells.accesskey;"
                    observes="cmd_SelectAllCells"/>
        </menupopup>
      </menu>
      <menu id="tableDeleteMenu" label="&tableDeleteMenu.label;" accesskey="&tableDeleteMenu.accesskey;">
        <menupopup id="tableDeletePopup">
          <menuitem id="menu_DeleteTable"
                    label="&tableTable.label;"
                    accesskey="&tableTable.accesskey;"
                    observes="cmd_DeleteTable"/>
          <menuitem id="menu_DeleteRow"
                    label="&tableRows.label;"
                    accesskey="&tableRow.accesskey;"
                    observes="cmd_DeleteRow"/>
          <menuitem id="menu_DeleteColumn"
                    label="&tableColumns.label;"
                    accesskey="&tableColumn.accesskey;"
                    observes="cmd_DeleteColumn"/>
          <menuitem id="menu_DeleteCell"
                    label="&tableCells.label;"
                    accesskey="&tableCell.accesskey;"
                    observes="cmd_DeleteCell"/>
          <menuitem id="menu_DeleteCellContents"
                    label="&tableCellContents.label;"
                    accesskey="&tableCellContents.accesskey;"
                    observes="cmd_DeleteCellContents"/>
        </menupopup>
      </menu>
      <menuseparator id="tableDeleteMenuAfterDeleteCellSeparator"/>
      <!-- menu label is set in InitTableMenu -->
      <menuitem id="menu_JoinTableCells"
                label="&tableJoinCells.label;"
                accesskey="&tableJoinCells.accesskey;"
                observes="cmd_JoinTableCells"/>
      <menuitem id="menu_SlitTableCell"
                label="&tableSplitCell.label;"
                accesskey="&tableSplitCell.accesskey;"
                observes="cmd_SplitTableCell"/>
      <menuitem id="menu_ConvertToTable"
                label="&convertToTable.label;"
                accesskey="&convertToTable.accesskey;"
                observes="cmd_ConvertToTable"/>
      <menuseparator id="tableDeleteMenuAfterConvertToTableSeparator"/>
      <menuitem id="menu_TableOrCellColor"
                label="&tableOrCellColor.label;"
                accesskey="&tableOrCellColor.accesskey;"
                observes="cmd_TableOrCellColor"/>
      <menuitem id="menu_tableProperties"
                label="&tableProperties.label;"
                accesskey="&tableProperties.accesskey;"
                observes="cmd_editTable"/>
    </menupopup>
  </menu>

  <!-- this is only used in messengercompose.xul -->
  <toolbarbutton type="menu" id="AlignPopupButton" observes="cmd_align"
              tooltiptext="&AlignPopupButton.tooltip;">
    <menupopup id="AlignPopup">
      <menuitem id="AlignLeftItem" class="menuitem-iconic" label="&alignLeft.label;"
                oncommand="doStatefulCommand('cmd_align', 'left')"
                tooltiptext="&alignLeftButton.tooltip;"    />
      <menuitem id="AlignCenterItem" class="menuitem-iconic" label="&alignCenter.label;"
                oncommand="doStatefulCommand('cmd_align', 'center')"
                tooltiptext="&alignCenterButton.tooltip;"  />
      <menuitem id="AlignRightItem" class="menuitem-iconic" label="&alignRight.label;"
                oncommand="doStatefulCommand('cmd_align', 'right')"
                tooltiptext="&alignRightButton.tooltip;"   />
      <menuitem id="AlignJustifyItem" class="menuitem-iconic" label="&alignJustify.label;"
                oncommand="doStatefulCommand('cmd_align', 'justify')"
                tooltiptext="&alignjustifyButton.tooltip;" />
    </menupopup>
  </toolbarbutton>

  <!-- InsertPopupButton is used by messengercompose.xul -->
  <toolbarbutton type="menu" id="InsertPopupButton" observes="cmd_renderedHTMLEnabler"
              tooltiptext="&InsertPopupButton.tooltip;">
    <menupopup id="InsertPopup">
      <menuitem id="InsertLinkItem" class="menuitem-iconic" observes="cmd_link"
                oncommand="goDoCommand('cmd_link')" label="&linkToolbarCmd.label;"
                tooltiptext="&linkToolbarCmd.tooltip;"   />
      <menuitem id="InsertAnchorItem" class="menuitem-iconic" observes="cmd_anchor"
                oncommand="goDoCommand('cmd_anchor')" label="&anchorToolbarCmd.label;"
                tooltiptext="&anchorToolbarCmd.tooltip;" />
      <menuitem id="InsertImageItem"  class="menuitem-iconic" observes="cmd_image"
                oncommand="goDoCommand('cmd_image')" label="&imageToolbarCmd.label;"
                tooltiptext="&imageToolbarCmd.tooltip;"  />
      <menuitem id="InsertHRuleItem"  class="menuitem-iconic" observes="cmd_hline"
                oncommand="goDoCommand('cmd_hline')" label="&hruleToolbarCmd.label;"
                tooltiptext="&hruleToolbarCmd.tooltip;"  />
      <menuitem id="InsertTableItem"  class="menuitem-iconic" observes="cmd_table"
                oncommand="goDoCommand('cmd_table')" label="&tableToolbarCmd.label;"
                tooltiptext="&tableToolbarCmd.tooltip;"  />
    </menupopup>
  </toolbarbutton>

  <!-- Editor toolbar items -->
  <!-- note that we override the submenu item label "Blank Window" with "New" used for the menu -->
  <toolbarbutton id="newButton" class="toolbarbutton-1"
                 label="&newMenu.label;" command="cmd_newEditor"
                 tooltiptext="&newToolbarCmd.tooltip;"/>
  <toolbarbutton id="openButton" class="toolbarbutton-1"
                 label="&openToolbarCmd.label;" observes="cmd_open"
                 tooltiptext="&openToolbarCmd.tooltip;"/>
  <toolbarbutton id="saveButton" class="toolbarbutton-1" observes="cmd_save"
                 tooltiptext="&saveToolbarCmd.tooltip;"/>
  <toolbarbutton id="publishButton" class="toolbarbutton-1"
                 observes="cmd_publish"
                 tooltiptext="&publishToolbarCmd.tooltip;"/>
  <toolbarbutton id="previewButton" class="toolbarbutton-1"
                 label="&previewToolbarCmd.label;" observes="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"
                 tooltiptext="&pasteCmd.label;"/>

  <toolbarbutton id="printButton" type="menu-button" class="toolbarbutton-1"
                 label="&printToolbarCmd.label;"
                 tooltiptext="&printToolbarCmd.tooltip;"
                 oncommand="if (event.target==this) goDoCommand('cmd_print');">
    <menupopup id="printMenu">
      <menuitem id="printMenuItemToolbar" accesskey="&printCmd.accesskey;" label="&printCmd.label;" default="true"
                oncommand="goDoCommand('cmd_print');"/>
      <!-- 'printSetupToolbar' is merged in here from platformGlobalOverlay.xul -->
    </menupopup>
  </toolbarbutton>
    
  <toolbarbutton id="findButton" class="toolbarbutton-1"
                 label="&findToolbarCmd.label;" observes="cmd_find"
                 tooltiptext="&findToolbarCmd.tooltip;"/>
  <toolbarbutton id="spellingButton" class="toolbarbutton-1" disabled="true"
                 label="&spellToolbarCmd.label;" observes="cmd_spelling"
                 tooltiptext="&spellToolbarCmd.tooltip;"/>
  <toolbarbutton id="imageButton" class="toolbarbutton-1"
                 label="&imageToolbarCmd.label;" observes="cmd_image"
                 tooltiptext="&imageToolbarCmd.tooltip;"/>
  <toolbarbutton id="hlineButton" class="toolbarbutton-1"
                 label="&hruleToolbarCmd.label;" observes="cmd_hline"
                 tooltiptext="&hruleToolbarCmd.tooltip;"/>
  <toolbarbutton id="tableButton" class="toolbarbutton-1"
                 label="&tableToolbarCmd.label;" observes="cmd_table"
                 tooltiptext="&tableToolbarCmd.tooltip;"/>
  <toolbarbutton id="linkButton" class="toolbarbutton-1"
                 label="&linkToolbarCmd.label;" observes="cmd_link"
                 tooltiptext="&linkToolbarCmd.tooltip;"/>
  <toolbarbutton id="namedAnchorButton" class="toolbarbutton-1"
                 label="&anchorToolbarCmd.label;" observes="cmd_anchor"
                 tooltiptext="&anchorToolbarCmd.tooltip;"/>

  <!-- Formatting toolbar items. "value" are HTML tagnames, don't translate -->
  <menulist class="toolbar-focustarget" id="ParagraphSelect" observes="cmd_renderedHTMLEnabler"
    tooltiptext="&ParagraphSelect.tooltip;" crop="right">
    <observes element="cmd_paragraphState" attribute="state" onbroadcast="onParagraphFormatChange(this.parentNode, 'cmd_paragraphState')"/>
    <menupopup id="ParagraphPopup" oncommand="doStatefulCommand('cmd_paragraphState', event.target.value)">
      <menuitem id="toolbarmenu_bodyText" label="&bodyTextCmd.label;" value=""/>
      <menuitem id="toolbarmenu_paragraph" label="&paragraphParagraphCmd.label;" value="p"/>
      <menuitem id="toolbarmenu_h1" label="&heading1Cmd.label;" value="h1"/>
      <menuitem id="toolbarmenu_h2"  label="&heading2Cmd.label;" value="h2"/>
      <menuitem id="toolbarmenu_h3" label="&heading3Cmd.label;" value="h3"/>
      <menuitem id="toolbarmenu_h4" label="&heading4Cmd.label;" value="h4"/>
      <menuitem id="toolbarmenu_h5" label="&heading5Cmd.label;" value="h5"/>
      <menuitem id="toolbarmenu_h6" label="&heading6Cmd.label;" value="h6"/>
      <menuitem id="toolbarmenu_address" label="&paragraphAddressCmd.label;" value="address"/>
      <menuitem id="toolbarmenu_pre" label="&paragraphPreformatCmd.label;"  value="pre"/>
    </menupopup>
  </menulist>

  <!-- "value" are HTML tagnames, don't translate -->
  <menulist class="toolbar-focustarget" id="FontFaceSelect" observes="cmd_renderedHTMLEnabler"
    tooltiptext="&FontFaceSelect.tooltip;" crop="right">
    <observes element="cmd_fontFace" attribute="state" onbroadcast="onFontFaceChange(this.parentNode, 'cmd_fontFace')"/>
    <menupopup id="FontFacePopup" oncommand="doStatefulCommand('cmd_fontFace', event.target.value)">
      <menuitem id="toolbarmenu_fontVarWidth" label="&fontVarWidth.label;" value=""/>
      <menuitem id="toolbarmenu_fontFixedWidth" label="&fontFixedWidth.label;" value="tt"/>
      <menuseparator id="toolbarmenuAfterFontFaceFontFixedWidthSeparator"/>
      <menuitem id="toolbarmenu_fontHelvetica" label="&fontHelvetica.label;"
                value="Helvetica, Arial, sans-serif"/>
      <menuitem id="toolbarmenu_fontTimes" label="&fontTimes.label;"
                value="Times New Roman, Times, serif"/>
      <menuitem id="toolbarmenu_fontCourier" label="&fontCourier.label;"
                value="Courier New, Courier, monospace"/>
      <menuseparator id="toolbarmenuAfterFontFaceCourierSeparator"/>
    </menupopup>
  </menulist>

  <menulist class="toolbar-focustarget" id="FontSizeSelect" oncommand="EditorSelectFontSize()"  tooltiptext="&FontSizeSelect.tooltip;" crop="right">
    <observes element="cmd_fontSize" attribute="state" onbroadcast="onFontSizeChange(this.parentNode, 'cmd_fontSize')"/>
    <menupopup id="FontSizePopup">
      <menuitem id="toobarmenu_fontSize_xx-small" label="&size-xx-smallCmd.label;"/>
      <menuitem id="toobarmenu_fontSize_x-small" label="&size-x-smallCmd.label;"/>
      <menuitem id="toobarmenu_fontSize_small" label="&size-smallCmd.label;"/>
      <menuitem id="toobarmenu_fontSize_medium" label="&size-mediumCmd.label;"/>
      <menuitem id="toobarmenu_fontSize_large" label="&size-largeCmd.label;"/>
      <menuitem id="toobarmenu_fontSize_x-large" label="&size-x-largeCmd.label;"/>
      <menuitem id="toobarmenu_fontSize_xx-large" label="&size-xx-largeCmd.label;"/>
    </menupopup>
  </menulist>

  <stack id="ColorButtons" align="center">
    <observes element="cmd_fontColor"       attribute="state" onbroadcast="onFontColorChange()"/>
    <observes element="cmd_backgroundColor" attribute="state" onbroadcast="onBackgroundColorChange()"/>
    <box class="color-button" id="BackgroundColorButton"
          onclick="EditorSelectColor('', event);"
          tooltiptext="&BackgroundColorButton.tooltip;"/>
    <box class="color-button" id="TextColorButton"
          onclick="EditorSelectColor('Text', event);"
          tooltiptext="&TextColorButton.tooltip;"/>
  </stack>
  <toolbarbutton id="HighlightColorButton"
          tooltiptext="&HighlightColorButton.tooltip;" command="cmd_highlight">
    <observes element="cmd_highlight" attribute="state" onbroadcast="onHighlightColorChange()"/>
    <observes element="cmd_highlight" attribute="collapsed"/>
  </toolbarbutton>

<!-- A BUG IN CSS/BOXES MAKES THIS ASSERT WHEN CLASS= IS PRESENT AND WE TRY TO COLLAPSE THE TOOLBOX -->
  <toolbarbutton id="DecreaseFontSizeButton" observes="cmd_decreaseFont"
          tooltiptext="&decreaseFontSizeToolbarCmd.tooltip;"/>
  <toolbarbutton id="IncreaseFontSizeButton" observes="cmd_increaseFont"
          tooltiptext="&increaseFontSizeToolbarCmd.tooltip;"/>

  <toolbarbutton id="boldButton" type="checkbox" autoCheck="false" observes="cmd_bold"
          tooltiptext="&boldToolbarCmd.tooltip;">
    <observes element="cmd_bold" type="checkbox" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_bold')"/>
  </toolbarbutton>
  <toolbarbutton id="italicButton" type="checkbox" autoCheck="false" observes="cmd_italic"
          tooltiptext="&italicToolbarCmd.tooltip;">
    <observes element="cmd_italic" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_italic')"/>
  </toolbarbutton>
  <toolbarbutton id="underlineButton" type="checkbox" autoCheck="false" observes="cmd_underline"
          tooltiptext="&underlineToolbarCmd.tooltip;">
    <observes element="cmd_underline" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_underline')"/>
  </toolbarbutton>

  <toolbarbutton id="ulButton" type="radio" group="lists" autoCheck="false" observes="cmd_ul"
          tooltiptext="&bulletListToolbarCmd.tooltip;">
      <observes element="cmd_ul" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_ul')"/>
  </toolbarbutton>

  <toolbarbutton id="olButton" type="radio" group="lists" autoCheck="false" observes="cmd_ol"
          tooltiptext="&numberListToolbarCmd.tooltip;">
      <observes element="cmd_ol" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_ol')"/>
  </toolbarbutton>

  <toolbarbutton id="outdentButton" observes="cmd_outdent"
          tooltiptext="&outdentToolbarCmd.tooltip;"/>
  <toolbarbutton id="indentButton" observes="cmd_indent"
          tooltiptext="&indentToolbarCmd.tooltip;"/>

  <!-- alignment buttons -->
  <toolbarbutton id="align-left-button" type="radio" group="align" autoCheck="false"
                 oncommand="doStatefulCommand('cmd_align', 'left')"
                 tooltiptext="&alignLeft.tooltip;" >
    <observes element="cmd_align" attribute="state" 
              onbroadcast="onStateButtonUpdate(this.parentNode, 'cmd_align', 'left')" />
  </toolbarbutton>
  <toolbarbutton id="align-center-button" type="radio" group="align" autoCheck="false"
                 oncommand="doStatefulCommand('cmd_align', 'center')"
                 tooltiptext="&alignCenter.tooltip;" >
    <observes element="cmd_align" attribute="state" 
              onbroadcast="onStateButtonUpdate(this.parentNode, 'cmd_align', 'center')"/>
  </toolbarbutton>
  <toolbarbutton id="align-right-button" type="radio" group="align" autoCheck="false"
                 oncommand="doStatefulCommand('cmd_align', 'right')"
                 tooltiptext="&alignRight.tooltip;" >
    <observes element="cmd_align" attribute="state"
              onbroadcast="onStateButtonUpdate(this.parentNode, 'cmd_align', 'right')"/>
  </toolbarbutton>
  <toolbarbutton id="align-justify-button" type="radio" group="align" autoCheck="false"
                 oncommand="doStatefulCommand('cmd_align', 'justify')"
                 tooltiptext="&alignJustify.tooltip;" >
    <observes element="cmd_align" attribute="state"
              onbroadcast="onStateButtonUpdate(this.parentNode, 'cmd_align', 'justify')"/>
  </toolbarbutton>
  
  <toolbarbutton id="absolutePositionButton" type="checkbox" tooltiptext="&layer.tooltip;" observes="cmd_absPos">
    <observes element="cmd_absPos" attribute="state" onbroadcast="onStateButtonUpdate(this.parentNode, 'cmd_absPos', 'absolute')"/>
  </toolbarbutton>
  <toolbarbutton id="decreaseZIndexButton" observes="cmd_decreaseZIndex"
                 tooltiptext="&layerSendToBack.tooltip;"/>
  <toolbarbutton id="increaseZIndexButton" observes="cmd_increaseZIndex"
                 tooltiptext="&layerBringToFront.tooltip;"/>

  <!-- Edit Mode toolbar -->
  <tabs id="EditModeTabs" onselect="this.selectedItem.doCommand()"/>
  <tab id="NormalModeButton"   class="tab-bottom edit-mode _plain" type="text" selected="1" label="&NormalModeTab.label;"  oncommand="goDoCommand('cmd_NormalMode');"
          tooltiptext="&NormalMode.tooltip;"/>
  <tab id="TagModeButton"      class="tab-bottom edit-mode _plain" type="text" selected="0" label="&AllTagsMode.label;"    oncommand="goDoCommand('cmd_AllTagsMode');"
          tooltiptext="&AllTagsMode.tooltip;"/>
  <tab id="SourceModeButton"   class="tab-bottom edit-mode _plain" type="text" selected="0" label="&SourceMode.label;"     oncommand="goDoCommand('cmd_HTMLSourceMode');"
          tooltiptext="&HTMLSourceMode.tooltip;" dir="&SourceTabDirection;"/>
  <tab id="PreviewModeButton"  class="tab-bottom edit-mode _plain" type="text" selected="0" label="&PreviewMode.label;"    oncommand="goDoCommand('cmd_PreviewMode');"
          tooltiptext="&PreviewMode.tooltip;"/>

  <!-- Paste as quotation is used by mail compose,
       but in composer it has to go in the debug menu
   -->
  <menuitem id="menu_pasteQuote" accesskey="&pasteAsQuotationCmd.accesskey;"
            command="cmd_pasteQuote"/>

</overlay>