.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "HTML::Prototype::Js 3pm" .TH HTML::Prototype::Js 3pm "2022-06-14" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" HTML::Prototype::Js \- prototype library, embedded in perl .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& our $prototype = do { package HTML::Prototype::Js; local $/; }; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is the actual Prototype library embedded in a perl _\|_DATA_\|_ section, for easy inclusion in HTML::Prototype. .SH "NEW SYNTAX" .IX Header "NEW SYNTAX" The prototype library provides some functions and classes which effectively change the basic syntax of the JavaScript you write. .IP "$(element)" 4 .IX Item "$(element)" This function takes an element / element list and gets all string elements using document.getElementbyId. This is probably one of the most common functions when using javascript for web development, so it will save you a lot of typing. .IP "Class" 4 .IX Item "Class" This uses fucntion references to allow namespace-like Class structures in javascript. .IP "Object.extend" 4 .IX Item "Object.extend" Simple inheritance for javacsript. Will set all properties of the child in the parent. .IP "Function.bind" 4 .IX Item "Function.bind" Allow function refs to be full object method references, through the use of extend and apply .IP "Try.these" 4 .IX Item "Try.these" Simple try/catch for a list of functions, will return the return value of the first that doesn't throw an exception. .IP "Array.push" 4 .IX Item "Array.push" implement push for arrays. returns number of elements in result. .IP "Function.apply" 4 .IX Item "Function.apply" Call a function on a given object, using eval. .SH "JS OBJECTS" .IX Header "JS OBJECTS" The Prototype library provides a number of classes you can use to improve interaction with the end user. .IP "Ajax" 4 .IX Item "Ajax" Provides one useful function, getTransport. This function will return a XMLHttpRequest object suitable for your browser. .IP "Ajax.Base" 4 .IX Item "Ajax.Base" An abstract base class for the Ajax objects described below. Sets some common options for Ajax objects; \fBmethod:\fR http method, defaults to post. \fBasynchronous:\fR process in the background, true/false, defaults to true. \fBparameters:\fR extra parameters, defaults to blank. .IP "Ajax.Updater" 4 .IX Item "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 parameters. .IP "Ajax.Request" 4 .IX Item "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' .IP "Effect.Appear" 4 .IX Item "Effect.Appear" Takes an element, and makes that element appear through a fade. .IP "Effect.ContentZoom" 4 .IX Item "Effect.ContentZoom" Takes an element, and zooms the content of that element. .IP "Effect.Fade" 4 .IX Item "Effect.Fade" Takes an element, and makes that element fade out and disappear. .IP "Effect.Highlight" 4 .IX Item "Effect.Highlight" Takes an element, and does a highlight of that element. .IP "Effect.Puff" 4 .IX Item "Effect.Puff" Takes an element, and makes that element \*(L"blow up\*(R" and disappear. (As in disappear in a puff of smoke). .IP "Effect.Scale" 4 .IX Item "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 \s-1EM.\s0 No such restrictions for pictures. .IP "Effect.Squish" 4 .IX Item "Effect.Squish" Takes an element, and shrinks that element until it disappears. .IP "Element" 4 .IX Item "Element" A collection of functions related to basic elements. takes one or more elements. \fBtoggle:\fR Toggles the element display style. \fBhide:\fR Turns off the element's display style. \fBshow:\fR Turns on the element's display style. \fBremove:\fR Delete this element from the \s-1DOM.\s0 \fBgetHeight:\fR Get the element height. .Sp Also provides a convenience object, Toggle, with one method display which aliases to toggle, so you can call it as Toggle.display(element) .IP "Field" 4 .IX Item "Field" Adds some useful functions to \s-1HTML\s0 Fields with several elements: \fBclear:\fR remove all content. \fBfocus:\fR Give the element focus. \fBpresent:\fR returns true if all arguments are filled in, false otherwise. \fBselect(element):\fR Select the given element in a form. \fBactivate(element):\fR give the selected element focus, and select it. .IP "Form" 4 .IX Item "Form" Some useful utilies for \s-1HTML\s0 Forms. all of these take a form element as sole argument. \fBserialize:\fR returns a \s-1URL\s0 serialized version of a given form. \fBgetElements:\fR returns all elements in the form. \fBdisable:\fR blurs and disables every element in the form. \fBfocusFirstElement:\fR Give first element in the form focus. \fBreset:\fR reset all form elements. .IP "Form.Element" 4 .IX Item "Form.Element" Some useful objects for Form Field Elements. These take an element as the sole argument. \fBserialize:\fR url encode the element for use in a \s-1URI\s0 string. \fBgetValue:\fR returns the value of the given element. .IP "Form.Element.Observer" 4 .IX Item "Form.Element.Observer" .PD 0 .IP "Form.Element.Serializers" 4 .IX Item "Form.Element.Serializers" .PD Serializers for various element types. Takes the input element as argument. \fBinput:\fR determines the element type, and chooses the right serializer. \fBinputSelector:\fR serialize checkbox/radio. .IP "Form.Element.Observer" 4 .IX Item "Form.Element.Observer" .PD 0 .IP "Insertion" 4 .IX Item "Insertion" .PD This can be used in place of a innerHTML, to insert the content into the dom. .IP "Insertion.Before" 4 .IX Item "Insertion.Before" Puts content before a given dom node. .IP "Insertion.Top" 4 .IX Item "Insertion.Top" Puts content at the top of a given dom node. .IP "Insertion.Bottom" 4 .IX Item "Insertion.Bottom" Puts content at the bottom of a given dom node. .IP "Insertion.After" 4 .IX Item "Insertion.After" Puts content after a given dom node. .IP "PeriodicalExecuter" 4 .IX Item "PeriodicalExecuter" This object takes two parameters, a reference to a callback function, and a frequency in seconds. It will execute the callback every second. .SH "SEE ALSO" .IX Header "SEE ALSO" HTML::Prototype, Catalyst::Plugin::Prototype .SH "AUTHOR" .IX Header "AUTHOR" Sebastian Riedel, \f(CW\*(C`sri@oook.de\*(C'\fR Marcus Ramberg, \f(CW\*(C`mramberg@cpan.org\*(C'\fR .PP Built around Prototype by Sam Stephenson. Much code is ported from Ruby on Rails javascript helpers. .SH "LICENSE" .IX Header "LICENSE" This library is free software. You can redistribute it and/or modify it under the same terms as perl itself.