Add Google Analitycs to the footer.

This commit is contained in:
Paulo Gustavo Veiga 2012-07-03 00:04:44 -03:00
parent cd178109f3
commit 61d0fcbdf6
12 changed files with 112 additions and 20 deletions

View File

@ -79,7 +79,8 @@ mindplot.Messages.BUNDLES = {
SUB_TOPIC:'Sub Topic',
ISOLATED_TOPIC:'Isolated Topic',
CENTRAL_TOPIC:'Central Topic',
ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE:'Children can not be collapsed. One topic must be selected.'
ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE:'Children can not be collapsed. One topic must be selected.',
SHORTCUTS:'Keyboard Shortcuts'
},
'es':{
DISCARD_CHANGES:'Descartar Cambios',
@ -125,7 +126,8 @@ mindplot.Messages.BUNDLES = {
SUB_TOPIC:'Tópico Secundario',
ISOLATED_TOPIC:'Tópico Aislado',
CENTRAL_TOPIC:'Tópico Central',
ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE:'Tópicos hijos no pueden ser colapsados. Solo un topic debe ser seleccionado.'
ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE:'Tópicos hijos no pueden ser colapsados. Solo un topic debe ser seleccionado.',
SHORTCUTS:'Accesos directos'
}
};

View File

@ -42,3 +42,4 @@ MAIN_TOPIC=Main Topic
SUB_TOPIC=Sub Topic
ISOLATED_TOPIC=Isolated Topic
CENTRAL_TOPIC=Central Topic
SHORTCUTS=Keyboard Shortcuts

View File

@ -43,3 +43,4 @@ SUB_TOPIC=Tópico Secundario
ISOLATED_TOPIC=Tópico Aislado
CENTRAL_TOPIC=Tópico Central
ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE=Tópicos hijos no pueden ser colapsados. Solo un topic debe ser seleccionado.
SHORTCUTS=Accesos directos

View File

