diff --git a/app/node_views/results.html b/app/node_views/results.html
index 25e826f..5a42166 100644
--- a/app/node_views/results.html
+++ b/app/node_views/results.html
@@ -122,24 +122,36 @@
-
-
+
+
0 ms
+
{{endTime}} ms
-
-
-
-
+
+
+
Executing Javascript and DOM queries here is a bad practice and slows down the DOM construction.
+
Also known as "document ready". This is where you should execute top-priority scripts, like binding action buttons or launch a video player.
+
Here you can execute mid-priority tasks. Loading a script with createElement('script') is one way to do so.
+
The page is fully loaded, it's time for low priority things : trackers, social plugins, easter egg...
+
diff --git a/app/public/scripts/resultsCtrl.js b/app/public/scripts/resultsCtrl.js
index 1f3cf85..f98d09d 100644
--- a/app/public/scripts/resultsCtrl.js
+++ b/app/public/scripts/resultsCtrl.js
@@ -226,8 +226,8 @@ app.controller('ResultsCtrl', function ($scope) {
// Split the timeline into 200 intervals
var numberOfIntervals = 200;
var lastEvent = $scope.javascript.children[$scope.javascript.children.length - 1];
- var endTime = lastEvent.data.timestamp + (lastEvent.data.time || 0);
- $scope.timelineIntervalDuration = endTime / numberOfIntervals;
+ $scope.endTime = lastEvent.data.timestamp + (lastEvent.data.time || 0);
+ $scope.timelineIntervalDuration = $scope.endTime / numberOfIntervals;
// Pre-filled array of 100 elements
$scope.timeline = Array.apply(null, new Array(numberOfIntervals)).map(Number.prototype.valueOf,0);
diff --git a/app/public/styles/results.css b/app/public/styles/results.css
index 711f229..4969dee 100644
--- a/app/public/styles/results.css
+++ b/app/public/styles/results.css
@@ -119,10 +119,26 @@ h4 {
margin: 2em 0 5em;
}
.timeline .chart {
- height: 100px;
+ position: relative;
width: 100%;
border-bottom: 1px solid #000;
}
+.timeline .startTime, .timeline .endTime {
+ position: absolute;
+ bottom: 0.5em;
+ font-size: 0.8em;
+}
+.timeline .startTime {
+ left: 0em;
+}
+.timeline .endTime {
+ right: 0em;
+}
+.timeline .chartPoints {
+ height: 100px;
+ width: 99%;
+ margin: 0 auto;
+}
.timeline .interval {
position: relative;
display: inline-block;
@@ -161,11 +177,24 @@ h4 {
.timeline .legend {
display: table;
width: 100%;
+ margin-top: 1em;
}
.timeline .legend > div {
+ display: table-row;
+}
+.timeline .legend > div > div {
display: table-cell;
margin-top: 1em;
}
+.timeline .titles {
+ font-weight: bold;
+}
+.timeline .tips {
+ font-size: 0.7em;
+}
+.timeline .tips > div {
+ padding: 1em 1.5em;
+}
.timeline .legend .color {
display: inline-block;
position: relative;
@@ -173,7 +202,7 @@ h4 {
height: 1.5em;
width: 1.5em;
border-radius: 0.2em;
- margin: 0 0.2em 0 1em;
+ margin: 0 0.4em 0 1em;
}