Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(901)

Side by Side Diff: Tools/GardeningServer/ui/ct-results-comparison.html

Issue 350563002: Port first garden-o-matic component over to polymer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: use mdv Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!--
2 Copyright 2014 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file.
5 -->
6
7 <polymer-element name="ct-results-comparison" attributes="type expectedUrl actu alUrl diffUrl">
8 <template>
9 <style>
10 :host {
11 display: flex;
12 flex-wrap: wrap;
13 width: 100%;
14 }
15 .container {
16 flex: 1;
17 min-width: 300px;
18 }
19 .result {
20 border: 1px solid gray;
21 }
22 iframe {
23 border: none;
24 width: 100%;
25 height: 400px;
26 }
27 img {
28 width: 100%;
29 }
30 </style>
31
32 <template repeat="{{resultKind in _resultKinds}}">
33 <div class="container">
34 <h2>{{resultKind}}</h2>
35 <div class="result">
36 <template if="{{type == _kImageType && _urlForKind(resultKin d)}}">
37 <img src="{{_urlForKind(resultKind)}}">
38 </template>
39 <template if="{{type == _kTextType && _urlForKind(resultKind )}}">
40 <iframe src="{{_urlForKind(resultKind)}}"></iframe>
41 </template>
42 <template if="{{type == _kAudioType && _urlForKind(resultKin d)}}">
43 <audio controls src="{{_urlForKind(resultKind)}}"></audi o>
44 </template>
45 </div>
46 </div>
47 </template>
48 </template>
49 <script>
50 Polymer({
51 _urlForKind: function(kind) {
52 if (kind == "Expected")
53 return this.expectedUrl;
54 if (kind == "Actual")
55 return this.actualUrl;
56 if (kind == "Diff")
57 return this.diffUrl;
58 },
59 _kAudioType: results.kAudioType,
60 _kImageType: results.kImageType,
61 _kTextType: results.kTextType,
62 _resultKinds: ["Expected", "Actual", "Diff"],
63 });
64 </script>
65 </polymer-element>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698