Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1752)

Unified Diff: appengine/sheriff_o_matic/ui/ct-last-updated.html

Issue 1315693002: SoM: upgrade Polymer from 0.5 to 1.0 Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: get bower_components from polymer_1.0.4 Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/sheriff_o_matic/ui/ct-last-updated.html
diff --git a/appengine/sheriff_o_matic/ui/ct-last-updated.html b/appengine/sheriff_o_matic/ui/ct-last-updated.html
index 0ebb76f81e1240ddfa2216a47b587411149197fb..cace88c6647f2962307ace39197a0deacff60ad7 100644
--- a/appengine/sheriff_o_matic/ui/ct-last-updated.html
+++ b/appengine/sheriff_o_matic/ui/ct-last-updated.html
@@ -2,11 +2,9 @@
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
--->
-
-<polymer-element name="ct-last-updated" attributes="date">
+--><html><head><dom-module id="ct-last-updated">
<template>
- <template if="{{ date }}">
+ <template is="dom-if" if="{{ date }}">
<style>
.stale_5minutes {
color: orange;
@@ -25,38 +23,43 @@ found in the LICENSE file.
display: none;
}
</style>
- <span class="{{ date | _style }}">Updated @ {{ date | _hours }}:{{ date | _minutes }}</span>
- <span class='{{ date | _dateStyle }}'>{{ date | _date }}</span>
+ <span class$="{{_style ( date)}}">Updated @ <span>{{_hours ( date)}}</span>:<span>{{_minutes ( date)}}</span></span>
+ <span class$="{{_dateStyle ( date)}}">{{_date ( date)}}</span>
</template>
</template>
<script>
- (function() {
- Polymer({
- date: null,
- _style: function(date) {
- var staleness = date.minutesAgo();
- if (staleness >= 20)
- return "stale_20minutes";
- if (staleness >= 10)
- return "stale_10minutes";
- if (staleness >= 5)
- return "stale_5minutes";
- return "";
- },
- _hours: function(date) {
- return date.getHours();
- },
- _minutes: function(date) {
- return date.getMinutes().toString().padLeft(2, '0');
- },
- _date: function(date) {
- return date.toDateString();
- },
- _dateStyle: function(date) {
- return date.hoursAgo() > 12 ? 'date_shown' : 'date_hidden';
- },
- });
- })();
-
+ (function () {
+ Polymer({
+ is: 'ct-last-updated',
+ properties: {
+ date: {
+ value: null,
+ notify: true
+ }
+ },
+ _style: function (date) {
+ var staleness = date.minutesAgo();
+ if (staleness >= 20)
+ return 'stale_20minutes';
+ if (staleness >= 10)
+ return 'stale_10minutes';
+ if (staleness >= 5)
+ return 'stale_5minutes';
+ return '';
+ },
+ _hours: function (date) {
+ return date.getHours();
+ },
+ _minutes: function (date) {
+ return date.getMinutes().toString().padLeft(2, '0');
+ },
+ _date: function (date) {
+ return date.toDateString();
+ },
+ _dateStyle: function (date) {
+ return date.hoursAgo() > 12 ? 'date_shown' : 'date_hidden';
+ }
+ });
+ }());
</script>
-</polymer-element>
+</dom-module>
« no previous file with comments | « appengine/sheriff_o_matic/ui/ct-health.html ('k') | appengine/sheriff_o_matic/ui/ct-master-failure-card.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698