@ -0,0 +1,46 @@
/*
* Copyright [2011] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
* "powered by wisemapping" text requirement on every single page;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the license at
*
* http://www.wisemapping.org/license
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.wisemapping.filter;
import com.wisemapping.exceptions.GoogleChromeFrameRequiredException;
import com.wisemapping.exceptions.UnsupportedBrowserException;
import org.jetbrains.annotations.NotNull;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
public class RequestPropertiesInterceptor extends HandlerInterceptorAdapter {
private Map<String, String> attributes;
public boolean preHandle(@NotNull HttpServletRequest request, @NotNull HttpServletResponse response, Object object) throws Exception {
for (String key : attributes.keySet()) {
request.setAttribute(key, attributes.get(key));
}
return true;
}
public void setAttributes(Map<String, String> attributes) {
this.attributes = attributes;
}
}

View File

@ -58,7 +58,7 @@ public class UsersController {
@Autowired
private ReCaptcha captchaService;
@Value("${registration.recaptcha.enabled}")
@Value("${google.recaptcha.enabled}")
private boolean captchaEnabled;

View File

@ -68,12 +68,12 @@ mail.errorReporterEmail=
registration.email.enabled = false
# Enable captcha confirmation
registration.recaptcha.enabled = true
google.recaptcha.enabled = true
# ReCaptcha is the default captcha. Public and private keys are required.
# More Info: http://www.google.com/recaptcha .
registration.recaptcha.privateKey = 6LeQ4tISAAAAAMfHMPRKyHupTfA-KE4QeTCnLXhK
registration.recaptcha.publicKey = 6LeQ4tISAAAAALzCGKNgRv8UqsDx7Cb0vq4wbJBr
google.recaptcha.privateKey = 6LeQ4tISAAAAAMfHMPRKyHupTfA-KE4QeTCnLXhK
google.recaptcha.publicKey = 6LeQ4tISAAAAALzCGKNgRv8UqsDx7Cb0vq4wbJBr
##################################################################################
# Site configuration
@ -85,3 +85,9 @@ admin.user = admin@wisemapping.org
# Site URL. This url will be used during sharing emails and public views.
site.baseurl = http://localhost:8080
##################################################################################
# Google Analytics Settings
##################################################################################
google.analytics.enabled=true
google.analytics.account=UA-XXXX

View File

@ -203,4 +203,5 @@ CHANGE_TEXT_ITALIC=Change Text Italic
DESELECT_ALL_TOPIC=Deselect All Topic
SHORTCUTS=Shortcuts
COLLAPSE_CHILDREN=Collapse Children
KEYBOARD_SHORTCUTS_MSG=Keyboard shortcuts can help you save time by allowing you to never take your hands off the keyboard to use the mouse.

View File

@ -204,4 +204,5 @@ CHANGE_TEXT_ITALIC=Cambiar Texto a Italica
DESELECT_ALL_TOPIC=Revertir Selecci\u00f3n de T\u00f3picos
SHORTCUTS=Shortcuts
COLLAPSE_CHILDREN=Colapsar Hijos
KEYBOARD_SHORTCUTS_MSG=Los accesos directos pueden ayudarte a salvar tiempo permitiendote no sacar las manos del teclado para usar el mouse.

View File

@ -15,6 +15,11 @@
<context:annotation-config/>
<mvc:annotation-driven/>
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="/WEB-INF/app.properties"/>
</bean>
<!-- Interceptors Registration -->
<mvc:interceptors>
<bean id="browserSupportInterceptor" class="com.wisemapping.filter.BrowserSupportInterceptor">
@ -37,11 +42,16 @@
</bean>
<bean id="userLocaleInterceptor" class="com.wisemapping.filter.UserLocaleInterceptor">
</bean>
<bean id="requestInterceptor" class="com.wisemapping.filter.RequestPropertiesInterceptor">
<property name="attributes">
<map>
<entry key="google.analytics.enabled" value="${google.analytics.enabled}"/>
<entry key="google.analytics.account" value="${google.analytics.account}"/>
</map>
</property>
</bean>
</mvc:interceptors>
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="/WEB-INF/app.properties"/>
</bean>
<bean id="exceptionHandlerResolver"
class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
@ -73,8 +83,8 @@
class="org.springframework.web.servlet.i18n.SessionLocaleResolver"/>
<bean id="reCaptcha" class="net.tanesha.recaptcha.ReCaptchaImpl">
<property name="privateKey" value="${registration.recaptcha.privateKey}"/>
<property name="publicKey" value="${registration.recaptcha.publicKey}"/>
<property name="privateKey" value="${google.recaptcha.privateKey}"/>
<property name="publicKey" value="${google.recaptcha.publicKey}"/>
<property name="includeNoscript" value="false"/>
</bean>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,4 +1,6 @@
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<div id="footer">
<div style="width:30%; float:left;">&nbsp;</div>
<div style="float:left; width:40%;">
@ -19,5 +21,24 @@
<img src="http://www.w3.org/html/logo/badge/html5-badge-h-graphics.png" width="66" height="32"
alt="HTML5 Powered with Graphics, 3D &amp; Effects"
title="HTML5 Powered with Graphics, 3D &amp; Effects">
</a></div>
</a>
</div>
<c:if test="${requestScope['google.analytics.enabled']}">
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '${requestScope['google.analytics.account']}']);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</c:if>
</div>

View File

@ -2,6 +2,8 @@
<%@ include file="/jsp/init.jsp" %>
<!DOCTYPE HTML>
<p><spring:message code="KEYBOARD_SHORTCUTS_MSG"/></p>
<style type="text/css">
#keyboardTable {
font-family: Arial, verdana, serif;
@ -12,6 +14,7 @@
padding: 3px;
white-space: nowrap;
}
#keyboardTable th {
padding: 5px;
white-space: nowrap;