Changeset 85312 in webkit
- Timestamp:
- Apr 29, 2011 2:34:56 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r85303 r85312 1 2011-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 1 37 2011-04-28 Simon Fraser <simon.fraser@apple.com> 2 38 -
trunk/Source/WebCore/inspector/front-end/ConsoleView.js
r85256 r85312 433 433 }.bind(this); 434 434 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)); 437 437 contextMenu.show(event); 438 438 }, -
trunk/Source/WebCore/inspector/front-end/DOMBreakpointsSidebarPane.js
r84904 r85312 46 46 ]; 47 47 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") 51 51 ]; 52 52 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.InspectedURLChanged, this._inspectedURLChanged, this); -
trunk/Source/WebCore/inspector/front-end/ElementsPanel.js
r84772 r85312 288 288 if (populated) 289 289 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)); 291 291 292 292 contextMenu.show(event); … … 303 303 304 304 // 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)); 306 306 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)); 308 308 return true; 309 309 }, -
trunk/Source/WebCore/inspector/front-end/ElementsTreeOutline.js
r83864 r85312 779 779 780 780 // 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)); 782 782 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)); 784 784 contextMenu.appendSeparator(); 785 785 … … 787 787 contextMenu.appendItem(WebInspector.UIString("Edit as HTML"), this._editAsHTML.bind(this)); 788 788 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)); 790 790 791 791 if (Preferences.nativeInstrumentationEnabled) { … … 799 799 _populateTextContextMenu: function(contextMenu, textNode) 800 800 { 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)); 802 802 }, 803 803 -
trunk/Source/WebCore/inspector/front-end/NetworkPanel.js
r84904 r85312 1002 1002 1003 1003 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)); 1005 1007 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)); 1007 1009 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)); 1012 1014 1013 1015 if (Preferences.saveAsAvailable) { 1014 1016 contextMenu.appendSeparator(); 1015 1017 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)); 1018 1020 } 1019 1021 -
trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js
r85184 r85312 1118 1118 _handleContextMenuEvent: function(event) 1119 1119 { 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 { 1120 1128 if (!Preferences.saveAsAvailable) 1121 1129 return; … … 1131 1139 this._resource.requestContent(InspectorFrontendHost.saveAs.bind(InspectorFrontendHost, fileName)); 1132 1140 } 1133 var contextMenu = new WebInspector.ContextMenu(); 1134 contextMenu.append Item(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)); 1136 1144 }, 1137 1145 … … 1394 1402 } 1395 1403 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)); 1397 1405 } 1398 1406 -
trunk/Source/WebCore/inspector/front-end/Settings.js
r85272 r85312 51 51 heapProfilerPresent: false, 52 52 detailedHeapProfiles: false, 53 saveAsAvailable: false 53 saveAsAvailable: false, 54 useLowerCaseMenuTitlesOnWindows: false 54 55 } 55 56 -
trunk/Source/WebCore/inspector/front-end/SourceFrame.js
r85204 r85312 607 607 populateLineGutterContextMenu: function(lineNumber, contextMenu) 608 608 { 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)); 610 610 611 611 var breakpoint = this._delegate.findBreakpoint(lineNumber); 612 612 if (!breakpoint) { 613 613 // 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)); 615 615 616 616 function addConditionalBreakpoint() … … 625 625 this._editBreakpointCondition(lineNumber, "", didEditBreakpointCondition.bind(this)); 626 626 } 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)); 628 628 } else { 629 629 // 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)); 631 631 function editBreakpointCondition() 632 632 { … … 638 638 this._editBreakpointCondition(lineNumber, breakpoint.condition, didEditBreakpointCondition.bind(this)); 639 639 } 640 contextMenu.appendItem(WebInspector.UIString( "Edit Breakpoint…"), editBreakpointCondition.bind(this));640 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Edit breakpoint…" : "Edit Breakpoint…"), editBreakpointCondition.bind(this)); 641 641 function setBreakpointEnabled(enabled) 642 642 { … … 644 644 } 645 645 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)); 647 647 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)); 649 649 } 650 650 }, -
trunk/Source/WebCore/inspector/front-end/TextViewer.js
r84629 r85312 292 292 var fileName = this._delegate.suggestedFileName(); 293 293 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)); 295 295 296 296 contextMenu.show(event); -
trunk/Source/WebCore/inspector/front-end/inspector.js
r85048 r85312 364 364 openLinkExternallyLabel: function() 365 365 { 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"); 367 367 } 368 368 } … … 662 662 WebInspector.showPanel("resources"); 663 663 } else 664 PageAgent.open(resource ? resource.url : resourceURL, true);664 PageAgent.open(resourceURL, true); 665 665 } 666 666 … … 1407 1407 1408 1408 return this._isMac; 1409 } 1410 1411 WebInspector.useLowerCaseMenuTitles = function() 1412 { 1413 return WebInspector.platform === "windows" && Preferences.useLowerCaseMenuTitlesOnWindows; 1409 1414 } 1410 1415 -
trunk/Source/WebKit/chromium/ChangeLog
r85292 r85312 1 2011-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 1 12 2011-04-28 Nat Duca <nduca@chromium.org> 2 13 -
trunk/Source/WebKit/chromium/src/js/DevTools.js
r84894 r85312 52 52 Preferences.showCookiesTab = true; 53 53 Preferences.saveAsAvailable = true; 54 Preferences.useLowerCaseMenuTitlesOnWindows = true; 54 55 })(); 55 56 … … 90 91 { 91 92 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.js97 *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");104 93 }; 105 94
Note: See TracChangeset
for help on using the changeset viewer.