diff --git a/mindplot/src/main/javascript/DesignerKeyboard.js b/mindplot/src/main/javascript/DesignerKeyboard.js index 1bead41f..4a35c6b8 100644 --- a/mindplot/src/main/javascript/DesignerKeyboard.js +++ b/mindplot/src/main/javascript/DesignerKeyboard.js @@ -314,7 +314,12 @@ mindplot.DesignerKeyboard = new Class({ var regex = /^(?:shift|control|ctrl|alt|meta)$/; var modifiers = ['shift', 'control', 'alt', 'meta']; + var excludes = ['esc', 'capslock', 'tab', 'f1', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12', 'backspace', 'down', 'up', 'left', 'right', 'control']; + if (!Browser.Platform.mac) { + // This is to avoid enter on edition mode in the node when alt+tab is pressed. + excludes.push("alt"); + } $(document).addEvent('keydown', function (event) { diff --git a/wise-webapp/src/main/java/com/wisemapping/filter/RequestPropertiesInterceptor.java b/wise-webapp/src/main/java/com/wisemapping/filter/RequestPropertiesInterceptor.java index dd6590d7..1b69ae16 100644 --- a/wise-webapp/src/main/java/com/wisemapping/filter/RequestPropertiesInterceptor.java +++ b/wise-webapp/src/main/java/com/wisemapping/filter/RequestPropertiesInterceptor.java @@ -19,18 +19,11 @@ package com.wisemapping.filter; import org.jetbrains.annotations.NotNull; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.env.ConfigurableEnvironment; -import org.springframework.core.env.Environment; -import org.springframework.core.env.MutablePropertySources; -import org.springframework.core.env.PropertySource; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.util.Map; -import java.util.regex.Pattern; public class RequestPropertiesInterceptor extends HandlerInterceptorAdapter { @@ -46,8 +39,9 @@ public class RequestPropertiesInterceptor extends HandlerInterceptorAdapter { @Value("${site.homepage}") private String siteHomepage; - @Autowired - Environment env; + @Value("${site.baseurl}") + private String siteUrl; + public boolean preHandle(@NotNull HttpServletRequest request, @NotNull HttpServletResponse response, Object object) throws Exception { @@ -56,13 +50,11 @@ public class RequestPropertiesInterceptor extends HandlerInterceptorAdapter { request.setAttribute("google.ads.enabled", adsEnabled); request.setAttribute("site.homepage", siteHomepage); - final String baseUrl; - if (env.containsProperty("site.baseurl")) { - baseUrl = env.getProperty("site.baseurl"); - } else { - baseUrl = request.getRequestURL().toString().replace(request.getRequestURI(), request.getContextPath()); + // If the property could not be resolved, try to infer one from the request... + if ("${site.baseurl}".equals(siteUrl)) { + siteUrl = request.getRequestURL().toString().replace(request.getRequestURI(), request.getContextPath()); } - request.setAttribute("site.baseurl", baseUrl); + request.setAttribute("site.baseurl", siteUrl); return true; } } diff --git a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java index 7ae0c865..bff76cc5 100644 --- a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java +++ b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java @@ -27,7 +27,6 @@ import org.apache.commons.lang.StringEscapeUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.env.Environment; import javax.servlet.http.HttpServletRequest; import java.io.PrintWriter; diff --git a/wise-webapp/src/main/webapp/WEB-INF/app.properties b/wise-webapp/src/main/webapp/WEB-INF/app.properties index f0aa2f30..963c6b30 100755 --- a/wise-webapp/src/main/webapp/WEB-INF/app.properties +++ b/wise-webapp/src/main/webapp/WEB-INF/app.properties @@ -82,7 +82,7 @@ admin.user = admin@wisemapping.org # Base URL where WiseMapping is deployed. By default, It will be automatically inferred. # If you are planning to put wisemapping behind an Apache using an Apache Proxy setup, you must enable this property. -# site.baseurl = http:///example.com:8080/wisemapping +#site.baseurl = http:///example.com:8080/wisemapping # Site Homepage URL. This will be used as URL for homepage location.