least painful way to make my stylesheet *first*

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

least painful way to make my stylesheet *first*

Randal L. Schwartz

In my WAComponent-derived class, I tried adding:

updateRoot: aRoot
  super updateRoot: aRoot.
  aRoot stylesheet url: 'http://yui.yahooapis.com/2.4.0/build/reset-fonts-grids/reset-fonts-grids.css'.

Except that this put this CSS *last*, not *first*.  It needs to go first,
because it wants to reset everything so that we get consistent behavior on all
browsers.

Drilling down, I see WAHtmlRoot has an "add:" but not an "addFirst:".

I suppose I could subclass WAHtmlRoot and figure out how to get the new class
to be my root.  But has anyone else run into this and has a less painful
means, or a place I can hook from my WAComponent that can get to that "aRoot
stylesheet" call early enough to be first in line?

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: least painful way to make my stylesheet *first*

Chris Cunnington-5
 
I don't understand why you want your CSS style sheet to come live from
Yahoo. Their YUI suite is great, but I don't see any need to access it using
a URL... Why not cut and paste into a file and put that in a Resources
folder? You want the URL to save the effort? To stay current?

Wait a second...Lukas does this. Or did this in 2.6. If you downloaded
Scriptaculous, and then disconnected your computer from the web
Scriptaculous couldn't render. It looked awful. Connecting your computer to
the web again, and it connected to the web, and a server in Bern provided a
css style sheet. In 2.6 it looked like this:

SUAllTests>>updateRoot: aHtmlRoot
    super updateRoot: aHtmlRoot.
    aHtmlRoot
        title: self title;
        linkToStyle: (self resources addToPath: 'style.css')

SUComponent>>resources
    ^ WAUrl new hostname: 'scriptaculous.seasidehosting.st'; addToPath:
'resources'


Then a component could use "style" to detail itself further (i.e.
SUAutocompleterTest>>style). I think this meant that the the styles coming
from Bern would be first, as you need them. Of course, that's changed in
2.8. SUAllTests>>updateRoot: now doesn't look the same at all. Je me
souviens, as the Quebecois say.

Chris


"We're adding a little something to this month's sales contest ... "
>
> In my WAComponent-derived class, I tried adding:
>
> updateRoot: aRoot
> super updateRoot: aRoot.
> aRoot stylesheet url:
>
'http://yui.yahooapis.com/2.4.0/build/reset-fonts-grids/reset-fonts-grids.css'>
.

>
> Except that this put this CSS *last*, not *first*.  It needs to go first,
> because it wants to reset everything so that we get consistent behavior on all
> browsers.
>
> Drilling down, I see WAHtmlRoot has an "add:" but not an "addFirst:".
>
> I suppose I could subclass WAHtmlRoot and figure out how to get the new class
> to be my root.  But has anyone else run into this and has a less painful
> means, or a place I can hook from my WAComponent that can get to that "aRoot
> stylesheet" call early enough to be first in line?
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: least painful way to make my stylesheet *first*

Randal L. Schwartz
>>>>> "Chris" == Chris Cunnington <[hidden email]> writes:

Chris> I don't understand why you want your CSS style sheet to come live from
Chris> Yahoo. Their YUI suite is great, but I don't see any need to access it
Chris> using a URL... Why not cut and paste into a file and put that in a
Chris> Resources folder? You want the URL to save the effort? To stay current?

The problem is the same either way.  My "updateRoot" is called too
late... long after all the other libraries have already had their chance to
add things.

I was just using a URL so that I wouldn't have to have local text that
looked ugly. :)

I think I'm making headway by having an application that has my library called
first.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: least painful way to make my stylesheet *first*

Boris Popov, DeepCove Labs (SNN)
Randal,

In your root component,

updateRoot: aRoot
  aRoot stylesheet url: 'myurl'.
  super updateRoot: aRoot.

Cheers!

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Randal L. Schwartz
> Sent: Wednesday, December 12, 2007 2:27 PM
> To: Chris Cunnington
> Cc: Seaside - general discussion
> Subject: Re: [Seaside] least painful way to make my stylesheet *first*
>
> >>>>> "Chris" == Chris Cunnington <[hidden email]> writes:
>
> Chris> I don't understand why you want your CSS style sheet to come
live
> from
> Chris> Yahoo. Their YUI suite is great, but I don't see any need to
access
> it
> Chris> using a URL... Why not cut and paste into a file and put that
in a
> Chris> Resources folder? You want the URL to save the effort? To stay
> current?
>
> The problem is the same either way.  My "updateRoot" is called too
> late... long after all the other libraries have already had their
chance
> to
> add things.
>
> I was just using a URL so that I wouldn't have to have local text that
> looked ugly. :)
>
> I think I'm making headway by having an application that has my
library

> called
> first.
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
> 0095
> <[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
> training!
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: least painful way to make my stylesheet *first*

Randal L. Schwartz
>>>>> "Boris" == Boris Popov <[hidden email]> writes:

Boris> Randal,
Boris> In your root component,

Boris> updateRoot: aRoot
Boris>   aRoot stylesheet url: 'myurl'.
Boris>   super updateRoot: aRoot.

Tried that.  Turns out the libraries actually get first pick (during session
setup), before it gets to walking the components.  And some of the libs
implement an updateRoot.

That's why I'm headed into the "making a lib" area.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: least painful way to make my stylesheet *first*

Michel Bany-3
I never did it myself but I would try this in your WASession subclass

updateRoot: aRoot
        "your stuff here"
        super updateRoot: anHtmlRoot


On Dec 13, 2007, at 2:06 AM, Randal L. Schwartz wrote:

>>>>>> "Boris" == Boris Popov <[hidden email]> writes:
>
> Boris> Randal,
> Boris> In your root component,
>
> Boris> updateRoot: aRoot
> Boris>   aRoot stylesheet url: 'myurl'.
> Boris>   super updateRoot: aRoot.
>
> Tried that.  Turns out the libraries actually get first pick  
> (during session
> setup), before it gets to walking the components.  And some of the  
> libs
> implement an updateRoot.
>
> That's why I'm headed into the "making a lib" area.
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503  
> 777 0095
> <[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl  
> training!
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside