Chromium Code Reviews| 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 queryPos = window.location.href.indexOf('?'); |
|
Dan Beam
2013/04/16 23:34:05
var loc = window.location;
var query = loc.search.
rkc
2013/04/17 00:38:07
Modified this a bit to make it slightly more under
| |
| 309 for (var i = 0; i < query.length; i++) { | 309 if (queryPos !== -1) { |
|
Dan Beam
2013/04/16 22:01:12
what is the point of this diff?
rkc
2013/04/16 22:07:34
I had changed this to use window.location.search (
Dan Beam
2013/04/16 23:20:18
can you give me a full URL of an example that does
rkc
2013/04/16 23:22:58
chrome://feedback/#0?description=&categoryTag=From
| |
| 310 // Decode and store each parameter value. | 310 var query = window.location.href.substring(queryPos + 1).split('&'); |
| 311 parameter = query[i].split('='); | 311 for (var i = 0; i < query.length; i++) { |
| 312 parameters[parameter[0]] = decodeURIComponent(parameter[1]); | 312 // Get an array of parameters in 'name=value' form. |
| 313 // Decode and store each parameter value. | |
| 314 parameter = query[i].split('='); | |
| 315 parameters[parameter[0]] = decodeURIComponent(parameter[1]); | |
| 316 } | |
| 313 } | 317 } |
| 314 | 318 |
| 315 // Set the initial description text. | 319 // Set the initial description text. |
| 316 $('description-text').textContent = parameters['description']; | 320 $('description-text').textContent = parameters['description']; |
| 317 // If a page url is spcified in the parameters, override the default page url. | 321 // If a page url is spcified in the parameters, override the default page url. |
| 318 if (parameters['customPageUrl'] != '') { | 322 if (parameters['customPageUrl'] != '') { |
| 319 $('page-url-text').value = parameters['customPageUrl']; | 323 $('page-url-text').value = parameters['customPageUrl']; |
| 320 // and disable the page image, since it doesn't make sense on a custom url. | 324 // and disable the page image, since it doesn't make sense on a custom url. |
| 321 $('screenshot-checkbox').checked = false; | 325 $('screenshot-checkbox').checked = false; |
| 322 forceDisableScreenshots = true; | 326 forceDisableScreenshots = true; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 396 | 400 |
| 397 if (!defaults.disableScreenshots) | 401 if (!defaults.disableScreenshots) |
| 398 enableScreenshots(); | 402 enableScreenshots(); |
| 399 | 403 |
| 400 if (defaults.useSaved) { | 404 if (defaults.useSaved) { |
| 401 $('screenshot-link-tosaved').hidden = false; | 405 $('screenshot-link-tosaved').hidden = false; |
| 402 } | 406 } |
| 403 } | 407 } |
| 404 | 408 |
| 405 window.addEventListener('DOMContentLoaded', load); | 409 window.addEventListener('DOMContentLoaded', load); |
| OLD | NEW |