Marcus Ramberg > HTML-Prototype-1.23 > HTML::Prototype::Js

Download:
HTML-Prototype-1.23.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  4
Open  1
View/Report Bugs
Source   Latest Release: HTML-Prototype-1.48

NAME ^

HTML::Prototype::Js - The actual prototype library, embedded in perl.

SYNOPSIS ^

  our $prototype = do { package HTML::Prototype::Js; local $/; <DATA> };

DESCRIPTION ^

This is the actual Prototype library embedded in a perl __DATA__ section, for easy inclusion in HTML::Prototype.

JS OBJECTS ^

The Prototype library provides a number of classes you can use to improve interaction with the end user.

Ajax

This represents a

Ajax

getTransport

Ajax

Provides one useful function, getTransport. This function will return a XMLHttpRequest object suitable for your browser.

Ajax.Base

An abstract base class for the Ajax objects described below. Sets some common options for Ajax objects; method: http method, defaults to post. asynchronous: process in the background, true/false, defaults to true. parameters: extra parameters, defaults to blank.

Ajax.Updater

a subclass of Ajax.Base, this class uses Ajax.Request to populate a container in your web page. Takes container, url and Ajax.Base options as paramters.

Ajax.Request

This object represents a plain ajax request. It extends base to add a constructor, as well as some events to handle events. The constructor takes an url, as well as the options described in Ajax.Base. Currently handles the following events: 'Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'

Effect.Appear

Takes an element, and makes that element appear through a fade.

Effect.ContentZoom

Takes an element, and zooms the content of that element.

Effect.Fade Takes an element, and makes that element fade out and disappear.
Effect.Highlight

Takes an element, and does a highlight of that element.

Effect.Puff

Takes an element, and makes that element "blow up" and disappear. (As in disappear in a puff of smoke).

Effect.Scale

Takes an element, and a size, in percent, and scales that element to the given size. If it's a div, the initial size will have to be given in EM. No such restrictions for pictures.

Effect.Squish

Takes an element, and shrinks that element until it disappears.

Field

Adds some useful functions to HTML Fields with several elements: clear: remove all content. focus: Give the element focus. present: returns true if all arguments are filled in, false otherwise. select(element): Select the given element in a form. activate(element): give the selected element focus, and select it.

Form

Some useful utilies for HTML Forms. all of these take a form element as sole argument.

serialize: returns a URL serialized version of a given form. getElements: returns all elements in the form. disable: blurs and disables every element in the form. focusFirstElement: Give first element in the form focus. reset: reset all form elements.

Form.Element

Some useful objects for Form Field Elements. These take an element as the sole argument. serialize: url encode the element for use in a URI string. getValue: returns the value of the given element.

Form.Element.Observer
Form.Element.Serializers

Serializers for various element types. Takes the input element as argument. input: determines the element type, and chooses the right serializer. inputSelector: serialize checkbox/radio.

Form.Element.Observer
Insertion

This can be used in place of a innerHTML, to insert the content into the dom.

Insertion.Before

Puts content before a given dom node.

Insertion.Top

Puts content at the top of a given dom node.

Insertion.Bottom

Puts content at the bottom of a given dom node.

Insertion.After

Puts content after a given dom node.

PeriodicalExecuter

This object takes two parameters, a reference to a callback function, and a frequency in seconds. It will execute the callback every <frequency> second.

SEE ALSO ^

HTML::Prototype, Catalyst::Plugin::Prototype http://prototype.conio.net/

AUTHOR ^

Sebastian Riedel, sri@oook.de Marcus Ramberg, mramberg@cpan.org

Built around Prototype by Sam Stephenson. Much code is ported from Ruby on Rails javascript helpers.

THANK YOU ^

Drew Taylor, Leon Brocard

LICENSE ^

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

syntax highlighting: