Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fddff26

Browse files
author
Patrick McDougle
committed
Put back the indentation
1 parent 9942edd commit fddff26

File tree

1 file changed

+71
-71
lines changed

1 file changed

+71
-71
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -230,86 +230,86 @@
230230
}
231231
232232
{% if excluded_ajax_paths is defined %}
233-
if (window.fetch && window.fetch.polyfill === undefined) {
234-
var oldFetch = window.fetch;
235-
window.fetch = function () {
236-
var promise = oldFetch.apply(this, arguments);
237-
if (!arguments[0].match(new RegExp({{ excluded_ajax_paths|json_encode|raw }}))) {
238-
var method = 'GET';
239-
if (arguments[1] && arguments[1].method !== undefined) {
240-
method = arguments[1].method;
241-
}
242-
243-
var stackElement = {
244-
error: false,
245-
url: arguments[0],
246-
method: method,
247-
type: 'fetch',
248-
start: new Date()
249-
};
250-
251-
var idx = requestStack.push(stackElement) - 1;
252-
promise.then(function (r) {
253-
stackElement.duration = new Date() - stackElement.start;
254-
stackElement.error = r.status < 200 || r.status >= 400;
255-
stackElement.statusCode = r.status;
256-
stackElement.profile = r.headers.get('x-debug-token');
257-
stackElement.profilerUrl = r.headers.get('x-debug-token-link');
258-
finishAjaxRequest(idx);
259-
}, function (e){
260-
stackElement.error = true;
261-
});
262-
startAjaxRequest(idx);
263-
}
264-
265-
return promise;
266-
};
267-
}
268-
if (window.XMLHttpRequest && XMLHttpRequest.prototype.addEventListener) {
269-
var proxied = XMLHttpRequest.prototype.open;
233+
if (window.fetch && window.fetch.polyfill === undefined) {
234+
var oldFetch = window.fetch;
235+
window.fetch = function () {
236+
var promise = oldFetch.apply(this, arguments);
237+
if (!arguments[0].match(new RegExp({{ excluded_ajax_paths|json_encode|raw }}))) {
238+
var method = 'GET';
239+
if (arguments[1] && arguments[1].method !== undefined) {
240+
method = arguments[1].method;
241+
}
270242
271-
XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {
272-
var self = this;
243+
var stackElement = {
244+
error: false,
245+
url: arguments[0],
246+
method: method,
247+
type: 'fetch',
248+
start: new Date()
249+
};
273250
274-
/* prevent logging AJAX calls to static and inline files, like templates */
275-
var path = url;
276-
if (url.substr(0, 1) === '/') {
277-
if (0 === url.indexOf('{{ request.basePath|e('js') }}')) {
278-
path = url.substr({{ request.basePath|length }});
251+
var idx = requestStack.push(stackElement) - 1;
252+
promise.then(function (r) {
253+
stackElement.duration = new Date() - stackElement.start;
254+
stackElement.error = r.status < 200 || r.status >= 400;
255+
stackElement.statusCode = r.status;
256+
stackElement.profile = r.headers.get('x-debug-token');
257+
stackElement.profilerUrl = r.headers.get('x-debug-token-link');
258+
finishAjaxRequest(idx);
259+
}, function (e){
260+
stackElement.error = true;
261+
});
262+
startAjaxRequest(idx);
279263
}
280-
}
281-
else if (0 === url.indexOf('{{ (request.schemeAndHttpHost ~ request.basePath)|e('js') }}')) {
282-
path = url.substr({{ (request.schemeAndHttpHost ~ request.basePath)|length }});
283-
}
284264
285-
if (!path.match(new RegExp({{ excluded_ajax_paths|json_encode|raw }}))) {
286-
var stackElement = {
287-
error: false,
288-
url: url,
289-
method: method,
290-
type: 'xhr',
291-
start: new Date()
292-
};
293-
294-
var idx = requestStack.push(stackElement) - 1;
265+
return promise;
266+
};
267+
}
268+
if (window.XMLHttpRequest && XMLHttpRequest.prototype.addEventListener) {
269+
var proxied = XMLHttpRequest.prototype.open;
295270
296-
this.addEventListener('readystatechange', function() {
297-
if (self.readyState == 4) {
298-
stackElement.duration = new Date() - stackElement.start;
299-
stackElement.error = self.status < 200 || self.status >= 400;
300-
stackElement.statusCode = self.status;
301-
extractHeaders(self, stackElement);
271+
XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {
272+
var self = this;
302273
303-
finishAjaxRequest(idx);
274+
/* prevent logging AJAX calls to static and inline files, like templates */
275+
var path = url;
276+
if (url.substr(0, 1) === '/') {
277+
if (0 === url.indexOf('{{ request.basePath|e('js') }}')) {
278+
path = url.substr({{ request.basePath|length }});
304279
}
305-
}, false);
280+
}
281+
else if (0 === url.indexOf('{{ (request.schemeAndHttpHost ~ request.basePath)|e('js') }}')) {
282+
path = url.substr({{ (request.schemeAndHttpHost ~ request.basePath)|length }});
283+
}
306284
307-
startAjaxRequest(idx);
308-
}
285+
if (!path.match(new RegExp({{ excluded_ajax_paths|json_encode|raw }}))) {
286+
var stackElement = {
287+
error: false,
288+
url: url,
289+
method: method,
290+
type: 'xhr',
291+
start: new Date()
292+
};
293+
294+
var idx = requestStack.push(stackElement) - 1;
295+
296+
this.addEventListener('readystatechange', function() {
297+
if (self.readyState == 4) {
298+
stackElement.duration = new Date() - stackElement.start;
299+
stackElement.error = self.status < 200 || self.status >= 400;
300+
stackElement.statusCode = self.status;
301+
extractHeaders(self, stackElement);
302+
303+
finishAjaxRequest(idx);
304+
}
305+
}, false);
309306
310-
proxied.apply(this, Array.prototype.slice.call(arguments));
311-
};
312-
}
307+
startAjaxRequest(idx);
308+
}
309+
310+
proxied.apply(this, Array.prototype.slice.call(arguments));
311+
};
312+
}
313313
{% endif %}
314314
315315
return {

0 commit comments

Comments
 (0)