Prototype 1.6 is a great release and I''ve been reading about it in <a href="http://www.prototypejs.org/2007/11/7/prototype-1-6-0-script- aculo-us-1-8-0-and-the-bungee-book-now-available">Sam Stephenson''s blog</a>. But it appears that the API Docs are behind and still focus on Prototype 1.5, while there are some important changes. Did I simply overlook the updated docs or are you guys still working on them? --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey Bas, You must be mistaken; the online docs (http://prototypejs.org/api/) are up-to-date on just about 100% of the 1.6.0 changes (our internal To-Do list for the doc site only has a few pending updates left around Element methods such as update, replace, insert and writeAttribute, plus String#interpret). I just browsed through it and it''s indeed alright. Perhaps you''re browsing it through some monster cache, either local to your machine or at a proxy level? -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Ah ok, because I seem to be missing stuff that has been said in the blog, like for instance the changes to the Event class as described here: http://prototypejs.org/2007/8/15/prototype-1-6-0-release-candidate. Looks like none of that made it to the docs. For instance, I was expecthing that the following would be possible and that the ''this'' in the initialize-function would refer to MyObject. I guess I misunderstood the note in the blog as this does not seem to be the case.. var MyObject = { initialize: function() { alert(this); } } document.observe(''dom:loaded'', MyObject.initialize); --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Bas van Gaalen a écrit :> For instance, I was expecthing that the following would be possible > and that the ''this'' in the initialize-function would refer to > MyObject. I guess I misunderstood the note in the blog as this does > not seem to be the case.. > > var MyObject = { > initialize: function() { > alert(this); > } > } > > document.observe(''dom:loaded'', MyObject.initialize);No, you misunderstood. Scope correction means in an unbound event handler, "this" will refer to the element you''re calling observe *on*. In the code above, you''re calling observe on *document*, so "this" will refer to document. When you need to have methods as event handlers you need to specifically bind; there''s actually no technical way around it at all: JS does not equip us with surefire means of detecting that the function we''re dealing with is a method (which would let us get rid of bindAsEventListener, for instance), and even if it did, you wouldn''t necessarily want to bind to the owner object. -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Alright got it, thanks for the replies Christophe. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---