[Proto-Scripty] Re: Awful Vacation...................Brad Vogel
Ignore this message. My email account was hacked. Sorry about that folks! For those of you using gmail, I highly recommend securing your account with 2 step verification: http://googleblog.blogspot.com/2011/02/advanced-sign-in-security-for-your.html Take care, Brad -- 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.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Feedback on a Mega Dropdown menu
Thanks for the feedback. I'm really just trying to get a consistent cross-browser way of doing this. If you know a CSS solution that works in IE, I'd be happy to learn! I agree the fade effect is a bit contentious... On Apr 5, 9:27 pm, Pete Brown pete+goo...@lette.us wrote: I'm sure there are pros and cons to doing a menu like that in Javascript, but all I can say is that I would ditch the fading effects. They are unnecessary and sort of annoying. --~--~-~--~~~---~--~~ 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.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Feedback on a Mega Dropdown menu
Hello All, I'm new to this group and to prototype script.aculo.us. I've tried to implement a Mega menu (loosely based on the blog: http://www.sitepoint.com/blogs/2009/03/31/make-a-mega-drop-down-menu-with-jquery/), and it seems to be working to some degree. The whole thing is here: http://bradmontgomery.net/megamenu/ I'm using registering observers for mouseover and mouseout and I'm using Effect.Appear and Effect.Fade with a specified ScopedQueue. I'm I going about this correctly... are there any caveats to what I'm doing? I've skimmed some other drop-downs that seem to approach this differently. Thanks in advance! Brad --~--~-~--~~~---~--~~ 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.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Hash#filter returns an Array?
TJ, thanks for correcting the docs. I hadn't noticed that error either. Are you suggesting that there no intersection of Prototype and Ruby communities? I only know of Prototype because of Ruby on Rails. Let's take Hash#reject() as an example. Let's say I'm moving server- side Ruby code to my Prototype-enhanced client-side. Ruby code: { a = 100, b = 200, c = 300 }.reject {|key, value| key == b } = {a=100, c=300} Translated to Javascript: $H({ a: 100, b: 200, c: 300 }).reject(function(i) { return i.key == b }) = [[a, 100], [c, 300]] Prototype returns an array? What good is an array if I started with a hash? It is intuitive that a reject() method returns a subset of the original data structure and not convert it to an entirely different one. Perhaps this is a plea better left for the Prototype-core list. On Feb 3, 6:18 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, Maybe filter should be an alias of findall for arrays, but shouldn't it really return a hash for hashes? FWIW (and it ain't much, I'm not a decision maker on Prototype stuff), in my opinion it would be an _extremely_ bad idea for Hash to break the contract documented for Enumerable. ...in ruby, which Prototype is supposed to be modeled after. Prototype has been split off from Ruby for a long time now. I'd venture to say that most people using Prototype do not use and may well never have even seen Ruby. PHP seems to be the server-side language I see most in code snippets from people asking questions. -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Feb 3, 2:04 pm, disccomp discc...@gmail.com wrote: Maybe filter should be an alias of findall for arrays, but shouldn't it really return a hash for hashes? Especially if thats its behavior in ruby, which Prototype is supposed to be modeled after. On Feb 3, 4:59 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi Brad, Sorry, I missed that Hash inherits from Enumerable (and I've filed a doc bug on it[1] and will fix it -- the doc page for Hash doesn't mention Enumerable). So I think that's your answer: Hash#filter is an alias for Enumerable#findAll[2], which is documented as returning an array, not a Hash, and so having it return a Hash would be breaking the contract. [1]http://prototype.lighthouseapp.com/projects/8886-prototype/tickets/535 [2]http://prototypejs.org/api/enumerable/findall Sorry again to have missed the Enumerable thing in the first place. -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Feb 3, 12:25 am, Brad bradavo...@gmail.com wrote: It does. Hash still inherits from Enumerable, hence the usage of Hash#findAll(). - Brad On Feb 2, 1:34 am, ColinFine colin.f...@pace.com wrote: On Jan 31, 11:11 pm, Brad bradavo...@gmail.com wrote: Yup, found it -http://dev.rubyonrails.org/ticket/3592 It is indeed a bug in Prototype that hasn't been addressed. - Brad But it seems to me that it's gone away, because Hash no longer mixes in Enumerable, does it? Colin --~--~-~--~~~---~--~~ 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.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Hash#filter returns an Array?
Yup, found it - http://dev.rubyonrails.org/ticket/3592 It is indeed a bug in Prototype that hasn't been addressed. - Brad On Jan 30, 6:23 pm, kangax kan...@gmail.com wrote: On Jan 30, 6:05 pm, Brad bradavo...@gmail.com wrote: Why does Hash#filter return an Array instead of a Hash? It isn't really a filter if it's returning another data type. Instead of $H({'a':1,'b':2,'c':3,'d':4}).filter(function(i) { return i.value % 2; }) that returns, [[a, 1], [c, 3]] I would expect it to return {a: 1, c: 3} This is the behavior of Ruby's (1.8) hashes - some of the enumerable methods return array rather than hash. It was considered a bug and was fixed in a recently released Ruby 1.9. IIRC, there should be an old ticket somewhere on the old bug tracker with a lengthy discussion about this issue. -- kangax --~--~-~--~~~---~--~~ 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.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Hash#filter returns an Array?
Why does Hash#filter return an Array instead of a Hash? It isn't really a filter if it's returning another data type. Instead of $H({'a':1,'b':2,'c':3,'d':4}).filter(function(i) { return i.value % 2; }) that returns, [[a, 1], [c, 3]] I would expect it to return {a: 1, c: 3} --~--~-~--~~~---~--~~ 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.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---