| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 Polymer({ | 5 Polymer({ |
| 6 is: 'history-item', | 6 is: 'history-item', |
| 7 | 7 |
| 8 properties: { | 8 properties: { |
| 9 timeAccessed_: { | 9 timeAccessed_: { |
| 10 type: String, | 10 type: String, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 /** | 86 /** |
| 87 * Fires a custom event when the menu button is clicked. Sends the details of | 87 * Fires a custom event when the menu button is clicked. Sends the details of |
| 88 * the history item and where the menu should appear. | 88 * the history item and where the menu should appear. |
| 89 */ | 89 */ |
| 90 onMenuButtonTap_: function(e) { | 90 onMenuButtonTap_: function(e) { |
| 91 var position = this.$['menu-button'].getBoundingClientRect(); | 91 var position = this.$['menu-button'].getBoundingClientRect(); |
| 92 | 92 |
| 93 this.fire('toggle-menu', { | 93 this.fire('toggle-menu', { |
| 94 x: position.left, | 94 x: position.left, |
| 95 y: position.top, | 95 y: position.top, |
| 96 accessTime: this.timestamp_ | 96 itemIdentifier: { |
| 97 url: this.websiteUrl_, |
| 98 timestamps: this.timestamp_, |
| 99 domain: this.websiteDomain_ |
| 100 } |
| 97 }); | 101 }); |
| 98 | 102 |
| 99 // Stops the 'tap' event from closing the menu when it opens. | 103 // Stops the 'tap' event from closing the menu when it opens. |
| 100 e.stopPropagation(); | 104 e.stopPropagation(); |
| 101 }, | 105 }, |
| 102 | 106 |
| 103 /** | 107 /** |
| 104 * If the results shown are search results set the search term to be bold | 108 * If the results shown are search results set the search term to be bold |
| 105 * where it is displayed in the history-item title. | 109 * where it is displayed in the history-item title. |
| 106 * @private | 110 * @private |
| (...skipping 26 matching lines...) Expand all Loading... |
| 133 * Quote a string so it can be used in a regular expression. | 137 * Quote a string so it can be used in a regular expression. |
| 134 * @param {string} str The source string. | 138 * @param {string} str The source string. |
| 135 * @return {string} The escaped string. | 139 * @return {string} The escaped string. |
| 136 * @private | 140 * @private |
| 137 */ | 141 */ |
| 138 quoteString_: function(searchTerm) { | 142 quoteString_: function(searchTerm) { |
| 139 return searchTerm.replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g, | 143 return searchTerm.replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g, |
| 140 '\\$1'); | 144 '\\$1'); |
| 141 } | 145 } |
| 142 }); | 146 }); |
| OLD | NEW |