You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by pa...@apache.org on 2020/01/14 20:51:53 UTC
[wicket] branch csp updated: WICKET-6725: render CSS via
application wide IHeaderContributor
This is an automated email from the ASF dual-hosted git repository.
papegaaij pushed a commit to branch csp
in repository https://gitbox.apache.org/repos/asf/wicket.git
The following commit(s) were added to refs/heads/csp by this push:
new dda3aa1 WICKET-6725: render CSS via application wide IHeaderContributor
dda3aa1 is described below
commit dda3aa11740c713078f42ffd67b526415ef2b612
Author: Emond Papegaaij <em...@topicus.nl>
AuthorDate: Tue Jan 14 20:53:39 2020 +0100
WICKET-6725: render CSS via application wide IHeaderContributor
---
wicket-core/src/main/java/org/apache/wicket/Component.java | 2 +-
wicket-core/src/main/java/org/apache/wicket/Page.java | 8 --------
.../main/java/org/apache/wicket/protocol/http/WebApplication.java | 3 +++
3 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/wicket-core/src/main/java/org/apache/wicket/Component.java b/wicket-core/src/main/java/org/apache/wicket/Component.java
index d2da23b..bb9c1ad 100644
--- a/wicket-core/src/main/java/org/apache/wicket/Component.java
+++ b/wicket-core/src/main/java/org/apache/wicket/Component.java
@@ -3043,7 +3043,7 @@ public abstract class Component
/**
* Render a placeholder tag when the component is not visible. The tag is of form:
- * <componenttag style="display:none;" id="markupid"/>. This method will also call
+ * <componenttag class="wicket--hidden" id="markupid"/>. This method will also call
* <code>setOutputMarkupId(true)</code>.
*
* This is useful, for example, in ajax situations where the component starts out invisible and
diff --git a/wicket-core/src/main/java/org/apache/wicket/Page.java b/wicket-core/src/main/java/org/apache/wicket/Page.java
index 14ec901..9cccfe5 100644
--- a/wicket-core/src/main/java/org/apache/wicket/Page.java
+++ b/wicket-core/src/main/java/org/apache/wicket/Page.java
@@ -1006,14 +1006,6 @@ public abstract class Page extends MarkupContainer
}
}
- @Override
- public void renderHead(IHeaderResponse response)
- {
- super.renderHead(response);
- response.render(
- CssHeaderItem.forReference(getApplication().getResourceSettings().getWicketCoreCSS()));
- }
-
/**
* THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL.
*
diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java
index 0f3177f..ab5beed 100644
--- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java
+++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java
@@ -758,6 +758,9 @@ public abstract class WebApplication extends Application
setAjaxRequestTargetProvider(AjaxRequestHandler::new);
getAjaxRequestTargetListeners().add(new AjaxEnclosureListener());
+
+ getHeaderContributorListeners().add(head -> head.render(
+ CssHeaderItem.forReference(getResourceSettings().getWicketCoreCSS())));
// Configure the app.
configure();