1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/components/downloads/content/allDownloadsViewOverlay.xul Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,119 @@ 1.4 +<?xml version="1.0"?> 1.5 + 1.6 +# This Source Code Form is subject to the terms of the Mozilla Public 1.7 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.9 + 1.10 +<?xml-stylesheet href="chrome://browser/content/downloads/allDownloadsViewOverlay.css"?> 1.11 +<?xml-stylesheet href="chrome://browser/skin/downloads/allDownloadsViewOverlay.css"?> 1.12 + 1.13 +<!DOCTYPE overlay [ 1.14 +<!ENTITY % downloadsDTD SYSTEM "chrome://browser/locale/downloads/downloads.dtd"> 1.15 +%downloadsDTD; 1.16 +]> 1.17 + 1.18 +<!-- This overlay provides a downloads view that lists both session downloads, 1.19 + using the DownloadsView API, and history downloads, using places queries. 1.20 + The view also implements a command controller and a context menu for 1.21 + managing the downloads list. In order to use this view: 1.22 + 1. Apply this overlay to your window. 1.23 + 2. Insert in all the overlay entry-points, namely: 1.24 + <richlistbox id="downloadsRichListBox"/> 1.25 + <commandset id="downloadCommands"/> 1.26 + <menupopup id="downloadsContextMenu"/> 1.27 + 3. Make sure your window has the editMenuOverlay overlay applied, 1.28 + because the view implements cmd_copy and cmd_delete. 1.29 + 4. Make sure your window has the globalOverlay.js script loaded. 1.30 + 5. To initialize the view 1.31 + let view = new DownloadsPlacesView(document.getElementById("downloadsRichListBox")); 1.32 + // This is what the Places Library uses. It could be tweaked a bit as long as the 1.33 + // transition-type is set correctly 1.34 + view.place = "place:transition=7&sort=4"; 1.35 +--> 1.36 +<overlay id="downloadsViewOverlay" 1.37 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 1.38 + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 1.39 + 1.40 + <script type="application/javascript" 1.41 + src="chrome://browser/content/downloads/allDownloadsViewOverlay.js"/> 1.42 + <script type="application/javascript" 1.43 + src="chrome://global/content/contentAreaUtils.js"/> 1.44 + 1.45 + <richlistbox flex="1" 1.46 + seltype="multiple" 1.47 + id="downloadsRichListBox" context="downloadsContextMenu" 1.48 + onscroll="return this._placesView.onScroll();" 1.49 + onkeypress="return this._placesView.onKeyPress(event);" 1.50 + ondblclick="return this._placesView.onDoubleClick(event);" 1.51 + oncontextmenu="return this._placesView.onContextMenu(event);" 1.52 + ondragstart="this._placesView.onDragStart(event);" 1.53 + ondragover="this._placesView.onDragOver(event);" 1.54 + ondrop="this._placesView.onDrop(event);" 1.55 + onfocus="goUpdateDownloadCommands();" 1.56 + onselect="this._placesView.onSelect();" 1.57 + onblur="goUpdateDownloadCommands();"/> 1.58 + 1.59 + <commandset id="downloadCommands" 1.60 + commandupdater="true" 1.61 + events="focus,select,contextmenu" 1.62 + oncommandupdate="goUpdateDownloadCommands();"> 1.63 + <command id="downloadsCmd_pauseResume" 1.64 + oncommand="goDoCommand('downloadsCmd_pauseResume')"/> 1.65 + <command id="downloadsCmd_cancel" 1.66 + oncommand="goDoCommand('downloadsCmd_cancel')"/> 1.67 + <command id="downloadsCmd_open" 1.68 + oncommand="goDoCommand('downloadsCmd_open')"/> 1.69 + <command id="downloadsCmd_show" 1.70 + oncommand="goDoCommand('downloadsCmd_show')"/> 1.71 + <command id="downloadsCmd_retry" 1.72 + oncommand="goDoCommand('downloadsCmd_retry')"/> 1.73 + <command id="downloadsCmd_openReferrer" 1.74 + oncommand="goDoCommand('downloadsCmd_openReferrer')"/> 1.75 + <command id="downloadsCmd_clearDownloads" 1.76 + oncommand="goDoCommand('downloadsCmd_clearDownloads')"/> 1.77 + </commandset> 1.78 + 1.79 + <menupopup id="downloadsContextMenu" class="download-state"> 1.80 + <menuitem command="downloadsCmd_pauseResume" 1.81 + class="downloadPauseMenuItem" 1.82 + label="&cmd.pause.label;" 1.83 + accesskey="&cmd.pause.accesskey;"/> 1.84 + <menuitem command="downloadsCmd_pauseResume" 1.85 + class="downloadResumeMenuItem" 1.86 + label="&cmd.resume.label;" 1.87 + accesskey="&cmd.resume.accesskey;"/> 1.88 + <menuitem command="downloadsCmd_cancel" 1.89 + class="downloadCancelMenuItem" 1.90 + label="&cmd.cancel.label;" 1.91 + accesskey="&cmd.cancel.accesskey;"/> 1.92 + <menuitem command="cmd_delete" 1.93 + class="downloadRemoveFromHistoryMenuItem" 1.94 + label="&cmd.removeFromHistory.label;" 1.95 + accesskey="&cmd.removeFromHistory.accesskey;"/> 1.96 + <menuitem command="downloadsCmd_show" 1.97 + class="downloadShowMenuItem" 1.98 +#ifdef XP_MACOSX 1.99 + label="&cmd.showMac.label;" 1.100 + accesskey="&cmd.showMac.accesskey;" 1.101 +#else 1.102 + label="&cmd.show.label;" 1.103 + accesskey="&cmd.show.accesskey;" 1.104 +#endif 1.105 + /> 1.106 + 1.107 + <menuseparator class="downloadCommandsSeparator"/> 1.108 + 1.109 + <menuitem command="downloadsCmd_openReferrer" 1.110 + label="&cmd.goToDownloadPage.label;" 1.111 + accesskey="&cmd.goToDownloadPage.accesskey;"/> 1.112 + <menuitem command="cmd_copy" 1.113 + label="&cmd.copyDownloadLink.label;" 1.114 + accesskey="&cmd.copyDownloadLink.accesskey;"/> 1.115 + 1.116 + <menuseparator/> 1.117 + 1.118 + <menuitem command="downloadsCmd_clearDownloads" 1.119 + label="&cmd.clearDownloads.label;" 1.120 + accesskey="&cmd.clearDownloads.accesskey;"/> 1.121 + </menupopup> 1.122 +</overlay>