| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2015 The Chromium Authors. All rights reserved. | 2 Copyright 2015 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="../appengine_module/components/net.html"
> |
| 6 | 6 <dom-module id="ct-banner"> |
| 7 <link rel="import" href="../appengine_module/components/net.html"> | |
| 8 <polymer-element name="ct-banner" attributes = "message"> | |
| 9 <template> | |
| 10 <style> | 7 <style> |
| 11 .message { | 8 .message { |
| 12 text-align: center; | 9 text-align: center; |
| 13 font-weight: bold; | 10 font-weight: bold; |
| 14 color: red; | 11 color: red; |
| 15 background-color: white; | 12 background-color: white; |
| 16 border-radius: 4px; | 13 border-radius: 4px; |
| 17 } | 14 } |
| 18 </style> | 15 </style> |
| 19 <template if="{{ message }}"> | 16 <template> |
| 17 <template is="dom-if" if="{{ message }}"> |
| 20 <div class="message">{{ message }}</div> | 18 <div class="message">{{ message }}</div> |
| 21 </template> | 19 </template> |
| 22 </template> | 20 </template> |
| 23 <script> | 21 <script> |
| 24 Polymer({ | 22 Polymer({ |
| 25 update: function() { | 23 is: 'ct-banner', |
| 26 return net.json('/banner-msg').then(function(data) { | 24 properties: { message: { notify: true } }, |
| 27 this.message = data.message; | 25 update: function () { |
| 28 }.bind(this), function(err) { | 26 return net.json('/banner-msg').then(function (data) { |
| 29 window.console.log("Banner message error: " + err); | 27 this.message = data.message; |
| 30 }); | 28 }.bind(this), function (err) { |
| 31 } | 29 window.console.log('Banner message error: ' + err); |
| 32 }); | 30 }); |
| 31 } |
| 32 }); |
| 33 </script> | 33 </script> |
| 34 </polymer-element> | 34 </dom-module> |
| 35 | 35 |
| OLD | NEW |