places-commands.js (1334B)
1 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- 2 * This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 document 7 .getElementById("placesCommands") 8 .addEventListener("commandupdate", () => { 9 PlacesUIUtils.updateCommands(window); 10 }); 11 12 document.getElementById("placesCommands").addEventListener("command", event => { 13 const cmd = event.target.id; 14 switch (cmd) { 15 case "Browser:ShowAllBookmarks": 16 PlacesCommandHook.showPlacesOrganizer("UnfiledBookmarks"); 17 break; 18 case "Browser:ShowAllHistory": 19 PlacesCommandHook.showPlacesOrganizer("History"); 20 break; 21 22 case "placesCmd_open": 23 case "placesCmd_open:window": 24 case "placesCmd_open:privatewindow": 25 case "placesCmd_open:tab": 26 case "placesCmd_new:bookmark": 27 case "placesCmd_new:folder": 28 case "placesCmd_new:separator": 29 case "placesCmd_show:info": 30 case "placesCmd_sortBy:name": 31 case "placesCmd_deleteDataHost": 32 case "placesCmd_createBookmark": 33 case "placesCmd_cut": 34 case "placesCmd_copy": 35 case "placesCmd_paste": 36 case "placesCmd_delete": 37 case "placesCmd_showInFolder": 38 PlacesUIUtils.doCommand(window, cmd); 39 break; 40 } 41 });