Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Loader: | 2 * Loader: |
| 3 * Reads GM result reports written out by results.py, and imports | 3 * Reads GM result reports written out by results.py, and imports |
| 4 * them into $scope.extraColumnHeaders and $scope.imagePairs . | 4 * them into $scope.extraColumnHeaders and $scope.imagePairs . |
| 5 */ | 5 */ |
| 6 var Loader = angular.module( | 6 var Loader = angular.module( |
| 7 'Loader', | 7 'Loader', |
| 8 ['ConstantsModule'] | 8 ['ConstantsModule'] |
| 9 ); | 9 ); |
| 10 | 10 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 157 [constants.KEY__VALUES_AND_COUNTS]); | 157 [constants.KEY__VALUES_AND_COUNTS]); |
| 158 | 158 |
| 159 // Associative array of partial string matches per category. | 159 // Associative array of partial string matches per category. |
| 160 $scope.categoryValueMatch = {}; | 160 $scope.categoryValueMatch = {}; |
| 161 $scope.categoryValueMatch.builder = ""; | 161 $scope.categoryValueMatch.builder = ""; |
| 162 $scope.categoryValueMatch.test = ""; | 162 $scope.categoryValueMatch.test = ""; |
| 163 | 163 |
| 164 // If any defaults were overridden in the URL, get them now. | 164 // If any defaults were overridden in the URL, get them now. |
| 165 $scope.queryParameters.load(); | 165 $scope.queryParameters.load(); |
| 166 | 166 |
| 167 // All image URLs are relative to the JSON file's source directory. | |
|
epoger
2014/03/19 21:01:40
Reason for the change: wherever we store the JSON
borenet
2014/03/20 13:05:05
This seems inconsistent with the above comment, wh
| |
| 168 var baseUrlKey = constants.KEY__IMAGESETS__FIELD__BASE_URL; | |
| 169 angular.forEach( | |
| 170 $scope.imageSets, | |
| 171 function(imageSet) { | |
| 172 var baseUrl = imageSet[baseUrlKey]; | |
| 173 if (!(baseUrl.substring(0, 1) === '/') && | |
| 174 !(baseUrl.substring(0, 5).toUpperCase() === 'HTTP:') && | |
| 175 !(baseUrl.substring(0, 6).toUpperCase() === 'HTTPS:')) { | |
| 176 imageSet[baseUrlKey] = $scope.resultsToLoad + '/../' + baseUrl; | |
|
borenet
2014/03/20 13:05:05
Maybe move the above comment here and modify to so
| |
| 177 } | |
| 178 } | |
| 179 ); | |
| 180 | |
| 167 $scope.updateResults(); | 181 $scope.updateResults(); |
| 168 $scope.loadingMessage = ""; | 182 $scope.loadingMessage = ""; |
| 169 $scope.windowTitle = "Current GM Results"; | 183 $scope.windowTitle = "Current GM Results"; |
| 170 } | 184 } |
| 171 } | 185 } |
| 172 ).error( | 186 ).error( |
| 173 function(data, status, header, config) { | 187 function(data, status, header, config) { |
| 174 $scope.loadingMessage = "FAILED to load."; | 188 $scope.loadingMessage = "FAILED to load."; |
| 175 $scope.windowTitle = "Failed to Load GM Results"; | 189 $scope.windowTitle = "Failed to Load GM Results"; |
| 176 } | 190 } |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 789 */ | 803 */ |
| 790 $scope.getImageDiffRelativeUrl = function(imagePair) { | 804 $scope.getImageDiffRelativeUrl = function(imagePair) { |
| 791 var before = | 805 var before = |
| 792 imagePair[constants.KEY__IMAGE_A_URL] + "-vs-" + | 806 imagePair[constants.KEY__IMAGE_A_URL] + "-vs-" + |
| 793 imagePair[constants.KEY__IMAGE_B_URL]; | 807 imagePair[constants.KEY__IMAGE_B_URL]; |
| 794 return before.replace(/[^\w\-]/g, "_") + ".png"; | 808 return before.replace(/[^\w\-]/g, "_") + ".png"; |
| 795 } | 809 } |
| 796 | 810 |
| 797 } | 811 } |
| 798 ); | 812 ); |
| OLD | NEW |