common/src/viewSource.xul
author Magnus Melin <mkmelin+mozilla@iki.fi>
Wed, 11 Dec 2019 23:56:09 +0200
changeset 37738 46e8e47b40124ea8b22d082c0a694bf87af7266a
parent 36532 2ecec2c37acf439209e9fe3b2d4eac0b51465a0f
permissions -rw-r--r--
Bug 1601769 - update Thunderbird references to toolkit xul->xhtml files renamings in bug 1601093. r=darktrojan grep -rEl '/(alert|appPicker|dummy|passwordManager|printPageSetup|printPreviewProgress|printProgress|commonDialog|selectDialog|config|editMenuKeys.inc|resetProfile|resetProfileProgress|win|createProfileWizard|profileDowngrade|profileSelection).xul' --exclude-dir=.hg --exclude-dir=suite --exclude-dir=editor . | xargs sed -E -i 's#/(alert|appPicker|dummy|passwordManager|printPageSetup|printPreviewProgress|printProgress|commonDialog|selectDialog|config|editMenuKeys.inc|resetProfile|resetProfileProgress|win|createProfileWizard|profileDowngrade|profileSelection).xul#/\1.xhtml#g' hg revert mail/components/cloudfile/jar.mn hg revert mail/components/preferences/jar.mn hg revert mail/components/preferences/privacy.js hg revert mail/components/compose/content/bigFileObserver.js

<?xml version="1.0"?>
# -*- Mode: HTML -*-
# 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"?>
<?xml-stylesheet href="chrome://messenger/content/viewSource.css" type="text/css"?>

<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
%brandDTD;
#ifndef MOZ_SUITE
<!ENTITY % baseMenuOverlayDTD SYSTEM "chrome://messenger/locale/baseMenuOverlay.dtd">
%baseMenuOverlayDTD;
#endif
<!ENTITY % sourceDTD SYSTEM "chrome://messenger/locale/viewSource.dtd" >
%sourceDTD;
<!ENTITY % charsetDTD SYSTEM "chrome://global/locale/charsetMenu.dtd" >
%charsetDTD;
<!ENTITY % editMenuDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd" >
%editMenuDTD;
]>

<window id="viewSource"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"
        contenttitlesetting="true"
        title="&mainWindow.title;"
        titlemodifier="&mainWindow.titlemodifier;"
        titlepreface="&mainWindow.preface;"
        titlemenuseparator ="&mainWindow.titlemodifierseparator;"
        windowtype="navigator:view-source"
        width="640" height="480"
        screenX="10" screenY="10"
        persist="screenX screenY width height sizemode">

<linkset>
  <html:link rel="localization" href="messenger/menubar.ftl"/>
</linkset>

  <script src="chrome://global/content/globalOverlay.js"/>
  <script src="chrome://global/content/printUtils.js"/>
  <script src="chrome://global/content/contentAreaUtils.js"/>
#ifndef MOZ_SUITE
  <script src="chrome://messenger/content/mailCore.js"/>
#endif
  <script src="chrome://messenger/content/viewSource.js"/>
  <script src="chrome://messenger/content/viewZoomOverlay.js"/>
  <script src="chrome://global/content/editMenuOverlay.js"/>

  <stringbundle id="viewSourceBundle" src="chrome://messenger/locale/viewSource.properties"/>

  <command id="cmd_savePage" oncommand="ViewSourceSavePage();"/>
  <command id="cmd_print" oncommand="PrintUtils.printWindow(gBrowser.outerWindowID, gBrowser);"/>
  <command id="cmd_printpreview" oncommand="PrintUtils.printPreview(PrintPreviewListener);"/>
  <command id="cmd_pagesetup" oncommand="PrintUtils.showPageSetup();"/>
  <command id="cmd_close" oncommand="window.close();"/>
  <command id="cmd_find"
           oncommand="document.getElementById('FindToolbar').onFindCommand();"/>
  <command id="cmd_findAgain"
           oncommand="document.getElementById('FindToolbar').onFindAgainCommand(false);"/>
  <command id="cmd_findPrevious"
           oncommand="document.getElementById('FindToolbar').onFindAgainCommand(true);"/>
#ifdef XP_MACOSX
  <command id="cmd_findSelection"
           oncommand="document.getElementById('FindToolbar').onFindSelectionCommand();"/>
#endif
  <command id="cmd_reload" oncommand="viewSourceChrome.reload();"/>
  <command id="cmd_goToLine" oncommand="viewSourceChrome.promptAndGoToLine();" disabled="true"/>
