Changeset 112539 in webkit


Ignore:
Timestamp:
Mar 29, 2012 9:22:13 AM (12 years ago)
Author:
pfeldman@chromium.org
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):

Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112538 r112539  
     12012-03-29  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Web Inspector: "go to the previous panel" shortcut is painful to maintain
     4        https://bugs.webkit.org/show_bug.cgi?id=82602
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        Present go to previous panel shortcut "Cmd - Left" is painful to support since we have
     9        more and more free flow editing capabilities (where Cmd - Left is handled by the editor).
     10        Remaping it to Cmd - Option - [ (]) /  (Ctrl - Alt - [ (]) ).
     11
     12        Drive-by: de-capitalize captions from the settings panel.
     13
     14        * English.lproj/localizedStrings.js:
     15        * inspector/front-end/ConsoleView.js:
     16        (WebInspector.ConsoleView.prototype._registerShortcuts):
     17        * inspector/front-end/InspectorView.js:
     18        (WebInspector.InspectorView.prototype._keyDown):
     19        * inspector/front-end/ScriptsPanel.js:
     20        * inspector/front-end/TimelinePanel.js:
     21        (WebInspector.TimelinePanel.prototype._registerShortcuts):
     22        (WebInspector.TimelinePanel.prototype._contextMenu):
     23        * inspector/front-end/inspector.js:
     24        (WebInspector._registerShortcuts):
     25
    1262012-03-29  Andrey Kosyakov  <caseq@chromium.org>
    227
  • trunk/Source/WebCore/inspector/front-end/ConsoleView.js

    r111551 r112539  
    540540        var section = WebInspector.shortcutsScreen.section(WebInspector.UIString("Console"));
    541541        var keys = WebInspector.isMac() ? [ shortcutK.name, shortcutL.name ] : [ shortcutL.name ];
    542         section.addAlternateKeys(keys, WebInspector.UIString("Clear Console"));
     542        section.addAlternateKeys(keys, WebInspector.UIString("Clear console"));
    543543
    544544        keys = [
  • trunk/Source/WebCore/inspector/front-end/InspectorView.js

    r111551 r112539  
    8989    {
    9090        switch (event.keyIdentifier) {
    91             case "Left":
    92                 var isBackKey = !event.shiftKey && WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && !WebInspector.isBeingEdited(event.target);
    93                 if (isBackKey && this._canGoBackInHistory()) {
    94                     this._goBackInHistory();
    95                     event.preventDefault();
    96                 }
    97                 break;
    98 
    99             case "Right":
    100                 var isForwardKey = !event.shiftKey && WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && !WebInspector.isBeingEdited(event.target);
    101                 if (isForwardKey && this._canGoForwardInHistory()) {
    102                     this._goForwardInHistory();
    103                     event.preventDefault();
    104                 }
    105                 break;
    106 
    10791            // Windows and Mac have two different definitions of [, so accept both.
    10892            case "U+005B":
     
    11397                    index = (index === 0) ? this._panelOrder.length - 1 : index - 1;
    11498                    this._panelOrder[index].toolbarItem.click();
    115                     event.preventDefault();
     99                    event.consume();
     100                    return;
     101                }
     102
     103                var isGoBack = WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && event.altKey;
     104                if (isGoBack && this._canGoBackInHistory()) {
     105                    this._goBackInHistory();
     106                    event.consume();
    116107                }
    117108                break;
     
    125116                    index = (index + 1) % this._panelOrder.length;
    126117                    this._panelOrder[index].toolbarItem.click();
    127                     event.preventDefault();
     118                    event.consume();
     119                    return;
    128120                }
    129    
     121
     122                var isGoForward = WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && event.altKey;
     123                if (isGoForward && this._canGoForwardInHistory()) {
     124                    this._goForwardInHistory();
     125                    event.consume();
     126                }
    130127                break;
    131128        }
  • trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js

    r112533 r112539  
    139139
    140140    var openResourceShortcut = WebInspector.OpenResourceDialog.createShortcut();
    141     helpSection.addKey(openResourceShortcut.name, WebInspector.UIString("Open Script"));
     141    helpSection.addKey(openResourceShortcut.name, WebInspector.UIString("Open script"));
    142142
    143143    var scriptOutlineShortcut = WebInspector.JavaScriptOutlineDialog.createShortcut();
    144     helpSection.addKey(scriptOutlineShortcut.name, WebInspector.UIString("Go to Function"));
     144    helpSection.addKey(scriptOutlineShortcut.name, WebInspector.UIString("Go to function"));
    145145
    146146    var panelEnablerHeading = WebInspector.UIString("You need to enable debugging before you can use the Scripts panel.");
  • trunk/Source/WebCore/inspector/front-end/TimelinePanel.js

    r112409 r112539  
    272272        if (InspectorFrontendHost.canSaveAs()) {
    273273            this._shortcuts[shortcut.makeKey("s", modifiers.CtrlOrMeta)] = this._saveToFile.bind(this);
    274             section.addKey(shortcut.shortcutToString("s", modifiers.CtrlOrMeta), WebInspector.UIString("Save Timeline data\u2026"));
     274            section.addKey(shortcut.shortcutToString("s", modifiers.CtrlOrMeta), WebInspector.UIString("Save timeline data"));
    275275        }
    276276
    277277        this._shortcuts[shortcut.makeKey("o", modifiers.CtrlOrMeta)] = this._fileSelectorElement.click.bind(this._fileSelectorElement);
    278         section.addKey(shortcut.shortcutToString("o", modifiers.CtrlOrMeta), WebInspector.UIString("Load Timeline data\u2026"));
     278        section.addKey(shortcut.shortcutToString("o", modifiers.CtrlOrMeta), WebInspector.UIString("Load timeline data"));
    279279    },
    280280
     
    297297        var contextMenu = new WebInspector.ContextMenu();
    298298        if (InspectorFrontendHost.canSaveAs())
    299             contextMenu.appendItem(WebInspector.UIString("&Save Timeline data\u2026"), this._saveToFile.bind(this));
    300         contextMenu.appendItem(WebInspector.UIString("L&oad Timeline data\u2026"), this._fileSelectorElement.click.bind(this._fileSelectorElement));
     299            contextMenu.appendItem(WebInspector.UIString("Save Timeline data\u2026"), this._saveToFile.bind(this));
     300        contextMenu.appendItem(WebInspector.UIString("Load Timeline data\u2026"), this._fileSelectorElement.click.bind(this._fileSelectorElement));
    301301        contextMenu.show(event);
    302302    },
  • trunk/Source/WebCore/inspector/front-end/inspector.js

    r111551 r112539  
    653653        shortcut.shortcutToString("[", shortcut.Modifiers.CtrlOrMeta)
    654654    ];
    655     section.addRelatedKeys(keys, WebInspector.UIString("Next/previous panel"));
     655    section.addRelatedKeys(keys, WebInspector.UIString("Go to the panel to the left/right"));
     656
     657    var keys = [
     658        shortcut.shortcutToString("[", shortcut.Modifiers.CtrlOrMeta | shortcut.Modifiers.Alt),
     659        shortcut.shortcutToString("]", shortcut.Modifiers.CtrlOrMeta | shortcut.Modifiers.Alt)
     660    ];
     661    section.addRelatedKeys(keys, WebInspector.UIString("Go back/forward in panel history"));
     662
    656663    section.addKey(shortcut.shortcutToString(shortcut.Keys.Esc), WebInspector.UIString("Toggle console"));
    657664    section.addKey(shortcut.shortcutToString("f", shortcut.Modifiers.CtrlOrMeta), WebInspector.UIString("Search"));
     
    669676
    670677    var goToShortcut = WebInspector.GoToLineDialog.createShortcut();
    671     section.addKey(goToShortcut.name, WebInspector.UIString("Go to Line"));
     678    section.addKey(goToShortcut.name, WebInspector.UIString("Go to line"));
    672679}
    673680
Note: See TracChangeset for help on using the changeset viewer.