tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Drobiazko <igor.drobia...@gmail.com>
Subject Re: Why does Kaptcha add its stylesheet via a filter?
Date Thu, 08 Sep 2011 20:52:11 GMT
I don't recall any reason why I did it that way. I'll fix that.

On Thu, Sep 8, 2011 at 7:36 PM, Howard Lewis Ship <hlship@gmail.com> wrote:

> I just noticed this:
>
>    @Contribute(MarkupRenderer.class)
>    public void provideMarkupRenderer(
>            OrderedConfiguration<MarkupRendererFilter> configuration,
>
>            final AssetSource assetSource,
>
>            final ThreadLocale threadLocale,
>
>            final Environment environment)
>    {
>        MarkupRendererFilter importKaptchaCss = new MarkupRendererFilter()
>        {
>            public void renderMarkup(MarkupWriter writer,
> MarkupRenderer renderer)
>            {
>                JavaScriptSupport javaScriptSupport =
> environment.peek(JavaScriptSupport.class);
>
>                Asset css = assetSource.getAsset(null,
> "org/apache/tapestry5/kaptcha/kaptcha.css",
>                        threadLocale.getLocale());
>
>                javaScriptSupport.importStylesheet(css);
>
>                renderer.renderMarkup(writer);
>            }
>        };
>
>
>        configuration.add("KaptchaAssets", importKaptchaCss, "after:*");
>    }
>
> I don't see why the Kaptcha components don't just use the @Import
> annotation.
>
>
> This appears to add the kaptcha.css to all pages, not just pages using
> a Kaptcha component.
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko
http://tapestry5.de

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message