Hi All, I''m trying to transition from Prototype 1.5.x to 1.6.x and now I have code (a cross-site plug-in) that is complaining about the absence of Request.setOptions(xxx) When I search for setOptions in Proto 1.5 it''s there but I can''t find it in Proto 1.6.x. I''m OK with it changing into something else, the problem is that I can''t seem to find any documentation anywhere for the function OR its replacement in 1.6 help? Is there something bigger I''m missing or.... Regards, Steve Upton -- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Steve Upton a écrit :> I''m trying to transition from Prototype 1.5.x to 1.6.x and now I have > code (a cross-site plug-in) that is complaining about the absence of > Request.setOptions(xxx)That''s monkey-patching: Ajax.Request#setOptions was never a part of the public API, so the code you''re mentioning was relying on an internal implementation detail…> When I search for setOptions in Proto 1.5 it''s there but I can''t find > it in Proto 1.6.x.Yes, it''s been refactored when Tobie introduced Ajax.Response.> I''m OK with it changing into something else, the problem is that I > can''t seem to find any documentation anywhere for the function OR its > replacement in 1.6It''s embedded in the initialize function now (which doesn''t do much else). I can''t say overwriting that would be clean or safe… -- 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 -~----------~----~----~----~------~----~------~--~---
At 8:31 PM +0100 3/5/08, Christophe Porteneuve wrote:>Steve Upton a écrit : >> I''m trying to transition from Prototype 1.5.x to 1.6.x and now I have >> code (a cross-site plug-in) that is complaining about the absence of >> Request.setOptions(xxx) > >That''s monkey-patching: Ajax.Request#setOptions was never a part of the >public API, so the code you''re mentioning was relying on an internal >implementation detailŠAh! understood. That would explain the lack of documentation...> > When I search for setOptions in Proto 1.5 it''s there but I can''t find >> it in Proto 1.6.x. > >Yes, it''s been refactored when Tobie introduced Ajax.Response. > >> I''m OK with it changing into something else, the problem is that I >> can''t seem to find any documentation anywhere for the function OR its >> replacement in 1.6 > >It''s embedded in the initialize function now (which doesn''t do much >else). I can''t say overwriting that would be clean or safeŠOK.... every time I think I have my head around Javascript I find there are many more was to be baffled... If you could... Here is the code snippit. (this is part of a ''plug-in'' that streamlines cross-site scripting using the <script> method. I want to communicate to another site (that we can control content coming from) and this plug-in seems to do the job well... in Proto 1.5 anyway, here''s the code //------------------------------- Extend prototype a bit ----------------------- // Ajax.Request.prototype = Object.extend(Ajax.Request.prototype,{ initialize: function(url, options) { this.setOptions(options); this.transport = (!this.options.crossSite) ? Ajax.getTransport() : new scriptTransport; this.options.asynchronous = (!this.options.crossSite) ? this.options.asynchronous : false; //turns off the timed onLoad executer this.transport.respondToReadyState = this.respondToReadyState.bind(this); this.request(url); } }); //--------------------------------------------------------------------------------- Is there a straight-forward way of doing this under Proto 1.6? Or a least a place I can go to learn more about making this work? thanks for your help regards, Steve Upton -- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
At 12:02 PM -0800 3/5/08, Steve Upton wrote:> >Is there a straight-forward way of doing this under Proto 1.6? Or a least a place I can go to learn more about making this work?incidentally, I do have your book (Christophe) and I''m reading away... it''s great. That''s doesn''t mean there isn''t plenty of room left in my head for confusion... Steve -- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Steve Upton a écrit :> incidentally, I do have your book (Christophe) and I''m reading > away... it''s great. That''s doesn''t mean there isn''t plenty of room > left in my head for confusion...Glad you like it. Feel free to review it on Amazon when you''re done (or before) :-) -- 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 -~----------~----~----~----~------~----~------~--~---
Steve Upton a écrit :> If you could... Here is the code snippit. (this is part of a > ''plug-in'' that streamlines cross-site scripting using the <script> > method. I want to communicate to another site (that we can control > content coming from) and this plug-in seems to do the job well... in > Proto 1.5Not too hard, with 1.6''s inheritance mechanism… I''ll give it a go tomorrow (or at least try to find time to). -- 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 -~----------~----~----~----~------~----~------~--~---
At 10:46 PM +0100 3/5/08, Christophe Porteneuve wrote:>Steve Upton a écrit : >> If you could... Here is the code snippit. (this is part of a >> ''plug-in'' that streamlines cross-site scripting using the <script> >> method. I want to communicate to another site (that we can control >> content coming from) and this plug-in seems to do the job well... in >> Proto 1.5 > >Not too hard, with 1.6''s inheritance mechanismŠ I''ll give it a go >tomorrow (or at least try to find time to).actually, I think I''ve figured it out. The new inheritance is nice and creating a sub-class with new bits seems to fit the bill. Thanks for your response, it helped put me on the right track. I guess I''m awaiting 1.6.1 for its ''abort'' function. That will come in handy.. regards, Steve -- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---