Changeset 75714 in webkit
- Timestamp:
- Jan 13, 2011 7:49:37 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r75713 r75714 1 2011-01-13 Mikhail Naganov <mnaganov@chromium.org> 2 3 Reviewed by Timothy Hatcher. 4 5 Web Inspector: Cleanup after r75613 -- make all UI-facing strings 6 to be passed directly to WebInspector.UIString 7 8 https://bugs.webkit.org/show_bug.cgi?id=52365 9 10 * English.lproj/localizedStrings.js: 11 * inspector/front-end/ApplicationCacheItemsView.js: 12 (WebInspector.ApplicationCacheItemsView.prototype._updateCallback): 13 (WebInspector.ApplicationCacheItemsView.prototype._populateDataGrid): 14 * inspector/front-end/AuditRules.js: 15 (WebInspector.AuditRules.GzipRule.prototype.doRun): 16 (WebInspector.AuditRules.CookieSizeRule.prototype.processCookies): 17 (WebInspector.AuditRules.StaticCookielessRule.prototype.processCookies): 18 * inspector/front-end/BreakpointsSidebarPane.js: 19 (WebInspector.EventListenerBreakpointsSidebarPane): 20 (WebInspector.EventListenerBreakpointsSidebarPane.prototype._createCategory): 21 * inspector/front-end/CookieItemsView.js: 22 (WebInspector.CookieItemsView.prototype._updateWithCookies): 23 * inspector/front-end/ImageView.js: 24 (WebInspector.ImageView.prototype._createContentIfNeeded.onImageLoad): 25 (WebInspector.ImageView.prototype._createContentIfNeeded): 26 * inspector/front-end/NetworkPanel.js: 27 (WebInspector.NetworkTimeCalculator.prototype.formatValue): 28 (WebInspector.NetworkTransferTimeCalculator.prototype.formatValue): 29 (WebInspector.NetworkTransferDurationCalculator.prototype.formatValue): 30 * inspector/front-end/ProfileDataGridTree.js: 31 (WebInspector.ProfileDataGridNode.prototype.get data.formatMilliseconds): 32 (WebInspector.ProfileDataGridNode.prototype.get data): 33 * inspector/front-end/Resource.js: 34 (WebInspector.Resource.Type.toUIString): 35 (WebInspector.Resource.Type.toString): 36 * inspector/front-end/TimelineOverviewPane.js: 37 (WebInspector.TimelineOverviewCalculator.prototype.formatValue): 38 * inspector/front-end/TimelinePanel.js: 39 (WebInspector.TimelinePanel): 40 (WebInspector.TimelineCalculator.prototype.formatValue): 41 (WebInspector.TimelinePanel.FormattedRecord.prototype._generateAggregatedInfo): 42 (WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent): 43 (WebInspector.TimelinePanel.FormattedRecord.prototype._getRecordDetails): 44 * inspector/front-end/utilities.js: 45 (): 46 1 47 2011-01-13 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com> 2 48 -
trunk/Source/WebCore/inspector/front-end/ApplicationCacheItemsView.js
r70214 r75714 168 168 this.deleteButton.visible = true; 169 169 170 var totalSizeString = Number.bytesToString(this._size , WebInspector.UIString);170 var totalSizeString = Number.bytesToString(this._size); 171 171 this._treeElement.subtitle = WebInspector.UIString("%s (%s)", lastPathComponent, totalSizeString); 172 172 … … 224 224 data[0] = resource.name; 225 225 data[1] = resource.type; 226 data[2] = Number.bytesToString(resource.size , WebInspector.UIString);226 data[2] = Number.bytesToString(resource.size); 227 227 var node = new WebInspector.DataGridNode(data); 228 228 node.resource = resource; -
trunk/Source/WebCore/inspector/front-end/AuditRules.js
r74709 r75714 93 93 var savings = 2 * size / 3; 94 94 totalSavings += savings; 95 summary.addChild(String.sprintf("%s could save ~%s", WebInspector.AuditRuleResult.linkifyDisplayName(resource.url), Number.bytesToString(savings , WebInspector.UIString)));95 summary.addChild(String.sprintf("%s could save ~%s", WebInspector.AuditRuleResult.linkifyDisplayName(resource.url), Number.bytesToString(savings))); 96 96 result.violationCount++; 97 97 } … … 99 99 if (!totalSavings) 100 100 return callback(null); 101 summary.value = String.sprintf("Compressing the following resources with gzip could reduce their transfer size by about two thirds (~%s):", Number.bytesToString(totalSavings , WebInspector.UIString));101 summary.value = String.sprintf("Compressing the following resources with gzip could reduce their transfer size by about two thirds (~%s):", Number.bytesToString(totalSavings)); 102 102 callback(result); 103 103 }, … … 967 967 var maxCookieSize = sortedCookieSizes[i].maxCookieSize; 968 968 if (maxCookieSize > this._maxBytesThreshold) 969 hugeCookieDomains.push(WebInspector.AuditRuleResult.resourceDomain(sortedCookieSizes[i].domain) + ": " + Number.bytesToString(maxCookieSize , WebInspector.UIString));969 hugeCookieDomains.push(WebInspector.AuditRuleResult.resourceDomain(sortedCookieSizes[i].domain) + ": " + Number.bytesToString(maxCookieSize)); 970 970 } 971 971 … … 976 976 var avgCookieSize = sortedCookieSizes[i].avgCookieSize; 977 977 if (avgCookieSize > this._avgBytesThreshold && avgCookieSize < this._maxBytesThreshold) 978 bigAvgCookieDomains.push(WebInspector.AuditRuleResult.resourceDomain(domain) + ": " + Number.bytesToString(avgCookieSize , WebInspector.UIString));979 } 980 result.addChild(String.sprintf("The average cookie size for all requests on this page is %s", Number.bytesToString(avgAllCookiesSize , WebInspector.UIString)));978 bigAvgCookieDomains.push(WebInspector.AuditRuleResult.resourceDomain(domain) + ": " + Number.bytesToString(avgCookieSize)); 979 } 980 result.addChild(String.sprintf("The average cookie size for all requests on this page is %s", Number.bytesToString(avgAllCookiesSize))); 981 981 982 982 var message; … … 1028 1028 return; 1029 1029 1030 var entry = result.addChild(String.sprintf("%s of cookies were sent with the following static resources. Serve these static resources from a domain that does not set cookies:", Number.bytesToString(cookieBytes , WebInspector.UIString)), true);1030 var entry = result.addChild(String.sprintf("%s of cookies were sent with the following static resources. Serve these static resources from a domain that does not set cookies:", Number.bytesToString(cookieBytes)), true); 1031 1031 entry.addURLs(badUrls); 1032 1032 result.violationCount = badUrls.length; -
trunk/Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js
r75613 r75714 266 266 267 267 this._breakpointItems = {}; 268 this._createCategory( /*@LS*/"Keyboard", "listener", ["keydown", "keyup", "keypress", "textInput"]);269 this._createCategory( /*@LS*/"Mouse", "listener", ["click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove", "mouseout", "mousewheel"]);268 this._createCategory(WebInspector.UIString("Keyboard"), "listener", ["keydown", "keyup", "keypress", "textInput"]); 269 this._createCategory(WebInspector.UIString("Mouse"), "listener", ["click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove", "mouseout", "mousewheel"]); 270 270 // FIXME: uncomment following once inspector stops being drop targer in major ports. 271 271 // Otherwise, inspector page reacts on drop event and tries to load the event data. 272 // this._createCategory( /*@LS*/"Drag", "listener", ["drag", "drop", "dragstart", "dragend", "dragenter", "dragleave", "dragover"]);273 this._createCategory( /*@LS*/"Control", "listener", ["resize", "scroll", "zoom", "focus", "blur", "select", "change", "submit", "reset"]);274 this._createCategory( /*@LS*/"Clipboard", "listener", ["copy", "cut", "paste", "beforecopy", "beforecut", "beforepaste"]);275 this._createCategory( /*@LS*/"Load", "listener", ["load", "unload", "abort", "error"]);276 this._createCategory( /*@LS*/"DOM Mutation", "listener", ["DOMActivate", "DOMFocusIn", "DOMFocusOut", "DOMAttrModified", "DOMCharacterDataModified", "DOMNodeInserted", "DOMNodeInsertedIntoDocument", "DOMNodeRemoved", "DOMNodeRemovedFromDocument", "DOMSubtreeModified", "DOMContentLoaded"]);277 this._createCategory( /*@LS*/"Device", "listener", ["deviceorientation", "devicemotion"]);278 this._createCategory( /*@LS*/"Timer", "instrumentation", ["setTimer", "clearTimer", "timerFired"]);272 // this._createCategory(WebInspector.UIString("Drag"), "listener", ["drag", "drop", "dragstart", "dragend", "dragenter", "dragleave", "dragover"]); 273 this._createCategory(WebInspector.UIString("Control"), "listener", ["resize", "scroll", "zoom", "focus", "blur", "select", "change", "submit", "reset"]); 274 this._createCategory(WebInspector.UIString("Clipboard"), "listener", ["copy", "cut", "paste", "beforecopy", "beforecut", "beforepaste"]); 275 this._createCategory(WebInspector.UIString("Load"), "listener", ["load", "unload", "abort", "error"]); 276 this._createCategory(WebInspector.UIString("DOM Mutation"), "listener", ["DOMActivate", "DOMFocusIn", "DOMFocusOut", "DOMAttrModified", "DOMCharacterDataModified", "DOMNodeInserted", "DOMNodeInsertedIntoDocument", "DOMNodeRemoved", "DOMNodeRemovedFromDocument", "DOMSubtreeModified", "DOMContentLoaded"]); 277 this._createCategory(WebInspector.UIString("Device"), "listener", ["deviceorientation", "devicemotion"]); 278 this._createCategory(WebInspector.UIString("Timer"), "instrumentation", ["setTimer", "clearTimer", "timerFired"]); 279 279 } 280 280 … … 283 283 { 284 284 var categoryItem = {}; 285 categoryItem.element = new TreeElement( WebInspector.UIString(name));285 categoryItem.element = new TreeElement(name); 286 286 this.categoriesTreeOutline.appendChild(categoryItem.element); 287 287 categoryItem.element.listItemElement.addStyleClass("event-category"); -
trunk/Source/WebCore/inspector/front-end/CookieItemsView.js
r75489 r75714 102 102 if (isAdvanced) { 103 103 this._treeElement.subtitle = String.sprintf(WebInspector.UIString("%d cookies (%s)"), this._cookies.length, 104 Number.bytesToString(this._totalSize , WebInspector.UIString));104 Number.bytesToString(this._totalSize)); 105 105 this._deleteButton.visible = true; 106 106 } -
trunk/Source/WebCore/inspector/front-end/ImageView.js
r72655 r75714 88 88 var imageProperties = [ 89 89 { name: WebInspector.UIString("Dimensions"), value: WebInspector.UIString("%d × %d", imagePreviewElement.naturalWidth, imagePreviewElement.naturalHeight) }, 90 { name: WebInspector.UIString("File size"), value: Number.bytesToString(resourceSize , WebInspector.UIString) },90 { name: WebInspector.UIString("File size"), value: Number.bytesToString(resourceSize) }, 91 91 { name: WebInspector.UIString("MIME type"), value: this.resource.mimeType } 92 92 ]; -
trunk/Source/WebCore/inspector/front-end/NetworkPanel.js
r74709 r75714 1231 1231 formatValue: function(value) 1232 1232 { 1233 return Number.secondsToString(value , WebInspector.UIString);1233 return Number.secondsToString(value); 1234 1234 }, 1235 1235 … … 1255 1255 formatValue: function(value) 1256 1256 { 1257 return Number.secondsToString(value , WebInspector.UIString);1257 return Number.secondsToString(value); 1258 1258 }, 1259 1259 … … 1279 1279 formatValue: function(value) 1280 1280 { 1281 return Number.secondsToString(value , WebInspector.UIString);1281 return Number.secondsToString(value); 1282 1282 }, 1283 1283 -
trunk/Source/WebCore/inspector/front-end/ProfileDataGridTree.js
r67525 r75714 51 51 function formatMilliseconds(time) 52 52 { 53 return Number.secondsToString(time / 1000, WebInspector.UIString,!Preferences.samplingCPUProfiler);53 return Number.secondsToString(time / 1000, !Preferences.samplingCPUProfiler); 54 54 } 55 55 -
trunk/Source/WebCore/inspector/front-end/Resource.js
r75613 r75714 56 56 toUIString: function(type) 57 57 { 58 return WebInspector.UIString(WebInspector.Resource.Type.toString(type)); 58 switch (type) { 59 case this.Document: 60 return WebInspector.UIString("Document"); 61 case this.Stylesheet: 62 return WebInspector.UIString("Stylesheet"); 63 case this.Image: 64 return WebInspector.UIString("Image"); 65 case this.Font: 66 return WebInspector.UIString("Font"); 67 case this.Script: 68 return WebInspector.UIString("Script"); 69 case this.XHR: 70 return WebInspector.UIString("XHR"); 71 case this.Media: 72 return WebInspector.UIString("Media"); 73 case this.WebSocket: 74 return WebInspector.UIString("WebSocket"); 75 case this.Other: 76 default: 77 return WebInspector.UIString("Other"); 78 } 59 79 }, 60 80 … … 65 85 switch (type) { 66 86 case this.Document: 67 return /*@LS*/"document";87 return "document"; 68 88 case this.Stylesheet: 69 return /*@LS*/"stylesheet";89 return "stylesheet"; 70 90 case this.Image: 71 return /*@LS*/"image";91 return "image"; 72 92 case this.Font: 73 return /*@LS*/"font";93 return "font"; 74 94 case this.Script: 75 return /*@LS*/"script";95 return "script"; 76 96 case this.XHR: 77 return /*@LS*/"xhr";97 return "xhr"; 78 98 case this.Media: 79 return /*@LS*/"media";99 return "media"; 80 100 case this.WebSocket: 81 return /*@LS*/"websocket";101 return "websocket"; 82 102 case this.Other: 83 103 default: 84 return /*@LS*/"other";104 return "other"; 85 105 } 86 106 } -
trunk/Source/WebCore/inspector/front-end/TimelineOverviewPane.js
r68778 r75714 399 399 formatValue: function(value) 400 400 { 401 return Number.secondsToString(value , WebInspector.UIString);401 return Number.secondsToString(value); 402 402 } 403 403 } -
trunk/Source/WebCore/inspector/front-end/TimelinePanel.js
r75604 r75714 84 84 this._calculator = new WebInspector.TimelineCalculator(); 85 85 this._calculator._showShortEvents = false; 86 var shortRecordThresholdTitle = Number.secondsToString(WebInspector.TimelinePanel.shortRecordThreshold , WebInspector.UIString);86 var shortRecordThresholdTitle = Number.secondsToString(WebInspector.TimelinePanel.shortRecordThreshold); 87 87 this._showShortRecordsTitleText = WebInspector.UIString("Show the records that are shorter than %s", shortRecordThresholdTitle); 88 88 this._hideShortRecordsTitleText = WebInspector.UIString("Hide the records that are shorter than %s", shortRecordThresholdTitle); … … 711 711 formatValue: function(value) 712 712 { 713 return Number.secondsToString(value + this.minimumBoundary - this._absoluteMinimumBoundary , WebInspector.UIString);713 return Number.secondsToString(value + this.minimumBoundary - this._absoluteMinimumBoundary); 714 714 } 715 715 } … … 909 909 cell.appendChild(label); 910 910 var text = document.createElement("span"); 911 text.textContent = Number.secondsToString(this._aggregatedStats[index] + 0.0001 , WebInspector.UIString);911 text.textContent = Number.secondsToString(this._aggregatedStats[index] + 0.0001); 912 912 cell.appendChild(text); 913 913 } … … 920 920 921 921 if (this._children && this._children.length) { 922 contentHelper._appendTextRow(WebInspector.UIString("Self Time"), Number.secondsToString(this._selfTime + 0.0001 , WebInspector.UIString));922 contentHelper._appendTextRow(WebInspector.UIString("Self Time"), Number.secondsToString(this._selfTime + 0.0001)); 923 923 contentHelper._appendElementRow(WebInspector.UIString("Aggregated Time"), this._generateAggregatedInfo()); 924 924 } 925 var text = WebInspector.UIString("%s (at %s)", Number.secondsToString(this._lastChildEndTime - this.startTime , WebInspector.UIString),925 var text = WebInspector.UIString("%s (at %s)", Number.secondsToString(this._lastChildEndTime - this.startTime), 926 926 calculator.formatValue(this.startTime - calculator.minimumBoundary)); 927 927 contentHelper._appendTextRow(WebInspector.UIString("Duration"), text); … … 931 931 switch (this.type) { 932 932 case recordTypes.GCEvent: 933 contentHelper._appendTextRow(WebInspector.UIString("Collected"), Number.bytesToString(this.data.usedHeapSizeDelta , WebInspector.UIString));933 contentHelper._appendTextRow(WebInspector.UIString("Collected"), Number.bytesToString(this.data.usedHeapSizeDelta)); 934 934 break; 935 935 case recordTypes.TimerInstall: … … 938 938 contentHelper._appendTextRow(WebInspector.UIString("Timer ID"), this.data.timerId); 939 939 if (typeof this.timeout === "number") { 940 contentHelper._appendTextRow(WebInspector.UIString("Timeout"), Number.secondsToString(this.timeout / 1000 , WebInspector.UIString));940 contentHelper._appendTextRow(WebInspector.UIString("Timeout"), Number.secondsToString(this.timeout / 1000)); 941 941 contentHelper._appendTextRow(WebInspector.UIString("Repeats"), !this.singleShot); 942 942 } … … 979 979 980 980 if (this.usedHeapSize) 981 contentHelper._appendTextRow(WebInspector.UIString("Used Heap Size"), WebInspector.UIString("%s of %s", Number.bytesToString(this.usedHeapSize , WebInspector.UIString), Number.bytesToString(this.totalHeapSize, WebInspector.UIString)));981 contentHelper._appendTextRow(WebInspector.UIString("Used Heap Size"), WebInspector.UIString("%s of %s", Number.bytesToString(this.usedHeapSize), Number.bytesToString(this.totalHeapSize))); 982 982 983 983 if (this.callSiteStackTrace && this.callSiteStackTrace.length) … … 994 994 switch (record.type) { 995 995 case WebInspector.TimelineAgent.RecordType.GCEvent: 996 return WebInspector.UIString("%s collected", Number.bytesToString(record.data.usedHeapSizeDelta , WebInspector.UIString));996 return WebInspector.UIString("%s collected", Number.bytesToString(record.data.usedHeapSizeDelta)); 997 997 case WebInspector.TimelineAgent.RecordType.TimerFire: 998 998 return record.data.scriptName ? WebInspector.linkifyResourceAsNode(record.data.scriptName, "scripts", record.data.scriptLine, "", "") : record.data.timerId; -
trunk/Source/WebCore/inspector/front-end/utilities.js
r75613 r75714 644 644 } 645 645 646 Number.millisToString = function(ms, formatterFunction, higherResolution) 647 { 648 return Number.secondsToString(ms / 1000, formatterFunction, higherResolution); 649 } 650 651 Number.secondsToString = function(seconds, formatterFunction, higherResolution) 652 { 653 if (!formatterFunction) 654 formatterFunction = String.sprintf; 655 646 Number.millisToString = function(ms, higherResolution) 647 { 648 return Number.secondsToString(ms / 1000, higherResolution); 649 } 650 651 Number.secondsToString = function(seconds, higherResolution) 652 { 656 653 if (seconds === 0) 657 654 return "0"; … … 659 656 var ms = seconds * 1000; 660 657 if (higherResolution && ms < 1000) 661 return formatterFunction(/*@LS*/"%.3fms", ms);658 return WebInspector.UIString("%.3fms", ms); 662 659 else if (ms < 1000) 663 return formatterFunction(/*@LS*/"%.0fms", ms);660 return WebInspector.UIString("%.0fms", ms); 664 661 665 662 if (seconds < 60) 666 return formatterFunction(/*@LS*/"%.2fs", seconds);663 return WebInspector.UIString("%.2fs", seconds); 667 664 668 665 var minutes = seconds / 60; 669 666 if (minutes < 60) 670 return formatterFunction(/*@LS*/"%.1fmin", minutes);667 return WebInspector.UIString("%.1fmin", minutes); 671 668 672 669 var hours = minutes / 60; 673 670 if (hours < 24) 674 return formatterFunction(/*@LS*/"%.1fhrs", hours);671 return WebInspector.UIString("%.1fhrs", hours); 675 672 676 673 var days = hours / 24; 677 return formatterFunction(/*@LS*/"%.1f days", days); 678 } 679 680 Number.bytesToString = function(bytes, formatterFunction, higherResolution) 681 { 682 if (!formatterFunction) 683 formatterFunction = String.sprintf; 674 return WebInspector.UIString("%.1f days", days); 675 } 676 677 Number.bytesToString = function(bytes, higherResolution) 678 { 684 679 if (typeof higherResolution === "undefined") 685 680 higherResolution = true; 686 681 687 682 if (bytes < 1024) 688 return formatterFunction(/*@LS*/"%.0fB", bytes);683 return WebInspector.UIString("%.0fB", bytes); 689 684 690 685 var kilobytes = bytes / 1024; 691 686 if (higherResolution && kilobytes < 1024) 692 return formatterFunction(/*@LS*/"%.2fKB", kilobytes);687 return WebInspector.UIString("%.2fKB", kilobytes); 693 688 else if (kilobytes < 1024) 694 return formatterFunction(/*@LS*/"%.0fKB", kilobytes);689 return WebInspector.UIString("%.0fKB", kilobytes); 695 690 696 691 var megabytes = kilobytes / 1024; 697 692 if (higherResolution) 698 return formatterFunction(/*@LS*/"%.2fMB", megabytes);693 return WebInspector.UIString("%.2fMB", megabytes); 699 694 else 700 return formatterFunction(/*@LS*/"%.0fMB", megabytes);695 return WebInspector.UIString("%.0fMB", megabytes); 701 696 } 702 697 -
trunk/Tools/ChangeLog
r75705 r75714 1 2011-01-13 Mikhail Naganov <mnaganov@chromium.org> 2 3 Reviewed by Timothy Hatcher. 4 5 Web Inspector: Cleanup after r75613 -- make all UI-facing strings 6 to be passed directly to WebInspector.UIString 7 8 https://bugs.webkit.org/show_bug.cgi?id=52365 9 10 * Scripts/check-inspector-strings: 11 1 12 2011-01-13 Sheriff Bot <webkit.review.bot@gmail.com> 2 13 -
trunk/Tools/Scripts/check-inspector-strings
r75613 r75714 95 95 change_directory(checkout_root=checkout_root, paths=None) 96 96 97 strings_extractor = StringsExtractor([r" (?:WebInspector\.(?:UIString|formatLocalized)\(|/\*@LS\*/)\"((?:[^\"\\]|\\.)*?)\"", r"\"((?:[^\"\\]|\\.)*?)\""])97 strings_extractor = StringsExtractor([r"WebInspector\.(?:UIString|formatLocalized)\(\"((?:[^\"\\]|\\.)*?)\"", r"\"((?:[^\"\\]|\\.)*?)\""]) 98 98 file_reader = TextFileReader(strings_extractor) 99 99 file_reader.process_paths([_inspector_directory])
Note: See TracChangeset
for help on using the changeset viewer.