Changeset 85312 in webkit


Ignore:
Timestamp:
Apr 29, 2011 2:34:56 AM (13 years ago)
Author:
pfeldman@chromium.org
Message:

2011-04-29 Pavel Feldman <pfeldman@google.com>

Reviewed by Yury Semikhatsky.

Web Inspector: add "open link in new tab" action into the network and resources panels.
https://bugs.webkit.org/show_bug.cgi?id=59788

This change also distinguishes context menu items case between platforms.

  • English.lproj/localizedStrings.js:
  • inspector/front-end/ConsoleView.js: (WebInspector.ConsoleView.prototype._handleContextMenuEvent):
  • inspector/front-end/DOMBreakpointsSidebarPane.js: (WebInspector.DOMBreakpointsSidebarPane):
  • inspector/front-end/ElementsPanel.js: (WebInspector.ElementsPanel.prototype._contextMenuEventFired): (WebInspector.ElementsPanel.prototype.populateHrefContextMenu):
  • inspector/front-end/ElementsTreeOutline.js: (WebInspector.ElementsTreeElement.prototype._populateTagContextMenu): (WebInspector.ElementsTreeElement.prototype._populateTextContextMenu):
  • inspector/front-end/NetworkPanel.js: (WebInspector.NetworkPanel.prototype._contextMenu):
  • inspector/front-end/ResourcesPanel.js: (WebInspector.FrameResourceTreeElement.prototype._handleContextMenuEvent): (WebInspector.FrameResourceTreeElement.prototype._appendSaveAsAction): (WebInspector.ResourceRevisionTreeElement.prototype._handleContextMenuEvent):
  • inspector/front-end/Settings.js:
  • inspector/front-end/SourceFrame.js: (WebInspector.SourceFrame.prototype.populateLineGutterContextMenu):
  • inspector/front-end/TextViewer.js: (WebInspector.TextViewer.prototype._contextMenu):
  • inspector/front-end/inspector.js: (WebInspector.openLinkExternallyLabel): (WebInspector.openResource): (WebInspector.useLowerCaseMenuTitles):

2011-04-29 Pavel Feldman <pfeldman@google.com>

Reviewed by Yury Semikhatsky.

Web Inspector: add "open link in new tab" action into the network and resources panels.
https://bugs.webkit.org/show_bug.cgi?id=59788

This change also distinguishes context menu items case between platforms.

  • src/js/DevTools.js:
