Changeset 143568 in webkit
- Timestamp:
- Feb 20, 2013 11:53:49 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r143560 r143568 1 2013-02-20 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Web Inspector: TabbedEditorContainer and OpenResourceDialog should show uiSourceCode path and name instead of parsedURL 4 https://bugs.webkit.org/show_bug.cgi?id=110334 5 6 Reviewed by Alexander Pavlov. 7 8 * inspector/debugger/scripts-file-selector-expected.txt: 9 * inspector/debugger/ui-source-code-display-name-expected.txt: 10 * inspector/debugger/ui-source-code-display-name.html: 11 1 12 2013-02-20 Mike West <mkwst@chromium.org> 2 13 -
trunk/LayoutTests/inspector/debugger/ui-source-code-display-name-expected.txt
r103812 r143568 3 3 UISourceCode display name for url "http://localhost:8080/folder/filename?parameter=value&nnn=1" is "filename?parameter=value&nnn=1". 4 4 UISourceCode display name for url "http://localhost:8080/folder/very-long-filename-123456?nn=1" is "very-long-filename-123456?nn=1". 5 UISourceCode display name for url "http://localhost:8080/folder/too-long-filename-1234567890?nn=1" is "too-long-fil …e-1234567890?nn=1".6 UISourceCode display name for url "http://localhost:8080/folder/long-filename?parameter=value&nnn=1" is "long-filename?p arameter=value…".7 UISourceCode display name for url "http://localhost:8080/folder/too-long-filename-1234567890?parameter=value&nnn=1" is "too-long-fil …e-1234567890?par…".5 UISourceCode display name for url "http://localhost:8080/folder/too-long-filename-1234567890?nn=1" is "too-long-filena…234567890?nn=1". 6 UISourceCode display name for url "http://localhost:8080/folder/long-filename?parameter=value&nnn=1" is "long-filename?p…er=value&nnn=1". 7 UISourceCode display name for url "http://localhost:8080/folder/too-long-filename-1234567890?parameter=value&nnn=1" is "too-long-filena…er=value&nnn=1". 8 8 -
trunk/LayoutTests/inspector/debugger/ui-source-code-display-name.html
r142259 r143568 6 6 { 7 7 WebInspector.showPanel("scripts"); 8 9 function createContentProvider(url) 10 { 11 var contentProvider = new WebInspector.StaticContentProvider(WebInspector.resourceTypes.Script, "", "text/javascript"); 12 contentProvider.requestContent = function(callback) 13 { 14 InspectorTest.addResult("Source requested for " + url); 15 callback(""); 16 }; 17 return contentProvider; 18 } 19 20 var workspace = new WebInspector.Workspace(); 21 workspace.networkWorkspaceProvider = new WebInspector.SimpleWorkspaceProvider(workspace, WebInspector.projectTypes.Network); 22 23 function addNetworkFile(url) 24 { 25 return workspace.networkWorkspaceProvider.addFileForURL(url, createContentProvider(url), false); 26 } 27 8 28 function dumpUISourceCodeDisplayName(url) 9 29 { 10 var uiSourceCode = new WebInspector.UISourceCode(null, url, url, url, null);30 var uiSourceCode = addNetworkFile(url); 11 31 InspectorTest.addResult("UISourceCode display name for url \"" + url + "\" is \"" + WebInspector.TabbedEditorContainer.prototype._titleForFile(uiSourceCode) + "\"."); 12 32 } -
trunk/Source/WebCore/ChangeLog
r143567 r143568 1 2013-02-20 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Web Inspector: TabbedEditorContainer and OpenResourceDialog should show uiSourceCode path and name instead of parsedURL 4 https://bugs.webkit.org/show_bug.cgi?id=110334 5 6 Reviewed by Alexander Pavlov. 7 8 Introduced uiSourceCode.name() that returns a name based on uiSourceCode path. 9 OpenResourceDialog now shows uiSourceCode workspace path as a subtitle. 10 TabbedEditorContainer now shows uiSourceCode name in the tab header. 11 12 * inspector/front-end/FilteredItemSelectionDialog.js: 13 (WebInspector.OpenResourceDialog.filterOutEmptyURLs): 14 (WebInspector.OpenResourceDialog): 15 (WebInspector.OpenResourceDialog.prototype.itemTitleAt): 16 (WebInspector.OpenResourceDialog.prototype.itemSubtitleAt): 17 (WebInspector.OpenResourceDialog.prototype.itemKeyAt): 18 * inspector/front-end/NavigatorView.js: 19 (WebInspector.NavigatorView.prototype._updateScriptTitle): 20 * inspector/front-end/TabbedEditorContainer.js: 21 (WebInspector.TabbedEditorContainer.prototype._titleForFile): 22 * inspector/front-end/UISourceCode.js: 23 (WebInspector.UISourceCode.prototype.name): 24 1 25 2013-02-20 Pavel Feldman <pfeldman@chromium.org> 2 26 -
trunk/Source/WebCore/inspector/front-end/FilteredItemSelectionDialog.js
r141989 r143568 586 586 function filterOutEmptyURLs(uiSourceCode) 587 587 { 588 return !!uiSourceCode. parsedURL.lastPathComponent;588 return !!uiSourceCode.name(); 589 589 } 590 590 this._uiSourceCodes = this._uiSourceCodes.filter(filterOutEmptyURLs); … … 598 598 itemTitleAt: function(itemIndex) 599 599 { 600 return this._uiSourceCodes[itemIndex]. parsedURL.lastPathComponent;600 return this._uiSourceCodes[itemIndex].name().trimEnd(100); 601 601 }, 602 602 … … 616 616 itemSubtitleAt: function(itemIndex) 617 617 { 618 return this._uiSourceCodes[itemIndex].parsedURL.folderPathComponents; 618 var uiSourceCode = this._uiSourceCodes[itemIndex] 619 var projectName = uiSourceCode.project().displayName(); 620 var path = uiSourceCode.path().slice(); 621 path.pop(); 622 path.unshift(projectName); 623 return path.join("/"); 619 624 }, 620 625 … … 625 630 itemKeyAt: function(itemIndex) 626 631 { 627 return this._uiSourceCodes[itemIndex]. parsedURL.lastPathComponent;632 return this._uiSourceCodes[itemIndex].name(); 628 633 }, 629 634 -
trunk/Source/WebCore/inspector/front-end/TabbedEditorContainer.js
r141589 r143568 171 171 const minDisplayQueryParamLength = 5; 172 172 173 var title; 174 var parsedURL = uiSourceCode.parsedURL; 175 if (!parsedURL.isValid) 176 title = parsedURL.url ? parsedURL.url.trimMiddle(maxDisplayNameLength) : WebInspector.UIString("(program)"); 177 else { 178 var maxDisplayQueryParamLength = Math.max(minDisplayQueryParamLength, maxDisplayNameLength - parsedURL.lastPathComponent.length); 179 var displayQueryParams = parsedURL.queryParams ? "?" + parsedURL.queryParams.trimEnd(maxDisplayQueryParamLength - 1) : ""; 180 var displayLastPathComponent = parsedURL.lastPathComponent.trimMiddle(maxDisplayNameLength - displayQueryParams.length); 181 var displayName = displayLastPathComponent + displayQueryParams; 182 title = displayName || WebInspector.UIString("(program)"); 183 } 184 173 var title = uiSourceCode.name(); 174 title = title ? title.trimMiddle(maxDisplayNameLength) : WebInspector.UIString("(program)"); 185 175 if (uiSourceCode.isDirty()) 186 176 title += "*"; -
trunk/Source/WebCore/inspector/front-end/UISourceCode.js
r143451 r143568 97 97 { 98 98 return this._path; 99 }, 100 101 /** 102 * @return {string} 103 */ 104 name: function() 105 { 106 return this._path[this._path.length - 1]; 99 107 }, 100 108
Note: See TracChangeset
for help on using the changeset viewer.