-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set markup id to the Theme's CSS resource reference
- Loading branch information
Showing
16 changed files
with
96 additions
and
54 deletions.
There are no files selected for viewing
39 changes: 22 additions & 17 deletions
39
...src/main/java/de/agilecoders/wicket/core/markup/html/themes/bootstrap/BootstrapTheme.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,43 @@ | ||
package de.agilecoders.wicket.core.markup.html.themes.bootstrap; | ||
|
||
import de.agilecoders.wicket.core.Bootstrap; | ||
import de.agilecoders.wicket.core.settings.IBootstrapSettings; | ||
import de.agilecoders.wicket.core.settings.Theme; | ||
import org.apache.wicket.Application; | ||
import org.apache.wicket.markup.head.CssHeaderItem; | ||
import org.apache.wicket.markup.head.HeaderItem; | ||
import org.apache.wicket.request.resource.ResourceReference; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* #### Description | ||
* | ||
* Bootstrap theme that uses the css resource reference from bootstrap settings. | ||
* | ||
* #### Caution | ||
* | ||
* There's a constructor which is deprecated and will be removed before 1.0 is released. Please | ||
* use {@link de.agilecoders.wicket.core.markup.html.themes.bootstrap.BootstrapTheme#BootstrapTheme(de.agilecoders.wicket.core.settings.IBootstrapSettings)} | ||
* instead. | ||
* | ||
* @author Michael Haitz <[email protected]> | ||
*/ | ||
public class BootstrapTheme extends Theme { | ||
|
||
/** | ||
* Construct. | ||
* | ||
* @param settings the bootstrap settings | ||
*/ | ||
public BootstrapTheme(final IBootstrapSettings settings) { | ||
super("bootstrap", settings.getCssResourceReference()); | ||
} | ||
|
||
/** | ||
* Construct. | ||
*/ | ||
@Deprecated | ||
public BootstrapTheme() { | ||
super("bootstrap", BootstrapCssReference.instance()); | ||
super("bootstrap"); | ||
} | ||
|
||
@Override | ||
public List<HeaderItem> getDependencies() { | ||
List<HeaderItem> references = new ArrayList<>(); | ||
ResourceReference cssResourceReference; | ||
if (Application.exists()) { | ||
IBootstrapSettings settings = Bootstrap.getSettings(); | ||
cssResourceReference = settings.getCssResourceReference(); | ||
} else { | ||
cssResourceReference = BootstrapCssReference.instance(); | ||
} | ||
references.add(CssHeaderItem.forReference(cssResourceReference).setId(BOOTSTRAP_THEME_MARKUP_ID)); | ||
return references; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
bootstrap-themes/src/main/java/de/agilecoders/wicket/themes/markup/html/metro/gettheme.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
wget "https://raw.githubusercontent.com/idleberg/m8tro-bootstrap/master/dist/css/m8tro.min.css" -O css/metro.css | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters