OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> | 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> |
4 * Copyright (C) 2011 Google Inc. All rights reserved. | 4 * Copyright (C) 2011 Google Inc. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
491 return fragment; | 491 return fragment; |
492 }, | 492 }, |
493 | 493 |
494 _patchTimelineHeader: function() | 494 _patchTimelineHeader: function() |
495 { | 495 { |
496 var timelineSorting = createElement("select"); | 496 var timelineSorting = createElement("select"); |
497 | 497 |
498 var option = createElement("option"); | 498 var option = createElement("option"); |
499 option.value = "startTime"; | 499 option.value = "startTime"; |
500 option.label = WebInspector.UIString("Timeline"); | 500 option.label = WebInspector.UIString("Timeline"); |
501 option.disabled = true; | |
501 timelineSorting.appendChild(option); | 502 timelineSorting.appendChild(option); |
502 | 503 |
503 option = createElement("option"); | 504 option = createElement("option"); |
504 option.value = "startTime"; | 505 option.value = "startTime"; |
505 option.label = WebInspector.UIString("Start Time"); | 506 option.label = WebInspector.UIString("Timeline \u2013 Start Time"); |
507 option.sortOrder = WebInspector.DataGrid.Order.Ascending; | |
506 timelineSorting.appendChild(option); | 508 timelineSorting.appendChild(option); |
507 | 509 |
508 option = createElement("option"); | 510 option = createElement("option"); |
509 option.value = "responseTime"; | 511 option.value = "responseTime"; |
510 option.label = WebInspector.UIString("Response Time"); | 512 option.label = WebInspector.UIString("Timeline \u2013 Response Time"); |
paulirish
2015/05/27 15:54:29
Response Start Time
dgozman
2015/05/29 12:58:31
This one is too similar to Start Time. I'd rather
| |
513 option.sortOrder = WebInspector.DataGrid.Order.Ascending; | |
511 timelineSorting.appendChild(option); | 514 timelineSorting.appendChild(option); |
512 | 515 |
513 option = createElement("option"); | 516 option = createElement("option"); |
514 option.value = "endTime"; | 517 option.value = "endTime"; |
515 option.label = WebInspector.UIString("End Time"); | 518 option.label = WebInspector.UIString("Timeline \u2013 End Time"); |
519 option.sortOrder = WebInspector.DataGrid.Order.Ascending; | |
516 timelineSorting.appendChild(option); | 520 timelineSorting.appendChild(option); |
517 | 521 |
518 option = createElement("option"); | 522 option = createElement("option"); |
519 option.value = "duration"; | 523 option.value = "duration"; |
520 option.label = WebInspector.UIString("Duration"); | 524 option.label = WebInspector.UIString("Timeline \u2013 Duration"); |
paulirish
2015/05/27 15:54:29
Total Duration
dgozman
2015/05/29 12:58:32
Done.
| |
525 option.sortOrder = WebInspector.DataGrid.Order.Descending; | |
521 timelineSorting.appendChild(option); | 526 timelineSorting.appendChild(option); |
522 | 527 |
523 option = createElement("option"); | 528 option = createElement("option"); |
524 option.value = "latency"; | 529 option.value = "latency"; |
525 option.label = WebInspector.UIString("Latency"); | 530 option.label = WebInspector.UIString("Timeline \u2013 Latency"); |
531 option.sortOrder = WebInspector.DataGrid.Order.Descending; | |
526 timelineSorting.appendChild(option); | 532 timelineSorting.appendChild(option); |
527 | 533 |
528 var header = this._dataGrid.headerTableHeader("timeline"); | 534 var header = this._dataGrid.headerTableHeader("timeline"); |
529 header.replaceChild(timelineSorting, header.firstChild); | 535 header.replaceChild(timelineSorting, header.firstChild); |
536 header.createChild("div", "sort-order-icon-container").createChild("div" , "sort-order-icon"); | |
530 | 537 |
538 timelineSorting.selectedIndex = 1; | |
531 timelineSorting.addEventListener("click", function(event) { event.consum e(); }, false); | 539 timelineSorting.addEventListener("click", function(event) { event.consum e(); }, false); |
532 timelineSorting.addEventListener("change", this._sortByTimeline.bind(thi s), false); | 540 timelineSorting.addEventListener("change", this._sortByTimeline.bind(thi s), false); |
533 this._timelineSortSelector = timelineSorting; | 541 this._timelineSortSelector = timelineSorting; |
534 }, | 542 }, |
535 | 543 |
536 _createSortingFunctions: function() | 544 _createSortingFunctions: function() |
537 { | 545 { |
538 this._sortingFunctions = {}; | 546 this._sortingFunctions = {}; |
539 this._sortingFunctions.name = WebInspector.NetworkDataGridNode.NameCompa rator; | 547 this._sortingFunctions.name = WebInspector.NetworkDataGridNode.NameCompa rator; |
540 this._sortingFunctions.method = WebInspector.NetworkDataGridNode.Request PropertyComparator.bind(null, "method", false); | 548 this._sortingFunctions.method = WebInspector.NetworkDataGridNode.Request PropertyComparator.bind(null, "method", false); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
600 var selectedIndex = this._timelineSortSelector.selectedIndex; | 608 var selectedIndex = this._timelineSortSelector.selectedIndex; |
601 if (!selectedIndex) | 609 if (!selectedIndex) |
602 selectedIndex = 1; // Sort by start time by default. | 610 selectedIndex = 1; // Sort by start time by default. |
603 var selectedOption = this._timelineSortSelector[selectedIndex]; | 611 var selectedOption = this._timelineSortSelector[selectedIndex]; |
604 var value = selectedOption.value; | 612 var value = selectedOption.value; |
605 | 613 |
606 this._setCalculator(this._calculators[value]); | 614 this._setCalculator(this._calculators[value]); |
607 var sortingFunction = this._sortingFunctions[value]; | 615 var sortingFunction = this._sortingFunctions[value]; |
608 this._dataGrid.sortNodes(sortingFunction); | 616 this._dataGrid.sortNodes(sortingFunction); |
609 this._highlightNthMatchedRequestForSearch(this._updateMatchCountAndFindM atchIndex(this._currentMatchedRequestNode), false); | 617 this._highlightNthMatchedRequestForSearch(this._updateMatchCountAndFindM atchIndex(this._currentMatchedRequestNode), false); |
610 this._dataGrid.markColumnAsSortedBy("timeline", WebInspector.DataGrid.Or der.Ascending); | 618 this._dataGrid.markColumnAsSortedBy("timeline", selectedOption.sortOrder ); |
611 }, | 619 }, |
612 | 620 |
613 _updateSummaryBar: function() | 621 _updateSummaryBar: function() |
614 { | 622 { |
615 var requestsNumber = this._nodesByRequestId.size; | 623 var requestsNumber = this._nodesByRequestId.size; |
616 | 624 |
617 if (!requestsNumber) { | 625 if (!requestsNumber) { |
618 if (this._summaryBarElement._isDisplayingWarning) | 626 if (this._summaryBarElement._isDisplayingWarning) |
619 return; | 627 return; |
620 this._summaryBarElement._isDisplayingWarning = true; | 628 this._summaryBarElement._isDisplayingWarning = true; |
(...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2019 if (request.endTime !== -1 && request.endTime < windowStart) | 2027 if (request.endTime !== -1 && request.endTime < windowStart) |
2020 return false; | 2028 return false; |
2021 return true; | 2029 return true; |
2022 } | 2030 } |
2023 | 2031 |
2024 WebInspector.NetworkLogView.EventTypes = { | 2032 WebInspector.NetworkLogView.EventTypes = { |
2025 RequestSelected: "RequestSelected", | 2033 RequestSelected: "RequestSelected", |
2026 SearchCountUpdated: "SearchCountUpdated", | 2034 SearchCountUpdated: "SearchCountUpdated", |
2027 SearchIndexUpdated: "SearchIndexUpdated" | 2035 SearchIndexUpdated: "SearchIndexUpdated" |
2028 }; | 2036 }; |
OLD | NEW |