Changeset 51341 in webkit
- Timestamp:
- Nov 24, 2009 9:53:59 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r51340 r51341 1 2009-11-24 Joseph Pecoraro <joepeck@webkit.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: Keyboard Shortcut to Clear Console Messages 6 https://bugs.webkit.org/show_bug.cgi?id=31780 7 8 All Platforms: Ctrl+L = Clear Console Messages 9 Mac Only: Cmd+K = Clear Console Messages 10 11 * inspector/front-end/ConsoleView.js: 12 (WebInspector.ConsoleView): create shortcuts 13 (WebInspector.ConsoleView.prototype._promptKeyDown): handle shortcuts 14 * inspector/front-end/KeyboardShortcut.js: 15 (WebInspector.KeyboardShortcut.makeKey): convenience conversion of "a-z" character to keyCode 16 * inspector/front-end/ScriptsPanel.js: 17 (WebInspector.ScriptsPanel): style fixes for keyboard shortcuts 18 1 19 2009-11-24 Pavel Feldman <pfeldman@chromium.org> 2 20 -
trunk/WebCore/inspector/front-end/ConsoleView.js
r51250 r51341 93 93 94 94 this.filter(this.allElement, false); 95 96 this._shortcuts = {}; 97 98 var shortcut; 99 var handler = this.clearMessages.bind(this, true); 100 101 shortcut = WebInspector.KeyboardShortcut.makeKey("k", WebInspector.KeyboardShortcut.Modifiers.Meta); 102 this._shortcuts[shortcut] = handler; 103 this._shortcuts[shortcut].isMacOnly = true; 104 shortcut = WebInspector.KeyboardShortcut.makeKey("l", WebInspector.KeyboardShortcut.Modifiers.Ctrl); 105 this._shortcuts[shortcut] = handler; 95 106 } 96 107 … … 393 404 return; 394 405 } 406 395 407 if (isFnKey(event)) { 396 408 if (WebInspector.currentPanel && WebInspector.currentPanel.handleKeyEvent) { 397 409 WebInspector.currentPanel.handleKeyEvent(event); 410 return; 411 } 412 } 413 414 var shortcut = WebInspector.KeyboardShortcut.makeKeyFromEvent(event); 415 var handler = this._shortcuts[shortcut]; 416 if (handler) { 417 if (!this._shortcuts[shortcut].isMacOnly || WebInspector.isMac()) { 418 handler(); 419 event.preventDefault(); 398 420 return; 399 421 } -
trunk/WebCore/inspector/front-end/KeyboardShortcut.js
r45460 r51341 77 77 /** 78 78 * Creates a number encoding keyCode in the lower 8 bits and modifiers mask in the higher 8 bits. 79 * It is useful lfor matching pressed keys.80 * @param {number} keyCode Code of the key.81 * @param {number} optModifiersOptional list of modifiers passed as additional paramerters.79 * It is useful for matching pressed keys. 80 * keyCode is the Code of the key, or a character "a-z" which is converted to a keyCode value. 81 * optModifiers is an Optional list of modifiers passed as additional paramerters. 82 82 */ 83 83 WebInspector.KeyboardShortcut.makeKey = function(keyCode, optModifiers) 84 84 { 85 if (typeof keyCode === "string") 86 keyCode = keyCode.charCodeAt(0) - 32; 85 87 var modifiers = WebInspector.KeyboardShortcut.Modifiers.None; 86 88 for (var i = 1; i < arguments.length; i++) -
trunk/WebCore/inspector/front-end/ScriptsPanel.js
r51250 r51341 162 162 163 163 this._shortcuts = {}; 164 164 var handler, shortcut; 165 165 var platformSpecificModifier = WebInspector.isMac() ? WebInspector.KeyboardShortcut.Modifiers.Meta : WebInspector.KeyboardShortcut.Modifiers.Ctrl; 166 166 167 167 // Continue. 168 varhandler = this.pauseButton.click.bind(this.pauseButton);169 varshortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.F8);168 handler = this.pauseButton.click.bind(this.pauseButton); 169 shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.F8); 170 170 this._shortcuts[shortcut] = handler; 171 varshortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.Slash, platformSpecificModifier);171 shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.Slash, platformSpecificModifier); 172 172 this._shortcuts[shortcut] = handler; 173 173 174 174 // Step over. 175 varhandler = this.stepOverButton.click.bind(this.stepOverButton);176 varshortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.F10);175 handler = this.stepOverButton.click.bind(this.stepOverButton); 176 shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.F10); 177 177 this._shortcuts[shortcut] = handler; 178 varshortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.SingleQuote, platformSpecificModifier);178 shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.SingleQuote, platformSpecificModifier); 179 179 this._shortcuts[shortcut] = handler; 180 180 181 181 // Step into. 182 varhandler = this.stepIntoButton.click.bind(this.stepIntoButton);183 varshortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.F11);182 handler = this.stepIntoButton.click.bind(this.stepIntoButton); 183 shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.F11); 184 184 this._shortcuts[shortcut] = handler; 185 varshortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.Semicolon, platformSpecificModifier);185 shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.Semicolon, platformSpecificModifier); 186 186 this._shortcuts[shortcut] = handler; 187 187 188 188 // Step out. 189 varhandler = this.stepOutButton.click.bind(this.stepOutButton);190 varshortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.F11, WebInspector.KeyboardShortcut.Modifiers.Shift);189 handler = this.stepOutButton.click.bind(this.stepOutButton); 190 shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.F11, WebInspector.KeyboardShortcut.Modifiers.Shift); 191 191 this._shortcuts[shortcut] = handler; 192 varshortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.Semicolon, WebInspector.KeyboardShortcut.Modifiers.Shift, platformSpecificModifier);192 shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.Semicolon, WebInspector.KeyboardShortcut.Modifiers.Shift, platformSpecificModifier); 193 193 this._shortcuts[shortcut] = handler; 194 194
Note: See TracChangeset
for help on using the changeset viewer.