browser/devtools/scratchpad/scratchpad.xul
author Ryan VanderMeulen <ryanvm@gmail.com>
Tue, 03 Apr 2012 20:22:42 -0400
changeset 94272 308440acc7b70223e7ab25aed3305da7e65a762a
parent 91682 6738581dc4d044d75107cfbb662d407fdcf82837
child 98529 f4157e8c410708d76703f19e4dfb61859bfe32d8
permissions -rw-r--r--
Backout 17deb5f61b4d (bug 150073) due to build bustage. a=shouldausedtryfirst

<?xml version="1.0"?>
#ifdef 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 Scratchpad.
   -
   - The Initial Developer of the Original Code is
   - The Mozilla Foundation.
   - Portions created by the Initial Developer are Copyright (C) 2011
   - the Initial Developer. All Rights Reserved.
   -
   - Contributor(s):
   -   Rob Campbell <robcee@mozilla.com> (original author)
   -   Mihai Sucan <mihai.sucan@gmail.com>
   -   Erik Vold <erikvvold@gmail.com>
   -   Mark Capella <markcapella@twcny.rr.com>
   -
   - Alternatively, the contents of this file may be used under the terms of
   - either 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 ***** -->
#endif
<!DOCTYPE window [
<!ENTITY % scratchpadDTD SYSTEM "chrome://browser/locale/devtools/scratchpad.dtd" >
 %scratchpadDTD;
]>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
<?xul-overlay href="chrome://browser/content/source-editor-overlay.xul"?>

<window id="main-window"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        title="&window.title;"
        windowtype="devtools:scratchpad"
        macanimationtype="document"
        screenX="4" screenY="4"
        width="640" height="480"
        persist="screenX screenY width height sizemode">

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

<commandset id="editMenuCommands"/>
<commandset id="sourceEditorCommands"/>

<commandset id="sp-commandset">
  <command id="sp-cmd-newWindow" oncommand="Scratchpad.openScratchpad();"/>
  <command id="sp-cmd-openFile" oncommand="Scratchpad.openFile();"/>
  <command id="sp-cmd-save" oncommand="Scratchpad.saveFile();"/>
  <command id="sp-cmd-saveas" oncommand="Scratchpad.saveFileAs();"/>

  <!-- TODO: bug 650340 - implement printFile()
  <command id="sp-cmd-printFile" oncommand="Scratchpad.printFile();" disabled="true"/>
 -->

  <command id="sp-cmd-close" oncommand="Scratchpad.close();"/>
  <command id="sp-cmd-run" oncommand="Scratchpad.run();"/>
  <command id="sp-cmd-inspect" oncommand="Scratchpad.inspect();"/>
  <command id="sp-cmd-display" oncommand="Scratchpad.display();"/>
  <command id="sp-cmd-contentContext" oncommand="Scratchpad.setContentContext();"/>
  <command id="sp-cmd-browserContext" oncommand="Scratchpad.setBrowserContext();" disabled="true"/>
  <command id="sp-cmd-resetContext" oncommand="Scratchpad.resetContext();"/>
  <command id="sp-cmd-errorConsole" oncommand="Scratchpad.openErrorConsole();" disabled="true"/>
  <command id="sp-cmd-webConsole" oncommand="Scratchpad.openWebConsole();"/>
  <command id="sp-cmd-documentationLink" oncommand="Scratchpad.openDocumentationPage();"/>
</commandset>

<keyset id="sourceEditorKeys"/>

<keyset id="sp-keyset">
  <key id="sp-key-window"
       key="&newWindowCmd.commandkey;"
       command="sp-cmd-newWindow"
       modifiers="accel"/>
  <key id="sp-key-open"
       key="&openFileCmd.commandkey;"
       command="sp-cmd-openFile"
       modifiers="accel"/>
  <key id="sp-key-save"
       key="&saveFileCmd.commandkey;"
       command="sp-cmd-save"
       modifiers="accel"/>
  <key id="sp-key-close"
       key="&closeCmd.key;"
       command="sp-cmd-close"
       modifiers="accel"/>

  <!-- TODO: bug 650340 - implement printFile
  <key id="sp-key-printFile"
       key="&printCmd.commandkey;"
       command="sp-cmd-printFile"
       modifiers="accel"/>
  -->

  <key id="sp-key-run"
       key="&run.key;"
       command="sp-cmd-run"
       modifiers="accel"/>
  <key id="sp-key-inspect"
       key="&inspect.key;"
       command="sp-cmd-inspect"
       modifiers="accel"/>
  <key id="sp-key-display"
       key="&display.key;"
       command="sp-cmd-display"
       modifiers="accel"/>
  <key id="sp-key-errorConsole"
       key="&errorConsoleCmd.commandkey;"
       command="sp-cmd-errorConsole"
       modifiers="accel,shift"/>
  <key id="sp-key-webConsole"
       key="&webConsoleCmd.commandkey;"
       command="sp-cmd-webConsole"
       modifiers="accel,shift"/>
  <key id="key_openHelp"
       keycode="VK_F1"
       command="sp-cmd-documentationLink"/>
</keyset>


