From f45480c0b93a76fab92a464c8e66951a06330fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Wed, 18 Mar 2015 08:09:51 +0100 Subject: [PATCH] Fix bugs with show warnings and some html escaping --- front/src/css/timeline.css | 6 ++++++ front/src/js/directives/offendersDirectives.js | 14 ++++++++++---- front/src/less/timeline.less | 8 ++++++++ front/src/views/timeline.html | 2 +- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/front/src/css/timeline.css b/front/src/css/timeline.css index ab00a13..e5ba04b 100644 --- a/front/src/css/timeline.css +++ b/front/src/css/timeline.css @@ -306,3 +306,9 @@ color: #e74c3c; cursor: pointer; } +.warningsFilterOn > div { + display: none; +} +.warningsFilterOn > div.warning { + display: table-row; +} diff --git a/front/src/js/directives/offendersDirectives.js b/front/src/js/directives/offendersDirectives.js index 2407a6b..45b8b33 100644 --- a/front/src/js/directives/offendersDirectives.js +++ b/front/src/js/directives/offendersDirectives.js @@ -157,13 +157,14 @@ function getJQueryHTML(node, onASingleLine) { var type = node.data.type; - var args = node.data.callDetails.arguments; + var unescapedArgs = node.data.callDetails.arguments; + var args = []; var ctxt = node.data.callDetails.context; // escape HTML in args for (var i = 0 ; i < 4 ; i ++) { - if (args[i]) { - args[i] = escapeHTML(args[i]); + if (unescapedArgs[i]) { + args[i] = escapeHTML(unescapedArgs[i]); } } @@ -706,7 +707,7 @@ index: '=', node: '=' }, - template: '
', + template: '
', replace: true, link: function(scope, element) { @@ -717,6 +718,11 @@ } element.append(getProfilerLineHTML(scope.index, scope.node)); + element[0].id = 'line_' + scope.index; + + if (scope.node.warning || scope.node.error) { + element[0].classList.add('warning'); + } // Bind click on the details icon var detailsIcon = element[0].querySelector('.details div'); diff --git a/front/src/less/timeline.less b/front/src/less/timeline.less index 7e353f8..952c918 100644 --- a/front/src/less/timeline.less +++ b/front/src/less/timeline.less @@ -345,4 +345,12 @@ .execution .icon-warning { color: #e74c3c; cursor: pointer; +} +.warningsFilterOn { + > div { + display: none; + &.warning { + display: table-row; + } + } } \ No newline at end of file diff --git a/front/src/views/timeline.html b/front/src/views/timeline.html index 176653a..dc0398c 100644 --- a/front/src/views/timeline.html +++ b/front/src/views/timeline.html @@ -64,7 +64,7 @@ -
+
Type