Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) IBM Corp. 2009 All rights reserved. | 3 * Copyright (C) IBM Corp. 2009 All rights reserved. |
| 4 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 value = value.replace(/\+/g, " "); | 162 value = value.replace(/\+/g, " "); |
| 163 if (value.indexOf("%") >= 0) { | 163 if (value.indexOf("%") >= 0) { |
| 164 try { | 164 try { |
| 165 value = decodeURIComponent(value); | 165 value = decodeURIComponent(value); |
| 166 } catch (e) { | 166 } catch (e) { |
| 167 errorDecoding = true; | 167 errorDecoding = true; |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 } | 170 } |
| 171 var div = createElementWithClass("div", className); | 171 var div = createElementWithClass("div", className); |
| 172 if (value === "") | |
| 173 div.classList.add('empty-value'); | |
|
caseq
2016/04/11 13:43:18
"double quotes" please.
| |
| 172 if (errorDecoding) | 174 if (errorDecoding) |
| 173 div.createChild("span", "error-message").textContent = WebInspector. UIString("(unable to decode value)"); | 175 div.createChild("span", "error-message").textContent = WebInspector. UIString("(unable to decode value)"); |
| 174 else | 176 else |
| 175 div.textContent = value; | 177 div.textContent = value; |
| 176 return div; | 178 return div; |
| 177 }, | 179 }, |
| 178 | 180 |
| 179 _refreshURL: function() | 181 _refreshURL: function() |
| 180 { | 182 { |
| 181 this._urlItem.title = this._formatHeader(WebInspector.UIString("Request URL"), this._request.url); | 183 this._urlItem.title = this._formatHeader(WebInspector.UIString("Request URL"), this._request.url); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 264 return; | 266 return; |
| 265 } | 267 } |
| 266 | 268 |
| 267 var toggleTitle = this._decodeRequestParameters ? WebInspector.UIString( "view URL encoded") : WebInspector.UIString("view decoded"); | 269 var toggleTitle = this._decodeRequestParameters ? WebInspector.UIString( "view URL encoded") : WebInspector.UIString("view decoded"); |
| 268 var toggleButton = this._createToggleButton(toggleTitle); | 270 var toggleButton = this._createToggleButton(toggleTitle); |
| 269 toggleButton.addEventListener("click", this._toggleURLDecoding.bind(this ), false); | 271 toggleButton.addEventListener("click", this._toggleURLDecoding.bind(this ), false); |
| 270 paramsTreeElement.listItemElement.appendChild(toggleButton); | 272 paramsTreeElement.listItemElement.appendChild(toggleButton); |
| 271 | 273 |
| 272 for (var i = 0; i < params.length; ++i) { | 274 for (var i = 0; i < params.length; ++i) { |
| 273 var paramNameValue = createDocumentFragment(); | 275 var paramNameValue = createDocumentFragment(); |
| 274 var name = this._formatParameter(params[i].name + ":", "header-name" , this._decodeRequestParameters); | 276 if (params[i].name !== "") { |
| 275 var value = this._formatParameter(params[i].value, "header-value sou rce-code", this._decodeRequestParameters); | 277 var name = this._formatParameter(params[i].name + ":", "header-n ame", this._decodeRequestParameters); |
| 276 paramNameValue.appendChild(name); | 278 var value = this._formatParameter(params[i].value, "header-value source-code", this._decodeRequestParameters); |
| 277 paramNameValue.appendChild(value); | 279 paramNameValue.appendChild(name); |
| 280 paramNameValue.appendChild(value); | |
| 281 } else { | |
| 282 paramNameValue.appendChild(this._formatParameter("(empty)", "emp ty-request-header", this._decodeRequestParameters)); | |
|
caseq
2016/04/11 13:43:18
WebInspector.UIString("(empty)")
| |
| 283 } | |
| 278 | 284 |
| 279 var parmTreeElement = new TreeElement(paramNameValue); | 285 var paramTreeElement = new TreeElement(paramNameValue); |
| 280 parmTreeElement.selectable = false; | 286 paramTreeElement.selectable = false; |
| 281 paramsTreeElement.appendChild(parmTreeElement); | 287 paramsTreeElement.appendChild(paramTreeElement); |
| 282 } | 288 } |
| 283 }, | 289 }, |
| 284 | 290 |
| 285 /** | 291 /** |
| 286 * @param {*} parsedObject | 292 * @param {*} parsedObject |
| 287 * @param {string} sourceText | 293 * @param {string} sourceText |
| 288 */ | 294 */ |
| 289 _refreshRequestJSONPayload: function(parsedObject, sourceText) | 295 _refreshRequestJSONPayload: function(parsedObject, sourceText) |
| 290 { | 296 { |
| 291 var treeElement = this._requestPayloadCategory; | 297 var treeElement = this._requestPayloadCategory; |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 571 this._expandedSetting.set(true); | 577 this._expandedSetting.set(true); |
| 572 }, | 578 }, |
| 573 | 579 |
| 574 oncollapse: function() | 580 oncollapse: function() |
| 575 { | 581 { |
| 576 this._expandedSetting.set(false); | 582 this._expandedSetting.set(false); |
| 577 }, | 583 }, |
| 578 | 584 |
| 579 __proto__: TreeElement.prototype | 585 __proto__: TreeElement.prototype |
| 580 } | 586 } |
| OLD | NEW |