zachr@google.com | 9432c0c | 2013-07-09 21:08:28 +0000 | [diff] [blame] | 1 | <!doctype html> |
zachr@google.com | 1bc995e | 2013-07-12 13:39:53 +0000 | [diff] [blame] | 2 | <!-- This whole page uses the module --> |
| 3 | <html ng-app="diff_viewer"> |
zachr@google.com | 9432c0c | 2013-07-09 21:08:28 +0000 | [diff] [blame] | 4 | <head> |
| 5 | <script type="text/javascript" |
| 6 | src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> |
| 7 | <script type="text/javascript" src="skpdiff_output.json"></script> |
| 8 | <script type="text/javascript" src="diff_viewer.js"></script> |
| 9 | <link rel="stylesheet" type="text/css" href="viewer_style.css"> |
| 10 | <title>SkPDiff</title> |
| 11 | </head> |
| 12 | <body> |
zachr@google.com | 1bc995e | 2013-07-12 13:39:53 +0000 | [diff] [blame] | 13 | <!-- |
| 14 | All templates are being included with the main page to avoid using AJAX, which would force |
| 15 | us to use a webserver. |
| 16 | --> |
| 17 | <script type="text/ng-template" id="/diff_list.html"> |
| 18 | <!-- Give a choice of how to order the differs --> |
zachr@google.com | 9432c0c | 2013-07-09 21:08:28 +0000 | [diff] [blame] | 19 | <div style="margin:8px"> |
| 20 | Show me the worst by metric: |
| 21 | <button ng-repeat="differ in differs" ng-click="setSortIndex($index)"> |
| 22 | <span class="result-{{ $index }}" style="padding-left:12px;"> </span> |
| 23 | {{ differ.title }} |
| 24 | </button> |
| 25 | </div> |
zachr@google.com | 1bc995e | 2013-07-12 13:39:53 +0000 | [diff] [blame] | 26 | <!-- Begin list of differences --> |
zachr@google.com | 9432c0c | 2013-07-09 21:08:28 +0000 | [diff] [blame] | 27 | <table> |
| 28 | <thead> |
| 29 | <tr> |
| 30 | <td>Baseline Image</td> |
| 31 | <td>Actual Image</td> |
| 32 | <td>Results</td> |
| 33 | </tr> |
| 34 | </thead> |
| 35 | <tbody> |
zachr@google.com | 1bc995e | 2013-07-12 13:39:53 +0000 | [diff] [blame] | 36 | <!-- |
| 37 | Loops through every record and crates a row for it. This sorts based on the whichever |
| 38 | metric the user chose, and places a limit on the max number of records to show. |
| 39 | --> |
zachr@google.com | 9432c0c | 2013-07-09 21:08:28 +0000 | [diff] [blame] | 40 | <tr ng-repeat="record in records | orderBy:sortingDiffer | limitTo:500"> |
zachr@google.com | 1bc995e | 2013-07-12 13:39:53 +0000 | [diff] [blame] | 41 | <td><swap-img left-src="{{ record.baselinePath }}" |
| 42 | right-src="{{ record.testPath }}" |
| 43 | side="left" |
| 44 | class="gm-image left-image" /></td> |
| 45 | <td><swap-img left-src="{{ record.baselinePath }}" |
| 46 | right-src="{{ record.testPath }}" |
| 47 | side="right" |
| 48 | class="gm-image right-image" /></td> |
zachr@google.com | 9432c0c | 2013-07-09 21:08:28 +0000 | [diff] [blame] | 49 | <td> |
| 50 | <div ng-repeat="diff in record.diffs" |
| 51 | ng-mouseover="highlight(diff.differName)" |
| 52 | class="result result-{{$index}}"> |
| 53 | <span class="result-button">{{ diff.result }}</span> |
| 54 | </div> |
| 55 | </td> |
| 56 | </tr> |
| 57 | </tbody> |
| 58 | </table> |
zachr@google.com | 1bc995e | 2013-07-12 13:39:53 +0000 | [diff] [blame] | 59 | </script> |
| 60 | <!-- Whatever template is used is rendered in the following div --> |
| 61 | <div ng-view></div> |
zachr@google.com | 9432c0c | 2013-07-09 21:08:28 +0000 | [diff] [blame] | 62 | </body> |
zachr@google.com | 904f86e | 2013-07-22 13:29:20 +0000 | [diff] [blame] | 63 | </html> |