| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 3 Use of this source code is governed by a BSD-style license that can be |
| 4 found in the LICENSE file. | 4 found in the LICENSE file. |
| 5 --> | 5 --><html><head><link rel="import" href="../model/ct-builder-list.html"> |
| 6 | |
| 7 <link rel="import" href="../model/ct-builder-list.html"> | |
| 8 <link rel="import" href="ct-button.html"> | 6 <link rel="import" href="ct-button.html"> |
| 9 <link rel="import" href="../bower_components/paper-dialog/paper-action-dialog.ht
ml"> | 7 <link rel="import" href="../bower_components/paper-dialog/paper-action-dialog.ht
ml"> |
| 10 <link rel="import" href="../bower_components/paper-dialog/paper-dialog-transitio
n.html"> | 8 <link rel="import" href="../bower_components/paper-dialog/paper-dialog-transitio
n.html"> |
| 11 <link rel="import" href="../bower_components/paper-input/paper-input.html"> | 9 <link rel="import" href="../bower_components/paper-input/paper-input.html"> |
| 12 <link rel="import" href="../bower_components/pushstate-anchor/pushstate-anchor.h
tml"> | 10 <link rel="import" href="../bower_components/pushstate-anchor/pushstate-anchor.h
tml"> |
| 13 | 11 |
| 14 <polymer-element name="ct-failure-card-buttons" attributes="group bug"> | 12 <dom-module id="ct-failure-card-buttons"> |
| 15 <template> | 13 <style> |
| 16 <style> | |
| 17 :host { | 14 :host { |
| 18 display: flex; | 15 display: flex; |
| 19 } | 16 } |
| 20 :host > * { | 17 :host > * { |
| 21 margin-right: 5px; | 18 margin-right: 5px; |
| 22 } | 19 } |
| 23 ct-button { | 20 ct-button { |
| 24 white-space: nowrap; | 21 white-space: nowrap; |
| 25 } | 22 } |
| 26 | 23 |
| 27 #bugReminder { | 24 #bugReminder { |
| 28 font-size: large; | 25 font-size: large; |
| 29 color: red; | 26 color: red; |
| 30 } | 27 } |
| 31 | 28 |
| 32 #examineLink { | 29 #examineLink { |
| 33 padding: 6px 22px; | 30 padding: 6px 22px; |
| 34 } | 31 } |
| 35 </style> | 32 </style> |
| 36 <a is="pushstate-anchor" href="{{ group.examineUrl }}" id="examineLink">Exam
ine</a> | 33 <template> |
| 37 <template if="{{ !group.isSnoozed }}"> | 34 <a is="pushstate-anchor" id="examineLink" href$="{{ group.examineUrl }}">Exa
mine</a> |
| 38 <ct-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></ct-button> | 35 <template is="dom-if" if="{{ !group.isSnoozed }}"> |
| 36 <ct-button id="snooze" on-tap=" snooze " label="Snooze"></ct-button> |
| 39 </template> | 37 </template> |
| 40 <template if="{{ group.isSnoozed }}"> | 38 <template is="dom-if" if="{{ group.isSnoozed }}"> |
| 41 <ct-button id="snooze" on-tap="{{ unsnooze }}" label="Unsnooze"></ct-butto
n> | 39 <ct-button id="snooze" on-tap=" unsnooze " label="Unsnooze"></ct-button> |
| 42 </template> | 40 </template> |
| 43 <ct-button id="link-bug" on-tap="{{ linkBug }}" label="Link Bug"></ct-button
> | 41 <ct-button id="link-bug" on-tap=" linkBug " label="Link Bug"></ct-button> |
| 44 | 42 |
| 45 <paper-action-dialog heading="Enter bug number" transition="paper-transition
-center" id="bugDialog"> | 43 <paper-action-dialog heading="Enter bug number" transition="paper-transition
-center" id="bugDialog"> |
| 46 <paper-input label="Bug# or URL" floatingLabel autofocus id="bug"></paper-
input> | 44 <paper-input label="Bug# or URL" always-float-label="" autofocus="" id="bu
g"></paper-input> |
| 47 <div><a id="fileBugLink" target="_blank" on-click="{{ fileBugClicked }}"> | 45 <div><a id="fileBugLink" target="_blank" on-click=" fileBugClicked "> |
| 48 <template if="{{ !_fileBugClicked }}"> | 46 <template is="dom-if" if="{{ !_fileBugClicked }}"> |
| 49 File bug | 47 File bug |
| 50 </template> | 48 </template> |
| 51 </a></div> | 49 </a></div> |
| 52 <template if="{{ _fileBugClicked }}"> | 50 <template is="dom-if" if="{{ _fileBugClicked }}"> |
| 53 <div id="bugReminder"> | 51 <div id="bugReminder"> |
| 54 Remember to enter the new bug number above! | 52 Remember to enter the new bug number above! |
| 55 </div> | 53 </div> |
| 56 </template> | 54 </template> |
| 57 <ct-button on-tap="{{ removeBug }}" dismissive role="button" id="dialogRem
oveBug" label="Remove bug link"></ct-button> | 55 <ct-button on-tap=" removeBug " dismissive="" role="button" id="dialogRemo
veBug" label="Remove bug link"></ct-button> |
| 58 <ct-button on-tap="{{ saveBug }}" affirmative role="button" id="dialogOk"
label="OK"></ct-button> | 56 <ct-button on-tap=" saveBug " affirmative="" role="button" id="dialogOk" l
abel="OK"></ct-button> |
| 59 </paper-action-dialog> | 57 </paper-action-dialog> |
| 60 </template> | 58 </template> |
| 61 <script> | 59 <script> |
| 62 Polymer({ | 60 Polymer({ |
| 63 group: null, | 61 is: 'ct-failure-card-buttons', |
| 64 _fileBugClicked: false, | 62 properties: { |
| 65 | 63 _fileBugClicked: { |
| 66 snooze: function() { | 64 type: Boolean, |
| 65 value: false |
| 66 }, |
| 67 bug: { notify: true }, |
| 68 group: { |
| 69 value: null, |
| 70 notify: true |
| 71 } |
| 72 }, |
| 73 snooze: function () { |
| 67 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000); | 74 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000); |
| 68 ga('send', 'event', 'snooze', 'click'); | 75 ga('send', 'event', 'snooze', 'click'); |
| 69 }, | 76 }, |
| 70 | 77 unsnooze: function () { |
| 71 unsnooze: function() { | |
| 72 this.group.unsnooze(); | 78 this.group.unsnooze(); |
| 73 ga('send', 'event', 'unsnooze', 'click'); | 79 ga('send', 'event', 'unsnooze', 'click'); |
| 74 }, | 80 }, |
| 75 | 81 linkBug: function () { |
| 76 linkBug: function() { | |
| 77 this.$.bug.value = this.group.bug; | 82 this.$.bug.value = this.group.bug; |
| 78 this._fileBugClicked = false; | 83 this._fileBugClicked = false; |
| 79 this.$.fileBugLink.href = this.group.data.fileBugLink(); | 84 this.$.fileBugLink.href = this.group.data.fileBugLink(); |
| 80 this.$.bugDialog.toggle(); | 85 this.$.bugDialog.toggle(); |
| 81 ga('send', 'event', 'linkBug', 'click'); | 86 ga('send', 'event', 'linkBug', 'click'); |
| 82 }, | 87 }, |
| 83 | 88 saveBug: function () { |
| 84 saveBug: function() { | |
| 85 this.group.setBug(this.$.bug.value); | 89 this.group.setBug(this.$.bug.value); |
| 86 this.$.bugDialog.toggle(); | 90 this.$.bugDialog.toggle(); |
| 87 ga('send', 'event', 'saveBug', 'click'); | 91 ga('send', 'event', 'saveBug', 'click'); |
| 88 }, | 92 }, |
| 89 | 93 removeBug: function () { |
| 90 removeBug: function() { | |
| 91 this.group.clearBug(); | 94 this.group.clearBug(); |
| 92 this.$.bugDialog.toggle(); | 95 this.$.bugDialog.toggle(); |
| 93 ga('send', 'event', 'removeBug', 'click'); | 96 ga('send', 'event', 'removeBug', 'click'); |
| 94 }, | 97 }, |
| 95 | 98 fileBugClicked: function () { |
| 96 fileBugClicked: function() { | |
| 97 this._fileBugClicked = true; | 99 this._fileBugClicked = true; |
| 98 ga('send', 'event', 'fileBug', 'click'); | 100 ga('send', 'event', 'fileBug', 'click'); |
| 99 }, | 101 } |
| 100 }); | 102 }); |
| 101 </script> | 103 </script> |
| 102 </polymer-element> | 104 </dom-module> |
| OLD | NEW |