Title: [112539] trunk/Source/WebCore
Revision
112539
Author
[email protected]
Date
2012-03-29 09:22:13 -0700 (Thu, 29 Mar 2012)

Log Message

Web Inspector: "go to the previous panel" shortcut is painful to maintain
https://bugs.webkit.org/show_bug.cgi?id=82602

Reviewed by Vsevolod Vlasov.

Present go to previous panel shortcut "Cmd - Left" is painful to support since we have
more and more free flow editing capabilities (where Cmd - Left is handled by the editor).
Remaping it to Cmd - Option - [ (]) /  (Ctrl - Alt - [ (]) ).

Drive-by: de-capitalize captions from the settings panel.

* English.lproj/localizedStrings.js:
* inspector/front-end/ConsoleView.js:
(WebInspector.ConsoleView.prototype._registerShortcuts):
* inspector/front-end/InspectorView.js:
(WebInspector.InspectorView.prototype._keyDown):
* inspector/front-end/ScriptsPanel.js:
* inspector/front-end/TimelinePanel.js:
(WebInspector.TimelinePanel.prototype._registerShortcuts):
(WebInspector.TimelinePanel.prototype._contextMenu):
* inspector/front-end/inspector.js:
(WebInspector._registerShortcuts):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (112538 => 112539)


--- trunk/Source/WebCore/ChangeLog	2012-03-29 16:19:08 UTC (rev 112538)
+++ trunk/Source/WebCore/ChangeLog	2012-03-29 16:22:13 UTC (rev 112539)
@@ -1,3 +1,28 @@
+2012-03-29  Pavel Feldman  <[email protected]>
+
+        Web Inspector: "go to the previous panel" shortcut is painful to maintain
+        https://bugs.webkit.org/show_bug.cgi?id=82602
+
+        Reviewed by Vsevolod Vlasov.
+
+        Present go to previous panel shortcut "Cmd - Left" is painful to support since we have
+        more and more free flow editing capabilities (where Cmd - Left is handled by the editor).
+        Remaping it to Cmd - Option - [ (]) /  (Ctrl - Alt - [ (]) ).
+
+        Drive-by: de-capitalize captions from the settings panel.
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView.prototype._registerShortcuts):
+        * inspector/front-end/InspectorView.js:
+        (WebInspector.InspectorView.prototype._keyDown):
+        * inspector/front-end/ScriptsPanel.js:
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel.prototype._registerShortcuts):
+        (WebInspector.TimelinePanel.prototype._contextMenu):
+        * inspector/front-end/inspector.js:
+        (WebInspector._registerShortcuts):
+
 2012-03-29  Andrey Kosyakov  <[email protected]>
 
         Unreviewed, rolling out r112531.

Modified: trunk/Source/WebCore/English.lproj/localizedStrings.js


(Binary files differ)

Modified: trunk/Source/WebCore/inspector/front-end/ConsoleView.js (112538 => 112539)


--- trunk/Source/WebCore/inspector/front-end/ConsoleView.js	2012-03-29 16:19:08 UTC (rev 112538)
+++ trunk/Source/WebCore/inspector/front-end/ConsoleView.js	2012-03-29 16:22:13 UTC (rev 112539)
@@ -539,7 +539,7 @@
 
         var section = WebInspector.shortcutsScreen.section(WebInspector.UIString("Console"));
         var keys = WebInspector.isMac() ? [ shortcutK.name, shortcutL.name ] : [ shortcutL.name ];
-        section.addAlternateKeys(keys, WebInspector.UIString("Clear Console"));
+        section.addAlternateKeys(keys, WebInspector.UIString("Clear console"));
 
         keys = [
             shortcut.shortcutToString(shortcut.Keys.Tab),

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


--- trunk/Source/WebCore/inspector/front-end/InspectorView.js	2012-03-29 16:19:08 UTC (rev 112538)
+++ trunk/Source/WebCore/inspector/front-end/InspectorView.js	2012-03-29 16:22:13 UTC (rev 112539)
@@ -88,22 +88,6 @@
     _keyDown: function(event)
     {
         switch (event.keyIdentifier) {
-            case "Left":
-                var isBackKey = !event.shiftKey && WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && !WebInspector.isBeingEdited(event.target);
-                if (isBackKey && this._canGoBackInHistory()) {
-                    this._goBackInHistory();
-                    event.preventDefault();
-                }
-                break;
-
-            case "Right":
-                var isForwardKey = !event.shiftKey && WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && !WebInspector.isBeingEdited(event.target);
-                if (isForwardKey && this._canGoForwardInHistory()) {
-                    this._goForwardInHistory();
-                    event.preventDefault();
-                }
-                break;
-
             // Windows and Mac have two different definitions of [, so accept both.
             case "U+005B":
             case "U+00DB": // [ key
@@ -112,8 +96,15 @@
                     var index = this._panelOrder.indexOf(this.currentPanel());
                     index = (index === 0) ? this._panelOrder.length - 1 : index - 1;
                     this._panelOrder[index].toolbarItem.click();
-                    event.preventDefault();
+                    event.consume();
+                    return;
                 }
+
+                var isGoBack = WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && event.altKey;
+                if (isGoBack && this._canGoBackInHistory()) {
+                    this._goBackInHistory();
+                    event.consume();
+                }
                 break;
 
             // Windows and Mac have two different definitions of ], so accept both.
@@ -124,9 +115,15 @@
                     var index = this._panelOrder.indexOf(this.currentPanel());
                     index = (index + 1) % this._panelOrder.length;
                     this._panelOrder[index].toolbarItem.click();
-                    event.preventDefault();
+                    event.consume();
+                    return;
                 }
-    
+
+                var isGoForward = WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && event.altKey;
+                if (isGoForward && this._canGoForwardInHistory()) {
+                    this._goForwardInHistory();
+                    event.consume();
+                }
                 break;
         }
     },

