Hi! I''m so sorry for bug you with IPE but I''m working on a freemind view of trees (as you could see on my weblog at: http://blogs.sistes.net/Garito/670) and the IPE edition is so much heavy used For that I have some questions to ask. As they are minor questions (at least it seems to me) I make them here in only one threat (sorry if you think will be better in a separated threats) Perhaps they will be for Christophe again (sorry for make you work again ;) ) The first one: If you see controls.js at line 710 you could find registerListeners function and at line 713 you could find this line: $H(Ajax.InPlaceEditor.Listeners).each(function(pair) { This is my question: have you any problem if Christophe change this line to something like: $H(this.Listeners).each(function(pair) { ? With this change you could subclass Ajax.InPlaceEditor to register other events instead of the original ones Or, if you prefer, how can I change the default Listeners? ****************************************************************************************************** The second question will be: I notice that if I try to cancel an edition with the escape key it doesn''t work (nothing happens) and if I cancel with the link button the url location changes to the parent location plus # for example: if I''m at http://server:port/url the cancel button change the location to http://server:port/# In previous versions of Scriptaculos this doesn''t happen never (this is the first time I see that) What can you say about this? Thanks again and again --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Garito a écrit :> For that I have some questions to ask. As they are minor questions (at > least it seems to me) I make them here in only one threat (sorry if > you think will be better in a separated threats)I love your typo ("threat" instead of "thread"); it feels like we''re in the comments on some Vi-vs-Emacs flamewar.> Perhaps they will be for Christophe again (sorry for make you work > again ;) )Hey, if I minded, I wouldn''t read it. Plus, I need to stretch my legs on this list again and maintain my reply score ;-)> This is my question: have you any problem if Christophe change this > line to something like: > > $H(this.Listeners).each(function(pair) { > > ? > With this change you could subclass Ajax.InPlaceEditor to register > other events instead of the original onesExcept this won''t work. You''re mistaking instance fields and class fields. A.IPE.Listeners is a class-level member. However, you could look into how A.IPCE augments default options for a way to do such a thing (which admittedly is a bit tortuous). I could imagine a _extraListeners field in there somewhere, but to make all this really cleaner I''d need to use Prototype''s inheritance mechanism. In the meantime you can just override registerListeners and unregisterListeners in your subclass and start by calling the inherited version, something like: Ajax.MyInPlaceEditor = Class.create(Ajax.InPlaceEditor, { // ... registerListeners: function($super) { $super(); // your registrations here }, unregisterListeners: function($super) { // your "unregistrations" here $super(); } });> Or, if you prefer, how can I change the default Listeners?Just overwrite Ajax.InPlaceEditor.Listeners, but that would be dangerous (in the sense that it could break behavior elsewhere on your page). What you could do is tweak A.IPE directly by adding new methods in it and then adding the matching defs in A.IPE.Listeners. That could work, but will affect *all* IPE''s in your page, when you might want to create a subclass for specific needs that do not pertain to all IPEs on your page.> I notice that if I try to cancel an edition with the escape key it > doesn''t work (nothing happens) and if I cancel with the link button > the url location changes to the parent location plus #That''s just plain wrong. None of these behaviors should occur, and they sure DON''T occur on my implementation. I suggest you check that you have the latest version and run the unit test page for IPE to verify everything passes. If it doesn''t, I and Thomas are interested in learning more about it. -- 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 -~----------~----~----~----~------~----~------~--~---
Hi, boy ;) ! About typos and some other english errors: my english is poor enough to shame (thanks to Cambridge Dictionaries Online) ;) 1st question: sorry Christophe but my code said this.Listeners issue works ok 2on question: I revise it. For me is weird too because is the first time it happens since version 1.7.something. I have Scriptaculous 1.8.1 On 20 ene, 22:32, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> Garito a écrit : > > > For that I have some questions to ask. As they are minor questions (at > > least it seems to me) I make them here in only one threat (sorry if > > you think will be better in a separated threats) > > I love your typo ("threat" instead of "thread"); it feels like we''re in > the comments on some Vi-vs-Emacs flamewar. > > > Perhaps they will be for Christophe again (sorry for make you work > > again ;) ) > > Hey, if I minded, I wouldn''t read it. Plus, I need to stretch my legs > on this list again and maintain my reply score ;-) > > > This is my question: have you any problem if Christophe change this > > line to something like: > > > $H(this.Listeners).each(function(pair) { > > > ? > > With this change you could subclass Ajax.InPlaceEditor to register > > other events instead of the original ones > > Except this won''t work. You''re mistaking instance fields and class > fields. A.IPE.Listeners is a class-level member. However, you could > look into how A.IPCE augments default options for a way to do such a > thing (which admittedly is a bit tortuous). > > I could imagine a _extraListeners field in there somewhere, but to make > all this really cleaner I''d need to use Prototype''s inheritance mechanism. > > In the meantime you can just override registerListeners and > unregisterListeners in your subclass and start by calling the inherited > version, something like: > > Ajax.MyInPlaceEditor = Class.create(Ajax.InPlaceEditor, { > // ... > registerListeners: function($super) { > $super(); > // your registrations here > }, > unregisterListeners: function($super) { > // your "unregistrations" here > $super(); > } > > }); > > Or, if you prefer, how can I change the default Listeners? > > Just overwrite Ajax.InPlaceEditor.Listeners, but that would be dangerous > (in the sense that it could break behavior elsewhere on your page). > > What you could do is tweak A.IPE directly by adding new methods in it > and then adding the matching defs in A.IPE.Listeners. > > That could work, but will affect *all* IPE''s in your page, when you > might want to create a subclass for specific needs that do not pertain > to all IPEs on your page. > > > I notice that if I try to cancel an edition with the escape key it > > doesn''t work (nothing happens) and if I cancel with the link button > > the url location changes to the parent location plus # > > That''s just plain wrong. None of these behaviors should occur, and they > sure DON''T occur on my implementation. I suggest you check that you > have the latest version and run the unit test page for IPE to verify > everything passes. If it doesn''t, I and Thomas are interested in > learning more about it. > > -- > Christophe Porteneuve aka TDD > t...-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 -~----------~----~----~----~------~----~------~--~---
Nothing to say? Can we do the change at controls.js? Thanks! On Jan 21, 12:54 am, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, boy ;) ! > About typos and some other english errors: my english is poor enough > to shame (thanks to Cambridge Dictionaries Online) ;) > > 1st question: sorry Christophe but my code said this.Listeners issue > works ok > 2on question: I revise it. For me is weird too because is the first > time it happens since version 1.7.something. I have Scriptaculous > 1.8.1 > > On 20 ene, 22:32, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote: > > >Garitoa écrit : > > > > For that I have some questions to ask. As they are minor questions (at > > > least it seems to me) I make them here in only one threat (sorry if > > > you think will be better in a separated threats) > > > I love your typo ("threat" instead of "thread"); it feels like we''re in > > the comments on some Vi-vs-Emacs flamewar. > > > > Perhaps they will be for Christophe again (sorry for make you work > > > again ;) ) > > > Hey, if I minded, I wouldn''t read it. Plus, I need to stretch my legs > > on this list again and maintain my reply score ;-) > > > > This is my question: have you any problem if Christophe change this > > > line to something like: > > > > $H(this.Listeners).each(function(pair) { > > > > ? > > > With this change you could subclass Ajax.InPlaceEditor to register > > > other events instead of the original ones > > > Except this won''t work. You''re mistaking instance fields and class > > fields. A.IPE.Listeners is a class-level member. However, you could > > look into how A.IPCE augments default options for a way to do such a > > thing (which admittedly is a bit tortuous). > > > I could imagine a _extraListeners field in there somewhere, but to make > > all this really cleaner I''d need to use Prototype''s inheritance mechanism. > > > In the meantime you can just override registerListeners and > > unregisterListeners in your subclass and start by calling the inherited > > version, something like: > > > Ajax.MyInPlaceEditor = Class.create(Ajax.InPlaceEditor, { > > // ... > > registerListeners: function($super) { > > $super(); > > // your registrations here > > }, > > unregisterListeners: function($super) { > > // your "unregistrations" here > > $super(); > > } > > > }); > > > Or, if you prefer, how can I change the default Listeners? > > > Just overwrite Ajax.InPlaceEditor.Listeners, but that would be dangerous > > (in the sense that it could break behavior elsewhere on your page). > > > What you could do is tweak A.IPE directly by adding new methods in it > > and then adding the matching defs in A.IPE.Listeners. > > > That could work, but will affect *all* IPE''s in your page, when you > > might want to create a subclass for specific needs that do not pertain > > to all IPEs on your page. > > > > I notice that if I try to cancel an edition with the escape key it > > > doesn''t work (nothing happens) and if I cancel with the link button > > > the url location changes to the parent location plus # > > > That''s just plain wrong. None of these behaviors should occur, and they > > sure DON''T occur on my implementation. I suggest you check that you > > have the latest version and run the unit test page for IPE to verify > > everything passes. If it doesn''t, I and Thomas are interested in > > learning more about it. > > > -- > > Christophe Porteneuve aka TDD > > t...-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 -~----------~----~----~----~------~----~------~--~---