Web Inspector: Better keyboard shortcut to focus on the console prompt
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Aug 2015 18:47:45 +0000 (18:47 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Aug 2015 18:47:45 +0000 (18:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=147927

Reviewed by Brian Burg.

* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):
(WebInspector._focusConsolePrompt):
Added a Control-Tilde keyboard shortcut to focus the console prompt.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188586 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Main.js

index 7b56068..d668e0b 100644 (file)
@@ -1,3 +1,15 @@
+2015-08-18  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: Better keyboard shortcut to focus on the console prompt
+        https://bugs.webkit.org/show_bug.cgi?id=147927
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Base/Main.js:
+        (WebInspector.contentLoaded):
+        (WebInspector._focusConsolePrompt):
+        Added a Control-Tilde keyboard shortcut to focus the console prompt.
+
 2015-08-18  Nikita Vasilyev  <nvasilyev@apple.com>
 
         Web Inspector: Option-Enter should commit console command without erasing the prompt
index f4a6ea9..48b8861 100644 (file)
@@ -244,7 +244,8 @@ WebInspector.contentLoaded = function()
     this._reloadPageKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "R", this._reloadPage.bind(this));
     this._reloadPageIgnoringCacheKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, "R", this._reloadPageIgnoringCache.bind(this));
 
-    this._consoleKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Option | WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "C", this._showConsoleTab.bind(this));
+    this._consoleTabKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Option | WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "C", this._showConsoleTab.bind(this));
+    this._quickConsoleKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control, WebInspector.KeyboardShortcut.Key.Apostrophe, this._focusConsolePrompt.bind(this));
 
     this._inspectModeKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, "C", this._toggleInspectMode.bind(this));
 
@@ -1617,6 +1618,11 @@ WebInspector._showConsoleTab = function(event)
     this.showConsoleTab();
 };
 
+WebInspector._focusConsolePrompt = function(event)
+{
+    this.quickConsole.prompt.focus();
+};
+
 WebInspector._focusedContentView = function()
 {
     if (this.tabBrowser.element.isSelfOrAncestor(this.currentFocusElement)) {