Thank you Siegfired!
-----Original Message-----
From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
[mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]
On Behalf Of Siegfried
Puchbauer
Sent: Wednesday, July 19, 2006 3:47 AM
To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Subject: Re: [Rails-spinoffs] collectTextNodes
Not tested, but should work: (It collects all textnodes, which are childs of
elements with the className)
Element.collectTextNodesWithClass = function(element, className) {
return $A($(element).childNodes).collect(function(node){
if(node.nodeType == 3){
return Element.hasClassName(node.parentNode, className) ?
node.nodeValue : '''';
} else {
return Element.hasClassName(node, className) ?
Element.collectTextNodesWithClass(node, className) :
'''';
}
}).flatten().join('''');
}
brgds, sigi
On 7/19/06, Daniel Elmore
<danielelmore-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
I see there is a collectTextNodesIgnoreClass method.
But who would I do the opposite: collectTextNodesWithClass
-Daniel
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
--
Mit freundlichen Grüßen
Siegfried Puchbauer
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs