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

@ -78,8 +78,9 @@ mindplot.Messages.BUNDLES = {
MAIN_TOPIC:'Main Topic', MAIN_TOPIC:'Main Topic',
SUB_TOPIC:'Sub Topic', SUB_TOPIC:'Sub Topic',
ISOLATED_TOPIC:'Isolated Topic', ISOLATED_TOPIC:'Isolated Topic',
CENTRAL_TOPIC: 'Central 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':{ 'es':{
DISCARD_CHANGES:'Descartar Cambios', DISCARD_CHANGES:'Descartar Cambios',
@ -124,8 +125,9 @@ mindplot.Messages.BUNDLES = {
MAIN_TOPIC:'Tópico Principal', MAIN_TOPIC:'Tópico Principal',
SUB_TOPIC:'Tópico Secundario', SUB_TOPIC:'Tópico Secundario',
ISOLATED_TOPIC:'Tópico Aislado', ISOLATED_TOPIC:'Tópico Aislado',
CENTRAL_TOPIC: 'Tópico Central', 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 SUB_TOPIC=Sub Topic
ISOLATED_TOPIC=Isolated Topic ISOLATED_TOPIC=Isolated Topic
CENTRAL_TOPIC=Central Topic CENTRAL_TOPIC=Central Topic
SHORTCUTS=Keyboard Shortcuts

View File

@ -43,3 +43,4 @@ SUB_TOPIC=Tópico Secundario
ISOLATED_TOPIC=Tópico Aislado ISOLATED_TOPIC=Tópico Aislado
CENTRAL_TOPIC=Tópico Central 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

@ -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 @Autowired
private ReCaptcha captchaService; private ReCaptcha captchaService;
@Value("${registration.recaptcha.enabled}") @Value("${google.recaptcha.enabled}")
private boolean captchaEnabled; private boolean captchaEnabled;

View File

@ -68,12 +68,12 @@ mail.errorReporterEmail=
registration.email.enabled = false registration.email.enabled = false
# Enable captcha confirmation # Enable captcha confirmation
registration.recaptcha.enabled = true google.recaptcha.enabled = true
# ReCaptcha is the default captcha. Public and private keys are required. # ReCaptcha is the default captcha. Public and private keys are required.
# More Info: http://www.google.com/recaptcha . # More Info: http://www.google.com/recaptcha .
registration.recaptcha.privateKey = 6LeQ4tISAAAAAMfHMPRKyHupTfA-KE4QeTCnLXhK google.recaptcha.privateKey = 6LeQ4tISAAAAAMfHMPRKyHupTfA-KE4QeTCnLXhK
registration.recaptcha.publicKey = 6LeQ4tISAAAAALzCGKNgRv8UqsDx7Cb0vq4wbJBr google.recaptcha.publicKey = 6LeQ4tISAAAAALzCGKNgRv8UqsDx7Cb0vq4wbJBr
################################################################################## ##################################################################################
# Site configuration # 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 URL. This url will be used during sharing emails and public views.
site.baseurl = http://localhost:8080 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 DESELECT_ALL_TOPIC=Deselect All Topic
SHORTCUTS=Shortcuts SHORTCUTS=Shortcuts
COLLAPSE_CHILDREN=Collapse Children 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 DESELECT_ALL_TOPIC=Revertir Selecci\u00f3n de T\u00f3picos
SHORTCUTS=Shortcuts SHORTCUTS=Shortcuts
COLLAPSE_CHILDREN=Colapsar Hijos 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/> <context:annotation-config/>
<mvc:annotation-driven/> <mvc:annotation-driven/>
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="/WEB-INF/app.properties"/>
</bean>
<!-- Interceptors Registration --> <!-- Interceptors Registration -->
<mvc:interceptors> <mvc:interceptors>
<bean id="browserSupportInterceptor" class="com.wisemapping.filter.BrowserSupportInterceptor"> <bean id="browserSupportInterceptor" class="com.wisemapping.filter.BrowserSupportInterceptor">
@ -37,11 +42,16 @@
</bean> </bean>
<bean id="userLocaleInterceptor" class="com.wisemapping.filter.UserLocaleInterceptor"> <bean id="userLocaleInterceptor" class="com.wisemapping.filter.UserLocaleInterceptor">
</bean> </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> </mvc:interceptors>
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="/WEB-INF/app.properties"/>
</bean>
<bean id="exceptionHandlerResolver" <bean id="exceptionHandlerResolver"
class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver"> class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
@ -73,8 +83,8 @@
class="org.springframework.web.servlet.i18n.SessionLocaleResolver"/> class="org.springframework.web.servlet.i18n.SessionLocaleResolver"/>
<bean id="reCaptcha" class="net.tanesha.recaptcha.ReCaptchaImpl"> <bean id="reCaptcha" class="net.tanesha.recaptcha.ReCaptchaImpl">
<property name="privateKey" value="${registration.recaptcha.privateKey}"/> <property name="privateKey" value="${google.recaptcha.privateKey}"/>
<property name="publicKey" value="${registration.recaptcha.publicKey}"/> <property name="publicKey" value="${google.recaptcha.publicKey}"/>
<property name="includeNoscript" value="false"/> <property name="includeNoscript" value="false"/>
</bean> </bean>
@ -84,7 +94,7 @@
<property name="maxUploadSize" value="522240"/> <property name="maxUploadSize" value="522240"/>
</bean> </bean>
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource" > <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basenames"> <property name="basenames">
<list> <list>
<value>messages</value> <value>messages</value>

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 prefix="spring" uri="http://www.springframework.org/tags" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<div id="footer"> <div id="footer">
<div style="width:30%; float:left;">&nbsp;</div> <div style="width:30%; float:left;">&nbsp;</div>
<div style="float:left; width:40%;"> <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" <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" alt="HTML5 Powered with Graphics, 3D &amp; Effects"
title="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> </div>

View File

@ -2,24 +2,27 @@
<%@ include file="/jsp/init.jsp" %> <%@ include file="/jsp/init.jsp" %>
<!DOCTYPE HTML> <!DOCTYPE HTML>
<p><spring:message code="KEYBOARD_SHORTCUTS_MSG"/></p>
<style type="text/css"> <style type="text/css">
#keyboardTable { #keyboardTable {
font-family: Arial,verdana,serif; font-family: Arial, verdana, serif;
font-size: 13px; font-size: 13px;
} }
#keyboardTable td { #keyboardTable td {
padding: 3px; padding: 3px;
white-space:nowrap; white-space: nowrap;
} }
#keyboardTable th { #keyboardTable th {
padding: 5px; padding: 5px;
white-space:nowrap; white-space: nowrap;
} }
#keyboardTable th { #keyboardTable th {
background-color: #000000; background-color: #000000;
color:#ffffff; color: #ffffff;
} }
</style> </style>