| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 298 |
| 299 // Set default values for the possible parameters, and then parse the actual | 299 // Set default values for the possible parameters, and then parse the actual |
| 300 // values from the URL href. | 300 // values from the URL href. |
| 301 var parameters = { | 301 var parameters = { |
| 302 'description': '', | 302 'description': '', |
| 303 'categoryTag': '', | 303 'categoryTag': '', |
| 304 'customPageUrl': '', | 304 'customPageUrl': '', |
| 305 'filePath': '', | 305 'filePath': '', |
| 306 }; | 306 }; |
| 307 | 307 |
| 308 var query = window.location.search.substr(1).split('&'); | 308 var loc = window.location; |
| 309 // Split the query string into an array of parameters. |
| 310 var query = loc.search.substr(1).split('&'); |
| 311 // If we have a query in the hash. |
| 312 if (loc.hash.indexOf('?') >= 0) { |
| 313 // Remove the hash and split this query into parameters too. |
| 314 query = query.concat(loc.hash.substr(loc.hash.indexOf('?') + 1).split('&')); |
| 315 } |
| 309 for (var i = 0; i < query.length; i++) { | 316 for (var i = 0; i < query.length; i++) { |
| 310 // Decode and store each parameter value. | 317 // Decode and store each parameter value. |
| 311 parameter = query[i].split('='); | 318 parameter = query[i].split('='); |
| 312 parameters[parameter[0]] = decodeURIComponent(parameter[1]); | 319 parameters[parameter[0]] = decodeURIComponent(parameter[1]); |
| 313 } | 320 } |
| 314 | 321 |
| 315 // Set the initial description text. | 322 // Set the initial description text. |
| 316 $('description-text').textContent = parameters['description']; | 323 $('description-text').textContent = parameters['description']; |
| 317 // If a page url is spcified in the parameters, override the default page url. | 324 // If a page url is spcified in the parameters, override the default page url. |
| 318 if (parameters['customPageUrl'] != '') { | 325 if (parameters['customPageUrl'] != '') { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 | 403 |
| 397 if (!defaults.disableScreenshots) | 404 if (!defaults.disableScreenshots) |
| 398 enableScreenshots(); | 405 enableScreenshots(); |
| 399 | 406 |
| 400 if (defaults.useSaved) { | 407 if (defaults.useSaved) { |
| 401 $('screenshot-link-tosaved').hidden = false; | 408 $('screenshot-link-tosaved').hidden = false; |
| 402 } | 409 } |
| 403 } | 410 } |
| 404 | 411 |
| 405 window.addEventListener('DOMContentLoaded', load); | 412 window.addEventListener('DOMContentLoaded', load); |
| OLD | NEW |