[Proto-Scripty] Re: Range utility increment

2009-09-28 Thread T.J. Crowder
Matt, The ObjectRange `include` method looks like this: function include(value) { if (value < this.start) return false; if (this.exclusive) return value < this.end; return value <= this.end; } So if you create a NumberRange of even numbers from 2 to 6 and ask it if 3

[Proto-Scripty] Re: IE Add Observers in Reverse Order?

2009-09-28 Thread KammylandSoftware
Thanks mate. You can imagine how frustrating this is :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.c

[Proto-Scripty] Re: IE Add Observers in Reverse Order?

2009-09-28 Thread T.J. Crowder
Hi, There is no order guarantee in either case (MDC doesn't discuss order [1], MSDN specifically says it's random[2]). You can determine empirically that IE does it one way and FF another, but you can't know that that won't change from dot release to dot release or even page to page. If you need

[Proto-Scripty] Re: .select the current element

2009-09-28 Thread T.J. Crowder
Hi, In the current version, I'm pretty sure you'd want to write your own "matching child" that is effectively: var matchingChild = element.childElements().find(function(child) { return child.hasClassName("bar"); }); I believe that when Prototype incorporates Sizzle (I think that

[Proto-Scripty] .select the current element

2009-09-28 Thread Alan Gutierrez
Hard to google because select is so overloaded, so if you could help... What is the equivalent of... $$('#foo > .bar').first(); when you select from '#foo'?j $('foo').select(/* What goes here? */); Or is it simply not possible? Alan Gutierrez --~--~-~--~~~---~--~

[Proto-Scripty] IE Add Observers in Reverse Order?

2009-09-28 Thread KammylandSoftware
When ever you add oberservers to the same event such as Event.oberve("myElement", "mousedown", "someMethod_1()"); Event.oberve("myElement", "mousedown", "someMethod_2()"); does IE execute them in REVERSE order upon fire? They get executed by order of chronological assignment in FF. IE is a blo

[Proto-Scripty] Re: Range utility increment

2009-09-28 Thread Matt Foster
Hey TJ, I don't understand, if a NumberRange was given an instance of EvenNumber as its start and end parameters, how would it come up with the number 3? On Sep 26, 7:10 am, "T.J. Crowder" wrote: > All right, lads, let's move along...  Each approach has its benefits > and costs, it all depends

[Proto-Scripty] Re: weird behavior w/ prototype & firefox

2009-09-28 Thread mhgrove
I want to have the button call a function which first schedules a call to show the busy spinner after say like 5 seconds. This way if the call to the server is fast, there's no blip on screen of the spinner just before the page redirects. The function should also defer a call to a function which

[Proto-Scripty] Re: weird behavior w/ prototype & firefox

2009-09-28 Thread T.J. Crowder
Hi, A submit button sends a form to the server, tearing down the current document and window contents and replacing them with the response from the server. You're scheduling asynchronous calls via setTimeout which are then happening (or not happening) before and as the window is being torn down a

[Proto-Scripty] weird behavior w/ prototype & firefox

2009-09-28 Thread mhgrove
I'll preface this with the fact that I am not much of a javascript hacker, and I'm new to prototype. So the following might be a very dumb question, but I couldn't find an answer to this googling around, I'm hoping that maybe someone here can point out what I'm doing wrong. Basically, what I was

[Proto-Scripty] Re: .select on a combo

2009-09-28 Thread Marko
No problem. I'm glad I have helped you. speedpac...@gmail.com wrote: > My hero! > Let's hope prototype just creates function to get the option from a > combo :) > > Thanks so much for this - it drove me MAD! > > On 28 sep, 17:28, Marko wrote: > >> I have both 3.0 and 3.5 installed and som

[Proto-Scripty] Re: .select on a combo

