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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 $scope.loadingMessage = "please wait..."; | 134 $scope.loadingMessage = "please wait..."; |
135 | 135 |
136 var currSortAsc = true; | 136 var currSortAsc = true; |
137 | 137 |
138 | 138 |
139 /** | 139 /** |
140 * On initial page load, load a full dictionary of results. | 140 * On initial page load, load a full dictionary of results. |
141 * Once the dictionary is loaded, unhide the page elements so they can | 141 * Once the dictionary is loaded, unhide the page elements so they can |
142 * render the data. | 142 * render the data. |
143 */ | 143 */ |
144 var liveQueryUrl = | 144 $scope.liveQueryUrl = |
145 "/live-results/setADir=" + encodeURIComponent($scope.setADir) + | 145 "/live-results/setADir=" + encodeURIComponent($scope.setADir) + |
146 "&setASection=" + encodeURIComponent($scope.setASection) + | 146 "&setASection=" + encodeURIComponent($scope.setASection) + |
147 "&setBDir=" + encodeURIComponent($scope.setBDir) + | 147 "&setBDir=" + encodeURIComponent($scope.setBDir) + |
148 "&setBSection=" + encodeURIComponent($scope.setBSection); | 148 "&setBSection=" + encodeURIComponent($scope.setBSection); |
149 $http.get(liveQueryUrl).success( | 149 $http.get($scope.liveQueryUrl).success( |
150 function(data, status, header, config) { | 150 function(data, status, header, config) { |
151 var dataHeader = data[constants.KEY__ROOT__HEADER]; | 151 var dataHeader = data[constants.KEY__ROOT__HEADER]; |
152 if (dataHeader[constants.KEY__HEADER__SCHEMA_VERSION] != | 152 if (dataHeader[constants.KEY__HEADER__SCHEMA_VERSION] != |
153 constants.VALUE__HEADER__SCHEMA_VERSION) { | 153 constants.VALUE__HEADER__SCHEMA_VERSION) { |
154 $scope.loadingMessage = "ERROR: Got JSON file with schema version " | 154 $scope.loadingMessage = "ERROR: Got JSON file with schema version " |
155 + dataHeader[constants.KEY__HEADER__SCHEMA_VERSION] | 155 + dataHeader[constants.KEY__HEADER__SCHEMA_VERSION] |
156 + " but expected schema version " | 156 + " but expected schema version " |
157 + constants.VALUE__HEADER__SCHEMA_VERSION; | 157 + constants.VALUE__HEADER__SCHEMA_VERSION; |
158 } else if (dataHeader[constants.KEY__HEADER__IS_STILL_LOADING]) { | 158 } else if (dataHeader[constants.KEY__HEADER__IS_STILL_LOADING]) { |
159 // Apply the server's requested reload delay to local time, | 159 // Apply the server's requested reload delay to local time, |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 */ | 1031 */ |
1032 $scope.getImageDiffRelativeUrl = function(imagePair) { | 1032 $scope.getImageDiffRelativeUrl = function(imagePair) { |
1033 var before = | 1033 var before = |
1034 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_A_URL] + "-vs-" + | 1034 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_A_URL] + "-vs-" + |
1035 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_B_URL]; | 1035 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_B_URL]; |
1036 return before.replace(/[^\w\-]/g, "_") + ".png"; | 1036 return before.replace(/[^\w\-]/g, "_") + ".png"; |
1037 } | 1037 } |
1038 | 1038 |
1039 } | 1039 } |
1040 ); | 1040 ); |
OLD | NEW |