<?xml version="1.0"?>

<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
   - You can obtain one at http://mozilla.org/MPL/2.0/.  -->

<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>

<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>

<!DOCTYPE window [
<!ENTITY % webappDTD SYSTEM "chrome://webapprt/locale/webapp.dtd">
%webappDTD;
]>

<window windowtype="webapprt:webapp"
        id="default"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        width="1024" height="768"
        persist="screenX screenY width height sizemode"
        >

<script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
<script type="application/javascript" src="chrome://webapprt/content/webapp.js"/>

<commandset id="mainCommandSet">
  <command id="cmd_quitApplication" oncommand="goQuitApplication()"/>
  <commandset id="editMenuCommands"/>
</commandset>

<keyset id="mainKeyset">
  <key id="key_undo"
       key="&undoCmd.key;"
       modifiers="accel"/>
  <key id="key_redo" key="&undoCmd.key;" modifiers="accel,shift"/>
  <key id="key_cut"
       key="&cutCmd.key;"
       modifiers="accel"/>
  <key id="key_copy"
       key="&copyCmd.key;"
       modifiers="accel"/>
  <key id="key_paste"
       key="&pasteCmd.key;"
       modifiers="accel"/>
  <key id="key_delete" keycode="VK_DELETE" command="cmd_delete"/>
  <key id="key_selectAll" key="&selectAllCmd.key;" modifiers="accel"/>
  <key id="key_quitApplication"
       key="&quitApplicationCmdMac.key;"
       command="cmd_quitApplication"
       modifiers="accel"/>
  <key id="key_hideThisAppCmdMac"
       key="&hideThisAppCmdMac.key;"
       modifiers="accel"/>
  <key id="key_hideOtherAppsCmdMac"
       key="&hideOtherAppsCmdMac.key;"
       modifiers="accel,alt"/>
</keyset>

  <menubar id="main-menubar">

    <!-- On Mac, the Quit item gets moved to the Application menu by nsMenuBarX.
       - And right now it's the only item in the File menu.  So if we put it
       - into that menu on Mac, the File menu shows up empty on that OS.
       - To work around that problem, we put the item into the Edit menu on Mac
       - (from which nsMenuBarX still moves it properly), and we don't create
       - the File menu in the first place on that OS.
       -
       - But if you are adding a persistent item to the File menu on Mac,
       - then that workaround is no longer necessary, and you can move the Quit
       - item up here. -->
    <menu id="file-menu" label="&fileMenu.label;"
          accesskey="&fileMenu.accesskey;">
      <menupopup id="menu_FilePopup">
        <menuitem id="menu_FileQuitItem"
                  label="&quitApplicationCmd.label;"
                  accesskey="&quitApplicationCmd.accesskey;"
                  key="key_quitApplication"
                  command="cmd_quitApplication"/>
      </menupopup>
    </menu>

    <menu id="edit-menu" label="&editMenu.label;"
          accesskey="&editMenu.accesskey;">
      <menupopup id="menu_EditPopup"
                 onpopupshowing="updateEditUIVisibility()"
                 onpopuphidden="updateEditUIVisibility()">


        <menuitem id="menu_undo"
                  label="&undoCmd.label;"
                  key="key_undo"
                  accesskey="&undoCmd.accesskey;"
                  command="cmd_undo"/>
        <menuitem id="menu_redo"
                  label="&redoCmd.label;"
                  key="key_redo"
                  accesskey="&redoCmd.accesskey;"
                  command="cmd_redo"/>
        <menuseparator/>
        <menuitem id="menu_cut"
                  label="&cutCmd.label;"
                  key="key_cut"
                  accesskey="&cutCmd.accesskey;"
                  command="cmd_cut"/>
        <menuitem id="menu_copy"
                  label="&copyCmd.label;"
                  key="key_copy"
                  accesskey="&copyCmd.accesskey;"
                  command="cmd_copy"/>
        <menuitem id="menu_paste"
                  label="&pasteCmd.label;"
                  key="key_paste"
                  accesskey="&pasteCmd.accesskey;"
                  command="cmd_paste"/>
        <menuitem id="menu_delete"
                  label="&deleteCmd.label;"
                  key="key_delete"
                  accesskey="&deleteCmd.accesskey;"
                  command="cmd_delete"/>
        <menuseparator/>
        <menuitem id="menu_selectAll"
                  label="&selectAllCmd.label;"
                  key="key_selectAll"
                  accesskey="&selectAllCmd.accesskey;"
                  command="cmd_selectAll"/>
      </menupopup>
    </menu>
  </menubar>

  <browser type="content-primary" id="content" flex="1"/>

</window>
