vendor/plugins/dialog_helper/lib/technoweenie/dialog_helper.rb
# Generates a javascript call to create a Dialog.  Dialog options are camelized and quoted, with the exception
# of callbacks starting with 'on_'.
#
#   <%= create_dialog(:confirm, 
#         :message => 'Are you sure?', 
#         :okay_test => 'Sure!', 
#         :on_okay => "function() { alert('whoa'); }") %>
#
#   new Dialog.Confirm({message:'Are you sure?', okayTest:'Sure!', onOkay:function() { alert('whoa'); }});
#
Generates a javascript call to create a Dialog.  Dialog options are camelized and quoted, with the exception
of callbacks starting with 'on_'.




Generates a javascript call to create a Dialog . Dialog options are camelized and quoted with the exception of callbacks starting with ' on_ ' .
def options_for_dialog(dialog_options = {})
      options_for_javascript(dialog_options.inject({}) { |options, d|
        options.merge((d.first.to_s[0..0] << d.first.to_s.camelize[1..-1]) => (d.first.to_s =~ /^on_/ ? d.last : %('#{d.last}')))
      })
    end
def options_for_dialog ( dialog_options = { } ) options_for_javascript ( dialog_options . inject ( { } ) { | options , d | options . merge ( ( d . first . to_s [ 0 .. 0 ] << d . first . to_s . camelize [ 1 .. - 1 ] ) => ( d . first . to_s =~ / ^on_ / ? d . last : %('#{d.last}') ) ) } ) end
Generates a javascript call to create a Dialog.
Generates a javascript call to create a Dialog .
dialog_options
<not_specific>