From 08c8105c6f0a978b0b82988811183d417bc0934b Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Fri, 16 May 2008 12:24:59 +0000 Subject: [PATCH] fixes #1636 (untested) svn changeset:4527/svn branch:trunk --- .../gwt/server/ApplicationServlet.java | 152 +++++++++++++----- 1 file changed, 112 insertions(+), 40 deletions(-) diff --git a/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java b/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java index fabd4e9cc1..6edf362d0a 100644 --- a/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java +++ b/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java @@ -800,49 +800,111 @@ public class ApplicationServlet extends HttpServlet { String appId = appUrl; appId = appId.replaceAll("[^a-zA-Z0-9]", ""); - page.write("\n"); + if (isGecko17(request)) { + // special start page for gecko 1.7 versions. Firefox 1.0 is not + // supported, but the hack is make it possible to use linux and + // hosted mode browser for debugging. Note that due this hack, + // debugging gwt code in portals with linux will be problematic if + // there are multiple toolkit portlets visible at the same time. + // TODO remove this when hosted mode on linux gets newer gecko + + page.write("\n"); + page.write("\n"); + page.write("\n"); + + if (themeName != null) { + // Custom theme's stylesheet, load only once, in different + // script + // tag to be dominate styles injected by widget + // set + page.write("\n"); + } - if (themeName != null) { - // Custom theme's stylesheet, load only once, in different script - // tag to be dominate styles injected by widget - // set + } else { page.write("\n"); + page.write("if(!itmill || !itmill.toolkitConfigurations) {\n " + + "if(!itmill) { var itmill = {}} \n" + + "itmill.toolkitConfigurations = {};\n" + + "itmill.themesLoaded = {};\n"); + page.write("document.write('');\n"); + page.write("document.write(\"\n"); + + if (themeName != null) { + // Custom theme's stylesheet, load only once, in different + // script + // tag to be dominate styles injected by widget + // set + page.write("\n"); + } } String style = null; @@ -860,6 +922,16 @@ public class ApplicationServlet extends HttpServlet { } + private boolean isGecko17(HttpServletRequest request) { + final WebBrowser browser = WebApplicationContext.getApplicationContext( + request.getSession()).getBrowser(); + if (browser.getBrowserApplication().indexOf("rv:1.7.") > 0 + && browser.getBrowserApplication().indexOf("Gecko") > 0) { + return true; + } + return false; + } + private void writeTestingToolsScripts(Writer page, HttpServletRequest request) throws IOException { // Testing Tools script and CSS files are served from Testing Tools -- 2.39.5