Title: [131166] trunk/Source/WebCore
Revision
131166
Author
[email protected]
Date
2012-10-12 02:54:48 -0700 (Fri, 12 Oct 2012)

Log Message

Web Inspector: Add "goto tab 1,2,3" hotkeys
https://bugs.webkit.org/show_bug.cgi?id=99157

Reviewed by Alexander Pavlov.

Ctrl/Cmd + digit shortcuts should select corresponding tabs

* inspector/front-end/InspectorView.js:
(WebInspector.InspectorView.prototype._keyDown):
(WebInspector.InspectorView.prototype._keyDownInternal):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (131165 => 131166)


--- trunk/Source/WebCore/ChangeLog	2012-10-12 09:38:43 UTC (rev 131165)
+++ trunk/Source/WebCore/ChangeLog	2012-10-12 09:54:48 UTC (rev 131166)
@@ -1,3 +1,16 @@
+2012-10-12  Pavel Feldman  <[email protected]>
+
+        Web Inspector: Add "goto tab 1,2,3" hotkeys
+        https://bugs.webkit.org/show_bug.cgi?id=99157
+
+        Reviewed by Alexander Pavlov.
+
+        Ctrl/Cmd + digit shortcuts should select corresponding tabs
+
+        * inspector/front-end/InspectorView.js:
+        (WebInspector.InspectorView.prototype._keyDown):
+        (WebInspector.InspectorView.prototype._keyDownInternal):
+
 2012-10-12  Vsevolod Vlasov  <[email protected]>
 
         Web Inspector: Extract domain specific editing handling logic from UISourceCode descendants (step 1).

Modified: trunk/Source/WebCore/inspector/front-end/InspectorView.js (131165 => 131166)


--- trunk/Source/WebCore/inspector/front-end/InspectorView.js	2012-10-12 09:38:43 UTC (rev 131165)
+++ trunk/Source/WebCore/inspector/front-end/InspectorView.js	2012-10-12 09:54:48 UTC (rev 131166)
@@ -132,10 +132,23 @@
 
     _keyDown: function(event)
     {
+        if (!WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event))
+            return;
+
+        // Ctrl/Cmd + 1-9 should show corresponding panel.
+        if (!event.shiftKey && !event.altKey && event.keyCode > 0x30 && event.keyCode < 0x3A) {
+            var panelName = this._panelOrder[event.keyCode - 0x31];
+            if (panelName) {
+                this.showPanel(panelName);
+                event.consume(true);
+            }
+            return;
+        }
+
         // BUG85312: On French AZERTY keyboards, AltGr-]/[ combinations (synonymous to Ctrl-Alt-]/[ on Windows) are used to enter ]/[,
         // so for a ]/[-related keydown we delay the panel switch using a timer, to see if there is a keypress event following this one.
         // If there is, we cancel the timer and do not consider this a panel switch.
-        if (!WebInspector.isWin() || (!this._openBracketIdentifiers.hasOwnProperty(event.keyIdentifier) && !this._closeBracketIdentifiers.hasOwnProperty(event.keyIdentifier))) {
+        if (!WebInspector.isWin() || (!this._openBracketIdentifiers[event.keyIdentifier] && !this._closeBracketIdentifiers[event.keyIdentifier])) {
             this._keyDownInternal(event);
             return;
         }
@@ -145,8 +158,8 @@
 
     _keyDownInternal: function(event)
     {
-        if (this._openBracketIdentifiers.hasOwnProperty(event.keyIdentifier)) {
-            var isRotateLeft = WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && !event.shiftKey && !event.altKey;
+        if (this._openBracketIdentifiers[event.keyIdentifier]) {
+            var isRotateLeft = !event.shiftKey && !event.altKey;
             if (isRotateLeft) {
                 var index = this._panelOrder.indexOf(this.currentPanel().name);
                 index = (index === 0) ? this._panelOrder.length - 1 : index - 1;
@@ -155,7 +168,7 @@
                 return;
             }
 
-            var isGoBack = WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && event.altKey;
+            var isGoBack = event.altKey;
             if (isGoBack && this._canGoBackInHistory()) {
                 this._goBackInHistory();
                 event.consume(true);
@@ -163,8 +176,8 @@
             return;
         }
 
-        if (this._closeBracketIdentifiers.hasOwnProperty(event.keyIdentifier)) {
-            var isRotateRight = WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && !event.shiftKey && !event.altKey;
+        if (this._closeBracketIdentifiers[event.keyIdentifier]) {
+            var isRotateRight = !event.shiftKey && !event.altKey;
             if (isRotateRight) {
                 var index = this._panelOrder.indexOf(this.currentPanel().name);
                 index = (index + 1) % this._panelOrder.length;
@@ -173,7 +186,7 @@
                 return;
             }
 
-            var isGoForward = WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && event.altKey;
+            var isGoForward = event.altKey;
             if (isGoForward && this._canGoForwardInHistory()) {
                 this._goForwardInHistory();
                 event.consume(true);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to