Skip to content

Commit 52b14f8

Browse files
author
Daniel Herzog
committed
Removed the button to switch raw view; Replaced it by a context menu entry. Added back the first border in multipart requests, even for parsed mode.
1 parent 62f80c6 commit 52b14f8

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

src/network/network_details_templates.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ templates.details = function(entry, left_val, do_raw)
4545
this._details_content(entry, do_raw),
4646
"data-object-id", String(entry.id),
4747
"class", "entry-details"
48+
// Todo: currently can't have the setting-changing context menu only on this container
49+
// ,"data-menu", "network-logger-details"
4850
],
4951
"class", "network-details-container",
5052
"style", "left:" + left_val + "px"]
@@ -357,10 +359,11 @@ templates._request_body = function(req, do_raw)
357359
if (req.request_body.partList.length) // Multipart
358360
{
359361
var use_raw_boundary = Boolean(do_raw && req.boundary);
362+
var boundary = use_raw_boundary ? req.boundary : ["hr"];
360363
for (var n = 0, part; part = req.request_body.partList[n]; n++)
361364
{
362-
if (use_raw_boundary && n === 0)
363-
ret.push(this._pre(req.boundary, HTTP_BOUNDARY_CLASS));
365+
if (n === 0)
366+
ret.push(this._pre(boundary, HTTP_BOUNDARY_CLASS));
364367

365368
ret.extend(this.headers_list(part.headerList, do_raw));
366369
ret.push(this._pre("\n"));
@@ -369,7 +372,6 @@ templates._request_body = function(req, do_raw)
369372
else
370373
ret.push(["p", ui_strings.S_NETWORK_N_BYTE_BODY.replace("%s", part.contentLength)]);
371374

372-
var boundary = use_raw_boundary ? req.boundary : ["hr"];
373375
if (use_raw_boundary && part === req.request_body.partList.last)
374376
boundary += "--\n";
375377

src/network/network_view.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,15 @@ cls.NetworkLogView = function(id, name, container_class, html, default_handler,
650650
}
651651
}.bind(this);
652652

653+
/*
654+
// Todo: currently can't have the setting-changing context menu only on this container
655+
this._on_toggle_raw_mode_bound = function(event)
656+
{
657+
var KEY = "view-raw";
658+
settings.network_logger.set(KEY, !settings.network_logger.get(KEY));
659+
}.bind(this);
660+
*/
661+
653662
var eh = window.eventHandlers;
654663

655664
eh.click["select-network-request"] = this._on_clicked_request_bound;
@@ -720,7 +729,8 @@ cls.NetworkLog.create_ui_widgets = function()
720729
},
721730
// settings map
722731
{
723-
checkboxes: ["track-content", "view-raw"]
732+
checkboxes: ["track-content", "view-raw"],
733+
contextmenu: ["view-raw"]
724734
},
725735
// templates
726736
{
@@ -821,15 +831,6 @@ cls.NetworkLog.create_ui_widgets = function()
821831
],
822832
handler: "profiler-mode-switch"
823833
},
824-
{
825-
type: UI.TYPE_SWITCH,
826-
items: [
827-
{
828-
key: "network_logger.view-raw",
829-
icon: "view-raw-requests-responses"
830-
}
831-
]
832-
},
833834
{
834835
type: UI.TYPE_INPUT,
835836
items: [
-250 Bytes
Binary file not shown.

src/ui-style/ui.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -432,11 +432,6 @@ cst-select-option-list,
432432
background-image: url("../ui-images/icons/icon_network_profiler.png");
433433
}
434434

435-
.network_logger\.view-raw::before
436-
{
437-
background-image: url("../ui-images/icons/icon_raw_headers.png");
438-
}
439-
440435
.profiler-start-stop::before
441436
{
442437
background-image: url("../ui-images/icons/icon_record.png");

0 commit comments

Comments
 (0)