#ifdef MOZ_SUITE
  <command id="cmd_highlightSyntax" oncommand="viewSourceChrome.toggleSyntaxHighlighting();"/>
  <command id="cmd_wrapLongLines" oncommand="viewSourceChrome.toggleWrapping();"/>
  <command id="Browser:Back" oncommand="viewSourceChrome.goBack()" class="viewSourceNavigation"/>
  <command id="Browser:Forward" oncommand="viewSourceChrome.goForward()" class="viewSourceNavigation"/>
#endif
  <command id="cmd_textZoomReduce" oncommand="ZoomManager.reduce();"/>
  <command id="cmd_textZoomEnlarge" oncommand="ZoomManager.enlarge();"/>
  <command id="cmd_textZoomReset" oncommand="ZoomManager.reset();"/>

#includesubst @TOOLKIT_DIR@/content/editMenuKeys.inc.xhtml
  <keyset id="viewSourceKeys">
    <key id="key_savePage" key="&savePageCmd.commandkey;" modifiers="accel" command="cmd_savePage"/>
    <key id="key_print" key="&printCmd.commandkey;" modifiers="accel" command="cmd_print"/>
    <key id="key_close" key="&closeCmd.commandkey;" modifiers="accel" command="cmd_close"/>
    <key id="key_goToLine"     key="&goToLineCmd.commandkey;"  command="cmd_goToLine"  modifiers="accel"/>

    <key id="key_textZoomEnlarge" key="&textEnlarge.commandkey;" command="cmd_textZoomEnlarge" modifiers="accel"/>
    <key id="key_textZoomEnlarge2" key="&textEnlarge.commandkey2;" command="cmd_textZoomEnlarge" modifiers="accel"/>
    <key id="key_textZoomEnlarge3" key="&textEnlarge.commandkey3;" command="cmd_textZoomEnlarge" modifiers="accel"/>
    <key id="key_textZoomReduce"  key="&textReduce.commandkey;" command="cmd_textZoomReduce" modifiers="accel"/>
    <key id="key_textZoomReduce2"  key="&textReduce.commandkey2;" command="cmd_textZoomReduce" modifiers="accel"/>
    <key id="key_textZoomReset" key="&textReset.commandkey;" command="cmd_textZoomReset" modifiers="accel"/>
    <key id="key_textZoomReset2" key="&textReset.commandkey2;" command="cmd_textZoomReset" modifiers="accel"/>

    <key id="key_reload" key="&reloadCmd.commandkey;" command="cmd_reload" modifiers="accel"/>
    <key key="&reloadCmd.commandkey;" command="cmd_reload" modifiers="accel,shift"/>
    <key keycode="VK_F5" command="cmd_reload"/>
    <key keycode="VK_F5" command="cmd_reload" modifiers="accel"/>
    <key id="key_find" key="&findOnCmd.commandkey;" command="cmd_find" modifiers="accel"/>
    <key id="key_findAgain" key="&findAgainCmd.commandkey;" command="cmd_findAgain" modifiers="accel"/>
    <key id="key_findPrevious" key="&findAgainCmd.commandkey;" command="cmd_findPrevious" modifiers="accel,shift"/>
#ifdef XP_MACOSX
    <key id="key_findSelection" key="&findSelectionCmd.commandkey;" command="cmd_findSelection" modifiers="accel"/>
#endif
    <key keycode="&findAgainCmd.commandkey2;" command="cmd_findAgain"/>
    <key keycode="&findAgainCmd.commandkey2;"  command="cmd_findPrevious" modifiers="shift"/>

    <key keycode="VK_BACK" command="Browser:Back"/>
    <key keycode="VK_BACK" command="Browser:Forward" modifiers="shift"/>
#ifndef XP_MACOSX
    <key id="goBackKb" keycode="VK_LEFT" command="Browser:Back" modifiers="alt"/>
    <key id="goForwardKb" keycode="VK_RIGHT" command="Browser:Forward" modifiers="alt"/>
#else
    <key id="goBackKb" keycode="VK_LEFT" command="Browser:Back" modifiers="accel" />
    <key id="goForwardKb" keycode="VK_RIGHT" command="Browser:Forward" modifiers="accel" />
#endif
#ifdef XP_UNIX
    <key id="goBackKb2" key="&goBackCmd.commandKey;" command="Browser:Back" modifiers="accel"/>
    <key id="goForwardKb2" key="&goForwardCmd.commandKey;" command="Browser:Forward" modifiers="accel"/>
