Chromium Code Reviews| Index: gm/rebaseline_server/static/constants.js |
| diff --git a/gm/rebaseline_server/static/constants.js b/gm/rebaseline_server/static/constants.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..872745eeb503a2c66b3417248d45c72a5c657e3f |
| --- /dev/null |
| +++ b/gm/rebaseline_server/static/constants.js |
| @@ -0,0 +1,69 @@ |
| +/* |
| + * Constants used by our imagediff-viewing Javascript code. |
| + */ |
| +var module = angular.module( |
| + 'ConstantsModule', |
| + [] |
| +); |
| + |
| +module.constant('constants', (function() { |
| + return { |
| + // Keep these in sync with ../column.py |
|
epoger
2014/02/26 04:38:14
This is another big part of this CL: use of define
|
| + KEY__HEADER_TEXT: 'headerText', |
| + KEY__HEADER_URL: 'headerUrl', |
| + KEY__IS_FILTERABLE: 'isFilterable', |
| + KEY__IS_SORTABLE: 'isSortable', |
| + KEY__VALUES_AND_COUNTS: 'valuesAndCounts', |
| + |
| + // Keep these in sync with ../imagediffdb.py |
| + KEY__DIFFERENCE_DATA__MAX_DIFF_PER_CHANNEL: 'maxDiffPerChannel', |
| + KEY__DIFFERENCE_DATA__NUM_DIFF_PIXELS: 'numDifferingPixels', |
| + KEY__DIFFERENCE_DATA__PERCENT_DIFF_PIXELS: 'percentDifferingPixels', |
| + KEY__DIFFERENCE_DATA__PERCEPTUAL_DIFF: 'perceptualDifference', |
| + KEY__DIFFERENCE_DATA__WEIGHTED_DIFF: 'weightedDiffMeasure', |
| + |
| + // Keep these in sync with ../imagepair.py |
| + KEY__DIFFERENCE_DATA: 'differenceData', |
| + KEY__EXPECTATIONS_DATA: 'expectations', |
| + KEY__EXTRA_COLUMN_VALUES: 'extraColumns', |
| + KEY__IMAGE_A_URL: 'imageAUrl', |
| + KEY__IMAGE_B_URL: 'imageBUrl', |
| + KEY__IS_DIFFERENT: 'isDifferent', |
| + |
| + // Keep these in sync with ../imagepairset.py |
| + KEY__EXTRACOLUMNHEADERS: 'extraColumnHeaders', |
| + KEY__IMAGEPAIRS: 'imagePairs', |
| + KEY__IMAGESETS: 'imageSets', |
| + KEY__IMAGESETS__BASE_URL: 'baseUrl', |
| + KEY__IMAGESETS__DESCRIPTION: 'description', |
| + |
| + // Keep these in sync with ../results.py |
| + KEY__EXPECTATIONS__BUGS: 'bugs', |
| + KEY__EXPECTATIONS__IGNOREFAILURE: 'ignore-failure', |
| + KEY__EXPECTATIONS__REVIEWED: 'reviewed-by-human', |
| + KEY__EXTRACOLUMN__BUILDER: 'builder', |
| + KEY__EXTRACOLUMN__CONFIG: 'config', |
| + KEY__EXTRACOLUMN__RESULT_TYPE: 'resultType', |
| + KEY__EXTRACOLUMN__TEST: 'test', |
| + KEY__HEADER__RESULTS_ALL: 'all', |
| + KEY__HEADER__RESULTS_FAILURES: 'failures', |
| + KEY__NEW_IMAGE_URL: 'newImageUrl', |
| + KEY__RESULT_TYPE__FAILED: 'failed', |
| + KEY__RESULT_TYPE__FAILUREIGNORED: 'failure-ignored', |
| + KEY__RESULT_TYPE__NOCOMPARISON: 'no-comparison', |
| + KEY__RESULT_TYPE__SUCCEEDED: 'succeeded', |
| + |
| + // Keep these in sync with ../server.py |
| + KEY__EDITS__MODIFICATIONS: 'modifications', |
| + KEY__EDITS__OLD_RESULTS_HASH: 'oldResultsHash', |
| + KEY__EDITS__OLD_RESULTS_TYPE: 'oldResultsType', |
| + KEY__HEADER: 'header', |
| + KEY__HEADER__DATAHASH: 'dataHash', |
| + KEY__HEADER__IS_EDITABLE: 'isEditable', |
| + KEY__HEADER__IS_EXPORTED: 'isExported', |
| + KEY__HEADER__IS_STILL_LOADING: 'resultsStillLoading', |
| + KEY__HEADER__TIME_NEXT_UPDATE_AVAILABLE: 'timeNextUpdateAvailable', |
| + KEY__HEADER__TIME_UPDATED: 'timeUpdated', |
| + KEY__HEADER__TYPE: 'type', |
| + } |
| +})()) |