blob: bd198b24b4842b6dbd1d4d8cb82c0e47934768d0 [file] [log] [blame]
zachr@google.com9432c0c2013-07-09 21:08:28 +00001<!doctype html>
zachr@google.com1bc995e2013-07-12 13:39:53 +00002<!-- This whole page uses the module -->
3<html ng-app="diff_viewer">
zachr@google.com9432c0c2013-07-09 21:08:28 +00004 <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.com1bc995e2013-07-12 13:39:53 +000013 <!--
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.com9432c0c2013-07-09 21:08:28 +000019 <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;">&nbsp;</span>
23 {{ differ.title }}
24 </button>
25 </div>
zachr@google.com1bc995e2013-07-12 13:39:53 +000026 <!-- Begin list of differences -->
zachr@google.com9432c0c2013-07-09 21:08:28 +000027 <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.com1bc995e2013-07-12 13:39:53 +000036 <!--
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.com9432c0c2013-07-09 21:08:28 +000040 <tr ng-repeat="record in records | orderBy:sortingDiffer | limitTo:500">
zachr@google.com1bc995e2013-07-12 13:39:53 +000041 <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.com9432c0c2013-07-09 21:08:28 +000049 <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.com1bc995e2013-07-12 13:39:53 +000059 </script>
60 <!-- Whatever template is used is rendered in the following div -->
61 <div ng-view></div>
zachr@google.com9432c0c2013-07-09 21:08:28 +000062 </body>
zachr@google.com35f02fb2013-07-22 17:05:24 +000063</html>