| 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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 }, | 367 }, |
| 368 | 368 |
| 369 _refreshHTTPInformation: function() | 369 _refreshHTTPInformation: function() |
| 370 { | 370 { |
| 371 var requestMethodElement = this._requestMethodTreeElement; | 371 var requestMethodElement = this._requestMethodTreeElement; |
| 372 requestMethodElement.hidden = !this._request.statusCode; | 372 requestMethodElement.hidden = !this._request.statusCode; |
| 373 var statusCodeElement = this._statusCodeTreeElement; | 373 var statusCodeElement = this._statusCodeTreeElement; |
| 374 statusCodeElement.hidden = !this._request.statusCode; | 374 statusCodeElement.hidden = !this._request.statusCode; |
| 375 | 375 |
| 376 if (this._request.statusCode) { | 376 if (this._request.statusCode) { |
| 377 var statusImageSource = ""; | 377 var statusCodeFragment = document.createDocumentFragment(); |
| 378 statusCodeFragment.createChild("div", "header-name").textContent = W
ebInspector.UIString("Status Code") + ":"; |
| 379 |
| 380 var statusCodeImage = statusCodeFragment.createChild("div", "resourc
e-status-image"); |
| 381 statusCodeImage.title = this._request.statusCode + " " + this._reque
st.statusText; |
| 382 |
| 378 if (this._request.statusCode < 300 || this._request.statusCode === 3
04) | 383 if (this._request.statusCode < 300 || this._request.statusCode === 3
04) |
| 379 statusImageSource = "Images/successGreenDot.png"; | 384 statusCodeImage.addStyleClass("green-ball"); |
| 380 else if (this._request.statusCode < 400) | 385 else if (this._request.statusCode < 400) |
| 381 statusImageSource = "Images/warningOrangeDot.png"; | 386 statusCodeImage.addStyleClass("orange-ball"); |
| 382 else | 387 else |
| 383 statusImageSource = "Images/errorRedDot.png"; | 388 statusCodeImage.addStyleClass("red-ball"); |
| 384 | 389 |
| 385 requestMethodElement.title = this._formatHeader(WebInspector.UIStrin
g("Request Method"), this._request.requestMethod); | 390 requestMethodElement.title = this._formatHeader(WebInspector.UIStrin
g("Request Method"), this._request.requestMethod); |
| 386 | 391 |
| 387 var statusCodeFragment = document.createDocumentFragment(); | |
| 388 statusCodeFragment.createChild("div", "header-name").textContent = W
ebInspector.UIString("Status Code") + ":"; | |
| 389 | |
| 390 var statusCodeImage = statusCodeFragment.createChild("img", "resourc
e-status-image"); | |
| 391 statusCodeImage.src = statusImageSource; | |
| 392 statusCodeImage.title = this._request.statusCode + " " + this._reque
st.statusText; | |
| 393 var value = statusCodeFragment.createChild("div", "header-value sour
ce-code"); | 392 var value = statusCodeFragment.createChild("div", "header-value sour
ce-code"); |
| 394 value.textContent = this._request.statusCode + " " + this._request.s
tatusText; | 393 value.textContent = this._request.statusCode + " " + this._request.s
tatusText; |
| 395 if (this._request.cached) | 394 if (this._request.cached) |
| 396 value.createChild("span", "status-from-cache").textContent = " "
+ WebInspector.UIString("(from cache)"); | 395 value.createChild("span", "status-from-cache").textContent = " "
+ WebInspector.UIString("(from cache)"); |
| 397 | 396 |
| 398 statusCodeElement.title = statusCodeFragment; | 397 statusCodeElement.title = statusCodeFragment; |
| 399 } | 398 } |
| 400 }, | 399 }, |
| 401 | 400 |
| 402 _refreshHeadersTitle: function(title, headersTreeElement, headersLength) | 401 _refreshHeadersTitle: function(title, headersTreeElement, headersLength) |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 }, | 451 }, |
| 453 | 452 |
| 454 _createHeadersToggleButton: function(isHeadersTextShown) | 453 _createHeadersToggleButton: function(isHeadersTextShown) |
| 455 { | 454 { |
| 456 var toggleTitle = isHeadersTextShown ? WebInspector.UIString("view parse
d") : WebInspector.UIString("view source"); | 455 var toggleTitle = isHeadersTextShown ? WebInspector.UIString("view parse
d") : WebInspector.UIString("view source"); |
| 457 return this._createToggleButton(toggleTitle); | 456 return this._createToggleButton(toggleTitle); |
| 458 }, | 457 }, |
| 459 | 458 |
| 460 __proto__: WebInspector.View.prototype | 459 __proto__: WebInspector.View.prototype |
| 461 } | 460 } |
| OLD | NEW |