Changeset 84484 in webkit
- Timestamp:
- Apr 21, 2011 5:05:16 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r84483 r84484 1 2011-04-21 Pavel Feldman <pfeldman@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: add support for Go To Line in Resources panel. 6 https://bugs.webkit.org/show_bug.cgi?id=59077 7 8 * inspector/front-end/CallStackSidebarPane.js: 9 (WebInspector.CallStackSidebarPane.prototype.registerShortcuts): 10 * inspector/front-end/GoToLineDialog.js: 11 (WebInspector.GoToLineDialog.show): 12 (WebInspector.GoToLineDialog.createShortcut): 13 (WebInspector.GoToLineDialog.prototype._onKeyDown): 14 * inspector/front-end/NetworkPanel.js: 15 (WebInspector.NetworkPanel.prototype.handleShortcut): 16 * inspector/front-end/Panel.js: 17 (WebInspector.Panel): 18 (WebInspector.Panel.prototype._restoreScrollPositions): 19 (WebInspector.Panel.prototype.handleShortcut): 20 (WebInspector.Panel.prototype.registerShortcuts): 21 (WebInspector.Panel.prototype._showGoToLineDialog): 22 * inspector/front-end/ProfilesPanel.js: 23 (WebInspector.ProfilesPanel.prototype.handleShortcut): 24 * inspector/front-end/ResourcesPanel.js: 25 (WebInspector.ResourcesPanel): 26 * inspector/front-end/ScriptsPanel.js: 27 (WebInspector.ScriptsPanel.prototype._registerShortcuts): 28 (WebInspector.ScriptsPanel.prototype.jumpToPreviousSearchResult): 29 * inspector/front-end/inspector.js: 30 (WebInspector._registerShortcuts): 31 (WebInspector.documentKeyDown): 32 1 33 2011-04-21 Pavel Feldman <pfeldman@google.com> 2 34 -
trunk/Source/WebCore/inspector/front-end/CallStackSidebarPane.js
r83864 r84484 84 84 }, 85 85 86 handleShortcut: function(event)87 {88 var shortcut = WebInspector.KeyboardShortcut.makeKeyFromEvent(event);89 var handler = this._shortcuts[shortcut];90 if (handler) {91 handler(event);92 event.handled = true;93 }94 },95 96 86 _selectNextCallFrameOnStack: function() 97 87 { … … 153 143 }, 154 144 155 registerShortcuts: function(section )145 registerShortcuts: function(section, shortcuts) 156 146 { 157 this._shortcuts = {};158 159 147 var nextCallFrame = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Period, 160 148 WebInspector.KeyboardShortcut.Modifiers.Ctrl); 161 this._shortcuts[nextCallFrame.key] = this._selectNextCallFrameOnStack.bind(this);149 shortcuts[nextCallFrame.key] = this._selectNextCallFrameOnStack.bind(this); 162 150 163 151 var prevCallFrame = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Comma, 164 152 WebInspector.KeyboardShortcut.Modifiers.Ctrl); 165 this._shortcuts[prevCallFrame.key] = this._selectPreviousCallFrameOnStack.bind(this);153 shortcuts[prevCallFrame.key] = this._selectPreviousCallFrameOnStack.bind(this); 166 154 167 155 section.addRelatedKeys([ nextCallFrame.name, prevCallFrame.name ], WebInspector.UIString("Next/previous call frame")); -
trunk/Source/WebCore/inspector/front-end/GoToLineDialog.js
r82943 r84484 72 72 WebInspector.GoToLineDialog.show = function(sourceView) 73 73 { 74 if (!sourceView || typeof sourceView.highlightLine !== "function") 75 return; 74 76 if (this._instance) 75 77 return; 76 78 this._instance = new WebInspector.GoToLineDialog(sourceView); 79 } 80 81 WebInspector.GoToLineDialog.createShortcut = function() 82 { 83 var isMac = WebInspector.isMac(); 84 var shortcut; 85 if (isMac) 86 return WebInspector.KeyboardShortcut.makeDescriptor("l", WebInspector.KeyboardShortcut.Modifiers.Meta); 87 return WebInspector.KeyboardShortcut.makeDescriptor("g", WebInspector.KeyboardShortcut.Modifiers.Ctrl); 77 88 } 78 89 … … 106 117 if (this._closeKeys.indexOf(event.keyCode) >= 0) { 107 118 this._hide(); 119 event.preventDefault(); 108 120 event.stopPropagation(); 109 121 } -
trunk/Source/WebCore/inspector/front-end/NetworkPanel.js
r84358 r84484 132 132 this._toggleGridMode(); 133 133 event.handled = true; 134 } 134 return; 135 } 136 137 WebInspector.Panel.prototype.handleShortcut.call(this, event); 135 138 }, 136 139 -
trunk/Source/WebCore/inspector/front-end/Panel.js
r82832 r84484 35 35 this._panelName = name; 36 36 37 this._shortcuts = {}; 38 37 39 WebInspector.settings.installApplicationSetting(this._sidebarWidthSettingName(), undefined); 38 40 } … … 419 421 container.scrollTop = container._scrollTop; 420 422 } 423 }, 424 425 handleShortcut: function(event) 426 { 427 var shortcutKey = WebInspector.KeyboardShortcut.makeKeyFromEvent(event); 428 var handler = this._shortcuts[shortcutKey]; 429 if (handler) { 430 handler(event); 431 event.handled = true; 432 } 433 }, 434 435 registerShortcuts: function(shortcuts) 436 { 437 this._shortcuts = shortcuts || {}; 438 var goToLineShortcut = WebInspector.GoToLineDialog.createShortcut(); 439 this._shortcuts[goToLineShortcut.key] = this._showGoToLineDialog.bind(this); 440 }, 441 442 _showGoToLineDialog: function(e) 443 { 444 var view = this.visibleView; 445 WebInspector.GoToLineDialog.show(view); 446 if (view) 447 WebInspector.GoToLineDialog.show(view); 421 448 } 422 449 } -
trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js
r83718 r84484 737 737 handleShortcut: function(event) 738 738 { 739 if (!Preferences.heapProfilerPresent || Preferences.detailedHeapProfiles) 740 return; 741 var combo = ["U+004C", "U+0045", "U+0041", "U+004B", "U+005A"]; // "LEAKZ" 742 if (this._recognizeKeyboardCombo(combo, event)) { 743 this._displayDetailedHeapProfilesEnabledHint(); 744 this._enableDetailedHeapProfiles(true); 745 } 739 if (Preferences.heapProfilerPresent && Preferences.detailedHeapProfiles) { 740 var combo = ["U+004C", "U+0045", "U+0041", "U+004B", "U+005A"]; // "LEAKZ" 741 if (this._recognizeKeyboardCombo(combo, event)) { 742 this._displayDetailedHeapProfilesEnabledHint(); 743 this._enableDetailedHeapProfiles(true); 744 } 745 } 746 WebInspector.Panel.prototype.handleShortcut.call(this, event); 746 747 }, 747 748 -
trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js
r84365 r84484 76 76 this.sidebarElement.addEventListener("mouseout", this._onmouseout.bind(this), false); 77 77 78 this.registerShortcuts(); 79 78 80 WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceUpdated, this._refreshResource, this); 79 81 } -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r83864 r84484 504 504 }, 505 505 506 handleShortcut: function(event)507 {508 var shortcut = WebInspector.KeyboardShortcut.makeKeyFromEvent(event);509 var handler = this._shortcuts[shortcut];510 if (handler) {511 handler(event);512 event.handled = true;513 } else514 this.sidebarPanes.callstack.handleShortcut(event);515 },516 517 506 _showSourceFrameAndAddToHistory: function(sourceFileId) 518 507 { … … 888 877 var platformSpecificModifier = WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta; 889 878 890 this._shortcuts = {};879 var shortcuts = {}; 891 880 892 881 // Continue. 893 882 handler = this.pauseButton.click.bind(this.pauseButton); 894 883 shortcut1 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F8); 895 this._shortcuts[shortcut1.key] = handler;884 shortcuts[shortcut1.key] = handler; 896 885 shortcut2 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Slash, platformSpecificModifier); 897 this._shortcuts[shortcut2.key] = handler;886 shortcuts[shortcut2.key] = handler; 898 887 section.addAlternateKeys([ shortcut1.name, shortcut2.name ], WebInspector.UIString("Continue")); 899 888 … … 901 890 handler = this.stepOverButton.click.bind(this.stepOverButton); 902 891 shortcut1 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F10); 903 this._shortcuts[shortcut1.key] = handler;892 shortcuts[shortcut1.key] = handler; 904 893 shortcut2 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.SingleQuote, platformSpecificModifier); 905 this._shortcuts[shortcut2.key] = handler;894 shortcuts[shortcut2.key] = handler; 906 895 section.addAlternateKeys([ shortcut1.name, shortcut2.name ], WebInspector.UIString("Step over")); 907 896 … … 909 898 handler = this.stepIntoButton.click.bind(this.stepIntoButton); 910 899 shortcut1 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F11); 911 this._shortcuts[shortcut1.key] = handler;900 shortcuts[shortcut1.key] = handler; 912 901 shortcut2 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Semicolon, platformSpecificModifier); 913 this._shortcuts[shortcut2.key] = handler;902 shortcuts[shortcut2.key] = handler; 914 903 section.addAlternateKeys([ shortcut1.name, shortcut2.name ], WebInspector.UIString("Step into")); 915 904 … … 917 906 handler = this.stepOutButton.click.bind(this.stepOutButton); 918 907 shortcut1 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F11, WebInspector.KeyboardShortcut.Modifiers.Shift); 919 this._shortcuts[shortcut1.key] = handler;908 shortcuts[shortcut1.key] = handler; 920 909 shortcut2 = WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Semicolon, WebInspector.KeyboardShortcut.Modifiers.Shift, platformSpecificModifier); 921 this._shortcuts[shortcut2.key] = handler;910 shortcuts[shortcut2.key] = handler; 922 911 section.addAlternateKeys([ shortcut1.name, shortcut2.name ], WebInspector.UIString("Step out")); 923 912 924 var isMac = WebInspector.isMac(); 925 if (isMac) 926 shortcut1 = WebInspector.KeyboardShortcut.makeDescriptor("l", WebInspector.KeyboardShortcut.Modifiers.Meta); 927 else 928 shortcut1 = WebInspector.KeyboardShortcut.makeDescriptor("g", WebInspector.KeyboardShortcut.Modifiers.Ctrl); 929 this._shortcuts[shortcut1.key] = this.showGoToLineDialog.bind(this); 930 section.addAlternateKeys([ shortcut1.name ], WebInspector.UIString("Go to Line")); 931 this.sidebarPanes.callstack.registerShortcuts(section); 913 this.sidebarPanes.callstack.registerShortcuts(section, shortcuts); 914 this.registerShortcuts(shortcuts); 932 915 }, 933 916 … … 999 982 this._searchView.jumpToPreviousSearchResult(); 1000 983 }, 1001 1002 showGoToLineDialog: function(e)1003 {1004 var view = this.visibleView;1005 if (view)1006 WebInspector.GoToLineDialog.show(view);1007 }1008 984 } 1009 985 -
trunk/Source/WebCore/inspector/front-end/inspector.js
r84481 r84484 682 682 section.addRelatedKeys(keys, WebInspector.UIString("Find next/previous")); 683 683 } 684 685 var goToShortcut = WebInspector.GoToLineDialog.createShortcut(); 686 section.addKey(goToShortcut.name, WebInspector.UIString("Go to Line")); 684 687 } 685 688 … … 709 712 } 710 713 711 if (this.currentPanel && this.currentPanel.handleShortcut) {714 if (this.currentPanel) { 712 715 this.currentPanel.handleShortcut(event); 713 716 if (event.handled) {
Note: See TracChangeset
for help on using the changeset viewer.