Skip to content

Commit

Permalink
removed hack
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Sep 23, 2014
1 parent e84884b commit 069cb62
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 31 deletions.
Expand Up @@ -108,7 +108,6 @@ public function panelAction(Request $request, $token)
'request' => $request,
'templates' => $this->getTemplateManager()->getTemplates($profile),
'is_ajax' => $request->isXmlHttpRequest(),
'excluded_ajax_paths' => null,
)), 200, array('Content-Type' => 'text/html'));
}

Expand Down
Expand Up @@ -173,38 +173,40 @@
var proxied = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {
var self = this;
/* prevent logging AJAX calls to static and inline files, like templates */
if (url.substr(0, 1) === '/' && !url.match(new RegExp("{{ excluded_ajax_paths }}"))) {
var stackElement = {
loading: true,
error: false,
url: url,
method: method,
start: new Date()
};
requestStack.push(stackElement);
this.addEventListener("readystatechange", function() {
if (self.readyState == 4) {
stackElement.duration = new Date() - stackElement.start;
stackElement.loading = false;
stackElement.error = self.status < 200 || self.status >= 400;
stackElement.profile = self.getResponseHeader("X-Debug-Token");
stackElement.profilerUrl = self.getResponseHeader("X-Debug-Token-Link");
Sfjs.renderAjaxRequests();
}
}, false);
{% if (excluded_ajax_paths is defined) %}
XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {
var self = this;
/* prevent logging AJAX calls to static and inline files, like templates */
if (url.substr(0, 1) === '/' && !url.match(new RegExp("{{ excluded_ajax_paths }}"))) {
var stackElement = {
loading: true,
error: false,
url: url,
method: method,
start: new Date()
};
requestStack.push(stackElement);
this.addEventListener("readystatechange", function() {
if (self.readyState == 4) {
stackElement.duration = new Date() - stackElement.start;
stackElement.loading = false;
stackElement.error = self.status < 200 || self.status >= 400;
stackElement.profile = self.getResponseHeader("X-Debug-Token");
stackElement.profilerUrl = self.getResponseHeader("X-Debug-Token-Link");
Sfjs.renderAjaxRequests();
}
}, false);
Sfjs.renderAjaxRequests();
}
Sfjs.renderAjaxRequests();
}
proxied.apply(this, Array.prototype.slice.call(arguments));
};
proxied.apply(this, Array.prototype.slice.call(arguments));
};
{% endif %}
return {
hasClass: hasClass,
Expand Down

0 comments on commit 069cb62

Please sign in to comment.