[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:37:20 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit e68a8a9284585b2f53ac83f6da34be482d724644
Author: bweinstein at apple.com <bweinstein at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 15 19:51:27 2009 +0000

    Part of <http://webkit.org/b/32568>.
    New Web Inspector: The Context Menu should be used in more places.
    
    Reviewed by Timothy Hatcher.
    
    Add support for context menu entries for editing and deleting elements
    in the datagrid. This gives support to deleting cookies, and editing and
    deleting session storage and local storage.
    
    * English.lproj/localizedStrings.js: Added "Edit" and "Add New" entries (delete was already there)
    * inspector/front-end/DataGrid.js:
    (WebInspector.DataGrid): Added context menu listener.
    (WebInspector.DataGrid.prototype._contextMenuInDataTable):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52165 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b3452f8..9283785 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2009-12-15  Brian Weinstein  <bweinstein at apple.com>
+
+        Reviewed by Timothy Hatcher.
+
+        Part of <http://webkit.org/b/32568>.
+        New Web Inspector: The Context Menu should be used in more places.
+        
+        Add support for context menu entries for editing and deleting elements
+        in the datagrid. This gives support to deleting cookies, and editing and
+        deleting session storage and local storage.
+
+        * English.lproj/localizedStrings.js: Added "Edit" and "Add New" entries (delete was already there)
+        * inspector/front-end/DataGrid.js:
+        (WebInspector.DataGrid): Added context menu listener.
+        (WebInspector.DataGrid.prototype._contextMenuInDataTable):
+
 2009-12-15  Kenneth Russell  <kbr at google.com>
 
         Reviewed by Darin Fisher.
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index e18a163..b05af87 100644
Binary files a/WebCore/English.lproj/localizedStrings.js and b/WebCore/English.lproj/localizedStrings.js differ
diff --git a/WebCore/inspector/front-end/DataGrid.js b/WebCore/inspector/front-end/DataGrid.js
index 2c91db5..3eca9e4 100644
--- a/WebCore/inspector/front-end/DataGrid.js
+++ b/WebCore/inspector/front-end/DataGrid.js
@@ -39,6 +39,8 @@ WebInspector.DataGrid = function(columns, editCallback, deleteCallback)
     this._dataTable.addEventListener("mousedown", this._mouseDownInDataTable.bind(this), true);
     this._dataTable.addEventListener("click", this._clickInDataTable.bind(this), true);
     
+    this._dataTable.addEventListener("contextmenu", this._contextMenuInDataTable.bind(this), true);
+    
     // FIXME: Add a createCallback which is different from editCallback and has different
     // behavior when creating a new node.
     if (editCallback) {
@@ -615,6 +617,30 @@ WebInspector.DataGrid.prototype = {
         } else
             gridNode.select();
     },
+    
+    _contextMenuInDataTable: function(event)
+    {
+        var gridNode = this.dataGridNodeFromNode(event.target);
+        if (!gridNode || !gridNode.selectable)
+            return;
+        
+        if (gridNode.isEventWithinDisclosureTriangle(event))
+            return;
+      
+        var contextMenu = new WebInspector.ContextMenu();
+        
+        // FIXME: Use the column names for Editing, instead of just "Edit".
+        if (this.dataGrid._editCallback) {
+            if (gridNode === this.creationNode)
+                contextMenu.appendItem(WebInspector.UIString("Add New"), this._startEditing.bind(this, event.target));
+            else
+                contextMenu.appendItem(WebInspector.UIString("Edit"), this._startEditing.bind(this, event.target));
+        }
+        if (this.dataGrid._deleteCallback && gridNode !== this.creationNode)
+            contextMenu.appendItem(WebInspector.UIString("Delete"), this._deleteCallback.bind(this, gridNode));
+        
+        contextMenu.show(event);
+    },
 
     _clickInDataTable: function(event)
     {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list