#endif
#ifndef MOZ_SUITE
    <key id="key_openHelp"
         oncommand="openSupportURL();"
#ifdef XP_MACOSX
         key="&productHelpMac.commandkey;"
         modifiers="&productHelpMac.modifiers;"/>
#else
         keycode="&productHelp.commandkey;"/>
#endif
#endif

  </keyset>

  <tooltip id="aHTMLTooltip" page="true"/>

  <menupopup id="viewSourceContextMenu">
#ifdef MOZ_SUITE
    <menuitem id="context-back"
              label="&backCmd.label;"
              accesskey="&backCmd.accesskey;"
              command="Browser:Back"
              observes="viewSourceNavigation"/>
    <menuitem id="context-forward"
              label="&forwardCmd.label;"
              accesskey="&forwardCmd.accesskey;"
              command="Browser:Forward"
              observes="viewSourceNavigation"/>
    <menuseparator observes="viewSourceNavigation"/>
#endif
    <menuitem id="cMenu_findAgain"
              label="&findAgainCmd.label;"
              accesskey="&findAgainCmd.accesskey;"
              command="cmd_findAgain"/>
    <menuseparator/>
    <menuitem id="cMenu_copy"
              label="&copyCmd.label;"
              accesskey="&copyCmd.accesskey;"
              command="cmd_copy"/>
    <menuitem id="context-copyLink"
              label="&copyLinkCmd.label;"
              accesskey="&copyLinkCmd.accesskey;"
              oncommand="viewSourceChrome.onContextMenuCopyLinkOrEmail();"/>
    <menuitem id="context-copyEmail"
              label="&copyEmailCmd.label;"
              accesskey="&copyEmailCmd.accesskey;"
              oncommand="viewSourceChrome.onContextMenuCopyLinkOrEmail();"/>
    <menuseparator/>
    <menuitem id="cMenu_selectAll"
              label="&selectAllCmd.label;"
              accesskey="&selectAllCmd.accesskey;"
              command="cmd_selectAll"/>
  </menupopup>

  <!-- Menu -->
  <toolbox id="viewSource-toolbox">
    <toolbar type="menubar">
    <menubar id="viewSource-main-menubar">

      <menu id="menu_file" label="&fileMenu.label;" accesskey="&fileMenu.accesskey;">
        <menupopup id="menu_FilePopup">
          <menuitem key="key_savePage" command="cmd_savePage" id="menu_savePage"
                    label="&savePageCmd.label;" accesskey="&savePageCmd.accesskey;"
                    class="menuitem-iconic"/>
          <menuitem command="cmd_pagesetup" id="menu_pageSetup"
                    label="&pageSetupCmd.label;" accesskey="&pageSetupCmd.accesskey;"/>
#ifndef XP_MACOSX
          <menuitem command="cmd_printpreview" id="menu_printPreview"
                    label="&printPreviewCmd.label;" accesskey="&printPreviewCmd.accesskey;"
                    class="menuitem-iconic"/>
