there should already be a png fix for ie in extensions.
-igor
On 8/18/07, Tauren Mills <[EMAIL PROTECTED]> wrote:
>
> Maybe its just late and I'm not thinking straight, but I can't figure
> out the best way to create a custom StringHeaderContributor. All I
> want it to is encapsulate some javascript that has some property
> replacements in it.
>
> I have it working with a custom model as such:
>
> add(new StringHeaderContributor(new PngTransparency(this)));
>
> But I want it to look like this:
>
> add(new PngTransparencyHeaderContributor(this));
>
> It's not really a big deal, but it seems like it would be cleaner that
> way. Here is the model class:
>
> public class PngTransparency extends Model {
>
> public static final ResourceReference PNGFIX = new
> ResourceReference(PngTransparency.class, "PngTransparency.js");
> public static final ResourceReference TRANSPARENT_PIXEL = new
> ResourceReference(PngTransparency.class, "transparentpixel.gif");
>
> public PngTransparency(Component component) {
>
> String output =
> "<!--[if lt IE 7]>\n" +
> " <script defer type=\"text/javascript\"
> src=\"" +
> component.urlFor(PNGFIX) + "\"></script>\n" +
> " <script language=\"javascript\"
> type=\"text/javascript\">\n" +
> " var pngTransparencyGif = \"" +
> component.urlFor(TRANSPARENT_PIXEL) + "\"\n" +
> " </script>\n" +
> "<![endif]-->\n";
> setObject(output);
> }
> }
>
> Any ideas?
>
> Tauren
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>