index.js (1101B)
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 5 "use strict"; 6 7 /* import-globals-from ../../../toolkit/content/globalOverlay.js */ 8 /* import-globals-from ../../../toolkit/content/editMenuOverlay.js */ 9 10 window.addEventListener("load", () => { 11 document 12 .getElementById("sourceEditorContextMenu") 13 .addEventListener("popupshowing", () => { 14 goUpdateGlobalEditMenuItems(); 15 16 [ 17 "cmd_undo", 18 "cmd_redo", 19 "cmd_cut", 20 "cmd_paste", 21 "cmd_delete", 22 "cmd_find", 23 "cmd_findAgain", 24 ].forEach(goUpdateCommand); 25 }); 26 27 document 28 .getElementById("sourceEditorCommands") 29 .addEventListener("command", event => { 30 // Restrict this to the <command> children of commandset#sourceEditorCommands. 31 switch (event.target.id) { 32 case "cmd_gotoLine": 33 case "cmd_find": 34 case "cmd_findAgain": 35 goDoCommand(event.target.id); 36 } 37 }); 38 });