#endif
          <menuitem key="key_print" command="cmd_print" id="menu_print"
                    label="&printCmd.label;" accesskey="&printCmd.accesskey;"
                    class="menuitem-iconic"/>
          <menuseparator/>
          <menuitem key="key_close" command="cmd_close" id="menu_close"
                    label="&closeCmd.label;" accesskey="&closeCmd.accesskey;"
                    class="menuitem-iconic"/>
        </menupopup>
      </menu>

      <menu id="menu_edit" label="&editMenu.label;"
            accesskey="&editMenu.accesskey;">
        <menupopup id="editmenu-popup">
          <menuitem id="menu_undo" label="&undoCmd.label;"
                    key="key_undo" accesskey="&undoCmd.accesskey;"
                    command="cmd_undo"
                    class="menuitem-iconic"/>
          <menuitem id="menu_redo" label="&redoCmd.label;"
                    key="key_redo" accesskey="&redoCmd.accesskey;"
                    command="cmd_redo"
                    class="menuitem-iconic"/>
          <menuseparator/>
          <menuitem id="menu_cut" label="&cutCmd.label;"
                    key="key_cut" accesskey="&cutCmd.accesskey;"
                    command="cmd_cut"
                    class="menuitem-iconic"/>
          <menuitem id="menu_copy" label="&copyCmd.label;"
                    key="key_copy" accesskey="&copyCmd.accesskey;"
                    command="cmd_copy"
                    class="menuitem-iconic"/>
          <menuitem id="menu_paste" label="&pasteCmd.label;"
                    key="key_paste" accesskey="&pasteCmd.accesskey;"
                    command="cmd_paste"
                    class="menuitem-iconic"/>
          <menuitem id="menu_delete" label="&deleteCmd.label;"
                    key="key_delete" accesskey="&deleteCmd.accesskey;"
                    command="cmd_delete"
                    class="menuitem-iconic"/>
          <menuseparator/>
          <menuitem id="menu_selectAll" label="&selectAllCmd.label;"
                    key="key_selectAll" accesskey="&selectAllCmd.accesskey;"
                    command="cmd_selectAll"/>
          <menuseparator/>
          <menuitem id="menu_find" label="&findCmd.label;"
                    key="key_find" accesskey="&findCmd.accesskey;"
                    command="cmd_find"/>
          <menuitem id="menu_findAgain" label="&findAgainCmd.label;"
                    key="key_findAgain" accesskey="&findAgainCmd.accesskey;"
                    command="cmd_findAgain"/>
          <menuseparator/>
          <menuitem id="menu_goToLine" key="key_goToLine" command="cmd_goToLine"
                    label="&goToLineCmd.label;" accesskey="&goToLineCmd.accesskey;"/>
        </menupopup>
      </menu>

      <menu id="menu_view" label="&viewMenu.label;" accesskey="&viewMenu.accesskey;">
        <menupopup id="viewmenu-popup">
          <menuitem id="menu_reload" command="cmd_reload" accesskey="&reloadCmd.accesskey;"
                    label="&reloadCmd.label;" key="key_reload"/>
          <menuseparator />
          <menu id="viewTextZoomMenu" label="&menu_textSize.label;" accesskey="&menu_textSize.accesskey;">
            <menupopup>
              <menuitem id="menu_textEnlarge" command="cmd_textZoomEnlarge"
                        label="&menu_textEnlarge.label;" accesskey="&menu_textEnlarge.accesskey;"
                        key="key_textZoomEnlarge" class="menuitem-iconic"/>
              <menuitem id="menu_textReduce" command="cmd_textZoomReduce"
                        label="&menu_textReduce.label;" accesskey="&menu_textReduce.accesskey;"
                        key="key_textZoomReduce" class="menuitem-iconic"/>
              <menuseparator/>
              <menuitem id="menu_textReset" command="cmd_textZoomReset"
                        label="&menu_textReset.label;" accesskey="&menu_textReset.accesskey;"
                        key="key_textZoomReset" class="menuitem-iconic"/>
            </menupopup>
          </menu>

          <!-- Charset Menu -->
          <menu id="charsetMenu"
                data-l10n-id="menu-view-charset"
                oncommand="viewSourceChrome.onSetCharacterSet(event);"
                onpopupshowing="CharsetMenu.build(event.target);
                                CharsetMenu.update(event.target, content.document.characterSet);">
            <menupopup/>
          </menu>
#ifdef MOZ_SUITE
          <menuseparator/>
          <menuitem id="menu_wrapLongLines" type="checkbox" command="cmd_wrapLongLines"
                    label="&menu_wrapLongLines.title;" accesskey="&menu_wrapLongLines.accesskey;"/>
          <menuitem type="checkbox" id="menu_highlightSyntax" command="cmd_highlightSyntax"
                    label="&menu_highlightSyntax.label;" accesskey="&menu_highlightSyntax.accesskey;"/>
#endif
        </menupopup>
      </menu>
#ifndef MOZ_SUITE
      <menu id="helpMenu"
#ifdef XP_WIN
            label="&helpMenuWin.label;" accesskey="&helpMenuWin.accesskey;">
#else
            label="&helpMenu.label;" accesskey="&helpMenu.accesskey;">
#endif
        <menupopup id="menu_HelpPopup">
          <menuitem id="menu_openHelp"
                    label="&productHelp.label;"
#ifndef XP_MACOSX
                    accesskey="&productHelp.accesskey;"
#endif
                    key="key_openHelp"
                    oncommand="openSupportURL();"
                    class="menuitem-iconic"/>
        </menupopup>
      </menu>
#endif
    </menubar>
    </toolbar>
  </toolbox>

  <vbox id="appcontent" flex="1">

    <browser id="content" type="content" name="content" src="about:blank" flex="1"
             primary="true"
#ifndef MOZ_SUITE
             disableglobalhistory="true"
#endif
             context="viewSourceContextMenu" showcaret="true" tooltip="aHTMLTooltip" />
    <findbar id="FindToolbar" browserid="content"/>
  </vbox>

</window>