-
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.
Adds SassResourceUrlSanitizer to recognize variants in the URL (#1182)
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
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
30 changes: 30 additions & 0 deletions
30
bootstrap-sass/src/main/java/de/agilecoders/wicket/sass/SassResourceUrlSanitizer.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package de.agilecoders.wicket.sass; | ||
|
||
import org.apache.wicket.request.resource.IResourceUrlSanitizer; | ||
import org.apache.wicket.request.resource.ResourceReference; | ||
|
||
public class SassResourceUrlSanitizer implements IResourceUrlSanitizer | ||
{ | ||
|
||
private IResourceUrlSanitizer delegate; | ||
|
||
public SassResourceUrlSanitizer(IResourceUrlSanitizer delegate) | ||
{ | ||
this.delegate = delegate; | ||
} | ||
|
||
@Override | ||
public ResourceReference.UrlAttributes sanitize(ResourceReference.UrlAttributes urlAttributes, | ||
Class<?> scope, String name) | ||
{ | ||
if (ContextRelativeSassResourceReference.CONTEXT_RELATIVE_SASS_REFERENCE_VARIATION.equals( | ||
urlAttributes.getVariation())) | ||
{ | ||
return urlAttributes; | ||
} | ||
else | ||
{ | ||
return delegate.sanitize(urlAttributes, scope, name); | ||
} | ||
} | ||
} |