| 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 --> |
| 6 | 6 |
| 7 <link rel="import" href="../model/ct-builder-list.html"> | 7 <link rel="import" href="../model/ct-builder-list.html"> |
| 8 <link rel="import" href="ct-button.html"> | 8 <link rel="import" href="ct-button.html"> |
| 9 <link rel="import" href="../bower_components/paper-dialog/paper-action-dialog.ht
ml"> | 9 <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"> | 10 <link rel="import" href="../bower_components/paper-dialog/paper-dialog-transitio
n.html"> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 #bugReminder { | 27 #bugReminder { |
| 28 font-size: large; | 28 font-size: large; |
| 29 color: red; | 29 color: red; |
| 30 } | 30 } |
| 31 | 31 |
| 32 #examineLink { | 32 #examineLink { |
| 33 padding: 6px 22px; | 33 padding: 6px 22px; |
| 34 } | 34 } |
| 35 </style> | 35 </style> |
| 36 <ct-user-prefs id="userPrefs"></ct-user-prefs> |
| 36 <a is="pushstate-anchor" href="{{ group.examineUrl }}" id="examineLink">Exam
ine</a> | 37 <a is="pushstate-anchor" href="{{ group.examineUrl }}" id="examineLink">Exam
ine</a> |
| 37 <template if="{{ !group.isSnoozed }}"> | 38 <template if="{{ !group.isSnoozed }}"> |
| 38 <ct-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></ct-button> | 39 <ct-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></ct-button> |
| 39 </template> | 40 </template> |
| 40 <template if="{{ group.isSnoozed }}"> | 41 <template if="{{ group.isSnoozed }}"> |
| 41 <ct-button id="snooze" on-tap="{{ unsnooze }}" label="Unsnooze"></ct-butto
n> | 42 <ct-button id="snooze" on-tap="{{ unsnooze }}" label="Unsnooze"></ct-butto
n> |
| 42 </template> | 43 </template> |
| 43 <ct-button id="link-bug" on-tap="{{ linkBug }}" label="Link Bug"></ct-button
> | 44 <ct-button id="link-bug" on-tap="{{ linkBug }}" label="Link Bug"></ct-button
> |
| 44 | 45 |
| 45 <paper-action-dialog heading="Enter bug number" transition="paper-transition
-center" id="bugDialog"> | 46 <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> | 47 <paper-input label="Bug# or URL" floatingLabel autofocus id="bug"></paper-
input> |
| 47 <div><a id="fileBugLink" target="_blank" on-click="{{ fileBugClicked }}"> | 48 <div><a id="fileBugLink" target="_blank" on-click="{{ fileBugClicked }}"> |
| 48 <template if="{{ !_fileBugClicked }}"> | 49 <template if="{{ !_fileBugClicked }}"> |
| 49 File bug | 50 File bug |
| 50 </template> | 51 </template> |
| 51 </a></div> | 52 </a></div> |
| 52 <template if="{{ _fileBugClicked }}"> | 53 <template if="{{ _fileBugClicked }}"> |
| 53 <div id="bugReminder"> | 54 <div id="bugReminder"> |
| 54 Remember to enter the new bug number above! | 55 Remember to enter the new bug number above! |
| 55 </div> | 56 </div> |
| 56 </template> | 57 </template> |
| 57 <ct-button on-tap="{{ removeBug }}" dismissive role="button" id="dialogRem
oveBug" label="Remove bug link"></ct-button> | 58 <ct-button on-tap="{{ removeBug }}" dismissive role="button" id="dialogRem
oveBug" label="Remove bug link"></ct-button> |
| 58 <ct-button on-tap="{{ saveBug }}" affirmative role="button" id="dialogOk"
label="OK"></ct-button> | 59 <ct-button on-tap="{{ saveBug }}" affirmative role="button" id="dialogOk"
label="OK"></ct-button> |
| 59 </paper-action-dialog> | 60 </paper-action-dialog> |
| 61 <paper-action-dialog heading="Error" transition="paper-transition-center" id
="loginDialog"> |
| 62 <div id="accessDeniedMessage"> |
| 63 Please <a href="{{ $.userPrefs.values.loginUrl }}">log in</a> to modify
alerts. |
| 64 </div> |
| 65 <div id="otherMessage"></div> |
| 66 </paper-action-dialog> |
| 60 </template> | 67 </template> |
| 61 <script> | 68 <script> |
| 62 Polymer({ | 69 Polymer({ |
| 63 group: null, | 70 group: null, |
| 64 _fileBugClicked: false, | 71 _fileBugClicked: false, |
| 65 | 72 |
| 73 ready: function() { |
| 74 this.group.errorCallback = this.errorCallback.bind(this); |
| 75 }, |
| 76 |
| 77 errorCallback: function(args) { |
| 78 if (args.message == "Forbidden") { |
| 79 this.$.otherMessage.hidden = true; |
| 80 } else { |
| 81 this.$.accessDeniedMessage.hidden = true; |
| 82 this.$.otherMessage.textContent = args.message; |
| 83 } |
| 84 this.$.loginDialog.open(); |
| 85 }, |
| 86 |
| 66 snooze: function() { | 87 snooze: function() { |
| 67 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000); | 88 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000); |
| 68 ga('send', 'event', 'snooze', 'click'); | 89 ga('send', 'event', 'snooze', 'click'); |
| 69 }, | 90 }, |
| 70 | 91 |
| 71 unsnooze: function() { | 92 unsnooze: function() { |
| 72 this.group.unsnooze(); | 93 this.group.unsnooze(); |
| 73 ga('send', 'event', 'unsnooze', 'click'); | 94 ga('send', 'event', 'unsnooze', 'click'); |
| 74 }, | 95 }, |
| 75 | 96 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 93 ga('send', 'event', 'removeBug', 'click'); | 114 ga('send', 'event', 'removeBug', 'click'); |
| 94 }, | 115 }, |
| 95 | 116 |
| 96 fileBugClicked: function() { | 117 fileBugClicked: function() { |
| 97 this._fileBugClicked = true; | 118 this._fileBugClicked = true; |
| 98 ga('send', 'event', 'fileBug', 'click'); | 119 ga('send', 'event', 'fileBug', 'click'); |
| 99 }, | 120 }, |
| 100 }); | 121 }); |
| 101 </script> | 122 </script> |
| 102 </polymer-element> | 123 </polymer-element> |
| OLD | NEW |