NAME HTML::Prototype - Generate HTML and Javascript for the Prototype library SYNOPSIS use HTML::Prototype; my $prototype = HTML::Prototype->new; print $prototype->auto_complete_field(...); print $prototype->auto_complete_result(...); print $prototype->auto_complete_stylesheet(...); print $prototype->content_tag(...); print $prototype->define_javascript_functions; print $prototype->draggable_element(...); print $prototype->drop_receiving_element(...); print $prototype->evaluate_remote_response(...); print $prototype->form_remote_tag(...); print $prototype->in_place_editor(...); print $prototype->in_place_editor_field(...); print $prototype->javascript_tag(...); print $prototype->link_to_function(...); print $prototype->link_to_remote(...); print $prototype->observe_field(...); print $prototype->observe_form(...); print $prototype->periodically_call_remote(...); print $prototype->sortable_element(...); print $prototype->submit_to_remote(...); print $prototype->tag(...); print $prototype->text_field_with_auto_complete(...); print $ptototype->update_element_function(...); print $prototype->visual_effect(...); DESCRIPTION The module contains some code generators for Prototype, the famous JavaScript OO library and the script.aculous extensions. The Prototype library (http://prototype.conio.net/) is designed to make AJAX easy. Catalyst::Plugin::Prototype makes it easy to connect to the Prototype library. This is mostly a port of the Ruby on Rails helper tags for JavaScript for use in Catalyst. METHODS $prototype->in_place_editor( $field_id, \%options ) Makes an HTML element specified by the DOM ID $field_id become an in-place editor of a property. A form is automatically created and displayed when the user clicks the element, something like this:
cancel
The form is serialized and sent to the server using an Ajax call, the action on the server should process the value and return the updated value in the body of the reponse. The element will automatically be updated with the changed value (as returned from the server). Required options are: "url": Specifies the url where the updated value should be sent after the user presses "ok". Addtional options are: "rows": Number of rows (more than 1 will use a TEXTAREA) "cancel_text": The text on the cancel link. (default: "cancel") "save_text": The text on the save link. (default: "ok") "external_control": The id of an external control used to enter edit mode. "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 $prototype->in_place_editor_field( $object, $method, \%tag_options, \%in_place_editor_options ) Renders the value of the specified object and method with in-place editing capabilities. $prototype->auto_complete_field( $field_id, \%options ) Adds Ajax autocomplete functionality to the text input field with the DOM ID specified by $field_id. This function expects that the called action returns a HTML