aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2013-10-29 10:10:42 +0100
committerStas Vilchik <vilchiks@gmail.com>2013-10-29 10:10:42 +0100
commit336b4ea25cf4ac0d517903625f86655897b0e56d (patch)
tree46a828559c6032d2c6bbda47ca62d3ecf8946772
parent86cbb7d1c0ba6bc7de42ba216230f91e23ff1ae1 (diff)
downloadsonarqube-336b4ea25cf4ac0d517903625f86655897b0e56d.tar.gz
sonarqube-336b4ea25cf4ac0d517903625f86655897b0e56d.zip
SONAR-4817 Fix timeline widget for IE8, improve time axis' labels
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb6
-rw-r--r--sonar-server/src/main/webapp/javascripts/widgets/timeline.js9
2 files changed, 14 insertions, 1 deletions
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb
index 8156f929343..dae64bfef9d 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb
@@ -146,11 +146,16 @@
%>
+<!--[if lte IE 8 ]> <h3><%= message('widget.unsupported_browser_warning') -%></h3> <![endif]-->
+
+<!--[if (gt IE 9)|!(IE)]><!-->
<% if widget_properties["chartTitle"] %>
<h3 style="text-align: center; margin-bottom: 10px"><%= h(widget_properties["chartTitle"]) -%></h3>
<% end %>
+<!--<![endif]-->
+<!--[if (gt IE 9)|!(IE)]><!-->
<%
unless metric_data_map.values.empty?
@@ -188,3 +193,4 @@
end
end
%>
+<!--<![endif]-->
diff --git a/sonar-server/src/main/webapp/javascripts/widgets/timeline.js b/sonar-server/src/main/webapp/javascripts/widgets/timeline.js
index 5772a0f2380..cc70e097367 100644
--- a/sonar-server/src/main/webapp/javascripts/widgets/timeline.js
+++ b/sonar-server/src/main/webapp/javascripts/widgets/timeline.js
@@ -147,7 +147,14 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets;
// Configure the axis
this.timeAxis = d3.svg.axis()
.scale(this.time)
- .orient('bottom');
+ .orient('bottom')
+ .tickFormat(function(d) {
+ var format = d.getMonth() === 0 ?
+ d3.time.format('%Y') :
+ d3.time.format('%b');
+
+ return format(d);
+ });
// Configure lines and points