| OLD | NEW |
| 1 <!-- The <ignore-summary-sk> custom element declaration. | 1 <!-- The <ignore-summary-sk> custom element declaration. |
| 2 | 2 |
| 3 Displays a summary of an ignore rule. | 3 Displays a summary of an ignore rule. |
| 4 | 4 |
| 5 Attributes: | 5 Attributes: |
| 6 None. | 6 None. |
| 7 | 7 |
| 8 Events: | 8 Events: |
| 9 'delete' | 9 'delete' |
| 10 The element will produce a 'deleted' event when the delete button is | 10 The element will produce a 'deleted' event when the delete button is |
| 11 pressed. The id of the deleted ignore rule will be included in | 11 pressed. The id of the deleted ignore rule will be included in |
| 12 e.detail. | 12 e.detail. |
| 13 | 13 |
| 14 'edit' | 14 'edit' |
| 15 The element will produce an 'edit' event when the edit button is | 15 The element will produce an 'edit' event when the edit button is |
| 16 pressed. The state of the ignore rule will be included in e.detail. | 16 pressed. The state of the ignore rule will be included in e.detail. |
| 17 | 17 |
| 18 Methods: | 18 Methods: |
| 19 None. | 19 None. |
| 20 | 20 |
| 21 --> | 21 --> |
| 22 | 22 |
| 23 <link rel="import" href="bower_components/iron-icons/iron-icons.html"> | 23 <link rel="import" href="bower_components/iron-icons/iron-icons.html"> |
| 24 <link rel="import" href="bower_components/paper-button/paper-button.html"> | 24 <link rel="import" href="bower_components/paper-button/paper-button.html"> |
| 25 | 25 |
| 26 <link rel="import" href="shared-styles.html"> | 26 <link rel="import" href="shared-styles.html"> |
| 27 | 27 |
| 28 <dom-module id="ignore-summary-sk"> | 28 <dom-module id="ignore-summary-sk"> |
| 29 <template> | 29 <template> |
| 30 <style include="shared-styles"> | 30 <style include="shared-styles"> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 57 vertical-align: middle; | 57 vertical-align: middle; |
| 58 } | 58 } |
| 59 #expires { | 59 #expires { |
| 60 width: 10em; | 60 width: 10em; |
| 61 color: #7570B3; | 61 color: #7570B3; |
| 62 } | 62 } |
| 63 #count { | 63 #count { |
| 64 width: 6em; | 64 width: 6em; |
| 65 color: #A6761D; | 65 color: #A6761D; |
| 66 } | 66 } |
| 67 #excount { |
| 68 width: 6em; |
| 69 color: #A6761D; |
| 70 } |
| 67 paper-button { | 71 paper-button { |
| 68 min-width: 2em; | 72 min-width: 2em; |
| 69 } | 73 } |
| 70 </style> | 74 </style> |
| 71 <div id="name">{{value.name}}</div> | 75 <div id="name">{{value.name}}</div> |
| 72 <div id="expires">{{_humanDiffDate(value.expires)}}</div> | 76 <div id="expires">{{_humanDiffDate(value.expires)}}</div> |
| 73 <div id="updatedBy">{{value.updatedBy}}</div> | 77 <div id="updatedBy">{{value.updatedBy}}</div> |
| 74 <pre id="query"><a href$="{{_queryHref(value.query)}}">{{_splitAmp(value.que
ry)}}</a></pre> | 78 <pre id="query"><a href$="{{_queryHref(value.query)}}">{{_splitAmp(value.que
ry)}}</a></pre> |
| 75 <div id="note">{{value.note}}</div> | 79 <div id="note">{{value.note}}</div> |
| 76 <div id="count">{{value.count}}</div> | 80 <div id="count">{{value.count}}</div> |
| 81 <div id="excount">{{value.exclusiveCount}}</div> |
| 77 <paper-button id="edit" title="Edit"><iron-icon icon="create"></iron-icon></
paper-button> | 82 <paper-button id="edit" title="Edit"><iron-icon icon="create"></iron-icon></
paper-button> |
| 78 <paper-button id="delete" title="Delete"><iron-icon icon="delete"></iron-ico
n></paper-button> | 83 <paper-button id="delete" title="Delete"><iron-icon icon="delete"></iron-ico
n></paper-button> |
| 79 </template> | 84 </template> |
| 80 <script> | 85 <script> |
| 81 (function () { | 86 (function () { |
| 82 Polymer({ | 87 Polymer({ |
| 83 is: 'ignore-summary-sk', | 88 is: 'ignore-summary-sk', |
| 84 | 89 |
| 85 properties: { | 90 properties: { |
| 86 value: { | 91 value: { |
| 87 type: Object, | 92 type: Object, |
| 88 value: function () { return {}; } | 93 value: function () { return {}; } |
| 89 } | 94 } |
| 90 }, | 95 }, |
| 91 | 96 |
| 92 ready: function () { | 97 ready: function () { |
| 93 this.listen(this.$.edit, 'click', "_handleEditClick"); | 98 this.listen(this.$.edit, 'click', "_handleEditClick"); |
| 94 this.listen(this.$.delete, 'click', "_handleDeleteClick"); | 99 this.listen(this.$.delete, 'click', "_handleDeleteClick"); |
| 95 }, | 100 }, |
| 96 | 101 |
| 97 _handleEditClick: function() { | 102 _handleEditClick: function() { |
| 98 this.fire('edit', this.value); | 103 this.fire('edit', this.value); |
| 99 }, | 104 }, |
| 100 | 105 |
| 101 _handleDeleteClick: function() { | 106 _handleDeleteClick: function() { |
| 102 this.fire('delete', this.value); | 107 this.fire('delete', this.value); |
| 103 }, | 108 }, |
| 104 | 109 |
| 105 // Make an alias to split by ampersand. | 110 // Make an alias to split by ampersand. |
| 106 _splitAmp: sk.query.splitAmp, | 111 _splitAmp: sk.query.splitAmp, |
| 107 | 112 |
| 108 _humanDiffDate: function (s) { | 113 _humanDiffDate: function (s) { |
| 109 var ms = Date.parse(s); | 114 var ms = Date.parse(s); |
| 110 return ms < Date.now() ? 'Expired' : sk.human.diffDate(s); | 115 return ms < Date.now() ? 'Expired' : sk.human.diffDate(s); |
| 111 }, | 116 }, |
| 112 | 117 |
| 113 _queryHref: function (query) { | 118 _queryHref: function (query) { |
| 114 return '/list?include=true&query=' + encodeURIComponent(query); | 119 return '/list?include=true&query=' + encodeURIComponent(query); |
| 115 } | 120 } |
| 116 }); | 121 }); |
| 117 }()); | 122 }()); |
| 118 </script> | 123 </script> |
| 119 </dom-module> | 124 </dom-module> |
| 120 | |
| OLD | NEW |