Title: [88942] trunk/Source/WebCore
Revision
88942
Author
[email protected]
Date
2011-06-15 09:00:34 -0700 (Wed, 15 Jun 2011)

Log Message

2011-06-15  Pavel Feldman  <[email protected]>

        Reviewed by Yury Semikhatsky.

        Web Inspector: introduce context menu on ImageView with Copy and Open in new tab actions.
        https://bugs.webkit.org/show_bug.cgi?id=62727

        * English.lproj/localizedStrings.js:
        * inspector/front-end/ImageView.js:
        (WebInspector.ImageView.prototype._base64ToSize):
        (WebInspector.ImageView.prototype._contextMenu):
        (WebInspector.ImageView.prototype._copyImageURL):
        (WebInspector.ImageView.prototype._openInNewTab):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (88941 => 88942)


--- trunk/Source/WebCore/ChangeLog	2011-06-15 15:59:04 UTC (rev 88941)
+++ trunk/Source/WebCore/ChangeLog	2011-06-15 16:00:34 UTC (rev 88942)
@@ -1,3 +1,17 @@
+2011-06-15  Pavel Feldman  <[email protected]>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: introduce context menu on ImageView with Copy and Open in new tab actions.
+        https://bugs.webkit.org/show_bug.cgi?id=62727
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/ImageView.js:
+        (WebInspector.ImageView.prototype._base64ToSize):
+        (WebInspector.ImageView.prototype._contextMenu):
+        (WebInspector.ImageView.prototype._copyImageURL):
+        (WebInspector.ImageView.prototype._openInNewTab):
+
 2011-06-15  Andrey Kosyakov  <[email protected]>
 
         Reviewed by Pavel Feldman.

Modified: trunk/Source/WebCore/English.lproj/localizedStrings.js


(Binary files differ)

Modified: trunk/Source/WebCore/inspector/front-end/ImageView.js (88941 => 88942)


--- trunk/Source/WebCore/inspector/front-end/ImageView.js	2011-06-15 15:59:04 UTC (rev 88941)
+++ trunk/Source/WebCore/inspector/front-end/ImageView.js	2011-06-15 16:00:34 UTC (rev 88942)
@@ -57,6 +57,7 @@
         var imagePreviewElement = document.createElement("img");
         imagePreviewElement.addStyleClass("resource-image-view");
         imageContainer.appendChild(imagePreviewElement);
+        imagePreviewElement.addEventListener("contextmenu", this._contextMenu.bind(this), true);
 
         this._container = document.createElement("div");
         this._container.className = "info";
@@ -118,6 +119,24 @@
         if (content.length > 1 && content[content.length - 2] === "=")
             size--;
         return size;
+    },
+
+    _contextMenu: function(event)
+    {
+        var contextMenu = new WebInspector.ContextMenu();
+        contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy image URL" : "Copy Image URL"), this._copyImageURL.bind(this));
+        contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Open image in new tab" : "Open Image in New Tab"), this._openInNewTab.bind(this));
+        contextMenu.show(event);
+    },
+
+    _copyImageURL: function(event)
+    {
+        InspectorFrontendHost.copyText(this.resource.url);
+    },
+
+    _openInNewTab: function(event)
+    {
+        WebInspector.openResource(this.resource.url, false);
     }
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to