Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Tools / GardeningServer / ui / ct-failure-card-buttons.html
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 <link rel="import" href="../model/ct-builder-list.html">
8 <link rel="import" href="ct-button.html">
9 <link rel="import" href="../bower_components/paper-dialog/paper-dialog.html">
10 <link rel="import" href="../bower_components/paper-dialog/paper-dialog-transition.html">
11 <link rel="import" href="../bower_components/paper-input/paper-input.html">
12
13 <polymer-element name="ct-failure-card-buttons" attributes="group bug">
14   <template>
15     <style>
16       :host {
17         display: flex;
18       }
19       :host > * {
20         margin-right: 5px;
21       }
22       ct-button {
23         white-space: nowrap;
24       }
25     </style>
26     <ct-button id="examine" on-tap="{{ examine }}" label="Examine"></ct-button>
27     <template if="{{ !group.isSnoozed }}">
28       <ct-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></ct-button>
29     </template>
30     <template if="{{ group.isSnoozed }}">
31       <ct-button id="snooze" on-tap="{{ unsnooze }}" label="Unsnooze"></ct-button>
32     </template>
33     <ct-button id="link-bug" on-tap="{{ linkBug }}" label="Link Bug"></ct-button>
34
35     <paper-dialog heading="Enter bug number" transition="paper-transition-center" id="bugDialog">
36       <paper-input label="Bug# or URL" floatingLabel autofocus id="bug"></paper-input>
37       <ct-button label="Remove bug link" on-tap="{{ removeBug }}" dismissive id="dialogRemoveBug"></ct-button>
38       <ct-button label="OK" on-tap="{{ saveBug }}" affirmative id="dialogOk"></ct-button>
39     </paper-dialog>
40   </template>
41   <script>
42     Polymer({
43       group: null,
44
45       examine: function() {
46         this.fire('ct-examine-failures', this.group);
47       },
48
49       snooze: function() {
50         this.group.snoozeUntil(Date.now() + 60 * 60 * 1000);
51       },
52
53       unsnooze: function() {
54         this.group.unsnooze();
55       },
56
57       linkBug: function() {
58         this.$.bug.value = this.group.bug;
59         this.$.bugDialog.toggle();
60       },
61
62       saveBug: function() {
63         this.group.setBug(this.$.bug.value);
64       },
65
66       removeBug: function() {
67         this.group.clearBug();
68       },
69     });
70   </script>
71 </polymer-element>