diff --git a/actionpack/lib/action_view/helpers/java_script_macros_helper.rb b/actionpack/lib/action_view/helpers/java_script_macros_helper.rb
index 8ce2940aeb..d4a1456561 100644
--- a/actionpack/lib/action_view/helpers/java_script_macros_helper.rb
+++ b/actionpack/lib/action_view/helpers/java_script_macros_helper.rb
@@ -35,13 +35,15 @@ module ActionView
# :size:: Synonym for :cols when using a single line text input.
# :cancel_text:: The text on the cancel link. (default: "cancel")
# :save_text:: The text on the save link. (default: "ok")
- # :loading_text:: The text to display when submitting to the server (default: "Saving...")
+ # :loading_text:: The text to display while the data is being loaded from the server (default: "Loading...")
+ # :saving_text:: The text to display when submitting to the server (default: "Saving...")
# :external_control:: The id of an external control used to enter edit mode.
# :load_text_url:: URL where initial value of editor (content) is retrieved.
# :options:: Pass through options to the AJAX call (see prototype's Ajax.Updater)
# :with:: JavaScript snippet that should return what is to be sent
# in the AJAX call, +form+ is an implicit parameter
# :script:: Instructs the in-place editor to evaluate the remote JavaScript response (default: false)
+ # :click_to_edit_text::The text shown during mouseover the editable text (default: "Click to edit")
def in_place_editor(field_id, options = {})
function = "new Ajax.InPlaceEditor("
function << "'#{field_id}', "
@@ -51,6 +53,7 @@ module ActionView
js_options['cancelText'] = %('#{options[:cancel_text]}') if options[:cancel_text]
js_options['okText'] = %('#{options[:save_text]}') if options[:save_text]
js_options['loadingText'] = %('#{options[:loading_text]}') if options[:loading_text]
+ js_options['savingText'] = %('#{options[:saving_text]}') if options[:saving_text]
js_options['rows'] = options[:rows] if options[:rows]
js_options['cols'] = options[:cols] if options[:cols]
js_options['size'] = options[:size] if options[:size]
@@ -59,6 +62,7 @@ module ActionView
js_options['ajaxOptions'] = options[:options] if options[:options]
js_options['evalScripts'] = options[:script] if options[:script]
js_options['callback'] = "function(form) { return #{options[:with]} }" if options[:with]
+ js_options['clickToEditText'] = %('#{options[:click_to_edit_text]}') if options[:click_to_edit_text]
function << (', ' + options_for_javascript(js_options)) unless js_options.empty?
function << ')'