Does anyone know how to change the highlight and fade-to color of the AJAX in_place_editor and in_place_editor_field? Amazingly enough, the Rails code seems to assume that we always want yellow highlights and fade-to-white. / Peter --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 6 Feb 2007, at 10:05, Peter Bengtson wrote:> Does anyone know how to change the highlight and fade-to color of the > AJAX in_place_editor and in_place_editor_field?Unfortunately, you are out of lack if you are looking for a clean way to do it. The in_place_editor helper doesn''t support all the options of Ajax.InPlaceEditor[1] You could do one of two things. 1) You could monkeypatch lib/actionview/ java_script_macros_helper.rb#in_place_editor to support more options. Stick this snippet of code[2] in your application.rb, Then you can call in_place_editor like this: <%= in_place_editor_field :post, ''title'', {}, {:highlight_color => ''#FF0000'', :highlight_end_color => ''#BB00FF'' } 2) You could change your local copy of script.aculo.us in ''public/ javascrips/control.js#Ajax.InPlaceEditor.defaultHighlightColor'' and all related default values in where InPlaceEditor is defined. Keeping in mind that InPlaceEditor is going to become a plugin in Rails 2.0, I would think it will eventually see some improvements on that area. -christos [1] http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor [2] http://pastie.caboo.se/38229 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for the quick reply. (1) is obviously the better way, so I''ll stick to that. It is somewhat surprising, though, that Rails assumes every web application has a white background... How 2.0. ;-) / Peter 6 feb 2007 kl. 12.12 skrev Christos Zisopoulos:> You could do one of two things. > > 1) You could monkeypatch lib/actionview/ > java_script_macros_helper.rb#in_place_editor to support more options. > Stick this snippet of code[2] in your application.rb, Then you can > call in_place_editor like this: > > <%= in_place_editor_field :post, ''title'', {}, {:highlight_color => > ''#FF0000'', :highlight_end_color => ''#BB00FF'' }--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---