Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

themes and resource handling #349

Open
l0rdn1kk0n opened this issue Mar 25, 2014 · 3 comments
Open

themes and resource handling #349

l0rdn1kk0n opened this issue Mar 25, 2014 · 3 comments

Comments

@l0rdn1kk0n
Copy link
Collaborator

we've to improve the theme and resource handling because it leads to some strange behavior.

see also: #347, #345, #344

@l0rdn1kk0n l0rdn1kk0n added this to the 0.9.x milestone Mar 25, 2014
@l0rdn1kk0n l0rdn1kk0n self-assigned this Mar 25, 2014
@martin-g
Copy link
Owner

de.agilecoders.wicket.core.settings.DefaultThemeProvider#defaultTheme(de.agilecoders.wicket.core.settings.ITheme) is a bit strange - it converts an ITheme to a String (its name) and passes it to de.agilecoders.wicket.core.settings.DefaultThemeProvider#defaultTheme(java.lang.String) where this String is converted back to ITheme

Update: improved with 58a8e22

@martin-g
Copy link
Owner

de.agilecoders.wicket.themes.markup.html.bootstrap.Bootstrap3Theme issues:

  • its Javadoc says "Google theme"
  • it passes Bootstrap3ThemeCssReference.instance() twice to super

Update: fixed with e67a05b

@martin-g
Copy link
Owner

It would be nice to get advantage of the new functionality provided by https://issues.apache.org/jira/browse/WICKET-5617

At the moment I have this local patch in wicket-7.0.0-M1 branch:

 --- i/bootstrap-themes/src/main/java/de/agilecoders/wicket/themes/markup/html/bootswatch/BootswatchTheme.java
 +++ w/bootstrap-themes/src/main/java/de/agilecoders/wicket/themes/markup/html/bootswatch/BootswatchTheme.java
@@ -51,10 +51,12 @@ public enum BootswatchTheme implements ITheme {
            if (cdnUrl == null) {
                 cdnUrl = String.format(CDN_PATTERN, getVersion(), name().toLowerCase());
             }
-            response.render(CssHeaderItem.forReference(new UrlResourceReference(Url.parse(cdnUrl))));
+            CssHeaderItem item = CssHeaderItem.forReference(new UrlResourceReference(Url.parse(cdnUrl)),
+                    null, null, null).setId("wb-theme");
+            response.render(item);
         }
         else {
-            response.render(CssHeaderItem.forReference(reference));
+            response.render(CssHeaderItem.forReference(reference).setId("wb-theme"));
         }

But I face the following problems:

  • Theme's constructor works with ResourceReferences and it is hard to set the CssHeaderItem markupId
  • BootswatchTheme is an enum and it is not possible to override its #renderHead() method locally

Update: Improved with 76c8d36 in wicket-7.0.0-M1 branch (the living branch against Wicket 7.0.0-SNAPSHOT).

@martin-g martin-g modified the milestones: 1.0.0, 0.9.x Jun 30, 2014
l0rdn1kk0n added a commit that referenced this issue Jun 30, 2014
upgrade TODC Bootstrap to bootstrap 3.2.0 (google theme) (related to issues #349 and #396)
martin-g added a commit that referenced this issue Nov 19, 2014
Simplifies DefaultThemeProvider#defaultTheme() methods
martin-g added a commit that referenced this issue Nov 19, 2014
Set markup id to the Theme's CSS resource reference
reiern70 pushed a commit to reiern70/wicket-bootstrap that referenced this issue Jun 2, 2017
Set markup id to the Theme's CSS resource reference
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants