| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Constants. | 5 // Constants. |
| 6 /** @const */ var FEEDBACK_LANDING_PAGE = | 6 /** @const */ var FEEDBACK_LANDING_PAGE = |
| 7 'https://www.google.com/support/chrome/go/feedback_confirmation'; | 7 'https://www.google.com/support/chrome/go/feedback_confirmation'; |
| 8 /** @const */ var MAX_ATTACH_FILE_SIZE = 3 * 1024 * 1024; | 8 /** @const */ var MAX_ATTACH_FILE_SIZE = 3 * 1024 * 1024; |
| 9 | 9 |
| 10 var selectedThumbnailDivId = ''; | 10 var selectedThumbnailDivId = ''; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 return; | 88 return; |
| 89 $('screenshot-row').hidden = false; | 89 $('screenshot-row').hidden = false; |
| 90 } | 90 } |
| 91 | 91 |
| 92 /** | 92 /** |
| 93 * Reads the selected file when the user selects a file. | 93 * Reads the selected file when the user selects a file. |
| 94 * @param {event} evtFileSelected The on changed event for the file input box. | 94 * @param {event} evtFileSelected The on changed event for the file input box. |
| 95 */ | 95 */ |
| 96 function onFileSelected(evtFileSelected) { | 96 function onFileSelected(evtFileSelected) { |
| 97 var file = evtFileSelected.target.files[0]; | 97 var file = evtFileSelected.target.files[0]; |
| 98 if (!file) { |
| 99 // User canceled file selection. |
| 100 $('attach-file-checkbox').checked = false; |
| 101 attachFileBinaryData = null; |
| 102 return; |
| 103 } |
| 104 |
| 98 if (file.size > MAX_ATTACH_FILE_SIZE) { | 105 if (file.size > MAX_ATTACH_FILE_SIZE) { |
| 99 $('attach-error').hidden = false; | 106 $('attach-error').hidden = false; |
| 100 | 107 |
| 101 // Clear our selected file. | 108 // Clear our selected file. |
| 102 $('attach-file').value = ''; | 109 $('attach-file').value = ''; |
| 103 attachFileBinaryData = null; | 110 attachFileBinaryData = null; |
| 104 $('attach-file-checkbox').checked = false; | 111 $('attach-file-checkbox').checked = false; |
| 105 | 112 |
| 106 return; | 113 return; |
| 107 } | 114 } |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 // Are screenshots disabled? | 356 // Are screenshots disabled? |
| 350 if (!defaults.disableScreenshots) | 357 if (!defaults.disableScreenshots) |
| 351 enableScreenshots(); | 358 enableScreenshots(); |
| 352 | 359 |
| 353 if (defaults.useSaved) { | 360 if (defaults.useSaved) { |
| 354 $('screenshot-link-tosaved').hidden = false; | 361 $('screenshot-link-tosaved').hidden = false; |
| 355 } | 362 } |
| 356 } | 363 } |
| 357 | 364 |
| 358 window.addEventListener('DOMContentLoaded', load); | 365 window.addEventListener('DOMContentLoaded', load); |
| OLD | NEW |