browser/components/downloads/content/allDownloadsViewOverlay.xul

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

     1 <?xml version="1.0"?>
     3 # This Source Code Form is subject to the terms of the Mozilla Public
     4 # License, v. 2.0. If a copy of the MPL was not distributed with this
     5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
     7 <?xml-stylesheet href="chrome://browser/content/downloads/allDownloadsViewOverlay.css"?>
     8 <?xml-stylesheet href="chrome://browser/skin/downloads/allDownloadsViewOverlay.css"?>
    10 <!DOCTYPE overlay [
    11 <!ENTITY % downloadsDTD SYSTEM "chrome://browser/locale/downloads/downloads.dtd">
    12 %downloadsDTD;
    13 ]>
    15 <!-- This overlay provides a downloads view that lists both session downloads,
    16      using the DownloadsView API, and history downloads, using places queries.
    17      The view also implements a command controller and a context menu for
    18      managing the downloads list.  In order to use this view:
    19      1. Apply this overlay to your window.
    20      2. Insert in all the overlay entry-points, namely:
    21         <richlistbox id="downloadsRichListBox"/>
    22         <commandset id="downloadCommands"/>
    23         <menupopup id="downloadsContextMenu"/>
    24     3. Make sure your window has the editMenuOverlay overlay applied,
    25        because the view implements cmd_copy and cmd_delete.
    26     4. Make sure your window has the globalOverlay.js script loaded.
    27     5. To initialize the view
    28         let view = new DownloadsPlacesView(document.getElementById("downloadsRichListBox"));
    29         // This is what the Places Library uses. It could be tweaked a bit as long as the
    30         // transition-type is set correctly
    31         view.place = "place:transition=7&sort=4";
    32 -->
    33 <overlay id="downloadsViewOverlay"
    34          xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    35          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    37   <script type="application/javascript"
    38           src="chrome://browser/content/downloads/allDownloadsViewOverlay.js"/>
    39   <script type="application/javascript"
    40           src="chrome://global/content/contentAreaUtils.js"/>
    42   <richlistbox flex="1"
    43                seltype="multiple"
    44                id="downloadsRichListBox" context="downloadsContextMenu"
    45                onscroll="return this._placesView.onScroll();"
    46                onkeypress="return this._placesView.onKeyPress(event);"
    47                ondblclick="return this._placesView.onDoubleClick(event);"
    48                oncontextmenu="return this._placesView.onContextMenu(event);"
    49                ondragstart="this._placesView.onDragStart(event);"
    50                ondragover="this._placesView.onDragOver(event);"
    51                ondrop="this._placesView.onDrop(event);"
    52                onfocus="goUpdateDownloadCommands();"
    53                onselect="this._placesView.onSelect();"
    54                onblur="goUpdateDownloadCommands();"/>
    56   <commandset id="downloadCommands"
    57               commandupdater="true"
    58               events="focus,select,contextmenu"
    59               oncommandupdate="goUpdateDownloadCommands();">
    60     <command id="downloadsCmd_pauseResume"
    61              oncommand="goDoCommand('downloadsCmd_pauseResume')"/>
    62     <command id="downloadsCmd_cancel"
    63              oncommand="goDoCommand('downloadsCmd_cancel')"/>
    64     <command id="downloadsCmd_open"
    65              oncommand="goDoCommand('downloadsCmd_open')"/>
    66     <command id="downloadsCmd_show"
    67              oncommand="goDoCommand('downloadsCmd_show')"/>
    68     <command id="downloadsCmd_retry"
    69              oncommand="goDoCommand('downloadsCmd_retry')"/>
    70     <command id="downloadsCmd_openReferrer"
    71              oncommand="goDoCommand('downloadsCmd_openReferrer')"/>
    72     <command id="downloadsCmd_clearDownloads"
    73              oncommand="goDoCommand('downloadsCmd_clearDownloads')"/>
    74   </commandset>
    76   <menupopup id="downloadsContextMenu" class="download-state">
    77     <menuitem command="downloadsCmd_pauseResume"
    78               class="downloadPauseMenuItem"
    79               label="&cmd.pause.label;"
    80               accesskey="&cmd.pause.accesskey;"/>
    81     <menuitem command="downloadsCmd_pauseResume"
    82               class="downloadResumeMenuItem"
    83               label="&cmd.resume.label;"
    84               accesskey="&cmd.resume.accesskey;"/>
    85     <menuitem command="downloadsCmd_cancel"
    86               class="downloadCancelMenuItem"
    87               label="&cmd.cancel.label;"
    88               accesskey="&cmd.cancel.accesskey;"/>
    89     <menuitem command="cmd_delete"
    90               class="downloadRemoveFromHistoryMenuItem"
    91               label="&cmd.removeFromHistory.label;"
    92               accesskey="&cmd.removeFromHistory.accesskey;"/>
    93     <menuitem command="downloadsCmd_show"
    94               class="downloadShowMenuItem"
    95 #ifdef XP_MACOSX
    96               label="&cmd.showMac.label;"
    97               accesskey="&cmd.showMac.accesskey;"
    98 #else
    99               label="&cmd.show.label;"
   100               accesskey="&cmd.show.accesskey;"
   101 #endif
   102               />
   104     <menuseparator class="downloadCommandsSeparator"/>
   106     <menuitem command="downloadsCmd_openReferrer"
   107               label="&cmd.goToDownloadPage.label;"
   108               accesskey="&cmd.goToDownloadPage.accesskey;"/>
   109     <menuitem command="cmd_copy"
   110               label="&cmd.copyDownloadLink.label;"
   111               accesskey="&cmd.copyDownloadLink.accesskey;"/>
   113     <menuseparator/>
   115     <menuitem command="downloadsCmd_clearDownloads"
   116               label="&cmd.clearDownloads.label;"
   117               accesskey="&cmd.clearDownloads.accesskey;"/>
   118   </menupopup>
   119 </overlay>

mercurial