From 238dfff1da5b80676bafbe54e0532c2f76a7f089 Mon Sep 17 00:00:00 2001 From: Marc Englund Date: Mon, 10 Nov 2008 10:43:52 +0000 Subject: [PATCH] Application div id now contains hashcode, classname contains themename and appname classes. Fixes #2196 svn changeset:5836/svn branch:trunk --- WebContent/ITMILL/themes/reservr/styles.css | 8 ++--- .../ITMILL/themes/sampler/sampler/styles.css | 32 +++++++++---------- WebContent/ITMILL/themes/sampler/styles.css | 2 ++ src/com/itmill/toolkit/Application.java | 7 ++-- .../gwt/server/ApplicationServlet.java | 14 +++++++- 5 files changed, 38 insertions(+), 25 deletions(-) diff --git a/WebContent/ITMILL/themes/reservr/styles.css b/WebContent/ITMILL/themes/reservr/styles.css index 29cb8ab8d6..a157f01b03 100644 --- a/WebContent/ITMILL/themes/reservr/styles.css +++ b/WebContent/ITMILL/themes/reservr/styles.css @@ -1,14 +1,14 @@ @import url(../default/styles.css); /* Reservr styles */ -#Reservr { +.i-app-ReservationApplication { background-color: #E9ECED; background-image: url(bmw.jpg); background-repeat: no-repeat; background-position: top right; } -#Reservr .i-label-logo { +.i-app-ReservationApplication .i-label-logo { font-family: "Trebuchet MS", geneva, helvetica, arial, tahoma, verdana, sans-serif; padding-left: 13px; padding-bottom: 10px; @@ -16,7 +16,7 @@ font-size: 22px; letter-spacing: -0.03em; } -#Reservr .i-label-slogan { +.i-app-ReservationApplication .i-label-slogan { color: black; padding-left: 15px; padding-bottom: 10px; @@ -45,7 +45,7 @@ font-weight: bold; } -#Reservr .i-button-selected-link { +.i-app-ReservationApplication .i-button-selected-link { border: 0px; text-align: left; text-decoration: none; diff --git a/WebContent/ITMILL/themes/sampler/sampler/styles.css b/WebContent/ITMILL/themes/sampler/sampler/styles.css index 70e1ed7eb5..a0e1799e59 100644 --- a/WebContent/ITMILL/themes/sampler/sampler/styles.css +++ b/WebContent/ITMILL/themes/sampler/sampler/styles.css @@ -1,76 +1,76 @@ /****************************************************************************** * Sampler styles ******************************************************************************/ -#sampler { +.i-app-SamplerApplication { background-color: white; } -#sampler .i-orderedlayout-topbar { +.i-app-SamplerApplication .i-orderedlayout-topbar { border-bottom: 1px solid #999; } -#sampler .i-label-section { +.i-app-SamplerApplication .i-label-section { font-size: 18px; font-weight: bold; border-bottom: 1px solid black; line-height: 35px; } -#sampler .i-label-subsection { +.i-app-SamplerApplication .i-label-subsection { font-size: 16px; font-weight: bold; color: #666666; text-indent: 7px; } -#sampler .i-button-screenshot { +.i-app-SamplerApplication .i-button-screenshot { border: 3px solid #eeeeee; overflow: hidden; } -#sampler .i-button-screenshot img { +.i-app-SamplerApplication .i-button-screenshot img { margin-top: -2px; margin-left: -3px; } -#sampler tr.i-table-row-section { +.i-app-SamplerApplication tr.i-table-row-section { color: #333366; font-size: 18px; font-weight: bold; } -#sampler tr.i-table-row-subsection { +.i-app-SamplerApplication tr.i-table-row-subsection { font-size: 16px; font-weight: bold; } -#sampler .i-panel-content-light { +.i-app-SamplerApplication .i-panel-content-light { border-top: 0px; } -#sampler .feature-main { +.i-app-SamplerApplication .feature-main { padding: 20px; } -#sampler .feature-controls { +.i-app-SamplerApplication .feature-controls { margin-bottom: 20px; } -#sampler .feature-controls .i-caption { +.i-app-SamplerApplication .feature-controls .i-caption { font-weight: bold; font-size: 16px; } -#sampler .feature-info { +.i-app-SamplerApplication .feature-info { background-color: #999; color: white; padding: 20px; line-height: 20px; } -#sampler .feature-info div.i-link a { +.i-app-SamplerApplication .feature-info div.i-link a { color: white; line-height: 20px; } -#sampler .feature-name { +.i-app-SamplerApplication .feature-name { font-size: 22px; font-weight: bold; line-height: 35px; } -#sampler .feature-info .i-caption { +.i-app-SamplerApplication .feature-info .i-caption { font-weight: bold; font-size: 16px; line-height: 30px; diff --git a/WebContent/ITMILL/themes/sampler/styles.css b/WebContent/ITMILL/themes/sampler/styles.css index cd0aed8820..ec764f8763 100644 --- a/WebContent/ITMILL/themes/sampler/styles.css +++ b/WebContent/ITMILL/themes/sampler/styles.css @@ -4,3 +4,5 @@ @import url(dummy/styles.css); +@import url(prominentprimaryaction/styles.css); + diff --git a/src/com/itmill/toolkit/Application.java b/src/com/itmill/toolkit/Application.java index 2233fa1cf4..d15aebab39 100644 --- a/src/com/itmill/toolkit/Application.java +++ b/src/com/itmill/toolkit/Application.java @@ -527,16 +527,15 @@ public abstract class Application implements URIHandler, Terminal.ErrorListener * the new theme for this application. */ public void setTheme(String theme) { - // Collect list of windows not having the current or future theme final LinkedList toBeUpdated = new LinkedList(); - final String myTheme = getTheme(); + final String oldAppTheme = getTheme(); for (final Iterator i = getWindows().iterator(); i.hasNext();) { final Window w = (Window) i.next(); final String windowTheme = w.getTheme(); if ((windowTheme == null) - || (!theme.equals(windowTheme) && windowTheme - .equals(myTheme))) { + || (!windowTheme.equals(theme) && windowTheme + .equals(oldAppTheme))) { toBeUpdated.add(w); } } diff --git a/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java b/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java index ac33a259ef..e7b61b094b 100644 --- a/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java +++ b/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java @@ -844,6 +844,9 @@ public class ApplicationServlet extends HttpServlet { appId = "ROOT"; } appId = appId.replaceAll("[^a-zA-Z0-9]", ""); + // Add hashCode to the end, so that it is still (sort of) predictable, + // but indicates that it should not be used in CSS and such: + appId = appId + appId.hashCode(); if (isGecko17(request)) { // special start page for gecko 1.7 versions. Firefox 1.0 is not @@ -961,7 +964,16 @@ public class ApplicationServlet extends HttpServlet { if (reqParam != null) { style = "style=\"" + reqParam + "\""; } - page.write("
+ * .i-theme- + */ + page.write("
\n"); if (!fragment) { -- 2.39.5