Re: [Proto-Scripty] multiselect combo plugin

2010-02-22 Thread Guillaume Lepicard
hi, you might want to check http://livepipe.net/control/selectmultiple http://scripteka.com/ On Sun, Feb 21, 2010 at 10:04 PM, termi ivan.po...@f4s.sk wrote: Hi! please, is there any multi select combo plugin for prototype (script.aculo.us) like

[Proto-Scripty] for...in gets a overflow if including scriptaculous and prototype ?

2010-02-22 Thread Dale
Hi I tried a simple javascript example on the w3school (http:// www.w3schools.com/JS/js_loop_for_in.asp), and the example works fine if I don't include scriptaculous or prototype, but once I do I keep getting a strange error. Anyone know why this error/bug shows up, or have I done something

[Proto-Scripty] Re: for...in gets a overflow if including scriptaculous and prototype ?

2010-02-22 Thread T.J. Crowder
Hi, That for..in code is incorrect, based on a misconception (a common one). This page explains the misconception and discusses correct ways of iterating through arrays: http://proto-scripty.wikidot.com/prototype:tip-looping-through-arrays HTH, -- T.J. Crowder Independent Software Consultant tj

[Proto-Scripty] Re: for...in gets a overflow if including scriptaculous and prototype ?

2010-02-22 Thread Dale
Thanks! That other way worked fine for me. //Daniel On Feb 22, 4:08 pm, T.J. Crowder t...@crowdersoftware.com wrote: Hi, That for..in code is incorrect, based on a misconception (a common one). This page explains the misconception and discusses correct ways of iterating through

Re: [Proto-Scripty] How would I get a closer set of siblings?

2010-02-22 Thread Walter Lee Davis
Hmmm. That's not a documented function. I had a look at the source, and I can't see how it works. It accepts a node as its only argument, and it doesn't seem to perform any comparison as it executes. How then would I get it to stick to just the one type of sibling, and how would I get it

Re: [Proto-Scripty] How would I get a closer set of siblings?

2010-02-22 Thread Alex Wallace
I whipped up something that should handle the task, although I'm sure this could be optimized using the nextElementSibling. This version grabs nextSiblings() and then filters them, but the faster way would be to iterate over the `element.nextSibling` and break when it encounters a different tag

Re: [Proto-Scripty] How would I get a closer set of siblings?

2010-02-22 Thread Walter Lee Davis
Thanks very much. I was looking in the wrong place for the functionality I need. You've given me the bones I need to build on. Walter On Feb 22, 2010, at 11:07 AM, Alex Wallace wrote: I whipped up something that should handle the task, although I'm sure this could be optimized using the

Re: [Proto-Scripty] How would I get a closer set of siblings?

2010-02-22 Thread Paul Kim
Hi Walter, if you want to get all similar elements up to but not including the next head, I would use Prototype's Element.nextSiblings() to loop through all elements with the same tagName and break when the tagName is different. Here is a function I created just now that would hopefully do what

Re: [Proto-Scripty] How would I get a closer set of siblings?

2010-02-22 Thread Alex Wallace
Paul, one recommendation: store the results of element.nextSiblings() in a local variable outside of the loop. DOM traversals are pretty slow. Best, Alex On Mon, Feb 22, 2010 at 12:28 PM, Paul Kim kimba...@gmail.com wrote: Hi Walter, if you want to get all similar elements up to but not

Re: [Proto-Scripty] How would I get a closer set of siblings?

2010-02-22 Thread Paul Kim
Hi Alex, thanks for the tip. I've modified the function based on your tip and your example function: function consecutiveSameTagSiblings(element) { var element = $(element); var nextSiblings = element.nextSiblings(); var similarElements = [];

Re: [Proto-Scripty] Re: How would I get a closer set of siblings?

2010-02-22 Thread Walter Lee Davis
The heads and the paragraphs are all at the same level, and I don't want all the paragraphs, just the ones between this head and the next head. (It's for an accordion effect.) So while up('div').select('p') would do exactly what you say, it would leave me where I started. Thanks, Walter

[Proto-Scripty] Re: for...in gets a overflow if including scriptaculous and prototype ?

2010-02-22 Thread joe t.
TJ, i see endless warnings against using for/in. And i understand the reasons for them, especially on arrays. But it seems like a fairly powerful looping tool, yet no one seems to temper the warnings with appropriate circumstances for its use. Since the JS spec disallows creating non-enumerable

[Proto-Scripty] Re: Date Picker on modal box

2010-02-22 Thread Bram Bruneel
Hi, You might want to try to add an onShow or onUpdate callback function in the options which constructs the datepicker. Regards, Bram On Feb 22, 1:23 pm, jothis jothish...@gmail.com wrote: I have a pop up (prototype js ) modal box , there I can enter data. Here a field for enter date. I

[Proto-Scripty] Re: for...in gets a overflow if including scriptaculous and prototype ?

2010-02-22 Thread T.J. Crowder
Hey Joe, ARE there any good uses for this loop method? Absolutely, I use it all the time! Remember that as the linked article says: ...`for..in` is not for iterating through the /indexes/ of an /array/. `for..in` iterates through the /property names/ of an /object/. Arrays are objects,