.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" 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 .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "SelectLayers 3pm" .TH SelectLayers 3pm "2018-08-27" "perl v5.26.2" "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::Widgets::SelectLayers \- Perl extension for selectable HTML layers .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use HTML::Widgets::SelectLayers; \& \& use Tie::IxHash; \& tie my %options, \*(AqTie::IxHash\*(Aq, \& \*(Aqvalue\*(Aq => \*(AqSelect One\*(Aq, \& \*(Aqvalue2\*(Aq => \*(AqSelect Two\*(Aq, \& ; \& \& $widget = new HTML::Widgets::SelectLayers( \& \*(Aqoptions\*(Aq => \e%options, \& \*(Aqform_name\*(Aq => \*(Aqdummy\*(Aq, \& \*(Aqform_action\*(Aq => \*(Aqprocess.cgi\*(Aq, \& \& #new code auto\-detects form types (radio not yet supported) \& #\*(Aqform_elements\*(Aq => [ qw( textfield1 textfield2 checkbox1 radio1 select1 ) ], \& \*(Aqform_elements\*(Aq => [ qw( textfield1 textfield2 checkbox1 radio1 select1 ) ], \& \& #deprecated style still works for now \& #\*(Aqform_text\*(Aq => [ qw( textfield1 textfield2 ) ], \& #\*(Aqform_checkbox\*(Aq => [ qw( checkbox1 ) ], \& #\*(Aqform_radio\*(Aq => [ qw( radio1 ) ], \& #\*(Aqform_select\*(Aq => [ qw( select1 ) ], \& \& \*(Aqlayer_callback\*(Aq => sub { \& my $layer = shift; \& my $html = qq!!; \& $html .= $other_stuff; \& $html; \& }, \& ); \& \& print \*(Aq
\*(Aq. \& \*(Aq\*(Aq. \& \*(Aq\*(Aq. \& \*(Aq\*(Aq. \& $widget\->html; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module implements an \s-1HTML\s0 widget with multiple layers. Only one layer is visible at any given time, controlled by a <\s-1SELECT\s0> box. For an example see http://www.420.am/selectlayers/ .PP This \s-1HTML\s0 generated by this module uses JavaScript, but nevertheless attempts to be as cross-browser as possible. The 0.05 release drops Navigator 4 compatibility and has been tested under Mozilla Firefox 1.0.6, \s-1MSIE 6.0,\s0 Konqueror 3.3.2, and Opera 8.0.2 (2006 note: still working under newer browsers such as \s-1IE7,\s0 Firefox 2.0, etc.). .SH "FORMS" .IX Header "FORMS" My understanding is that forms cannot span <\s-1DIV\s0>s elements. The generated \s-1HTML\s0 will have a
tag before the layers and will generate <\s-1FORM\s0> and tags for each layer. To facilitate <\s-1SUBMIT\s0> buttons located within the layers, you can pass a form name and element names, and the relevant values will be copied to the layer's form. See the \fBform_\fR options below. .SH "METHODS" .IX Header "METHODS" .IP "new \s-1KEY, VALUE, KEY, VALUE...\s0" 4 .IX Item "new KEY, VALUE, KEY, VALUE..." Options are passed as name/value pairs: .Sp options \- Hash reference of layers and labels for the <\s-1SELECT\s0>. See Tie::IxHash to control ordering. In \s-1HTML:\s0 <\s-1OPTION\s0 VALUE=\*(L"$layer\*(R">$label .Sp layer_callback \- subroutine reference to create each layer. The layer name is passed as an option in \fI\f(CI@_\fI\fR .Sp selected_layer \- (optional) initially selected layer .Sp form_name \- (optional) Form name to copy values from. If not supplied, no values will be copied. .Sp form_action \- Form action .Sp form_elements \- (optional) Array reference of form fields to copy from the \fBform_name\fR form. Field type is autodetected; currently text, hidden, checkbox, and select fields are supported. Radio fields are not yet supported. .Sp form_text \- (optional) Array reference of text (or hidden) form fields to copy from the \fBform_name\fR form. .Sp form_checkbox \- (optional) Array reference of checkbox form fields to copy from the \fBform_name\fR form. .Sp form_radio \- (optional) Array reference of radio form fields to copy from the \fBform_name\fR form. .Sp form_select \- (optional) Array reference of select form fields to copy from the \fBform_name\fR form. .Sp fixup_callback \- (optional) subroutine reference, returns supplimentary JavaScript for the function described above under \s-1FORMS.\s0 .Sp size \- (optional) size of the <\s-1SELECT\s0>, default 1. .Sp unique_key \- (optional) prepended to all JavaScript function/variable/object names to avoid namespace collisions. .Sp html_beween \- (optional) \s-1HTML\s0 between the <\s-1SELECT\s0> and the layers. .Sp under_position \- (optional) specifies the positioning of any \s-1HTML\s0 appearing after the widget. \fIstatic\fR, the default, positions subsequent \s-1HTML\s0 underneath the current layer (or immediately under the select box if no layer has yet been selected), reflowing when layers are changed. \fIabsolute\fR calculates the size of the largest layer and keeps the subsequent \s-1HTML\s0 in a single position underneath it. Note that \fIabsolute\fR works by positioning subsequent \s-1HTML\s0 in a <\s-1DIV\s0>, so you should probably close it yourself with a before your end tag. \fIabsolute\fR is a bit experimental and might have some quirks with truncating the end of the page under \s-1IE\s0; you might have better results by just making all your layers the exact same size at the moment. .IP "html" 4 .IX Item "html" Returns \s-1HTML\s0 for the widget. .SH "AUTHOR" .IX Header "AUTHOR" Ivan Kohler .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2002\-2005 Ivan Kohler All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "BUGS" .IX Header "BUGS" JavaScript .PP All the different form_* options are unnecessary, could use .type to auto-sense .PP Could give you a function or something for copying variables out of the layered forms. .SH "SEE ALSO" .IX Header "SEE ALSO" perl. Tie::IxHash, http://www.xs4all.nl/~ppk/js/dom.html, http://javascript.about.com/library/scripts/blsafeonload.htm