placesOverlay.xul 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <!-- This Source Code Form is subject to the terms of the Mozilla Public
  2. - License, v. 2.0. If a copy of the MPL was not distributed with this
  3. - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
  4. <!DOCTYPE overlay [
  5. <!ENTITY % placesDTD SYSTEM "chrome://browser/locale/places/places.dtd">
  6. %placesDTD;
  7. <!ENTITY % editMenuOverlayDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
  8. %editMenuOverlayDTD;
  9. ]>
  10. <overlay id="placesOverlay"
  11. xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  12. xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  13. <script type="application/javascript"
  14. src="chrome://global/content/globalOverlay.js"/>
  15. <script type="application/javascript"
  16. src="chrome://browser/content/utilityOverlay.js"/>
  17. <script type="application/javascript"><![CDATA[
  18. // TODO: Bug 406371.
  19. // A bunch of browser code depends on us defining these, sad but true :(
  20. var Cc = Components.classes;
  21. var Ci = Components.interfaces;
  22. var Cr = Components.results;
  23. Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
  24. Components.utils.import("resource:///modules/PlacesUIUtils.jsm");
  25. ]]></script>
  26. <script type="application/javascript"
  27. src="chrome://browser/content/places/controller.js"/>
  28. <script type="application/javascript"
  29. src="chrome://browser/content/places/treeView.js"/>
  30. <!-- Bookmarks and history tooltip -->
  31. <tooltip id="bhTooltip" noautohide="true"
  32. onpopupshowing="return window.top.BookmarksEventHandler.fillInBHTooltip(document, event)">
  33. <vbox id="bhTooltipTextBox" flex="1">
  34. <label id="bhtTitleText" class="tooltip-label" />
  35. <label id="bhtUrlText" crop="center" class="tooltip-label" />
  36. </vbox>
  37. </tooltip>
  38. <commandset id="placesCommands"
  39. commandupdater="true"
  40. events="focus,sort,places"
  41. oncommandupdate="goUpdatePlacesCommands();">
  42. <command id="placesCmd_open"
  43. oncommand="goDoPlacesCommand('placesCmd_open');"/>
  44. <command id="placesCmd_open:window"
  45. oncommand="goDoPlacesCommand('placesCmd_open:window');"/>
  46. <command id="placesCmd_open:privatewindow"
  47. oncommand="goDoPlacesCommand('placesCmd_open:privatewindow');"/>
  48. <command id="placesCmd_open:tab"
  49. oncommand="goDoPlacesCommand('placesCmd_open:tab');"/>
  50. <command id="placesCmd_new:bookmark"
  51. oncommand="goDoPlacesCommand('placesCmd_new:bookmark');"/>
  52. <command id="placesCmd_new:livemark"
  53. oncommand="goDoPlacesCommand('placesCmd_new:livemark');"/>
  54. <command id="placesCmd_new:folder"
  55. oncommand="goDoPlacesCommand('placesCmd_new:folder');"/>
  56. <command id="placesCmd_new:separator"
  57. oncommand="goDoPlacesCommand('placesCmd_new:separator');"/>
  58. <command id="placesCmd_show:info"
  59. oncommand="goDoPlacesCommand('placesCmd_show:info');"/>
  60. <command id="placesCmd_rename"
  61. oncommand="goDoPlacesCommand('placesCmd_show:info');"
  62. observes="placesCmd_show:info"/>
  63. <command id="placesCmd_reload"
  64. oncommand="goDoPlacesCommand('placesCmd_reload');"/>
  65. <command id="placesCmd_sortBy:name"
  66. oncommand="goDoPlacesCommand('placesCmd_sortBy:name');"/>
  67. <command id="placesCmd_moveBookmarks"
  68. oncommand="goDoPlacesCommand('placesCmd_moveBookmarks');"/>
  69. <command id="placesCmd_deleteDataHost"
  70. oncommand="goDoPlacesCommand('placesCmd_deleteDataHost');"/>
  71. <command id="placesCmd_createBookmark"
  72. oncommand="goDoPlacesCommand('placesCmd_createBookmark');"/>
  73. <command id="placesCmd_openParentFolder"
  74. oncommand="goDoPlacesCommand('placesCmd_openParentFolder');"/>
  75. <!-- Special versions of cut/copy/paste/delete which check for an open context menu. -->
  76. <command id="placesCmd_cut"
  77. oncommand="goDoPlacesCommand('placesCmd_cut');"/>
  78. <command id="placesCmd_copy"
  79. oncommand="goDoPlacesCommand('placesCmd_copy');"/>
  80. <command id="placesCmd_paste"
  81. oncommand="goDoPlacesCommand('placesCmd_paste');"/>
  82. <command id="placesCmd_delete"
  83. oncommand="goDoPlacesCommand('placesCmd_delete');"/>
  84. </commandset>
  85. <keyset id="placesCommandKeys">
  86. <key id="key_placesCmd_openParentFolder"
  87. keycode="VK_F1"
  88. command="placesCmd_openParentFolder"
  89. modifiers="accel,shift"/>
  90. </keyset>
  91. <menupopup id="placesContext"
  92. onpopupshowing="this._view = PlacesUIUtils.getViewForNode(document.popupNode);
  93. return this._view.buildContextMenu(this);"
  94. onpopuphiding="this._view.destroyContextMenu();">
  95. <menuitem id="placesContext_open"
  96. command="placesCmd_open"
  97. label="&cmd.open.label;"
  98. accesskey="&cmd.open.accesskey;"
  99. default="true"
  100. selectiontype="single"
  101. selection="link"/>
  102. <menuitem id="placesContext_open:newtab"
  103. command="placesCmd_open:tab"
  104. label="&cmd.open_tab.label;"
  105. accesskey="&cmd.open_tab.accesskey;"
  106. selectiontype="single"
  107. selection="link"/>
  108. <menuitem id="placesContext_openContainer:tabs"
  109. oncommand="var view = PlacesUIUtils.getViewForNode(document.popupNode);
  110. view.controller.openSelectionInTabs(event);"
  111. onclick="checkForMiddleClick(this, event);"
  112. label="&cmd.open_all_in_tabs.label;"
  113. accesskey="&cmd.open_all_in_tabs.accesskey;"
  114. selectiontype="single"
  115. selection="folder|host|query"/>
  116. <menuitem id="placesContext_openLinks:tabs"
  117. oncommand="var view = PlacesUIUtils.getViewForNode(document.popupNode);
  118. view.controller.openSelectionInTabs(event);"
  119. onclick="checkForMiddleClick(this, event);"
  120. label="&cmd.open_all_in_tabs.label;"
  121. accesskey="&cmd.open_all_in_tabs.accesskey;"
  122. selectiontype="multiple"
  123. selection="link"/>
  124. <menuitem id="placesContext_open:newwindow"
  125. command="placesCmd_open:window"
  126. label="&cmd.open_window.label;"
  127. accesskey="&cmd.open_window.accesskey;"
  128. selectiontype="single"
  129. selection="link"/>
  130. <menuitem id="placesContext_open:newprivatewindow"
  131. command="placesCmd_open:privatewindow"
  132. label="&cmd.open_private_window.label;"
  133. accesskey="&cmd.open_private_window.accesskey;"
  134. selectiontype="single"
  135. selection="link"
  136. hideifprivatebrowsing="true"/>
  137. <menuseparator id="placesContext_openSeparator"/>
  138. <menuitem id="placesContext_new:bookmark"
  139. command="placesCmd_new:bookmark"
  140. label="&cmd.new_bookmark.label;"
  141. accesskey="&cmd.new_bookmark.accesskey;"
  142. selectiontype="any"
  143. hideifnoinsertionpoint="true"/>
  144. <menuitem id="placesContext_new:folder"
  145. command="placesCmd_new:folder"
  146. label="&cmd.new_folder.label;"
  147. accesskey="&cmd.context_new_folder.accesskey;"
  148. selectiontype="any"
  149. hideifnoinsertionpoint="true"/>
  150. <menuitem id="placesContext_new:separator"
  151. command="placesCmd_new:separator"
  152. label="&cmd.new_separator.label;"
  153. accesskey="&cmd.new_separator.accesskey;"
  154. closemenu="single"
  155. selectiontype="any"
  156. hideifnoinsertionpoint="true"/>
  157. <menuseparator id="placesContext_newSeparator"/>
  158. <menuitem id="placesContext_createBookmark"
  159. command="placesCmd_createBookmark"
  160. label="&cmd.bookmarkLink.label;"
  161. accesskey="&cmd.bookmarkLink.accesskey;"
  162. selection="link"
  163. forcehideselection="bookmark|tagChild"/>
  164. <menuitem id="placesContext_cut"
  165. command="placesCmd_cut"
  166. label="&cutCmd.label;"
  167. accesskey="&cutCmd.accesskey;"
  168. closemenu="single"
  169. selection="bookmark|folder|separator|query"
  170. forcehideselection="tagChild|livemarkChild"/>
  171. <menuitem id="placesContext_copy"
  172. command="placesCmd_copy"
  173. label="&copyCmd.label;"
  174. closemenu="single"
  175. accesskey="&copyCmd.accesskey;"/>
  176. <menuitem id="placesContext_paste"
  177. command="placesCmd_paste"
  178. label="&pasteCmd.label;"
  179. closemenu="single"
  180. accesskey="&pasteCmd.accesskey;"
  181. selectiontype="any"
  182. hideifnoinsertionpoint="true"/>
  183. <menuseparator id="placesContext_editSeparator"/>
  184. <menuitem id="placesContext_delete"
  185. command="placesCmd_delete"
  186. label="&deleteCmd.label;"
  187. accesskey="&deleteCmd.accesskey;"
  188. closemenu="single"
  189. selection="bookmark|tagChild|folder|query|dynamiccontainer|separator|host"/>
  190. <menuitem id="placesContext_delete_history"
  191. command="placesCmd_delete"
  192. label="&cmd.delete.label;"
  193. accesskey="&cmd.delete.accesskey;"
  194. closemenu="single"
  195. selection="link"
  196. forcehideselection="bookmark|livemarkChild"/>
  197. <menuitem id="placesContext_deleteHost"
  198. command="placesCmd_deleteDataHost"
  199. label="&cmd.deleteDomainData.label;"
  200. accesskey="&cmd.deleteDomainData.accesskey;"
  201. closemenu="single"
  202. selection="link|host"
  203. selectiontype="single"
  204. hideifprivatebrowsing="true"
  205. forcehideselection="bookmark|livemarkChild"/>
  206. <menuseparator id="placesContext_deleteSeparator"/>
  207. <menuitem id="placesContext_reload"
  208. command="placesCmd_reload"
  209. label="&cmd.reloadLivebookmark.label;"
  210. accesskey="&cmd.reloadLivebookmark.accesskey;"
  211. closemenu="single"
  212. selection="livemark/feedURI"/>
  213. <menuitem id="placesContext_sortBy:name"
  214. command="placesCmd_sortBy:name"
  215. label="&cmd.sortby_name.label;"
  216. accesskey="&cmd.context_sortby_name.accesskey;"
  217. closemenu="single"
  218. selection="folder"/>
  219. <menuseparator id="placesContext_sortSeparator"/>
  220. <menuitem id="placesContext_openParentFolder"
  221. command="placesCmd_openParentFolder"
  222. label="&cmd.openParentFolder.label;"
  223. key="key_placesCmd_openParentFolder"
  224. accesskey="&cmd.openParentFolder.accesskey;"
  225. selectiontype="single"
  226. selection="bookmark"
  227. forcehideselection="livemarkChild|livemark/feedURI|PlacesOrganizer/OrganizerQuery"/>
  228. <menuseparator id="placesContext_parentFolderSeparator"/>
  229. <menuitem id="placesContext_show:info"
  230. command="placesCmd_show:info"
  231. label="&cmd.properties.label;"
  232. accesskey="&cmd.properties.accesskey;"
  233. selection="bookmark|folder|query"
  234. forcehideselection="livemarkChild"/>
  235. </menupopup>
  236. </overlay>