Catalyst::Plugin::Prototype - Plugin for Prototype


Catalyst-Plugin-Prototype documentation Contained in the Catalyst-Plugin-Prototype distribution.

Index


Code Index:

NAME

Top

Catalyst::Plugin::Prototype - Plugin for Prototype

SYNOPSIS

Top

    # use it
    use Catalyst qw/Prototype/;

INLINE USE

    # ...add this to your tt2 template...
    [% c.prototype.define_javascript_functions %]

REFERENCE USE

If you don't want to include the entire prototype library inline on every hit, you can use "script/myapp_create.pl Prototype" to generate static JavaScript files which then can be included via remote "script" tags.

    # ...add this to your template...
    <script LANGUAGE="JavaScript1.2" type="text/javascript"
         src="/prototype.js"></script>
    <script LANGUAGE="JavaScript1.2" type="text/javascript"
         src="/effects.js"></script>
    <!-- .... -->




    # ...and use the helper methods...
    <div id="view"></div>
    <textarea id="editor" cols="80" rows="24"></textarea>
    [% uri = base _ 'edit/' _ page.title %]
    [% c.prototype.observe_field( 'editor', uri, { 'update' => 'view' } ) %]

DESCRIPTION

Top

Some stuff to make Prototype fun.

This plugin replaces Catalyst::Helper::Prototype.

METHODS

prototype

    Returns a ready to use L<HTML::Prototype> object.

SEE ALSO

Top

Catalyst::Manual, Catalyst::Test, Catalyst::Request, Catalyst::Response, Catalyst::Helper

AUTHOR

Top

Sebastian Riedel, sri@oook.de

LICENSE

Top

This library is free software . You can redistribute it and/or modify it under the same terms as perl itself.


Catalyst-Plugin-Prototype documentation Contained in the Catalyst-Plugin-Prototype distribution.

package Catalyst::Plugin::Prototype;

use strict;
use base 'Class::Data::Inheritable';
use HTML::Prototype;

our $VERSION = '1.33';

__PACKAGE__->mk_classdata('prototype');
eval { require HTML::Prototype::Useful; };

if ( $@ ) {
    __PACKAGE__->prototype( HTML::Prototype->new );
} else {
    __PACKAGE__->prototype( HTML::Prototype::Useful->new );
}

1;