Hey Sam, welcome back from wherever you've been hiding!

I did end up re-writing the function to use  
document.getElementsByClassName. On a personal note, it's nice to be  
at the point where I can look at something that isn't working, and  
see several alternative techniques. I owe Prototype a lot for that  
flexibility.

The issue really was that at this point there are many excellent open  
source modules which rely on specific prototype versions, and to a  
lesser degree, script.aculo.us versions. That some of these things  
would fall out of date as their internal workings occasionally rely  
on "the old way" is not revelatory.

However, the code in question was Sebastien Gruhier's Prototype  
Carousel widget, (http://prototype-carousel.xilinus.com/) which is  
well designed, fairly recent, and perhaps unfortunately, widely used.  
I say unfortunately only because the moment people upgrade their  
scripts - or soon, Rails 1.2 - they are in for a nasty surprise.

So, if I have a point to make, I would love to see these things  
discussed openly:

- Prototype roadmap... what's coming, what's changing, what's going  
away?
- Deprecated function list, with bonus points for documentation on  
their replacements

I know that there's now a team of highly trained killer elves working  
on Prototype stuff, and the end result is going to kick ass. In the  
meantime, it's a bit hectic when functions start disappearing without  
fanfare.

Pete

ps. From the looks of the latest RC, it's apparently time we all  
start mastering XPath.

On 13-Nov-06, at 8:12 PM, [EMAIL PROTECTED] wrote:

>
> Hi Pete-
>
>> I am running script.aculo.us v1.6.5 and it would seem as though
>> Element.childrenWithClassName has disappeared from this build.
>
> There are several options now.  As Martin suggested, you can use
>
>   document.getElementsByClassName('widget', 'sidebar')
>
> where 'widget' is the class name and 'sidebar' is the parent element
> (the parentElement argument first appeared in Prototype 1.4).  In
> Prototype 1.5, getElementsByClassName is a method on all extended DOM
> elements:
>
>   $('sidebar').getElementsByClassName('widget')
>
> You can also use getElementsBySelector:
>
>   $('sidebar').getElementsBySelector('.widget')
>
> which is merely a wrapper around Selector.findChildElements:
>
>   Selector.findChildElements($('sidebar'), ['.widget'])
>
> And if you need only a single child element, use the down method:
>
>   $('sidebar').down('.widget')  // first child matching .widget
>   $('sidebar').down('.widget', 3)  // fourth child matching .widget
>
> --
> sam
>
>
> >

  Pete Forde: Partner at Unspace Interactive
contact | [EMAIL PROTECTED] - 416.548.8444


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to