Changeset 52217 in webkit
- Timestamp:
- Dec 16, 2009 1:17:08 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r52214 r52217 1 2009-12-16 Brian Weinstein <bweinstein@apple.com> 2 3 Reviewed by Timothy Hatcher. 4 5 Part of <http://webkit.org/b/32568>. 6 Web Inspector: Context Menus should be used in more places. 7 8 Add a context menu entry in the console to clear the console. This 9 is only shown when there is no user selection of text, because if 10 there is selection of the text, then we want to give the user the Copy + 11 Spell Check context menu that they are used to. 12 13 * English.lproj/localizedStrings.js: Added "Clear Console". 14 * inspector/front-end/ConsoleView.js: 15 (WebInspector.ConsoleView.prototype._handleContextMenuEvent): 16 1 17 2009-12-16 Brian Weinstein <bweinstein@apple.com> 2 18 -
trunk/WebCore/inspector/front-end/ConsoleView.js
r52203 r52217 93 93 94 94 var shortcut; 95 var handler = this.clearMessages.bind(this, true);95 var clearConsoleHandler = this.clearMessages.bind(this, true); 96 96 97 97 shortcut = WebInspector.KeyboardShortcut.makeKey("k", WebInspector.KeyboardShortcut.Modifiers.Meta); 98 this._shortcuts[shortcut] = handler;98 this._shortcuts[shortcut] = clearConsoleHandler; 99 99 this._shortcuts[shortcut].isMacOnly = true; 100 100 shortcut = WebInspector.KeyboardShortcut.makeKey("l", WebInspector.KeyboardShortcut.Modifiers.Ctrl); 101 this._shortcuts[shortcut] = handler; 102 101 this._shortcuts[shortcut] = clearConsoleHandler; 102 103 // Since the Context Menu for the Console View will always be the same, we can create it in 104 // the constructor. 105 this._contextMenu = new WebInspector.ContextMenu(); 106 this._contextMenu.appendItem(WebInspector.UIString("Clear Console"), clearConsoleHandler); 107 this.messagesElement.addEventListener("contextmenu", this._handleContextMenuEvent.bind(this), true); 108 103 109 this._customFormatters = { 104 110 "object": this._formatobject, … … 372 378 this.clearMessages(true); 373 379 }, 380 381 _handleContextMenuEvent: function(event) 382 { 383 if (!window.getSelection().isCollapsed) { 384 // If there is a selection, we want to show our normal context menu 385 // (with Copy, etc.), and not Clear Console. 386 return; 387 } 388 389 this._contextMenu.show(event); 390 }, 374 391 375 392 _messagesSelectStart: function(event)
Note: See TracChangeset
for help on using the changeset viewer.