[Seaside] Re: IE 5.5 and 6 png "fix"

Philippe Marschall philippe.marschall at gmail.com
Sat Sep 22 20:05:47 UTC 2007


2007/9/21, Udo Schneider <Udo.Schneider at homeaddress.de>:
> Philippe Marschall wrote:
> > aRoot if lessThan; ie7; do: [
> >    aRoot javascripts
> >        url: 'pngfix.js' ]
> >
> I use something like this:
>
> anHtmlRoot if lessThan ie7 do:
>    [(anHtmlRoot linkToScript: (WATCFileLibrary urlOf: #pngfixJs))
>      attributeAt: 'defer'
>      put: 'defer']
>
> To use the defer piece in this was I had to patch
> WHHtmlRoot>>#linkToScript: to return the script though:
>
> linkToScript: url
>         "only link to script if it's not already been linked too, necessary
> when lists of child components try to link to dependant scripts, a
> google map for example"
>
>         | fullUrl |
>         fullUrl := self absoluteUrlForResource: url asString.
>         ^headElements
>                 detect: [ :each | each name = 'script' and: [ each url = fullUrl ] ]
>                 ifNone: [ self scriptElementWithSrc: fullUrl ]

There are two "problems" with your code. #linkToScript: was deprecated
in 2.7 and removed in 2.8 because if its non-canvas-ishness. This
makes it hard to configure and shows in exactly such cases. Second
"the correct way" (tm) to deal with attributes that have no value in
HTML is to put true as a value. So ideally your code would read:

aRoot if lessThan; ie7; do: [
   aRoot javascript
       attributeAt: 'defer' put: true;
       url: (WATCFileLibrary urlOf: #pngfixJs) ]

Seaside2.8a1-pmm.487 adds #defer to WAScriptElement and WAScriptTag.
Although we are officially in code freeze I think this goes ok. If
somebody has a problem with this I can remove it and start 2.9 today.
As usual the code is copy pasted because we don't need no stinkin'
traits.

Now you can do:

aRoot if lessThan; ie7; do: [
   aRoot javascript
       defer;
       url: 'pngfix.js' ]

Cheers
Philippe

> CU,
>
> Udo
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


More information about the seaside mailing list