]> source.dussan.org Git - vaadin-framework.git/commitdiff
Application div id now contains hashcode, classname contains themename and appname...
authorMarc Englund <marc.englund@itmill.com>
Mon, 10 Nov 2008 10:43:52 +0000 (10:43 +0000)
committerMarc Englund <marc.englund@itmill.com>
Mon, 10 Nov 2008 10:43:52 +0000 (10:43 +0000)
svn changeset:5836/svn branch:trunk

WebContent/ITMILL/themes/reservr/styles.css
WebContent/ITMILL/themes/sampler/sampler/styles.css
WebContent/ITMILL/themes/sampler/styles.css
src/com/itmill/toolkit/Application.java
src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java

index 29cb8ab8d691bf28ab4983127a2c69ae37fd5252..a157f01b038e1fdc9cf584b939034f6acc983b40 100644 (file)
@@ -1,14 +1,14 @@
 @import url(../default/styles.css);
 
 /* Reservr styles */\r
-#Reservr {\r
+.i-app-ReservationApplication {\r
        background-color: #E9ECED;\r
        background-image: url(bmw.jpg);\r
        background-repeat: no-repeat;\r
        background-position: top right;\r
 }\r
 \r
-#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;\r
@@ -16,7 +16,7 @@
        font-size: 22px;\r
        letter-spacing: -0.03em;\r
 }
-#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;\r
 }\r
 \r
-#Reservr .i-button-selected-link {\r
+.i-app-ReservationApplication .i-button-selected-link {\r
        border: 0px;\r
        text-align: left;\r
        text-decoration: none;\r
index 70e1ed7eb5eb3e3b5e7d78fccaa3fc96fd462686..a0e1799e59d433791cf5f8312ed8972973370920 100644 (file)
@@ -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;
index cd0aed88204946d767140236f1bc965cec2e03c4..ec764f8763181ee7b8f529bec8d625190f5cc9c9 100644 (file)
@@ -4,3 +4,5 @@
 
 @import url(dummy/styles.css);
 
+@import url(prominentprimaryaction/styles.css);
+
index 2233fa1cf4cde621c6c4677a5a8f427a3115ee6c..d15aebab3968f4e56eafc9923ba2c5071a8e044e 100644 (file)
@@ -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);
             }
         }
index ac33a259efcf3ebe39a85fb26fa5e7afe6cdbf4b..e7b61b094b33b08d1642542c9203f763ded7d71b 100644 (file)
@@ -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("<div id=\"" + appId + "\" class=\"i-app i-app-loading\" "
+        /*- Add classnames; 
+         *      .i-app 
+         *      .i-app-loading
+         *      .i-app-<simpleName for app class> 
+         *      .i-theme-<themeName, remove non-alphanum>
+         */
+        page.write("<div id=\"" + appId
+                + "\" class=\"i-app i-app-loading i-theme-"
+                + themeName.replaceAll("[^a-zA-Z0-9]", "") + " i-app-"
+                + applicationClass.getSimpleName() + "\" "
                 + (style != null ? style : "") + "></div>\n");
 
         if (!fragment) {