2009-09-28 Thread speedpac...@gmail.com
My hero! Let's hope prototype just creates function to get the option from a combo :) Thanks so much for this - it drove me MAD! On 28 sep, 17:28, Marko wrote: > I have both 3.0 and 3.5 installed and sometimes I start 3.0 instead of > 3.5 :-). > > I've wrote workaround function: > >  /* >  

[Proto-Scripty] Re: .select on a combo

2009-09-28 Thread Marko
I have both 3.0 and 3.5 installed and sometimes I start 3.0 instead of 3.5 :-). I've wrote workaround function: /* * Function retuns selected option for given select element. * As options are stored as array on select element, and we can get * selected element as select.selectedInde

[Proto-Scripty] Re: .select on a combo

2009-09-28 Thread speedpac...@gmail.com
OMG - I have been tesing on 3.5 for ages now LOL How did you find out? Is there gonna be a patch soon? How can I go around this? Your code doesn't work on 3.5 either, does it? David. On 28 sep, 17:19, Marko wrote: > Hi again :-) > > I forgot to mention that your code works in FF 3.0, and not

[Proto-Scripty] Re: .select on a combo

2009-09-28 Thread Marko
Hi again :-) I forgot to mention that your code works in FF 3.0, and not 3.5. Sorry my mistake. Have you tried my code on pastie? It will return you option element on change. - Marko speedpac...@gmail.com wrote: > Hi Marko, > > Thanks again for this. > I'm starting to lose my faith here, but t

[Proto-Scripty] Re: .select on a combo

2009-09-28 Thread speedpac...@gmail.com
Hi Marko, Thanks again for this. I'm starting to lose my faith here, but this still hasn't been resolved... Basically, this is (still) my issue: THIS: alert(orderOptions.getValue()); returns a CORRECT value, indicating that I do have an option under the combo that returns a good value... So

[Proto-Scripty] Re: Content-type for AJAX/JSON? Argh!

2009-09-28 Thread disccomp
I'd inspect the headers with Firebug just to be sure, I'd also use change the 'alert("Response:" + foo);' to 'console.dir(foo);' and check it in Firebug as well. Might give you a better idea of exactly whats going on. Good luck, -Mark --~--~-~--~~~---~--~~ You rece

[Proto-Scripty] Re: Hash.get() in IE 8

2009-09-28 Thread KammylandSoftware
Does it make a difference that I am passing to Hash.get() a var that holds a string, not a something like Hash.get("myVar")? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post

[Proto-Scripty] subscribing to event with element name starting with a certain text string

2009-09-28 Thread Chris Sansom
At 11:08 +0100 28/9/09, Alex McAuley wrote: >I am sure that its a regex in the "name=" bit so a regilar expression >something like >(0-9Aa-Zz) would do it In that case, surely just (\w)? -- Cheers... Chris Highway 57 Web Development -- http://highway57.co.uk/ Anything played wrong twice in a r

[Proto-Scripty] Re: subscribing to event with element name starting with a certain text string

2009-09-28 Thread Alex McAuley
I am sure that its a regex in the "name=" bit so a regilar expression something like (0-9Aa-Zz) would do it Alex Mcauley http://www.thevacancymarket.com - Original Message - From: "David Winslow" To: "Prototype & script.aculo.us" Sent: Monday, September 28, 2009 9:45 AM Subject: [Prot

[Proto-Scripty] subscribing to event with element name starting with a certain text string

2009-09-28 Thread David Winslow
If i got a input field with the name of field1,field2 etc and i want to do below dynamically "#participants [name=field1]:keyup": function() { "#participants [name=field2]:keyup": function() { Is it possible to do something like this "#participants [name=field*]:keyup": function() { where * can

[Proto-Scripty] Re: Setting focus after Ajax.Updater complete?

2009-09-28 Thread T.J. Crowder
Hi Steve, > Well, I tried rewriting the focus call as: > > onComplete: function() {$('editdescription').focus.defer(); > > Is that the right way to put it? No, you'll need to use my function or one like it. (The function is generic, so you can add it to any utility class you have lying around an

[Proto-Scripty] Re: Setting focus after Ajax.Updater complete?

2009-09-28 Thread Steve Marshall
Well, I tried rewriting the focus call as: onComplete: function() {$('editdescription').focus.defer(); Is that the right way to put it? Please remember I'm very new to all this, and still getting my head around it. If it is, it didn't work - in fact it stopped Firefox from working. This is not b