| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 var FilesQuickView = Polymer({ | 5 var FilesQuickView = Polymer({ |
| 6 is: 'files-quick-view', | 6 is: 'files-quick-view', |
| 7 | 7 |
| 8 properties: { | 8 properties: { |
| 9 // File media type, e.g. image, video. | 9 // File media type, e.g. image, video. |
| 10 type: String, | 10 type: String, |
| 11 filePath: String, | 11 filePath: String, |
| 12 // URLs should be accessible from webview since contets are rendered inside | 12 // URLs should be accessible from webview since contets are rendered inside |
| 13 // it. Hint: use URL.createObjectURL. | 13 // it. Hint: use URL.createObjectURL. |
| 14 contentUrl: String, | 14 contentUrl: String, |
| 15 // Image shown before full resolution image is rendered, or |
| 16 // Audio thumbnail. |
| 17 contentThumbnailUrl: String, |
| 18 imageHeight: Number, |
| 19 imageWidth: Number, |
| 20 |
| 15 videoPoster: String, | 21 videoPoster: String, |
| 16 audioArtwork: String, | |
| 17 autoplay: Boolean, | 22 autoplay: Boolean, |
| 18 | 23 |
| 19 // metadata-box-active-changed event is fired on attribute change. | 24 // metadata-box-active-changed event is fired on attribute change. |
| 20 metadataBoxActive: { | 25 metadataBoxActive: { |
| 21 value: true, | 26 value: true, |
| 22 type: Boolean, | 27 type: Boolean, |
| 23 notify: true, | 28 notify: true, |
| 24 }, | 29 }, |
| 25 // Text shown when no playback is available. | 30 // Text shown when no playback is available. |
| 26 noPlaybackText: String, | 31 noPlaybackText: String, |
| 27 // Text shown when no preview is available. | 32 // Text shown when no preview is available. |
| 28 noPreviewText: String, | 33 noPreviewText: String, |
| 29 }, | 34 }, |
| 30 | 35 |
| 31 listeners: { | 36 listeners: { |
| 32 'iron-overlay-closed': 'clear', | 37 'iron-overlay-closed': 'clear', |
| 33 'files-safe-media-tap-outside': 'close', | 38 'files-safe-media-tap-outside': 'close', |
| 34 }, | 39 }, |
| 35 | 40 |
| 36 // Clears fields. | 41 // Clears fields. |
| 37 clear: function() { | 42 clear: function() { |
| 38 this.type = ''; | 43 this.type = ''; |
| 39 this.filePath = ''; | 44 this.filePath = ''; |
| 40 this.contentUrl = ''; | 45 this.contentUrl = ''; |
| 46 this.contentThumbnailUrl = ''; |
| 41 this.videoPoster = ''; | 47 this.videoPoster = ''; |
| 42 this.audioArtwork = ''; | |
| 43 this.autoplay = false; | 48 this.autoplay = false; |
| 44 }, | 49 }, |
| 45 | 50 |
| 46 // Opens the dialog. | 51 // Opens the dialog. |
| 47 open: function() { | 52 open: function() { |
| 48 if (!this.isOpened()) | 53 if (!this.isOpened()) |
| 49 this.$.dialog.open(); | 54 this.$.dialog.open(); |
| 50 }, | 55 }, |
| 51 | 56 |
| 52 // Closes the dialog. | 57 // Closes the dialog. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 * @param {string} type | 146 * @param {string} type |
| 142 * @return {boolean} | 147 * @return {boolean} |
| 143 * | 148 * |
| 144 * @private | 149 * @private |
| 145 */ | 150 */ |
| 146 isUnsupported_: function(type) { | 151 isUnsupported_: function(type) { |
| 147 return !this.isImage_(type) && !this.isVideo_(type) && !this.isAudio_(type); | 152 return !this.isImage_(type) && !this.isVideo_(type) && !this.isAudio_(type); |
| 148 }, | 153 }, |
| 149 | 154 |
| 150 }); | 155 }); |
| OLD | NEW |