diff options
author | James Moger <james.moger@gitblit.com> | 2014-06-13 08:55:14 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-06-13 08:55:14 -0400 |
commit | 54a6acc53a150e3a52265fd6fb684d239b0918b2 (patch) | |
tree | f686e586df51277ceecbfa764231520a30532f0d /src/main | |
parent | 0e63b9a5d56600856e280f2f4d0ac8ad8cb4528a (diff) | |
parent | 7fb8d1209a3926329638fc3ca5f0b4bc428029f6 (diff) | |
download | gitblit-54a6acc53a150e3a52265fd6fb684d239b0918b2.tar.gz gitblit-54a6acc53a150e3a52265fd6fb684d239b0918b2.zip |
Merge branch 'ticket/103' into release-v1.6.0
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/gitblit/wicket/charting/Flotr2Charts.java | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/main/java/com/gitblit/wicket/charting/Flotr2Charts.java b/src/main/java/com/gitblit/wicket/charting/Flotr2Charts.java index dd723622..7a8adcf2 100644 --- a/src/main/java/com/gitblit/wicket/charting/Flotr2Charts.java +++ b/src/main/java/com/gitblit/wicket/charting/Flotr2Charts.java @@ -32,24 +32,30 @@ public class Flotr2Charts extends Charts { @Override public void renderHead(IHeaderResponse response) { - + // add Google Chart JS API reference ServletContext servletContext = WebApplication.get().getServletContext(); String contextPath = servletContext.getContextPath(); - + response.renderJavascriptReference(contextPath + "/bootstrap/js/jquery.js"); response.renderJavascriptReference(contextPath + "/flotr2/flotr2.min.js"); response.renderCSSReference(contextPath + "/flotr2/flotr2.custom.css"); - + // prepare draw chart function StringBuilder sb = new StringBuilder(); - + line(sb, "$( document ).ready(function() {"); + line(sb, "try {"); // add charts to header for (Chart chart : charts) { chart.appendChart(sb); } - + line(sb, "} catch (exception) {"); + line(sb, " if (window.console && window.console.log) {"); + line(sb, " window.console.log('flotr2 exception');"); + line(sb, " window.console.log(exception);"); + line(sb, " }"); + line(sb, "}"); // end draw chart function line(sb, "});"); response.renderJavascript(sb.toString(), null); @@ -72,5 +78,5 @@ public class Flotr2Charts extends Charts { String valueName) { return new Flotr2BarChart(tagId, title, keyName, valueName); } - + } |