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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 }; | 419 }; |
420 $scope.queryParameters.map[constants.KEY__EXTRACOLUMNS__BUILDER] = | 420 $scope.queryParameters.map[constants.KEY__EXTRACOLUMNS__BUILDER] = |
421 $scope.queryParameters.copiers.categoryValueMatch; | 421 $scope.queryParameters.copiers.categoryValueMatch; |
422 $scope.queryParameters.map[constants.KEY__EXTRACOLUMNS__TEST] = | 422 $scope.queryParameters.map[constants.KEY__EXTRACOLUMNS__TEST] = |
423 $scope.queryParameters.copiers.categoryValueMatch; | 423 $scope.queryParameters.copiers.categoryValueMatch; |
424 | 424 |
425 // Loads all parameters into $scope from the URL query string; | 425 // Loads all parameters into $scope from the URL query string; |
426 // any which are not found within the URL will keep their current value. | 426 // any which are not found within the URL will keep their current value. |
427 $scope.queryParameters.load = function() { | 427 $scope.queryParameters.load = function() { |
428 var nameValuePairs = $location.search(); | 428 var nameValuePairs = $location.search(); |
| 429 |
| 430 var urlSchemaVersion = nameValuePairs[constants.URL_KEY__SCHEMA_VERSION]; |
| 431 if (!urlSchemaVersion) { |
| 432 $scope.urlSchemaVersionLoaded = 0; |
| 433 } else if (urlSchemaVersion == constants.URL_VALUE__SCHEMA_VERSION__ALWAYS
_CURRENT) { |
| 434 $scope.urlSchemaVersionLoaded = constants.URL_VALUE__SCHEMA_VERSION__CUR
RENT; |
| 435 } else { |
| 436 $scope.urlSchemaVersionLoaded = urlSchemaVersion; |
| 437 } |
| 438 |
429 angular.forEach($scope.queryParameters.map, | 439 angular.forEach($scope.queryParameters.map, |
430 function(copier, paramName) { | 440 function(copier, paramName) { |
431 copier.load(nameValuePairs, paramName); | 441 copier.load(nameValuePairs, paramName); |
432 } | 442 } |
433 ); | 443 ); |
434 }; | 444 }; |
435 | 445 |
436 // Saves all parameters from $scope into the URL query string. | 446 // Saves all parameters from $scope into the URL query string. |
437 $scope.queryParameters.save = function() { | 447 $scope.queryParameters.save = function() { |
438 var nameValuePairs = {}; | 448 var nameValuePairs = {}; |
| 449 nameValuePairs[constants.URL_KEY__SCHEMA_VERSION] = constants.URL_VALUE__S
CHEMA_VERSION__CURRENT; |
439 angular.forEach($scope.queryParameters.map, | 450 angular.forEach($scope.queryParameters.map, |
440 function(copier, paramName) { | 451 function(copier, paramName) { |
441 copier.save(nameValuePairs, paramName); | 452 copier.save(nameValuePairs, paramName); |
442 } | 453 } |
443 ); | 454 ); |
444 $location.search(nameValuePairs); | 455 $location.search(nameValuePairs); |
445 }; | 456 }; |
446 | 457 |
447 | 458 |
448 // | 459 // |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 */ | 934 */ |
924 $scope.getImageDiffRelativeUrl = function(imagePair) { | 935 $scope.getImageDiffRelativeUrl = function(imagePair) { |
925 var before = | 936 var before = |
926 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_A_URL] + "-vs-" + | 937 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_A_URL] + "-vs-" + |
927 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_B_URL]; | 938 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_B_URL]; |
928 return before.replace(/[^\w\-]/g, "_") + ".png"; | 939 return before.replace(/[^\w\-]/g, "_") + ".png"; |
929 } | 940 } |
930 | 941 |
931 } | 942 } |
932 ); | 943 ); |
OLD | NEW |