summaryrefslogtreecommitdiffstats
path: root/browser/components/downloads/content/allDownloadsViewOverlay.xul
blob: cb8c699bf8290a50ae7d0179a37292ed6d17ae97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?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://browser/content/downloads/downloads.css"?>
<?xml-stylesheet href="chrome://browser/skin/downloads/allDownloadsViewOverlay.css"?>

<!DOCTYPE overlay [
<!ENTITY % downloadsDTD SYSTEM "chrome://browser/locale/downloads/downloads.dtd">
%downloadsDTD;
]>

<!-- This overlay provides a downloads view that lists both session downloads,
     using the DownloadsView API, and history downloads, using places queries.
     The view also implements a command controller and a context menu for
     managing the downloads list.  In order to use this view:
     1. Apply this overlay to your window.
     2. Insert in all the overlay entry-points, namely:
        <richlistbox id="downloadsRichListBox"/>
        <commandset id="downloadCommands"/>
        <menupopup id="downloadsContextMenu"/>
    3. Make sure your window has the editMenuOverlay overlay applied,
       because the view implements cmd_copy and cmd_delete.
    4. Make sure your window has the globalOverlay.js script loaded.
    5. To initialize the view
        let view = new DownloadsPlacesView(document.getElementById("downloadsRichListBox"));
        // This is what the Places Library uses. It could be tweaked a bit as long as the
        // transition-type is set correctly
        view.place = "place:transition=7&sort=4";
-->
<overlay id="downloadsViewOverlay"
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <script type="application/javascript"
          src="chrome://browser/content/downloads/allDownloadsViewOverlay.js"/>
  <script type="application/javascript"
          src="chrome://global/content/contentAreaUtils.js"/>

  <richlistbox flex="1"
               seltype="multiple"
               id="downloadsRichListBox" context="downloadsContextMenu"
               onscroll="return this._placesView.onScroll();"
               onkeypress="return this._placesView.onKeyPress(event);"
               ondblclick="return this._placesView.onDoubleClick(event);"
               oncontextmenu="return this._placesView.onContextMenu(event);"
               ondragstart="this._placesView.onDragStart(event);"
               ondragover="this._placesView.onDragOver(event);"
               ondrop="this._placesView.onDrop(event);"
               onfocus="goUpdateDownloadCommands();"
               onselect="this._placesView.onSelect();"
               onblur="goUpdateDownloadCommands();"/>

  <commandset id="downloadCommands"
              commandupdater="true"
              events="focus,select,contextmenu"
              oncommandupdate="goUpdateDownloadCommands();">
    <command id="downloadsCmd_pauseResume"
             oncommand="goDoCommand('downloadsCmd_pauseResume')"/>
    <command id="downloadsCmd_cancel"
             oncommand="goDoCommand('downloadsCmd_cancel')"/>
    <command id="downloadsCmd_unblock"
             oncommand="goDoCommand('downloadsCmd_unblock')"/>
    <command id="downloadsCmd_chooseUnblock"
             oncommand="goDoCommand('downloadsCmd_chooseUnblock')"/>
    <command id="downloadsCmd_chooseOpen"
             oncommand="goDoCommand('downloadsCmd_chooseOpen')"/>
    <command id="downloadsCmd_confirmBlock"
             oncommand="goDoCommand('downloadsCmd_confirmBlock')"/>
    <command id="downloadsCmd_open"
             oncommand="goDoCommand('downloadsCmd_open')"/>
    <command id="downloadsCmd_show"
             oncommand="goDoCommand('downloadsCmd_show')"/>
    <command id="downloadsCmd_retry"
             oncommand="goDoCommand('downloadsCmd_retry')"/>
    <command id="downloadsCmd_openReferrer"
             oncommand="goDoCommand('downloadsCmd_openReferrer')"/>
    <command id="downloadsCmd_clearDownloads"
             oncommand="goDoCommand('downloadsCmd_clearDownloads')"/>
  </commandset>

  <menupopup id="downloadsContextMenu" class="download-state">
    <menuitem command="downloadsCmd_pauseResume"
              class="downloadPauseMenuItem"
              label="&cmd.pause.label;"
              accesskey="&cmd.pause.accesskey;"/>
    <menuitem command="downloadsCmd_pauseResume"
              class="downloadResumeMenuItem"
              label="&cmd.resume.label;"
              accesskey="&cmd.resume.accesskey;"/>
    <menuitem command="downloadsCmd_cancel"
              class="downloadCancelMenuItem"
              label="&cmd.cancel.label;"
              accesskey="&cmd.cancel.accesskey;"/>
    <menuitem command="downloadsCmd_unblock"
              class="downloadUnblockMenuItem"
              label="&cmd.unblock2.label;"
              accesskey="&cmd.unblock2.accesskey;"/>
    <menuitem command="cmd_delete"
              class="downloadRemoveFromHistoryMenuItem"
              label="&cmd.removeFromHistory.label;"
              accesskey="&cmd.removeFromHistory.accesskey;"/>
    <menuitem command="downloadsCmd_show"
              class="downloadShowMenuItem"
#ifdef XP_MACOSX
              label="&cmd.showMac.label;"
              accesskey="&cmd.showMac.accesskey;"
#else
              label="&cmd.show.label;"
              accesskey="&cmd.show.accesskey;"
#endif
              />

    <menuseparator class="downloadCommandsSeparator"/>

    <menuitem command="downloadsCmd_openReferrer"
              label="&cmd.goToDownloadPage.label;"
              accesskey="&cmd.goToDownloadPage.accesskey;"/>
    <menuitem command="cmd_copy"
              label="&cmd.copyDownloadLink.label;"
              accesskey="&cmd.copyDownloadLink.accesskey;"/>

    <menuseparator/>

    <menuitem command="downloadsCmd_clearDownloads"
              label="&cmd.clearDownloads.label;"
              accesskey="&cmd.clearDownloads.accesskey;"/>
  </menupopup>
</overlay>