Chromium Code Reviews| Index: gm/rebaseline_server/static/loader.js |
| =================================================================== |
| --- gm/rebaseline_server/static/loader.js (revision 11963) |
| +++ gm/rebaseline_server/static/loader.js (working copy) |
| @@ -21,8 +21,9 @@ |
| var filteredItems = []; |
| for (var i = 0; i < unfilteredItems.length; i++) { |
| var item = unfilteredItems[i]; |
| - // For performance, we examine the "set" objects directly rather |
| - // than calling $scope.isValueInSet(). |
| + // For performance, we examine the "set" objects directly rather |
|
epoger
2013/10/25 16:38:26
fixed some tabs -> spaces
|
| + // than calling $scope.isValueInSet(). |
| + // Besides, I don't think we have access to $scope in here... |
| if (!(true == hiddenResultTypes[item.resultType]) && |
| !(true == hiddenConfigs[item.config]) && |
| (viewingTab == item.tab)) { |
| @@ -83,10 +84,10 @@ |
| $scope.testData[i].tab = $scope.defaultTab; |
| } |
| - // Arrays within which the user can toggle individual elements. |
| + // Arrays within which the user can toggle individual elements. |
| $scope.selectedItems = []; |
| - // Sets within which the user can toggle individual elements. |
| + // Sets within which the user can toggle individual elements. |
| $scope.hiddenResultTypes = { |
| 'failure-ignored': true, |
| 'no-comparison': true, |
| @@ -108,6 +109,48 @@ |
| // |
| + // Select/Clear/Toggle all tests. |
| + // |
| + |
| + /** |
| + * Select all currently showing tests. |
| + */ |
| + $scope.selectAllItems = function() { |
| + var numItemsShowing = $scope.limitedTestData.length; |
| + for (var i=0; i<numItemsShowing; i++) { |
| + var index = $scope.limitedTestData[i].index; |
| + if (!$scope.isValueInArray(index, $scope.selectedItems)) { |
| + $scope.toggleValueInArray(index, $scope.selectedItems); |
| + } |
| + } |
| + } |
| + |
| + /** |
| + * Deselect all currently showing tests. |
| + */ |
| + $scope.clearAllItems = function() { |
| + var numItemsShowing = $scope.limitedTestData.length; |
| + for (var i=0; i<numItemsShowing; i++) { |
| + var index = $scope.limitedTestData[i].index; |
| + if ($scope.isValueInArray(index, $scope.selectedItems)) { |
| + $scope.toggleValueInArray(index, $scope.selectedItems); |
| + } |
| + } |
| + } |
| + |
| + /** |
| + * Toggle selection of all currently showing tests. |
| + */ |
| + $scope.toggleAllItems = function() { |
| + var numItemsShowing = $scope.limitedTestData.length; |
| + for (var i=0; i<numItemsShowing; i++) { |
| + var index = $scope.limitedTestData[i].index; |
| + $scope.toggleValueInArray(index, $scope.selectedItems); |
| + } |
| + } |
| + |
| + |
| + // |
| // Tab operations. |
| // |
| @@ -204,8 +247,7 @@ |
| true |
| ), |
| $scope.sortColumn); |
| - $scope.limitedTestData = $filter("limitTo")( |
| - $scope.filteredTestData, $scope.displayLimit); |
| + $scope.limitedTestData = $scope.filteredTestData; |
| } |
| $scope.imageSize = $scope.imageSizePending; |
| $scope.setUpdatesPending(false); |
| @@ -245,6 +287,10 @@ |
| expectedHashType: actualResult['actualHashType'], |
| expectedHashDigest: actualResult['actualHashDigest'], |
| }; |
| + // Since these are *approvals*, we make assumptions about these fields: |
| + expectedResult['reviewed-by-human'] = true; |
| + // expectedResult['bugs'] is empty |
| + // expectedResult['ignore-failure'] is empty (defaults to false) |
| newResults.push(expectedResult); |
| } |
| $http({ |