[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

bweinstein at apple.com bweinstein at apple.com
Thu Apr 8 00:38:56 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit edf2c6cef9935486d970083764cba85f5bd8491e
Author: bweinstein at apple.com <bweinstein at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 16 21:17:08 2009 +0000

    Part of <http://webkit.org/b/32568>.
    Web Inspector: Context Menus should be used in more places.
    
    Reviewed by Timothy Hatcher.
    
    Add a context menu entry in the console to clear the console. This
    is only shown when there is no user selection of text, because if
    there is selection of the text, then we want to give the user the Copy +
    Spell Check context menu that they are used to.
    
    * English.lproj/localizedStrings.js: Added "Clear Console".
    * inspector/front-end/ConsoleView.js:
    (WebInspector.ConsoleView.prototype._handleContextMenuEvent):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52217 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index cfd4cfe..20fb368 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,21 @@
 2009-12-16  Brian Weinstein  <bweinstein at apple.com>
 
+        Reviewed by Timothy Hatcher.
+
+        Part of <http://webkit.org/b/32568>.
+        Web Inspector: Context Menus should be used in more places.
+        
+        Add a context menu entry in the console to clear the console. This
+        is only shown when there is no user selection of text, because if
+        there is selection of the text, then we want to give the user the Copy +
+        Spell Check context menu that they are used to.
+
+        * English.lproj/localizedStrings.js: Added "Clear Console".
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView.prototype._handleContextMenuEvent):
+
+2009-12-16  Brian Weinstein  <bweinstein at apple.com>
+
         Reviewed by Pavel Feldman.
 
         Fixes <https://bugs.webkit.org/show_bug.cgi?id=32621>.
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index 743a031..a372b18 100644
Binary files a/WebCore/English.lproj/localizedStrings.js and b/WebCore/English.lproj/localizedStrings.js differ
diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js
index 501b9ac..0cf4a75 100644
--- a/WebCore/inspector/front-end/ConsoleView.js
+++ b/WebCore/inspector/front-end/ConsoleView.js
@@ -92,14 +92,20 @@ WebInspector.ConsoleView = function(drawer)
     this._shortcuts = {};
 
     var shortcut;
-    var handler = this.clearMessages.bind(this, true);
+    var clearConsoleHandler = this.clearMessages.bind(this, true);
 
     shortcut = WebInspector.KeyboardShortcut.makeKey("k", WebInspector.KeyboardShortcut.Modifiers.Meta);
-    this._shortcuts[shortcut] = handler;
+    this._shortcuts[shortcut] = clearConsoleHandler;
     this._shortcuts[shortcut].isMacOnly = true;
     shortcut = WebInspector.KeyboardShortcut.makeKey("l", WebInspector.KeyboardShortcut.Modifiers.Ctrl);
-    this._shortcuts[shortcut] = handler;
+    this._shortcuts[shortcut] = clearConsoleHandler;
 
+    // Since the Context Menu for the Console View will always be the same, we can create it in
+    // the constructor.
+    this._contextMenu = new WebInspector.ContextMenu();
+    this._contextMenu.appendItem(WebInspector.UIString("Clear Console"), clearConsoleHandler);
+    this.messagesElement.addEventListener("contextmenu", this._handleContextMenuEvent.bind(this), true);
+    
     this._customFormatters = {
         "object": this._formatobject,
         "array":  this._formatarray,
@@ -371,6 +377,17 @@ WebInspector.ConsoleView.prototype = {
     {
         this.clearMessages(true);
     },
+    
+    _handleContextMenuEvent: function(event)
+    {
+        if (!window.getSelection().isCollapsed) {
+            // If there is a selection, we want to show our normal context menu
+            // (with Copy, etc.), and not Clear Console.
+            return;
+        }
+
+        this._contextMenu.show(event);
+    },
 
     _messagesSelectStart: function(event)
     {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list