fix bugs with empty tracking code

This commit is contained in:
Sebastian Sdorra
2011-11-13 18:10:20 +01:00
parent 124cae18d7
commit bd0b46f9e2
2 changed files with 11 additions and 5 deletions

View File

@@ -33,13 +33,16 @@
package sonia.scm.plugin.rest; package sonia.scm.plugin.rest;
//~--- non-JDK imports --------------------------------------------------------
import sonia.scm.plugin.BackendConfiguration;
//~--- JDK imports ------------------------------------------------------------ //~--- JDK imports ------------------------------------------------------------
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import javax.servlet.ServletContext; import javax.servlet.ServletContext;
import sonia.scm.plugin.BackendConfiguration;
/** /**
* *
@@ -53,15 +56,15 @@ public class ViewableResource
* *
* *
* @param context * @param context
* @param configuration
*/ */
public ViewableResource(ServletContext context, BackendConfiguration configuration) public ViewableResource(ServletContext context,
BackendConfiguration configuration)
{ {
this.contextPath = context.getContextPath(); this.contextPath = context.getContextPath();
this.configuration = configuration; this.configuration = configuration;
} }
private BackendConfiguration configuration;
//~--- methods -------------------------------------------------------------- //~--- methods --------------------------------------------------------------
/** /**
@@ -85,6 +88,9 @@ public class ViewableResource
//~--- fields --------------------------------------------------------------- //~--- fields ---------------------------------------------------------------
/** Field description */
private BackendConfiguration configuration;
/** Field description */ /** Field description */
private String contextPath; private String contextPath;
} }

View File

@@ -48,7 +48,7 @@
<script src="${contextPath}template/js/html5.js"></script> <script src="${contextPath}template/js/html5.js"></script>
<![endif]--> <![endif]-->
<base href="${contextPath}" /> <base href="${contextPath}" />
<#if configuration.trackingConde??> <#if configuration.trackingCode??>
<script type="text/javascript"> <script type="text/javascript">
var _gaq = _gaq || []; var _gaq = _gaq || [];