summaryrefslogtreecommitdiffstats
path: root/application/basilisk/components/places/content/placesOverlay.xul
blob: f6474b4ef5c2d12cf4f0a2f88cbbf83fac821ebc (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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<!-- 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/. -->

<!DOCTYPE overlay [
<!ENTITY % placesDTD SYSTEM "chrome://browser/locale/places/places.dtd">
%placesDTD;
<!ENTITY % editMenuOverlayDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
%editMenuOverlayDTD;
]>

<overlay id="placesOverlay"
         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://global/content/globalOverlay.js"/>
  <script type="application/javascript"
          src="chrome://browser/content/utilityOverlay.js"/>
  <script type="application/javascript"><![CDATA[
    // TODO: Bug 406371.
    // A bunch of browser code depends on us defining these, sad but true :(
    var Cc = Components.classes;
    var Ci = Components.interfaces;
    var Cr = Components.results;

    Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
    Components.utils.import("resource://gre/modules/Task.jsm");
    Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
    XPCOMUtils.defineLazyModuleGetter(window,
      "PlacesUIUtils", "resource:///modules/PlacesUIUtils.jsm");
    XPCOMUtils.defineLazyModuleGetter(window,
      "PlacesTransactions", "resource://gre/modules/PlacesTransactions.jsm");
  ]]></script>
  <script type="application/javascript"
          src="chrome://browser/content/places/controller.js"/>
  <script type="application/javascript"
          src="chrome://browser/content/places/treeView.js"/>

  <!-- Bookmarks and history tooltip -->
  <tooltip id="bhTooltip" noautohide="true"
           onpopupshowing="return window.top.BookmarksEventHandler.fillInBHTooltip(document, event)">
    <vbox id="bhTooltipTextBox" flex="1">
      <label id="bhtTitleText" class="tooltip-label" />
      <label id="bhtUrlText" crop="center" class="tooltip-label uri-element" />
    </vbox>
  </tooltip>

  <commandset id="placesCommands"
              commandupdater="true"
              events="focus,sort,places"
              oncommandupdate="goUpdatePlacesCommands();">
    <command id="placesCmd_open"
             oncommand="goDoPlacesCommand('placesCmd_open');"/>
    <command id="placesCmd_open:window"
             oncommand="goDoPlacesCommand('placesCmd_open:window');"/>
    <command id="placesCmd_open:privatewindow"
             oncommand="goDoPlacesCommand('placesCmd_open:privatewindow');"/>
    <command id="placesCmd_open:tab"
             oncommand="goDoPlacesCommand('placesCmd_open:tab');"/>

    <command id="placesCmd_new:bookmark"
             oncommand="goDoPlacesCommand('placesCmd_new:bookmark');"/>
    <command id="placesCmd_new:folder"
             oncommand="goDoPlacesCommand('placesCmd_new:folder');"/>
    <command id="placesCmd_new:separator"
             oncommand="goDoPlacesCommand('placesCmd_new:separator');"/>
    <command id="placesCmd_show:info" 
             oncommand="goDoPlacesCommand('placesCmd_show:info');"/>
    <command id="placesCmd_rename"
             oncommand="goDoPlacesCommand('placesCmd_show:info');"
             observes="placesCmd_show:info"/>
    <command id="placesCmd_reload"
             oncommand="goDoPlacesCommand('placesCmd_reload');"/>
    <command id="placesCmd_sortBy:name"
             oncommand="goDoPlacesCommand('placesCmd_sortBy:name');"/>
    <command id="placesCmd_moveBookmarks"
             oncommand="goDoPlacesCommand('placesCmd_moveBookmarks');"/>
    <command id="placesCmd_deleteDataHost"
             oncommand="goDoPlacesCommand('placesCmd_deleteDataHost');"/>
    <command id="placesCmd_createBookmark"
             oncommand="goDoPlacesCommand('placesCmd_createBookmark');"/>

    <!-- Special versions of cut/copy/paste/delete which check for an open context menu. -->
    <command id="placesCmd_cut"
             oncommand="goDoPlacesCommand('placesCmd_cut');"/>
    <command id="placesCmd_copy"
             oncommand="goDoPlacesCommand('placesCmd_copy');"/>
    <command id="placesCmd_paste"
             oncommand="goDoPlacesCommand('placesCmd_paste');"/>
    <command id="placesCmd_delete"
             oncommand="goDoPlacesCommand('placesCmd_delete');"/>
  </commandset>

  <menupopup id="placesContext"
             onpopupshowing="this._view = PlacesUIUtils.getViewForNode(document.popupNode);
                             return this._view.buildContextMenu(this);"
             onpopuphiding="this._view.destroyContextMenu();">
    <menuitem id="placesContext_open"
              command="placesCmd_open"
              label="&cmd.open.label;"
              accesskey="&cmd.open.accesskey;"
              default="true"
              selectiontype="single"
              selection="link"/>
    <menuitem id="placesContext_open:newtab"
              command="placesCmd_open:tab"
              label="&cmd.open_tab.label;"
              accesskey="&cmd.open_tab.accesskey;"
              selectiontype="single"
              selection="link"/>
    <menuitem id="placesContext_openContainer:tabs"
              oncommand="var view = PlacesUIUtils.getViewForNode(document.popupNode);
                         view.controller.openSelectionInTabs(event);"
              onclick="checkForMiddleClick(this, event);"
              label="&cmd.open_all_in_tabs.label;"
              accesskey="&cmd.open_all_in_tabs.accesskey;"
              selectiontype="single|none"
              selection="folder|host|query"/>
    <menuitem id="placesContext_openLinks:tabs"
              oncommand="var view = PlacesUIUtils.getViewForNode(document.popupNode);
                         view.controller.openSelectionInTabs(event);"
              onclick="checkForMiddleClick(this, event);"
              label="&cmd.open_all_in_tabs.label;"
              accesskey="&cmd.open_all_in_tabs.accesskey;"
              selectiontype="multiple"
              selection="link"/>
    <menuitem id="placesContext_open:newwindow"
              command="placesCmd_open:window"
              label="&cmd.open_window.label;"
              accesskey="&cmd.open_window.accesskey;"
              selectiontype="single"
              selection="link"/>
    <menuitem id="placesContext_open:newprivatewindow"
              command="placesCmd_open:privatewindow"
              label="&cmd.open_private_window.label;"
              accesskey="&cmd.open_private_window.accesskey;"
              selectiontype="single"
              selection="link"
              hideifprivatebrowsing="true"/>
    <menuseparator id="placesContext_openSeparator"/>
    <menuitem id="placesContext_new:bookmark"
              command="placesCmd_new:bookmark"
              label="&cmd.new_bookmark.label;"
              accesskey="&cmd.new_bookmark.accesskey;"
              selectiontype="any"
              hideifnoinsertionpoint="true"/>
    <menuitem id="placesContext_new:folder"
              command="placesCmd_new:folder"
              label="&cmd.new_folder.label;"
              accesskey="&cmd.context_new_folder.accesskey;"
              selectiontype="any"
              hideifnoinsertionpoint="true"/>
    <menuitem id="placesContext_new:separator"
              command="placesCmd_new:separator"
              label="&cmd.new_separator.label;"
              accesskey="&cmd.new_separator.accesskey;"
              closemenu="single"
              selectiontype="any"
              hideifnoinsertionpoint="true"/>
    <menuseparator id="placesContext_newSeparator"/>
    <menuitem id="placesContext_createBookmark"
              command="placesCmd_createBookmark"
              selection="link"
              forcehideselection="bookmark|tagChild"/>
    <menuitem id="placesContext_cut"
              command="placesCmd_cut"
              label="&cutCmd.label;"
              accesskey="&cutCmd.accesskey;" 
              closemenu="single"
              selection="bookmark|folder|separator|query"
              forcehideselection="tagChild|livemarkChild"/>
    <menuitem id="placesContext_copy"
              command="placesCmd_copy"
              label="&copyCmd.label;"
              closemenu="single"
              accesskey="&copyCmd.accesskey;"
              selection="any"/>
    <menuitem id="placesContext_paste"
              command="placesCmd_paste"
              label="&pasteCmd.label;"
              closemenu="single"
              accesskey="&pasteCmd.accesskey;"
              selectiontype="any"
              hideifnoinsertionpoint="true"/>
    <menuseparator id="placesContext_editSeparator"/>
    <menuitem id="placesContext_delete"
              command="placesCmd_delete"
              label="&deleteCmd.label;"
              accesskey="&deleteCmd.accesskey;"
              closemenu="single"
              selection="bookmark|tagChild|folder|query|dynamiccontainer|separator|host"/>
    <menuitem id="placesContext_delete_history"
              command="placesCmd_delete"
              closemenu="single"
              selection="link"
              forcehideselection="bookmark"/>
    <menuitem id="placesContext_deleteHost"
              command="placesCmd_deleteDataHost"
              label="&cmd.deleteDomainData.label;"
              accesskey="&cmd.deleteDomainData.accesskey;"
              closemenu="single"
              selection="link|host"
              selectiontype="single"
              hideifprivatebrowsing="true"
              forcehideselection="bookmark"/>
    <menuseparator id="placesContext_deleteSeparator"/>
    <menuitem id="placesContext_sortBy:name"
              command="placesCmd_sortBy:name"
              label="&cmd.sortby_name.label;"
              accesskey="&cmd.context_sortby_name.accesskey;"
              closemenu="single"
              selection="folder"/>
    <menuitem id="placesContext_reload"
              command="placesCmd_reload"
              label="&cmd.reloadLivebookmark.label;"
              accesskey="&cmd.reloadLivebookmark.accesskey;"
              closemenu="single"
              selection="livemark/feedURI"/>
    <menuseparator id="placesContext_sortSeparator"/>
    <menuitem id="placesContext_show:info"
              command="placesCmd_show:info"
              label="&cmd.properties.label;" 
              accesskey="&cmd.properties.accesskey;"
              selection="bookmark|folder|query"
              forcehideselection="livemarkChild"/>
  </menupopup>

</overlay>