Location:
trunk/Source
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r85303 r85312  
     12011-04-29  Pavel Feldman  <pfeldman@google.com>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: add "open link in new tab" action into the network and resources panels.
     6        https://bugs.webkit.org/show_bug.cgi?id=59788
     7
     8        This change also distinguishes context menu items case between platforms.
     9
     10        * English.lproj/localizedStrings.js:
     11        * inspector/front-end/ConsoleView.js:
     12        (WebInspector.ConsoleView.prototype._handleContextMenuEvent):
     13        * inspector/front-end/DOMBreakpointsSidebarPane.js:
     14        (WebInspector.DOMBreakpointsSidebarPane):
     15        * inspector/front-end/ElementsPanel.js:
     16        (WebInspector.ElementsPanel.prototype._contextMenuEventFired):
     17        (WebInspector.ElementsPanel.prototype.populateHrefContextMenu):
     18        * inspector/front-end/ElementsTreeOutline.js:
     19        (WebInspector.ElementsTreeElement.prototype._populateTagContextMenu):
     20        (WebInspector.ElementsTreeElement.prototype._populateTextContextMenu):
     21        * inspector/front-end/NetworkPanel.js:
     22        (WebInspector.NetworkPanel.prototype._contextMenu):
     23        * inspector/front-end/ResourcesPanel.js:
     24        (WebInspector.FrameResourceTreeElement.prototype._handleContextMenuEvent):
     25        (WebInspector.FrameResourceTreeElement.prototype._appendSaveAsAction):
     26        (WebInspector.ResourceRevisionTreeElement.prototype._handleContextMenuEvent):
     27        * inspector/front-end/Settings.js:
     28        * inspector/front-end/SourceFrame.js:
     29        (WebInspector.SourceFrame.prototype.populateLineGutterContextMenu):
     30        * inspector/front-end/TextViewer.js:
     31        (WebInspector.TextViewer.prototype._contextMenu):
     32        * inspector/front-end/inspector.js:
     33        (WebInspector.openLinkExternallyLabel):
     34        (WebInspector.openResource):
     35        (WebInspector.useLowerCaseMenuTitles):
     36
    1372011-04-28  Simon Fraser  <simon.fraser@apple.com>
    238
  • trunk/Source/WebCore/inspector/front-end/ConsoleView.js

    r85256 r85312  
    433433        }.bind(this);
    434434        var contextMenu = new WebInspector.ContextMenu();
    435         contextMenu.appendCheckboxItem(WebInspector.UIString("XMLHttpRequest logging"), itemAction, WebInspector.settings.monitoringXHREnabled)
    436         contextMenu.appendItem(WebInspector.UIString("Clear Console"), this.requestClearMessages.bind(this));
     435        contextMenu.appendCheckboxItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "XMLHttpRequest logging" : "XMLHttpRequest Logging"), itemAction, WebInspector.settings.monitoringXHREnabled)
     436        contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Clear console" : "Clear Console"), this.requestClearMessages.bind(this));
    437437        contextMenu.show(event);
    438438    },
  • trunk/Source/WebCore/inspector/front-end/DOMBreakpointsSidebarPane.js

    r84904 r85312  
    4646    ];
    4747    this._contextMenuLabels = [
    48         WebInspector.UIString("Break on Subtree Modifications"),
    49         WebInspector.UIString("Break on Attributes Modifications"),
    50         WebInspector.UIString("Break on Node Removal")
     48        WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Break on subtree modifications" : "Break on Subtree Modifications"),
     49        WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Break on attributes modifications" : "Break on Attributes Modifications"),
     50        WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Break on node removal" : "Break on Node Removal")
    5151    ];
    5252    WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.InspectedURLChanged, this._inspectedURLChanged, this);
  • trunk/Source/WebCore/inspector/front-end/ElementsPanel.js

    r84772 r85312  
    288288        if (populated)
    289289            contextMenu.appendSeparator();
    290         contextMenu.appendCheckboxItem(WebInspector.UIString("Word Wrap"), toggleWordWrap.bind(this), isTextWrapped.call(this));
     290        contextMenu.appendCheckboxItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Word wrap" : "Word Wrap"), toggleWordWrap.bind(this), isTextWrapped.call(this));
    291291
    292292        contextMenu.show(event);
     
    303303
    304304        // Add resource-related actions.
    305         contextMenu.appendItem(WebInspector.openLinkExternallyLabel(), WebInspector.openResource.bind(null, resourceURL, false));
     305        contextMenu.appendItem(WebInspector.openLinkExternallyLabel(), WebInspector.openResource.bind(WebInspector, resourceURL, false));
    306306        if (WebInspector.resourceForURL(resourceURL))
    307             contextMenu.appendItem(WebInspector.UIString("Open Link in Resources Panel"), WebInspector.openResource.bind(null, resourceURL, true));
     307            contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Open link in Resources panel" : "Open Link in Resources Panel"), WebInspector.openResource.bind(null, resourceURL, true));
    308308        return true;
    309309    },
  • trunk/Source/WebCore/inspector/front-end/ElementsTreeOutline.js

    r83864 r85312  
    779779
    780780        // Add attribute-related actions.
    781         contextMenu.appendItem(WebInspector.UIString("Add Attribute"), this._addNewAttribute.bind(this));
     781        contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Add attribute" : "Add Attribute"), this._addNewAttribute.bind(this));
    782782        if (attribute && !newAttribute)
    783             contextMenu.appendItem(WebInspector.UIString("Edit Attribute"), this._startEditingAttribute.bind(this, attribute, event.target));
     783            contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Edit attribute" : "Edit Attribute"), this._startEditingAttribute.bind(this, attribute, event.target));
    784784        contextMenu.appendSeparator();
    785785
     
    787787        contextMenu.appendItem(WebInspector.UIString("Edit as HTML"), this._editAsHTML.bind(this));
    788788        contextMenu.appendItem(WebInspector.UIString("Copy as HTML"), this._copyHTML.bind(this));
    789         contextMenu.appendItem(WebInspector.UIString("Delete Node"), this.remove.bind(this));
     789        contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Delete node" : "Delete Node"), this.remove.bind(this));
    790790
    791791        if (Preferences.nativeInstrumentationEnabled) {
     
    799799    _populateTextContextMenu: function(contextMenu, textNode)
    800800    {
    801         contextMenu.appendItem(WebInspector.UIString("Edit Text"), this._startEditingTextNode.bind(this, textNode));
     801        contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Edit text" : "Edit Text"), this._startEditingTextNode.bind(this, textNode));
    802802    },
    803803
  • trunk/Source/WebCore/inspector/front-end/NetworkPanel.js

    r84904 r85312  
    10021002
    10031003        if (resource) {
    1004             contextMenu.appendItem(WebInspector.UIString("Copy location"), this._copyLocation.bind(this, resource));
     1004            contextMenu.appendItem(WebInspector.openLinkExternallyLabel(), WebInspector.openResource.bind(WebInspector, resource.url, false));
     1005            contextMenu.appendSeparator();
     1006            contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy location" : "Copy Location"), this._copyLocation.bind(this, resource));
    10051007            if (resource.requestHeadersText)
    1006                 contextMenu.appendItem(WebInspector.UIString("Copy request headers"), this._copyRequestHeaders.bind(this, resource));
     1008                contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy request headers" : "Copy Request Headers"), this._copyRequestHeaders.bind(this, resource));
    10071009            if (resource.responseHeadersText)
    1008                 contextMenu.appendItem(WebInspector.UIString("Copy response headers"), this._copyResponseHeaders.bind(this, resource));
    1009             contextMenu.appendItem(WebInspector.UIString("Copy entry as HAR"), this._copyResource.bind(this, resource));
    1010         }
    1011         contextMenu.appendItem(WebInspector.UIString("Copy all as HAR"), this._copyAll.bind(this));
     1010                contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy response headers" : "Copy Response Headers"), this._copyResponseHeaders.bind(this, resource));
     1011            contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy entry as HAR" : "Copy Entry as HAR"), this._copyResource.bind(this, resource));
     1012        }
     1013        contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy all as HAR" : "Copy All as HAR"), this._copyAll.bind(this));
    10121014
    10131015        if (Preferences.saveAsAvailable) {
    10141016            contextMenu.appendSeparator();
    10151017            if (resource)
    1016                 contextMenu.appendItem(WebInspector.UIString("Save entry as HAR"), this._exportResource.bind(this, resource));
    1017             contextMenu.appendItem(WebInspector.UIString("Save all as HAR"), this._exportAll.bind(this));
     1018                contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Save entry as HAR" : "Save Entry as HAR"), this._exportResource.bind(this, resource));
     1019            contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Save all as HAR" : "Save All as HAR"), this._exportAll.bind(this));
    10181020        }
    10191021
  • trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js

    r85184 r85312  
    11181118    _handleContextMenuEvent: function(event)
    11191119    {
     1120        var contextMenu = new WebInspector.ContextMenu();
     1121        contextMenu.appendItem(WebInspector.openLinkExternallyLabel(), WebInspector.openResource.bind(WebInspector, this._resource.url, false));
     1122        this._appendSaveAsAction(contextMenu, event);
     1123        contextMenu.show(event);
     1124    },
     1125
     1126    _appendSaveAsAction: function(contextMenu, event)
     1127    {
    11201128        if (!Preferences.saveAsAvailable)
    11211129            return;
     
    11311139            this._resource.requestContent(InspectorFrontendHost.saveAs.bind(InspectorFrontendHost, fileName));
    11321140        }
    1133         var contextMenu = new WebInspector.ContextMenu();
    1134         contextMenu.appendItem(WebInspector.UIString("Save as..."), save.bind(this));
    1135         contextMenu.show(event);
     1141
     1142        contextMenu.appendSeparator();
     1143        contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Save as..." : "Save As..."), save.bind(this));
    11361144    },
    11371145   
     
    13941402            }
    13951403            contextMenu.appendSeparator();
    1396             contextMenu.appendItem(WebInspector.UIString("Save as..."), save.bind(this));
     1404            contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Save as..." : "Save As..."), save.bind(this));
    13971405        }
    13981406
  • trunk/Source/WebCore/inspector/front-end/Settings.js

    r85272 r85312  
    5151    heapProfilerPresent: false,
    5252    detailedHeapProfiles: false,
    53     saveAsAvailable: false
     53    saveAsAvailable: false,
     54    useLowerCaseMenuTitlesOnWindows: false
    5455}
    5556
  • trunk/Source/WebCore/inspector/front-end/SourceFrame.js

    r85204 r85312  
    607607    populateLineGutterContextMenu: function(lineNumber, contextMenu)
    608608    {
    609         contextMenu.appendItem(WebInspector.UIString("Continue to Here"), this._delegate.continueToLine.bind(this._delegate, lineNumber));
     609        contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Continue to here" : "Continue to Here"), this._delegate.continueToLine.bind(this._delegate, lineNumber));
    610610
    611611        var breakpoint = this._delegate.findBreakpoint(lineNumber);
    612612        if (!breakpoint) {
    613613            // This row doesn't have a breakpoint: We want to show Add Breakpoint and Add and Edit Breakpoint.
    614             contextMenu.appendItem(WebInspector.UIString("Add Breakpoint"), this._delegate.setBreakpoint.bind(this._delegate, lineNumber, "", true));
     614            contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Add breakpoint" : "Add Breakpoint"), this._delegate.setBreakpoint.bind(this._delegate, lineNumber, "", true));
    615615
    616616            function addConditionalBreakpoint()
     
    625625                this._editBreakpointCondition(lineNumber, "", didEditBreakpointCondition.bind(this));
    626626            }
    627             contextMenu.appendItem(WebInspector.UIString("Add Conditional Breakpoint…"), addConditionalBreakpoint.bind(this));
     627            contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Add conditional breakpoint…" : "Add Conditional Breakpoint…"), addConditionalBreakpoint.bind(this));
    628628        } else {
    629629            // This row has a breakpoint, we want to show edit and remove breakpoint, and either disable or enable.
    630             contextMenu.appendItem(WebInspector.UIString("Remove Breakpoint"), this._delegate.removeBreakpoint.bind(this._delegate, lineNumber));
     630            contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Remove breakpoint" : "Remove Breakpoint"), this._delegate.removeBreakpoint.bind(this._delegate, lineNumber));
    631631            function editBreakpointCondition()
    632632            {
     
    638638                this._editBreakpointCondition(lineNumber, breakpoint.condition, didEditBreakpointCondition.bind(this));
    639639            }
    640             contextMenu.appendItem(WebInspector.UIString("Edit Breakpoint…"), editBreakpointCondition.bind(this));
     640            contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Edit breakpoint…" : "Edit Breakpoint…"), editBreakpointCondition.bind(this));
    641641            function setBreakpointEnabled(enabled)
    642642            {
     
    644644            }
    645645            if (breakpoint.enabled)
    646                 contextMenu.appendItem(WebInspector.UIString("Disable Breakpoint"), setBreakpointEnabled.bind(this, false));
     646                contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Disable breakpoint" : "Disable Breakpoint"), setBreakpointEnabled.bind(this, false));
    647647            else
    648                 contextMenu.appendItem(WebInspector.UIString("Enable Breakpoint"), setBreakpointEnabled.bind(this, true));
     648                contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Enable breakpoint" : "Enable Breakpoint"), setBreakpointEnabled.bind(this, true));
    649649        }
    650650    },
  • trunk/Source/WebCore/inspector/front-end/TextViewer.js

    r84629 r85312  
    292292        var fileName = this._delegate.suggestedFileName();
    293293        if (fileName)
    294             contextMenu.appendItem(WebInspector.UIString("Save as..."), InspectorFrontendHost.saveAs.bind(InspectorFrontendHost, fileName, this._textModel.text));
     294            contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Save as..." : "Save As..."), InspectorFrontendHost.saveAs.bind(InspectorFrontendHost, fileName, this._textModel.text));
    295295
    296296        contextMenu.show(event);
  • trunk/Source/WebCore/inspector/front-end/inspector.js

    r85048 r85312  
    364364    openLinkExternallyLabel: function()
    365365    {
    366         return WebInspector.UIString("Open Link in New Window");
     366        return WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Open link in new tab" : "Open Link in New Tab");
    367367    }
    368368}
     
    662662        WebInspector.showPanel("resources");
    663663    } else
    664         PageAgent.open(resource ? resource.url : resourceURL, true);
     664        PageAgent.open(resourceURL, true);
    665665}
    666666
     
    14071407
    14081408    return this._isMac;
     1409}
     1410
     1411WebInspector.useLowerCaseMenuTitles = function()
     1412{
     1413    return WebInspector.platform === "windows" && Preferences.useLowerCaseMenuTitlesOnWindows;
    14091414}
    14101415
  • trunk/Source/WebKit/chromium/ChangeLog

    r85292 r85312  
     12011-04-29  Pavel Feldman  <pfeldman@google.com>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: add "open link in new tab" action into the network and resources panels.
     6        https://bugs.webkit.org/show_bug.cgi?id=59788
     7
     8        This change also distinguishes context menu items case between platforms.
     9
     10        * src/js/DevTools.js:
     11
    1122011-04-28  Nat Duca  <nduca@chromium.org>
    213
  • trunk/Source/WebKit/chromium/src/js/DevTools.js

    r84894 r85312  
    5252    Preferences.showCookiesTab = true;
    5353    Preferences.saveAsAvailable = true;
     54    Preferences.useLowerCaseMenuTitlesOnWindows = true;
    5455})();
    5556
     
    9091{
    9192    return String.vsprintf(string, Array.prototype.slice.call(arguments, 1));
    92 };
    93 
    94 
    95 /*
    96  * This label must be kept consistent with that in English.lproj/localizedStrings.js
    97  *
    98  * http://code.google.com/p/chromium/issues/detail?id=61302 requires a custom label for Chromium,
    99  * since its behavior is different.
    100  */
    101 WebInspector.openLinkExternallyLabel = function()
    102 {
    103     return WebInspector.UIString("Open Link in New Tab");
    10493};
    10594
Note: See TracChangeset for help on using the changeset viewer.