Add Google Crome Frame support.

This commit is contained in:
Paulo Gustavo Veiga 2012-06-21 22:18:04 -03:00
parent a5bf5b8d57
commit 10e869ab70
23 changed files with 99 additions and 154 deletions

View File

@ -0,0 +1,23 @@
/*
* 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.exceptions;
public class GoogleChromeFrameRequiredException extends Exception {
}

View File

@ -18,6 +18,7 @@
package com.wisemapping.filter; package com.wisemapping.filter;
import com.wisemapping.exceptions.GoogleChromeFrameRequiredException;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
@ -57,6 +58,13 @@ public class BrowserSupportInterceptor extends HandlerInterceptorAdapter {
if (!userAgent.isBrowserSupported()) { if (!userAgent.isBrowserSupported()) {
throw new UnsupportedBrowserException(); throw new UnsupportedBrowserException();
} }
// Is a Explorer 9 or less without Google Chrome Frame ?.
if (!userAgent.needsGCF()) {
throw new GoogleChromeFrameRequiredException();
}
} }
return true; return true;
} }

View File

@ -331,8 +331,9 @@ public class UserAgent implements Serializable {
} }
public boolean needsGCF() { public boolean needsGCF() {
final UserAgent.Product product = this.getProduct(); return true;
return product == UserAgent.Product.EXPLORER && this.isVersionLessThan(9) && this.getOs() == UserAgent.OS.WINDOWS && !this.hasGCFInstalled; // final UserAgent.Product product = this.getProduct();
// return product == UserAgent.Product.EXPLORER && this.isVersionLessThan(9) && this.getOs() == UserAgent.OS.WINDOWS && !this.hasGCFInstalled;
} }
} }

View File

@ -34,32 +34,32 @@ public class PublicPagesController {
@RequestMapping(value = "aboutUs") @RequestMapping(value = "aboutUs")
public ModelAndView aboutUs() { public String aboutUs() {
return new ModelAndView("aboutUs"); return "aboutUs";
} }
@RequestMapping(value = "crew") @RequestMapping(value = "crew")
public ModelAndView crew() { public String crew() {
return new ModelAndView("crew"); return "crew";
} }
@RequestMapping(value = "installCFG") @RequestMapping(value = "GCFInstall")
public ModelAndView installCFG() { public String showGCFInstallationPage() {
return new ModelAndView("installCFG"); return "GCFInstall";
} }
@RequestMapping(value = "keyboard") @RequestMapping(value = "keyboard")
public ModelAndView newsPage() { public String newsPage() {
return new ModelAndView("keyboard"); return "keyboard";
} }
@RequestMapping(value = "home") @RequestMapping(value = "home")
public ModelAndView home() { public String home() {
return new ModelAndView("homepage"); return "homepage";
} }
@RequestMapping(value = "iframeWrapper") @RequestMapping(value = "iframeWrapper")
public ModelAndView showIframe(@RequestParam(required = true) String url) { public ModelAndView showIframePage(@RequestParam(required = true) String url) {
return new ModelAndView("iframeWrapper", "url", url); return new ModelAndView("iframeWrapper", "url", url);
} }
} }

View File

@ -47,7 +47,6 @@ FAQ=Frequent Asked Questions
SHORT_FAQ=FAQ SHORT_FAQ=FAQ
LOGIN=Login LOGIN=Login
SUBJECT=Subject SUBJECT=Subject
SUBJECT_MESSAGE= has shared a mind map with you at WiseMapping
MSG=Message MSG=Message
PROBLEM_DETAIL=Description PROBLEM_DETAIL=Description
EXPORT=Export EXPORT=Export
@ -291,18 +290,12 @@ UNDO=Undo
REDO_EDITION=Redo Edition REDO_EDITION=Redo Edition
REDO=Redo REDO=Redo
BY=By
MODIFIED=Modified
LAST_UPDATE=Last Update
LAST_UPDATE_BY=Last Updated By
HISTORY_MSG=Looking for an old modification of you map?. Here is the place. HISTORY_MSG=Looking for an old modification of you map?. Here is the place.
NO_HISTORY_RESULTS= No History Information was found. NO_HISTORY_RESULTS= No History Information was found.
HISTORY_INFO = Here is the list of the last revisions of you map. HISTORY_INFO = Here is the list of the last revisions of you map.
REVERT=revert REVERT=revert
SAMPLE_MAPS=Sample Maps INSTALL_CFG=You need to install the Google Chrome Frame Plugin
INSTALL_CFG=Google Chrome Frame Plugin Needed INSTALL_CFG_REASON = We used to support IE 7/8 by rendering VML instead of SVG. In a few words, VML was the SVG equivalent in the Microsoft world, and we have invested a lot of energy in VML during several years solving several performance and instability issues among others things. Since Internet Explorer 9 has support for HTML 5.0 (thus SVG support), we decided to deprecate the support of VML. The side effect of this is that all users using Internet Explorer 7/8 will have to install a plugin from Google that enables the display of HTML 5.0 web pages.<br/>You might have to reopen the browser after you have installed the plugin.<br/><br/>We highly recommend using Firefox, Chrome or Internet Explorer 9 where this plugin is not required and the performance is much better.
INSTALL_CFG_REASON = <h1>You need to install the Google Chrome Frame Plugin</h1><br/><h2>We used to support IE 7/8 by rendering VML instead of SVG. In a few words, VML was the SVG equivalent in the Microsoft world, and we have invested a lot of energy in VML during several years solving several performance and instability issues among others things. Since Internet Explorer 9 has support for HTML 5.0 (thus SVG support), we decided to deprecate the support of VML. The side effect of this is that all users using Internet Explorer 7/8 will have to install a plugin from Google that enables the display of HTML 5.0 web pages.<br/>You might have to reopen the browser after you have installed the plugin.<br/><br/>We highly recommend using Firefox, Chrome or Internet Explorer 9 where this plugin is not required and the performance is much better.</h2>
INSTALL_CFG_CLICK_HERE=To install Google Chrome Frame Plugin click here INSTALL_CFG_CLICK_HERE=To install Google Chrome Frame Plugin click here
INVALID_EMAIL_ERROR = The e-mail was not verified INVALID_EMAIL_ERROR = The e-mail was not verified

View File

@ -37,13 +37,13 @@
<definition name="iframeWrapper" template="/jsp/iframeWrapper.jsp"/> <definition name="iframeWrapper" template="/jsp/iframeWrapper.jsp"/>
<!-- Error Pages --> <!-- Error Pages -->
<definition name="gcfPluginNeeded" extends="pageTemplate"> <definition name="GCFPluginRequired" extends="pageTemplate">
<put-attribute name="body" value="/jsp/gcfPluginNeeded.jsp"/> <put-attribute name="body" value="/jsp/GCFPluginRequired.jsp"/>
<put-attribute name="title" value="INSTALL_CFG"/> <put-attribute name="title" value="INSTALL_CFG"/>
</definition> </definition>
<definition name="installCFG" extends="pageTemplate"> <definition name="GCFInstall" extends="pageTemplate">
<put-attribute name="body" value="/jsp/installCFG.jsp"/> <put-attribute name="body" value="/jsp/GCFInstall.jsp"/>
<put-attribute name="title" value="INSTALL_CFG"/> <put-attribute name="title" value="INSTALL_CFG"/>
</definition> </definition>

View File

@ -29,6 +29,8 @@
<sec:http pattern="/c/maps/*/embed" security="none"/> <sec:http pattern="/c/maps/*/embed" security="none"/>
<sec:http pattern="/c/maps/*/public" security="none"/> <sec:http pattern="/c/maps/*/public" security="none"/>
<sec:http pattern="/c/GCFInstall" security="none"/>
<sec:http pattern="/c/publicview.htm" security="none"/> <sec:http pattern="/c/publicview.htm" security="none"/>
<sec:http pattern="/c/embeddedview.htm" security="none"/> <sec:http pattern="/c/embeddedview.htm" security="none"/>
<sec:http pattern="/c/termsOfUse" security="none"/> <sec:http pattern="/c/termsOfUse" security="none"/>

View File

@ -25,6 +25,7 @@
<value>/c/home</value> <value>/c/home</value>
<value>/c/j_spring_security</value> <value>/c/j_spring_security</value>
<value>/c/login</value> <value>/c/login</value>
<value>/c/GCFInstall</value>
<value>/service/</value> <value>/service/</value>
<value>/c/maps/*/embed</value> <value>/c/maps/*/embed</value>
<value>/c/maps/*/public</value> <value>/c/maps/*/public</value>
@ -50,6 +51,7 @@
<property name="exceptionMappings"> <property name="exceptionMappings">
<props> <props>
<prop key="com.wisemapping.exceptions.UnsupportedBrowserException">browserNotSupported</prop> <prop key="com.wisemapping.exceptions.UnsupportedBrowserException">browserNotSupported</prop>
<prop key="com.wisemapping.exceptions.GoogleChromeFrameRequiredException">GCFPluginRequired</prop>
<!-- Security exceptions are wrapped in this exceptions --> <!-- Security exceptions are wrapped in this exceptions -->
<prop key="java.lang.reflect.UndeclaredThrowableException">securityError</prop> <prop key="java.lang.reflect.UndeclaredThrowableException">securityError</prop>
</props> </props>

View File

@ -120,21 +120,6 @@ div#paypal {
cursor: pointer; cursor: pointer;
} }
#headerLoading {
padding-left: 40px;
background: url('../images/ajax-loader.gif') #BBB4D6 no-repeat left;
position: absolute;
right: 3px;
top: 5px;
width: 75px;
height: 20px;
color: white;
font-weight: bold;
border: 1px solid;
border-color: #f5f5f5;
background-position: 5px 2px;
visibility: hidden;
}
div#headerActions { div#headerActions {
padding-right: 8px; padding-right: 8px;

View File

@ -110,28 +110,6 @@ div.pageBodyContent li {
border: 1px dotted gray; border: 1px dotted gray;
} }
div.installCFG {
width: 100%;
font-size: 130%;
}
div.installCFG h1 {
width: 100%;
font-size: 130%;
}
div.installCFG h2 {
font-size: 100%;
border-bottom: 0 solid black;
}
.chromeFrameInstallDefaultStyle {
position: relative;
left: 0;
top: 0;
margin: 0;
}
div.fform { div.fform {
background: #eeeeee; background: #eeeeee;
border: 1px solid #cfcfcf; border: 1px solid #cfcfcf;

View File

@ -0,0 +1,17 @@
<%@ page autoFlush="true" buffer="none" %>
<%@ include file="/jsp/init.jsp" %>
<div style="position:relative;">
<div id="prompt">
<!-- if IE without GCF, prompt goes here -->
</div>
</div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
<script type="text/javascript">
CFInstall.check({
mode: "inline",
node:"prompt",
destination:"c/maps/"
});
</script>

View File

@ -0,0 +1,11 @@
<%@ page autoFlush="true" buffer="none" %>
<%@ include file="/jsp/init.jsp" %>
<h2><spring:message code="INSTALL_CFG"/></h2>
<p><spring:message code="INSTALL_CFG_REASON"/></p>
<div>
<a href="c/GCFInstall"><spring:message code="INSTALL_CFG_CLICK_HERE"/></a>
</div>

View File

@ -1,3 +1,5 @@
<!DOCTYPE HTML>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %> <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ include file="/jsp/init.jsp" %> <%@ include file="/jsp/init.jsp" %>
@ -8,7 +10,9 @@
<head> <head>
<base href="${pageContext.request.contextPath}/"/> <base href="${pageContext.request.contextPath}/"/>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<!--[if lt IE 9]>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<![endif]-->
<script type="text/javascript" language="javascript" src="js/jquery-1.7.2.min.js"></script> <script type="text/javascript" language="javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" language="javascript" src="bootstrap/js/bootstrap.js"></script> <script type="text/javascript" language="javascript" src="bootstrap/js/bootstrap.js"></script>
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css"/> <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css"/>

View File

@ -1,3 +1,5 @@
<!DOCTYPE HTML>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %> <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ include file="/jsp/init.jsp" %> <%@ include file="/jsp/init.jsp" %>

View File

@ -1,41 +0,0 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<div id="editorHeader">
<div id="headerToolbar">
<c:if test="${mindmap != null}">
<div id="headerTitle">${mindmap.title}<span id="headerSubTitle">&nbsp;<spring:message
code='EDITOR.LAST_SAVED' arguments='${mindmap.lastModifierUser}'/></span></div>
</c:if>
<c:choose>
<c:when test="${principal != null}">
<div id="headerActions">
<spring:message code="WELCOME"/>
, ${principal.firstname}
| <a href="${pageContext.request.contextPath}/c/maps/" title="<spring:message code="MY_WISEMAPS"/>">
<spring:message code="MY_WISEMAPS"/>
</a>
| <a href="${pageContext.request.contextPath}/c/settings" rel="moodalbox 400px 250px wizard"
title="<spring:message code="ACCOUNT_DETAIL"/>">
<spring:message code="ACCOUNT"/>
</a>
| <a href="${pageContext.request.contextPath}/c/logout" title="<spring:message code="LOGOUT"/>">
<spring:message code="LOGOUT"/>
</a>
</div>
</c:when>
<c:when test="${param.removeSignin!=true}">
<div id="signUpHeader">
<spring:message code="ALREADY_A_MEMBER"/>
<a href="${pageContext.request.contextPath}/c/login" title="<spring:message code="SIGN_IN"/>">
<spring:message code="SIGN_IN"/>
</a>
</div>
</c:when>
</c:choose>
</div>
</div>
<div id="headerLoading">
<spring:message code="LOADING_MSG"/>
</div>

View File

@ -1,3 +1,5 @@
<!DOCTYPE HTML>
<%@ page import="org.apache.log4j.Logger" %> <%@ page import="org.apache.log4j.Logger" %>
<%@ page autoFlush="true" buffer="none" %> <%@ page autoFlush="true" buffer="none" %>
<%@ include file="/jsp/init.jsp" %> <%@ include file="/jsp/init.jsp" %>
@ -5,9 +7,9 @@
<%! <%!
final Logger logger = Logger.getLogger("com.wisemapping"); final Logger logger = Logger.getLogger("com.wisemapping");
%> %>
<h1> <h2>
<spring:message code="${requestScope.title}"/> <spring:message code="${requestScope.title}"/>
</h1> </h2>
<p style="font-weight:bold;"> <p style="font-weight:bold;">
<spring:message code="${requestScope.details}"/> <spring:message code="${requestScope.details}"/>

View File

@ -1,13 +0,0 @@
<%@ page import="org.apache.log4j.Logger" %>
<%@ page autoFlush="true" buffer="none" %>
<%@ include file="/jsp/init.jsp" %>
<%!
final Logger logger = Logger.getLogger("com.wisemapping");
%>
<div class="installCFG">
<spring:message code="INSTALL_CFG_REASON"/>
<br/><br/>
<a href="${pageContext.request.contextPath}/c/installCFG?mapId=${mapId}"><spring:message code="INSTALL_CFG_CLICK_HERE"/></a>
</div>

View File

@ -10,10 +10,4 @@
<% <%
User user = Utils.getUser(false); User user = Utils.getUser(false);
request.setAttribute("principal", user); request.setAttribute("principal", user);
UserAgent userAgent = null;
final HttpSession session = request.getSession();
if (session != null) {
userAgent = (UserAgent) session.getAttribute(BrowserSupportInterceptor.USER_AGENT);
}
%> %>

View File

@ -1,23 +0,0 @@
<%@ page autoFlush="true" buffer="none" %>
<%@ include file="/jsp/init.jsp" %>
<div style="position:relative;">
<div id="prompt">
<!-- if IE without GCF, prompt goes here -->
</div>
</div>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
<script type="text/javascript">
function getURLParameter(name) {
return unescape(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
);
}
CFInstall.check({
mode: "inline",
node:"prompt",
destination:"${pageContext.request.contextPath}/c/editor?mapId="+getURLParameter("mapId")
});
</script>

View File

@ -11,11 +11,9 @@
<base href="${pageContext.request.contextPath}/"/> <base href="${pageContext.request.contextPath}/"/>
<title><spring:message code="SITE.TITLE"/> - ${mindmap.title} </title> <title><spring:message code="SITE.TITLE"/> - ${mindmap.title} </title>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/> <meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
<!--[if lt IE 9]> <!--[if lt IE 9]>
<meta http-equiv="X-UA-Compatible" content="chrome=1"> <meta http-equiv="X-UA-Compatible" content="chrome=1">
<![endif]--> <![endif]-->
<link rel="stylesheet/less" type="text/css" href="css/editor.less"/> <link rel="stylesheet/less" type="text/css" href="css/editor.less"/>
<script type='text/javascript' src='js/mootools-core.js'></script> <script type='text/javascript' src='js/mootools-core.js'></script>
<script type='text/javascript' src='js/mootools-more.js'></script> <script type='text/javascript' src='js/mootools-more.js'></script>

View File

@ -6,11 +6,14 @@
<base href="${pageContext.request.contextPath}/"/> <base href="${pageContext.request.contextPath}/"/>
<title><spring:message code="SITE.TITLE"/></title> <title><spring:message code="SITE.TITLE"/></title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<!--[if lt IE 9]>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<![endif]-->
<link rel="icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/> <link rel="icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/> <link rel="shortcut icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
<link rel="stylesheet/less" type="text/css" href="css/mymaps.less"/> <link rel="stylesheet/less" type="text/css" href="css/mindmapList.less"/>
<script type="text/javascript" language="javascript" src="js/jquery-1.7.2.min.js"></script> <script type="text/javascript" language="javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" language="javascript" src="bootstrap/js/bootstrap.js"></script> <script type="text/javascript" language="javascript" src="bootstrap/js/bootstrap.js"></script>

View File

@ -36,7 +36,6 @@
<jsp:include page="header.jsp"/> <jsp:include page="header.jsp"/>
<div class="pageBody"> <div class="pageBody">
<div class="pageBodyContent"> <div class="pageBodyContent">
<tiles:insertAttribute name="body"/> <tiles:insertAttribute name="body"/>
</div> </div>