Modified: trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js (112538 => 112539)


--- trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2012-03-29 16:19:08 UTC (rev 112538)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2012-03-29 16:22:13 UTC (rev 112539)
@@ -138,10 +138,10 @@
     this.registerShortcut(evaluateInConsoleShortcut.key, this._evaluateSelectionInConsole.bind(this));
 
     var openResourceShortcut = WebInspector.OpenResourceDialog.createShortcut();
-    helpSection.addKey(openResourceShortcut.name, WebInspector.UIString("Open Script"));
+    helpSection.addKey(openResourceShortcut.name, WebInspector.UIString("Open script"));
 
     var scriptOutlineShortcut = WebInspector._javascript_OutlineDialog.createShortcut();
-    helpSection.addKey(scriptOutlineShortcut.name, WebInspector.UIString("Go to Function"));
+    helpSection.addKey(scriptOutlineShortcut.name, WebInspector.UIString("Go to function"));
 
     var panelEnablerHeading = WebInspector.UIString("You need to enable debugging before you can use the Scripts panel.");
     var panelEnablerDisclaimer = WebInspector.UIString("Enabling debugging will make scripts run slower.");

Modified: trunk/Source/WebCore/inspector/front-end/TimelinePanel.js (112538 => 112539)


--- trunk/Source/WebCore/inspector/front-end/TimelinePanel.js	2012-03-29 16:19:08 UTC (rev 112538)
+++ trunk/Source/WebCore/inspector/front-end/TimelinePanel.js	2012-03-29 16:22:13 UTC (rev 112539)
@@ -271,11 +271,11 @@
 
         if (InspectorFrontendHost.canSaveAs()) {
             this._shortcuts[shortcut.makeKey("s", modifiers.CtrlOrMeta)] = this._saveToFile.bind(this);
-            section.addKey(shortcut.shortcutToString("s", modifiers.CtrlOrMeta), WebInspector.UIString("Save Timeline data\u2026"));
+            section.addKey(shortcut.shortcutToString("s", modifiers.CtrlOrMeta), WebInspector.UIString("Save timeline data"));
         }
 
         this._shortcuts[shortcut.makeKey("o", modifiers.CtrlOrMeta)] = this._fileSelectorElement.click.bind(this._fileSelectorElement);
-        section.addKey(shortcut.shortcutToString("o", modifiers.CtrlOrMeta), WebInspector.UIString("Load Timeline data\u2026"));
+        section.addKey(shortcut.shortcutToString("o", modifiers.CtrlOrMeta), WebInspector.UIString("Load timeline data"));
     },
 
     _createFileSelector: function()
@@ -296,8 +296,8 @@
     {
         var contextMenu = new WebInspector.ContextMenu();
         if (InspectorFrontendHost.canSaveAs())
-            contextMenu.appendItem(WebInspector.UIString("&Save Timeline data\u2026"), this._saveToFile.bind(this));
-        contextMenu.appendItem(WebInspector.UIString("L&oad Timeline data\u2026"), this._fileSelectorElement.click.bind(this._fileSelectorElement));
+            contextMenu.appendItem(WebInspector.UIString("Save Timeline data\u2026"), this._saveToFile.bind(this));
+        contextMenu.appendItem(WebInspector.UIString("Load Timeline data\u2026"), this._fileSelectorElement.click.bind(this._fileSelectorElement));
         contextMenu.show(event);
     },
 

Modified: trunk/Source/WebCore/inspector/front-end/inspector.js (112538 => 112539)


--- trunk/Source/WebCore/inspector/front-end/inspector.js	2012-03-29 16:19:08 UTC (rev 112538)
+++ trunk/Source/WebCore/inspector/front-end/inspector.js	2012-03-29 16:22:13 UTC (rev 112539)
@@ -652,7 +652,14 @@
         shortcut.shortcutToString("]", shortcut.Modifiers.CtrlOrMeta),
         shortcut.shortcutToString("[", shortcut.Modifiers.CtrlOrMeta)
     ];
-    section.addRelatedKeys(keys, WebInspector.UIString("Next/previous panel"));
+    section.addRelatedKeys(keys, WebInspector.UIString("Go to the panel to the left/right"));
+
+    var keys = [
+        shortcut.shortcutToString("[", shortcut.Modifiers.CtrlOrMeta | shortcut.Modifiers.Alt),
+        shortcut.shortcutToString("]", shortcut.Modifiers.CtrlOrMeta | shortcut.Modifiers.Alt)
+    ];
+    section.addRelatedKeys(keys, WebInspector.UIString("Go back/forward in panel history"));
+
     section.addKey(shortcut.shortcutToString(shortcut.Keys.Esc), WebInspector.UIString("Toggle console"));
     section.addKey(shortcut.shortcutToString("f", shortcut.Modifiers.CtrlOrMeta), WebInspector.UIString("Search"));
     
@@ -668,7 +675,7 @@
     }
 
     var goToShortcut = WebInspector.GoToLineDialog.createShortcut();
-    section.addKey(goToShortcut.name, WebInspector.UIString("Go to Line"));
+    section.addKey(goToShortcut.name, WebInspector.UIString("Go to line"));
 }
 
 WebInspector.documentKeyDown = function(event)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to