Skip to content

Commit 0d771ed

Browse files
author
p01
committed
Review fixes
1 parent 290979b commit 0d771ed

File tree

4 files changed

+27
-34
lines changed

4 files changed

+27
-34
lines changed

src/resource-manager/resource_detail_view.js

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ cls.ResourceDetailView = function(id, name, container_class, html, default_handl
118118
this._tops = [];
119119
var _ele = container.querySelector("." + HIGHLIGHTED_LINE_CLASSNAME);
120120
if (_ele)
121-
_ele.removeClass(HIGHLIGHTED_LINE_CLASSNAME)
121+
_ele.removeClass(HIGHLIGHTED_LINE_CLASSNAME);
122122
}
123123

124124
this.go_to_line = function(container, data)
@@ -129,7 +129,7 @@ cls.ResourceDetailView = function(id, name, container_class, html, default_handl
129129
this._root_ele = container.querySelector("." + RESOURCE_DETAIL_CONTAINER_CLASSNAME);
130130
if (this._root_ele)
131131
{
132-
this.clear_line_highlight(this._root_ele)
132+
this.clear_line_highlight(this._root_ele);
133133
this._target_line = Number(data.lines[0]);
134134
this._highlight_line(this._root_ele);
135135
}
@@ -199,7 +199,7 @@ cls.ResourceDetailView.create_ui_widgets = function()
199199
{
200200
new ToolbarConfig(
201201
{
202-
view:"resource_detail_view",
202+
view: "resource_detail_view",
203203
groups:
204204
[
205205
{
@@ -224,23 +224,16 @@ cls.ResourceDetailView.create_ui_widgets = function()
224224
text_search.searchDelayed(target.value);
225225
};
226226

227-
ActionBroker.
228-
get_instance().
229-
get_global_handler().
230-
register_shortcut_listener
231-
(
232-
"resource-text-search",
233-
cls.Helpers.shortcut_search_cb.bind(text_search)
234-
);
227+
ActionBroker.get_instance().get_global_handler().register_shortcut_listener(
228+
"resource-text-search",
229+
cls.Helpers.shortcut_search_cb.bind(text_search)
230+
);
235231

236232
var on_view_created = function(msg)
237233
{
238234
if (msg.id === "resource_detail_view")
239235
{
240-
var scroll_container = msg.container.querySelector(".request-details");
241-
if (!scroll_container)
242-
scroll_container = msg.container.querySelector(".resource-detail-container");
243-
236+
var scroll_container = msg.container.querySelector(".resource-detail-container");
244237
if (scroll_container)
245238
{
246239
text_search.setContainer(scroll_container);
@@ -249,13 +242,13 @@ cls.ResourceDetailView.create_ui_widgets = function()
249242
);
250243
}
251244
}
252-
}
245+
};
253246

254247
var on_view_destroyed = function(msg)
255248
{
256249
if (msg.id == "resource_detail_view")
257250
text_search.cleanup();
258-
}
251+
};
259252

260253
window.messages.add_listener("view-created", on_view_created);
261254
window.messages.add_listener("view-destroyed", on_view_destroyed);

src/resource-manager/resource_display_broker.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ cls.ResourceDisplayBroker = function()
4848
if (rt_id)
4949
url = window.helpers.resolveURLS(runtimes.getURI(rt_id), url);
5050
}
51+
id_or_url = url;
5152
}
5253

5354
if (!this._show_resource(id_or_url, line) && url)

src/resource-manager/resource_service.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ cls.ResourceManagerService = function(view, network_logger)
3636
d.url = new URI(d.url);
3737
});
3838

39-
this._update({type: "_handle_list_documents"});
39+
this._update();
4040
};
4141

4242
this._list_documents = function()
@@ -88,13 +88,16 @@ cls.ResourceManagerService = function(view, network_logger)
8888

8989
if (ctx.windowList.length)
9090
{
91-
// get all the (non-suppressed) resources with content
91+
// get all the (non-suppressed) resources with content, sorted by uid
9292
ctx.resourceList = (this._network_logger.get_resources() || [])
9393
.filter(function(v) {
9494
return !this._suppress_uids.hasOwnProperty(v.uid) && v.responsecode != 204;
95-
}, this);
95+
}, this)
96+
.sort(function(a, b) {
97+
return a.uid > b.uid ? 1 : a.uid == b.uid ? 0 : -1;
98+
});
9699

97-
ctx.documentResourceHash = {};
100+
ctx.document_resource_hash = {};
98101

99102
// mapping of the WindowIDs in the debugging context
100103
var window_id_index = {};
@@ -116,7 +119,7 @@ cls.ResourceManagerService = function(view, network_logger)
116119
null_document_id = true;
117120

118121
if (d.resourceID != null)
119-
ctx.documentResourceHash[d.resourceID] = d.documentID;
122+
ctx.document_resource_hash[d.resourceID] = d.documentID;
120123

121124
// populate document_id_index
122125
document_id_index[d.documentID] = i;
@@ -152,7 +155,7 @@ cls.ResourceManagerService = function(view, network_logger)
152155
unknown_document_id = true;
153156

154157
// check if this is the top resource of a document
155-
var documentID = ctx.documentResourceHash[r.resource_id];
158+
var documentID = ctx.document_resource_hash[r.resource_id];
156159
if (documentID != null && documentID != r.document_id)
157160
r.document_id = documentID;
158161

src/resource-manager/resource_tree_view.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ cls.ResourceTreeView.create_ui_widgets = function()
140140
{
141141
new ToolbarConfig(
142142
{
143-
view:"resource_tree_view",
143+
view: "resource_tree_view",
144144
groups:
145145
[
146146
{
@@ -176,14 +176,10 @@ cls.ResourceTreeView.create_ui_widgets = function()
176176
text_search.searchDelayed(target.value);
177177
};
178178

179-
ActionBroker.
180-
get_instance().
181-
get_global_handler().
182-
register_shortcut_listener
183-
(
184-
"resource-tree-text-search",
185-
cls.Helpers.shortcut_search_cb.bind(text_search)
186-
);
179+
ActionBroker.get_instance().get_global_handler().register_shortcut_listener(
180+
"resource-tree-text-search",
181+
cls.Helpers.shortcut_search_cb.bind(text_search)
182+
);
187183

188184
var on_view_created = function(msg)
189185
{
@@ -199,13 +195,13 @@ cls.ResourceTreeView.create_ui_widgets = function()
199195
);
200196
}
201197
}
202-
}
198+
};
203199

204200
var on_view_destroyed = function(msg)
205201
{
206202
if (msg.id == "resource_tree_view")
207203
text_search.cleanup();
208-
}
204+
};
209205

210206
window.messages.add_listener("view-created", on_view_created);
211207
window.messages.add_listener("view-destroyed", on_view_destroyed);

0 commit comments

Comments
 (0)