Loading browser/devtools/scratchpad/scratchpad.xul +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ <script type="application/javascript"> function goUpdateSourceEditorMenuItems() { goUpdateGlobalEditMenuItems(); let commands = ['cmd_undo', 'cmd_redo', 'cmd_cut', 'cmd_paste', 'cmd_delete', 'cmd_findAgain']; let commands = ['cmd_undo', 'cmd_redo', 'cmd_delete', 'cmd_findAgain']; commands.forEach(goUpdateCommand); } </script> Loading browser/devtools/sourceeditor/editor.js +4 −17 Original line number Diff line number Diff line Loading @@ -185,8 +185,7 @@ Editor.prototype = { appendTo: function (el) { let def = promise.defer(); let cm = editors.get(this); let doc = el.ownerDocument; let env = doc.createElement("iframe"); let env = el.ownerDocument.createElement("iframe"); env.flex = 1; if (cm) Loading Loading @@ -223,7 +222,7 @@ Editor.prototype = { cm = win.CodeMirror(win.document.body, this.config); cm.getWrapperElement().addEventListener("contextmenu", (ev) => { ev.preventDefault(); this.showContextMenu(doc, ev.screenX, ev.screenY); this.showContextMenu(el.ownerDocument, ev.screenX, ev.screenY); }, false); cm.on("focus", () => this.emit("focus")); Loading @@ -235,7 +234,7 @@ Editor.prototype = { return L10N.GetStringFromName(name); }); doc.defaultView.controllers.insertControllerAt(0, controller(this, doc.defaultView)); cm.getInputField().controllers.insertControllerAt(0, controller(this)); this.container = env; editors.set(this, cm); Loading Loading @@ -703,7 +702,7 @@ function getCSSKeywords() { * editor-specific commands such as find, jump to line, * copy/paste, etc. */ function controller(ed, view) { function controller(ed) { return { supportsCommand: function (cmd) { switch (cmd) { Loading @@ -713,8 +712,6 @@ function controller(ed, view) { case "cmd_gotoLine": case "cmd_undo": case "cmd_redo": case "cmd_cut": case "cmd_paste": case "cmd_delete": case "cmd_selectAll": return true; Loading @@ -737,12 +734,8 @@ function controller(ed, view) { return ed.canUndo(); case "cmd_redo": return ed.canRedo(); case "cmd_cut": return cm.getOption("readOnly") !== true && ed.somethingSelected(); case "cmd_delete": return ed.somethingSelected(); case "cmd_paste": return cm.getOption("readOnly") !== true; } return false; Loading @@ -762,12 +755,6 @@ function controller(ed, view) { if (map[cmd]) return void cm.execCommand(map[cmd]); if (cmd === "cmd_cut") return void view.goDoCommand("cmd_cut"); if (cmd === "cmdste") return void view.goDoCommand("cmd_paste"); if (cmd == "cmd_gotoLine") ed.jumpToLine(cm); }, Loading Loading
browser/devtools/scratchpad/scratchpad.xul +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ <script type="application/javascript"> function goUpdateSourceEditorMenuItems() { goUpdateGlobalEditMenuItems(); let commands = ['cmd_undo', 'cmd_redo', 'cmd_cut', 'cmd_paste', 'cmd_delete', 'cmd_findAgain']; let commands = ['cmd_undo', 'cmd_redo', 'cmd_delete', 'cmd_findAgain']; commands.forEach(goUpdateCommand); } </script> Loading
browser/devtools/sourceeditor/editor.js +4 −17 Original line number Diff line number Diff line Loading @@ -185,8 +185,7 @@ Editor.prototype = { appendTo: function (el) { let def = promise.defer(); let cm = editors.get(this); let doc = el.ownerDocument; let env = doc.createElement("iframe"); let env = el.ownerDocument.createElement("iframe"); env.flex = 1; if (cm) Loading Loading @@ -223,7 +222,7 @@ Editor.prototype = { cm = win.CodeMirror(win.document.body, this.config); cm.getWrapperElement().addEventListener("contextmenu", (ev) => { ev.preventDefault(); this.showContextMenu(doc, ev.screenX, ev.screenY); this.showContextMenu(el.ownerDocument, ev.screenX, ev.screenY); }, false); cm.on("focus", () => this.emit("focus")); Loading @@ -235,7 +234,7 @@ Editor.prototype = { return L10N.GetStringFromName(name); }); doc.defaultView.controllers.insertControllerAt(0, controller(this, doc.defaultView)); cm.getInputField().controllers.insertControllerAt(0, controller(this)); this.container = env; editors.set(this, cm); Loading Loading @@ -703,7 +702,7 @@ function getCSSKeywords() { * editor-specific commands such as find, jump to line, * copy/paste, etc. */ function controller(ed, view) { function controller(ed) { return { supportsCommand: function (cmd) { switch (cmd) { Loading @@ -713,8 +712,6 @@ function controller(ed, view) { case "cmd_gotoLine": case "cmd_undo": case "cmd_redo": case "cmd_cut": case "cmd_paste": case "cmd_delete": case "cmd_selectAll": return true; Loading @@ -737,12 +734,8 @@ function controller(ed, view) { return ed.canUndo(); case "cmd_redo": return ed.canRedo(); case "cmd_cut": return cm.getOption("readOnly") !== true && ed.somethingSelected(); case "cmd_delete": return ed.somethingSelected(); case "cmd_paste": return cm.getOption("readOnly") !== true; } return false; Loading @@ -762,12 +755,6 @@ function controller(ed, view) { if (map[cmd]) return void cm.execCommand(map[cmd]); if (cmd === "cmd_cut") return void view.goDoCommand("cmd_cut"); if (cmd === "cmdste") return void view.goDoCommand("cmd_paste"); if (cmd == "cmd_gotoLine") ed.jumpToLine(cm); }, Loading