<menubar id="sp-menubar">
  <menu id="sp-file-menu" label="&fileMenu.label;"
        accesskey="&fileMenu.accesskey;">
    <menupopup id="sp-menu-filepopup">
      <menuitem id="sp-menu-newscratchpad"
                label="&newWindowCmd.label;"
                accesskey="&newWindowCmd.accesskey;"
                key="sp-key-window"
                command="sp-cmd-newWindow"/>
      <menuseparator/>
      <menuitem id="sp-menu-open"
                label="&openFileCmd.label;"
                command="sp-cmd-openFile"
                key="sp-key-open"
                accesskey="&openFileCmd.accesskey;"/>
      <menuitem id="sp-menu-save"
                label="&saveFileCmd.label;"
                accesskey="&saveFileCmd.accesskey;"
                key="sp-key-save"
                command="sp-cmd-save"/>
      <menuitem id="sp-menu-saveas"
                label="&saveFileAsCmd.label;"
                accesskey="&saveFileAsCmd.accesskey;"
                command="sp-cmd-saveas"/>
      <menuseparator/>

      <!-- TODO: bug 650340 - implement printFile
      <menuitem id="sp-menu-print"
                label="&printCmd.label;"
                accesskey="&printCmd.accesskey;"
                command="sp-cmd-printFile"/>
      <menuseparator/>
      -->

      <menuitem id="sp-menu-close"
                label="&closeCmd.label;"
                key="sp-key-close"
                accesskey="&closeCmd.accesskey;"
                command="sp-cmd-close"/>
    </menupopup>
  </menu>

  <menu id="sp-edit-menu" label="&editMenu.label;"
        accesskey="&editMenu.accesskey;">
    <menupopup id="sp-menu_editpopup"
               onpopupshowing="goUpdateSourceEditorMenuItems()">
      <menuitem id="se-menu-undo"/>
      <menuitem id="se-menu-redo"/>
      <menuseparator/>
      <menuitem id="se-menu-cut"/>
      <menuitem id="se-menu-copy"/>
      <menuitem id="se-menu-paste"/>
      <menuseparator/>
      <menuitem id="se-menu-selectAll"/>
      <menuseparator/>
      <menuitem id="se-menu-find"/>
      <menuitem id="se-menu-findAgain"/>
      <menuseparator/>
      <menuitem id="se-menu-gotoLine"/>
    </menupopup>
  </menu>

  <menu id="sp-execute-menu" label="&executeMenu.label;"
        accesskey="&executeMenu.accesskey;">
    <menupopup id="sp-menu_executepopup">
      <menuitem id="sp-text-run"
                label="&run.label;"
                accesskey="&run.accesskey;"
                key="sp-key-run"
                command="sp-cmd-run"/>
      <menuitem id="sp-text-inspect"
                label="&inspect.label;"
                accesskey="&inspect.accesskey;"
                key="sp-key-inspect"
                command="sp-cmd-inspect"/>
      <menuitem id="sp-text-display"
                label="&display.label;"
                accesskey="&display.accesskey;"
                key="sp-key-display"
                command="sp-cmd-display"/>
      <menuseparator/>
      <menuitem id="sp-text-resetContext"
                label="&resetContext2.label;"
                accesskey="&resetContext2.accesskey;"
                command="sp-cmd-resetContext"/>
    </menupopup>
  </menu>

  <menu id="sp-environment-menu"
        label="&environmentMenu.label;"
        accesskey="&environmentMenu.accesskey;"
        hidden="true">
    <menupopup id="sp-menu-environment">
      <menuitem id="sp-menu-content"
                label="&contentContext.label;"
                accesskey="&contentContext.accesskey;"
                command="sp-cmd-contentContext"
                checked="true"
                type="radio"/>
      <menuitem id="sp-menu-browser"
                command="sp-cmd-browserContext"
                label="&browserContext.label;"
                accesskey="&browserContext.accesskey;"
                type="radio"/>
    </menupopup>
  </menu>

#ifdef XP_WIN
  <menu id="sp-help-menu"
        label="&helpMenu.label;"
        accesskey="&helpMenuWin.accesskey;">
#else
  <menu id="sp-help-menu"
        label="&helpMenu.label;"
        accesskey="&helpMenu.accesskey;">
#endif
    <menupopup id="sp-menu-help">
      <menuitem id="sp-menu-documentation"
                label="&documentationLink.label;"
                accesskey="&documentationLink.accesskey;"
                command="sp-cmd-documentationLink"
                key="key_openHelp"/>
    </menupopup>
  </menu>
</menubar>

<popupset id="scratchpad-popups">
  <menupopup id="scratchpad-text-popup"
             onpopupshowing="goUpdateSourceEditorMenuItems()">
    <menuitem id="se-cMenu-cut"/>
    <menuitem id="se-cMenu-copy"/>
    <menuitem id="se-cMenu-paste"/>
    <menuitem id="se-cMenu-delete"/>
    <menuseparator/>
    <menuitem id="se-cMenu-selectAll"/>
    <menuseparator/>
    <menuitem id="sp-text-run"
              label="&run.label;"
              accesskey="&run.accesskey;"
              key="sp-key-run"
              command="sp-cmd-run"/>
    <menuitem id="sp-text-inspect"
              label="&inspect.label;"
              accesskey="&inspect.accesskey;"
              key="sp-key-inspect"
              command="sp-cmd-inspect"/>
    <menuitem id="sp-text-display"
              label="&display.label;"
              accesskey="&display.accesskey;"
              key="sp-key-display"
              command="sp-cmd-display"/>
    <menuseparator/>
    <menuitem id="sp-text-resetContext"
              label="&resetContext2.label;"
              accesskey="&resetContext2.accesskey;"
              command="sp-cmd-resetContext"/>
  </menupopup>
</popupset>

<notificationbox id="scratchpad-notificationbox" flex="1">
  <hbox id="scratchpad-editor" flex="1"/>
</notificationbox>

</window>