Chris Craik | f516a62 | 2015-04-01 17:52:39 -0700 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <!-- |
| 3 | Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 4 | Use of this source code is governed by a BSD-style license that can be |
| 5 | found in the LICENSE file. |
| 6 | --> |
| 7 | <link rel="import" href="/core/analysis/util.html"> |
| 8 | |
| 9 | <script> |
| 10 | 'use strict'; |
| 11 | tv.exportTo('tv.c.analysis', function() { |
| 12 | function createTimeStamp(timestamp) { |
| 13 | if (timestamp === undefined) |
| 14 | return ''; |
| 15 | var span = document.createElement('tv-c-a-time-stamp'); |
| 16 | span.timestamp = timestamp; |
| 17 | return span; |
| 18 | } |
| 19 | return { |
| 20 | createTimeStamp: createTimeStamp |
| 21 | }; |
| 22 | }); |
| 23 | </script> |
| 24 | |
| 25 | <polymer-element name="tv-c-a-time-stamp"> |
| 26 | <template> |
| 27 | </template> |
| 28 | <script> |
| 29 | 'use strict'; |
| 30 | |
| 31 | Polymer({ |
| 32 | ready: function() { |
| 33 | this.timestamp_ = undefined; |
| 34 | }, |
| 35 | |
| 36 | get timestamp() { |
| 37 | return this.timestamp_; |
| 38 | }, |
| 39 | |
| 40 | set timestamp(timestamp) { |
| 41 | this.timestamp_ = timestamp; |
| 42 | this.shadowRoot.textContent = tv.c.analysis.tsString(timestamp); |
| 43 | } |
| 44 | }); |
| 45 | </script> |
Chris Craik | 44c2820 | 2015-05-12 17:25:16 -0700 | [diff] [blame^] | 46 | </polymer-element> |