Skip to content

Commit 035d254

Browse files
author
p01
committed
Syntax tweaks
1 parent 0d4671f commit 035d254

File tree

2 files changed

+31
-24
lines changed

2 files changed

+31
-24
lines changed

src/resource-manager/resource_detail_view.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,11 @@ cls.ResourceDetailView.create_ui_widgets = function()
211211
ActionBroker.
212212
get_instance().
213213
get_global_handler().
214-
register_shortcut_listener("resource-text-search", cls.Helpers.shortcut_search_cb.bind(text_search));
214+
register_shortcut_listener
215+
(
216+
"resource-text-search",
217+
cls.Helpers.shortcut_search_cb.bind(text_search)
218+
);
215219

216220
var on_view_created = function(msg)
217221
{

src/resource-manager/resource_service.js

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,13 @@ cls.ResourceManagerService = function(view, network_logger)
9999
});
100100

101101
// filter the documentId that belong in the windowIdList
102-
ctx.documentList = this._documentList.filter(function(d)
102+
ctx.documentList = this._documentList
103+
.filter(function(d)
103104
{
104-
var inWindowContext = ctx.windowList.some( function(w)
105+
var inWindowContext = ctx.windowList
106+
.some( function(w)
105107
{
106-
return w.id==d.windowID;
108+
return w.id == d.windowID;
107109
});
108110

109111
if (inWindowContext && d.resourceID != null)
@@ -133,11 +135,13 @@ cls.ResourceManagerService = function(view, network_logger)
133135
},this);
134136

135137
// filter the list of window. Purge the ones with no documents
136-
ctx.windowList = ctx.windowList.filter(function(v)
138+
ctx.windowList = ctx.windowList
139+
.filter(function(v)
137140
{
138-
return ctx.documentList.some(function(w)
141+
return ctx.documentList
142+
.some(function(w)
139143
{
140-
return v.id==w.windowID;
144+
return v.id == w.windowID;
141145
});
142146
});
143147

@@ -147,18 +151,18 @@ cls.ResourceManagerService = function(view, network_logger)
147151
// or a document does not have a documentID yet
148152
if(
149153
ctx.documentList.length == 0
150-
||
151-
ctx.resourceList.some(
152-
function(v)
153-
{
154-
return v.document_id && !this._documentURLHash[v.document_id];
155-
},this)
156-
||
157-
ctx.documentList.some(
158-
function(v)
159-
{
160-
return v.documentID==null;
161-
})
154+
||
155+
ctx.resourceList
156+
.some(function(v)
157+
{
158+
return v.document_id && !this._documentURLHash[v.document_id];
159+
},this)
160+
||
161+
ctx.documentList
162+
.some(function(v)
163+
{
164+
return v.documentID == null;
165+
})
162166
)
163167
this._listDocuments();
164168

@@ -269,8 +273,8 @@ cls.ResourceManagerService = function(view, network_logger)
269273
broker.show_resource_for_ele(target);
270274
}
271275

272-
this._res_service = window.services['resource-manager'];
273-
window.messages.addListener('debug-context-selected', this._on_debug_context_selected_bound);
276+
var messages = window.messages;
277+
messages.addListener('debug-context-selected', this._on_debug_context_selected_bound);
274278
this._network_logger.addListener("resource-update", this._update_bound);
275279
this._network_logger.addListener("window-context-added", this._update_bound);
276280
this._network_logger.addListener("window-context-removed", this._update_bound);
@@ -302,8 +306,7 @@ cls.ResourceManagerService = function(view, network_logger)
302306
return resource && resource.last;
303307
};
304308

305-
306-
this.request_resource_for_url = function(url,callback)
309+
this.request_resource = function( url, callback, data )
307310
{
308311
cls.ResourceRequest(url, callback, data);
309312
}
@@ -312,7 +315,7 @@ cls.ResourceManagerService = function(view, network_logger)
312315
this._init();
313316
};
314317

315-
cls.ResourceRequest = function(url, callback,data)
318+
cls.ResourceRequest = function(url, callback, data)
316319
{
317320
const
318321
TRANSPORT_STRING = 1,

0 commit comments

Comments
 (0)