How can you change the highlight color for in_place_editor_field? I tried: <%= in_place_editor_field :client, :name, {}, {:highlightcolor => ''"#d81983"'', :highlightendcolor => ''"#d81983"''} %> (both with and without the double-quotes) and it just doesn''t pass the javascript options... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2006-Nov-21 08:08 UTC
Re: Change in_place_editor_field highlight color?
jeremy*pinnix a écrit :> How can you change the highlight color for in_place_editor_field? > > I tried: > > <%= in_place_editor_field :client, :name, {}, {:highlightcolor => > ''"#d81983"'', :highlightendcolor => ''"#d81983"''} %> > > (both with and without the double-quotes) and it just doesn''t pass the > javascript options...Well, so far, this helper isn''t up to par with all the options used by the JS object. It''s also scheduled for extraction as a plugin by Rails 2.0 time, like many other script.aculo.us helpers, or so it seems. You have only two choices: - copy/paste to create a custom helper in your app/helpers/application_helper.rb - write the thing straight in JavaScript, tailored to your needs. -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: 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 -~----------~----~----~----~------~----~------~--~---
I have done a extension to inplace editor to set highlightcolor and highlightendcolor in a CSS file which is better when you need to skin websites. If you are interested, I can post it in the mailing-list Seb On Nov 21, 9:08 am, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> jeremy*pinnix a écrit : > > > How can you change the highlight color for in_place_editor_field? > > > I tried: > > > <%= in_place_editor_field :client, :name, {}, {:highlightcolor => > > ''"#d81983"'', :highlightendcolor => ''"#d81983"''} %> > > > (both with and without the double-quotes) and it just doesn''t pass the > > javascript options...Well, so far, this helper isn''t up to par with all the options used by > the JS object. It''s also scheduled for extraction as a plugin by Rails > 2.0 time, like many other script.aculo.us helpers, or so it seems. > > You have only two choices: > - copy/paste to create a custom helper in your > app/helpers/application_helper.rb > - write the thing straight in JavaScript, tailored to your needs. > > -- > Christophe Porteneuve a.k.a. TDD > "[They] did not know it was impossible, so they did it." --Mark Twain > Email: 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 -~----------~----~----~----~------~----~------~--~---
I would greatly appreciate that Seb! On Nov 21, 3:44 am, "seb" <sgruh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have done a extension to inplace editor to set highlightcolor and > highlightendcolor in a CSS file which is better when you need to skin > websites. > If you are interested, I can post it in the mailing-list > > Seb > > On Nov 21, 9:08 am, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote: > > > jeremy*pinnix a écrit : > > > > How can you change the highlight color for in_place_editor_field? > > > > I tried: > > > > <%= in_place_editor_field :client, :name, {}, {:highlightcolor => > > > ''"#d81983"'', :highlightendcolor => ''"#d81983"''} %> > > > > (both with and without the double-quotes) and it just doesn''t pass the > > > javascript options...Well, so far, this helper isn''t up to par with all the options used by > > the JS object. It''s also scheduled for extraction as a plugin by Rails > > 2.0 time, like many other script.aculo.us helpers, or so it seems. > > > You have only two choices: > > - copy/paste to create a custom helper in your > > app/helpers/application_helper.rb > > - write the thing straight in JavaScript, tailored to your needs. > > > -- > > Christophe Porteneuve a.k.a. TDD > > "[They] did not know it was impossible, so they did it." --Mark Twain > > Email: 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 -~----------~----~----~----~------~----~------~--~---
Here is a zip file with an example the extention is inplace_ext.js I hope zip file is accepted in the ML Seb  On Nov 21, 2006, at 4:41 PM, jeremy*pinnix wrote:> > I would greatly appreciate that Seb! > > On Nov 21, 3:44 am, "seb" <sgruh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> I have done a extension to inplace editor to set highlightcolor and >> highlightendcolor in a CSS file which is better when you need to skin >> websites. >> If you are interested, I can post it in the mailing-list >> >> Seb >> >> On Nov 21, 9:08 am, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote: >> >>> jeremy*pinnix a écrit : >> >>>> How can you change the highlight color for in_place_editor_field? >> >>>> I tried: >> >>>> <%= in_place_editor_field :client, :name, {}, {:highlightcolor => >>>> ''"#d81983"'', :highlightendcolor => ''"#d81983"''} %> >> >>>> (both with and without the double-quotes) and it just doesn''t >>>> pass the >>>> javascript options...Well, so far, this helper isn''t up to par >>>> with all the options used by >>> the JS object. It''s also scheduled for extraction as a plugin by >>> Rails >>> 2.0 time, like many other script.aculo.us helpers, or so it seems. >> >>> You have only two choices: >>> - copy/paste to create a custom helper in your >>> app/helpers/application_helper.rb >>> - write the thing straight in JavaScript, tailored to your needs. >> >>> -- >>> Christophe Porteneuve a.k.a. TDD >>> "[They] did not know it was impossible, so they did it." --Mark >>> Twain >>> Email: 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 -~----------~----~----~----~------~----~------~--~---
You could find a zip file here http://www.xilinus.com/inplace.zip it includes a html sample file Let me know if it''s fine for you. BTW, is there a better place to post it? Seb On Nov 21, 2006, at 4:41 PM, jeremy*pinnix wrote:> > I would greatly appreciate that Seb! > > On Nov 21, 3:44 am, "seb" <sgruh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> I have done a extension to inplace editor to set highlightcolor and >> highlightendcolor in a CSS file which is better when you need to skin >> websites. >> If you are interested, I can post it in the mailing-list >> >> Seb >> >> On Nov 21, 9:08 am, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote: >> >>> jeremy*pinnix a écrit : >> >>>> How can you change the highlight color for in_place_editor_field? >> >>>> I tried: >> >>>> <%= in_place_editor_field :client, :name, {}, {:highlightcolor => >>>> ''"#d81983"'', :highlightendcolor => ''"#d81983"''} %> >> >>>> (both with and without the double-quotes) and it just doesn''t >>>> pass the >>>> javascript options...Well, so far, this helper isn''t up to par >>>> with all the options used by >>> the JS object. It''s also scheduled for extraction as a plugin by >>> Rails >>> 2.0 time, like many other script.aculo.us helpers, or so it seems. >> >>> You have only two choices: >>> - copy/paste to create a custom helper in your >>> app/helpers/application_helper.rb >>> - write the thing straight in JavaScript, tailored to your needs. >> >>> -- >>> Christophe Porteneuve a.k.a. TDD >>> "[They] did not know it was impossible, so they did it." --Mark >>> Twain >>> Email: 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 -~----------~----~----~----~------~----~------~--~---
I encountered the same problem. I found that when passing the option in JavaScript, instead through the ruby method, the option gets interpreted right. So I did mimic the "in_place_editor_field". If you can do without the separate CSS-file, this could be a fast solution. Instead of ''in_place_editor_field :user, :email''(in my case) I wrote the ''span'' tag it would generate: <span id="user_email_<%= @user[:id] %>_in_place_editor" class="in_place_editor_field"><%= @user.email %></span> The tag id is generated like "#{object}_#{method}_#{object.id}_in_place_editor". The method needed\generated from the ''in_place_edit_for'' in the controller is named like "set_#{object}_#{method}". so for me it came to this: <% url = url_for({ :action => "set_user_email", :id => @user[:id] }) -%> Then I added the InPlaceEditor function to the same rhtml file: <script type="text/javascript"> new Ajax.InPlaceEditor(''user_email_<%= @user[:id] %>_in_place_editor'', ''<%= url %>'', {highlightcolor:''#550000'', highlightendcolor:''#005500''}); </script> And it worked. On Nov 21, 9:11 pm, Sébastien Gruhier <sgruh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You could find a zip file herehttp://www.xilinus.com/inplace.zip > it includes a html sample file > > Let me know if it''s fine for you. > > BTW, is there a better place to post it? > > Seb > > On Nov 21, 2006, at 4:41 PM, jeremy*pinnix wrote: > > > > > I would greatly appreciate that Seb! > > > On Nov 21, 3:44 am, "seb" <sgruh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> I have done a extension to inplace editor to set highlightcolor and > >> highlightendcolor in a CSS file which is better when you need to skin > >> websites. > >> If you are interested, I can post it in the mailing-list > > >> Seb > > >> On Nov 21, 9:08 am, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote: > > >>> jeremy*pinnix a écrit : > > >>>> How can you change thehighlightcolorfor in_place_editor_field? > > >>>> I tried: > > >>>> <%= in_place_editor_field :client, :name, {}, {:highlightcolor => > >>>> ''"#d81983"'', :highlightendcolor => ''"#d81983"''} %> > > >>>> (both with and without the double-quotes) and it just doesn''t > >>>> pass the > >>>> javascript options...Well, so far, this helper isn''t up to par > >>>> with all the options used by > >>> the JS object. It''s also scheduled for extraction as a plugin by > >>> Rails > >>> 2.0 time, like many other script.aculo.us helpers, or so it seems. > > >>> You have only two choices: > >>> - copy/paste to create a custom helper in your > >>> app/helpers/application_helper.rb > >>> - write the thing straight in JavaScript, tailored to your needs. > > >>> -- > >>> Christophe Porteneuve a.k.a. TDD > >>> "[They] did not know it was impossible, so they did it." --Mark > >>> Twain > >>> Email: 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 -~----------~----~----~----~------~----~------~--~---