@@ -35,7 +35,7 @@ templates.details = function(entry, left_val, do_raw)
3535 "handler" , "resize-request-detail"
3636 ] ,
3737 [ "div" ,
38- templates . _details_content ( entry , do_raw ) ,
38+ this . _details_content ( entry , do_raw ) ,
3939 "data-object-id" , String ( entry . id ) ,
4040 "class" , "entry-details"
4141 ] ,
@@ -46,13 +46,13 @@ templates.details = function(entry, left_val, do_raw)
4646
4747templates . _details_content = function ( entry , do_raw )
4848{
49- var responsecode = entry . last_responsecode ;
49+ var responsecode = entry . current_responsecode ;
5050 if ( responsecode && responsecode in cls . ResourceUtil . http_status_codes )
5151 responsecode = responsecode + " " + cls . ResourceUtil . http_status_codes [ responsecode ] ;
5252
5353 // todo: not really pretty
5454 if ( ! this [ "_requests_responses_" + do_raw ] )
55- this [ "_requests_responses_" + do_raw ] = templates . requests_responses . bind ( this , do_raw ) ;
55+ this [ "_requests_responses_" + do_raw ] = this . requests_responses . bind ( this , do_raw ) ;
5656
5757 var requests_responses = entry . requests_responses . map ( this [ "_requests_responses_" + do_raw ] )
5858
@@ -77,10 +77,10 @@ templates._details_content = function(entry, do_raw)
7777 [ "td" ,
7878 entry . touched_network && responsecode ? String ( responsecode ) : ui_strings . S_RESOURCE_ALL_NOT_APPLICABLE
7979 ] ,
80- "data-spec" , "http#" + entry . last_responsecode
80+ "data-spec" , "http#" + entry . current_responsecode
8181 ]
8282 ] ,
83- entry . touched_network ? [ ] : templates . did_not_touch_network ( entry ) ,
83+ entry . touched_network ? [ ] : this . did_not_touch_network ( entry ) ,
8484 requests_responses
8585 ]
8686 ) ;
@@ -91,7 +91,7 @@ templates.did_not_touch_network = function(entry)
9191 var data = cls . ResourceManager [ "1.2" ] . UrlLoad . URLType . DATA ;
9292 return (
9393 [ "tbody" ,
94- templates . _wrap_col_or_row ( // Todo: Alternatively put into a headline, as these otherwise say "Request" here.
94+ this . _wrap_col_or_row ( // Todo: Alternatively put into a headline, as these otherwise say "Request" here.
9595 [ "p" , entry . urltype === data ? ui_strings . S_NETWORK_NOT_REQUESTED
9696 : ui_strings . S_NETWORK_SERVED_FROM_CACHE ] )
9797 ] ) ;
@@ -100,11 +100,11 @@ templates.did_not_touch_network = function(entry)
100100templates . requests_responses = function ( do_raw , request_response , index , requests_responses )
101101{
102102 var is_last = index == requests_responses . length - 1 ;
103- var template_func = templates . _response ;
103+ var template_func = this . _response ;
104104 if ( request_response instanceof cls . NetworkLoggerRequest )
105- template_func = templates . _request ;
105+ template_func = this . _request ;
106106
107- return template_func ( request_response , is_last , do_raw ) ;
107+ return template_func . call ( this , request_response , is_last , do_raw ) ;
108108} ;
109109
110110templates . _request = function ( request , is_last , do_raw )
@@ -118,8 +118,8 @@ templates._request = function(request, is_last, do_raw)
118118templates . _response = function ( response , is_last , do_raw )
119119{
120120 return [
121- templates . _response_headers ( response , do_raw ) ,
122- templates . _response_body ( response , do_raw , is_last )
121+ this . _response_headers ( response , do_raw ) ,
122+ this . _response_body ( response , do_raw , is_last )
123123 ]
124124} ;
125125
@@ -174,12 +174,12 @@ templates._request_headers = function(req, do_raw)
174174 {
175175 var tokens = [ ] ;
176176 var tokenizer = new cls . HTTPHeaderTokenizer ( ) ;
177- tokenizer . tokenize ( req . request_headers_raw , templates . _token_receiver . bind ( this , tokens ) ) ;
177+ tokenizer . tokenize ( req . request_headers_raw , this . _token_receiver . bind ( this , tokens ) ) ;
178178 req . header_tokens = tokens ;
179179 }
180180 if ( req . header_tokens . length )
181181 {
182- var map_func = templates . _make_header_template_func ( true ) ;
182+ var map_func = this . _make_header_template_func ( true ) ;
183183 return [
184184 [ "h2" , ui_strings . S_NETWORK_REQUEST_DETAIL_REQUEST_TITLE ] ,
185185 [ "pre" , req . header_tokens . map ( map_func ) , "class" , "mono" ]
@@ -214,10 +214,10 @@ templates._request_headers = function(req, do_raw)
214214 [ "span" , parts [ 2 ] + " " ]
215215 ] ;
216216 }
217- ret . extend ( templates . headers_list ( req . request_headers , firstline ) ) ;
217+ ret . extend ( this . headers_list ( req . request_headers , firstline ) ) ;
218218 }
219219 }
220- return [ "tbody" , ret . map ( templates . _wrap_col_or_row ) ] ;
220+ return [ "tbody" , ret . map ( this . _wrap_col_or_row ) ] ;
221221} ;
222222
223223templates . _response_headers = function ( resp , do_raw )
@@ -231,12 +231,12 @@ templates._response_headers = function(resp, do_raw)
231231 {
232232 var tokens = [ ] ;
233233 var tokenizer = new cls . HTTPHeaderTokenizer ( ) ;
234- tokenizer . tokenize ( resp . response_headers_raw , templates . _token_receiver . bind ( this , tokens ) ) ;
234+ tokenizer . tokenize ( resp . response_headers_raw , this . _token_receiver . bind ( this , tokens ) ) ;
235235 resp . header_tokens = tokens ;
236236 }
237237 if ( resp . header_tokens . length )
238238 {
239- var map_func = templates . _make_header_template_func ( false ) ;
239+ var map_func = this . _make_header_template_func ( false ) ;
240240 return [
241241 [ "h2" , ui_strings . S_NETWORK_REQUEST_DETAIL_RESPONSE_TITLE ] ,
242242 [ "pre" , resp . header_tokens . map ( map_func ) , "class" , "mono" ]
@@ -261,8 +261,8 @@ templates._response_headers = function(resp, do_raw)
261261 if ( resp . logger_entry_touched_network )
262262 ret . push ( [ "h2" , ui_strings . S_NETWORK_REQUEST_DETAIL_RESPONSE_TITLE ] ) ;
263263
264- ret . extend ( templates . headers_list ( resp . response_headers , firstline ) ) ;
265- return [ "tbody" , ret . map ( templates . _wrap_col_or_row ) ] ;
264+ ret . extend ( this . headers_list ( resp . response_headers , firstline ) ) ;
265+ return [ "tbody" , ret . map ( this . _wrap_col_or_row ) ] ;
266266} ;
267267
268268templates . headers_list = function ( headers , firstline , do_raw )
@@ -272,7 +272,7 @@ templates.headers_list = function(headers, firstline, do_raw)
272272 {
273273 map_func = function ( header )
274274 {
275- return templates . _wrap_pre ( [ [ "span" , header . name + ":" , "data-spec" , "http#" + header . name ] , [ "span" , " " + header . value ] ] ) ;
275+ return this . _wrap_pre ( [ [ "span" , header . name + ":" , "data-spec" , "http#" + header . name ] , [ "span" , " " + header . value ] ] ) ;
276276 } ;
277277 }
278278 else
@@ -296,7 +296,7 @@ templates._request_body = function(req, do_raw)
296296 if ( req . requestbody == null )
297297 return [ ] ;
298298
299- var ret = [ templates . _wrap_pre ( "\n" ) ] ;
299+ var ret = [ this . _wrap_pre ( "\n" ) ] ;
300300 if ( req . requestbody . partList . length ) // multipart
301301 {
302302 var use_raw_boundary = false ;
@@ -308,7 +308,7 @@ templates._request_body = function(req, do_raw)
308308 if ( use_raw_boundary && n === 0 )
309309 ret . push ( this . _wrap_pre ( req . boundary ) ) ;
310310
311- ret . extend ( templates . headers_list ( part . headerList , null , do_raw ) ) ;
311+ ret . extend ( this . headers_list ( part . headerList , null , do_raw ) ) ;
312312 ret . push ( this . _wrap_pre ( "\n" ) ) ;
313313 if ( part . content && part . content . stringData )
314314 ret . push ( [ "pre" , part . content . stringData , "class" , "mono network-body" ] ) ;
@@ -370,13 +370,13 @@ templates._request_body = function(req, do_raw)
370370 if ( do_raw )
371371 return ret ;
372372 else
373- return [ "tbody" , ret . map ( templates . _wrap_col_or_row ) ] ;
373+ return [ "tbody" , ret . map ( this . _wrap_col_or_row ) ] ;
374374} ;
375375
376376
377377templates . _response_body = function ( resp , do_raw , is_last )
378378{
379- var ret = [ templates . _wrap_pre ( "\n" ) ] ; // todo: no, then it's (really) empty there shouldn't be a separator either.
379+ var ret = [ this . _wrap_pre ( "\n" ) ] ; // todo: no, then it's (really) empty there shouldn't be a separator either.
380380
381381 var classname = "" ;
382382 if ( resp . body_unavailable ||
@@ -422,7 +422,7 @@ templates._response_body = function(resp, do_raw, is_last)
422422 if ( do_raw )
423423 return ret ;
424424 else
425- return [ "tbody" , ret . map ( templates . _wrap_col_or_row ) , "class" , classname ] ;
425+ return [ "tbody" , ret . map ( this . _wrap_col_or_row ) , "class" , classname ] ;
426426} ;
427427
428428} ) ( window . templates . network ) ;
0 commit comments