From: ivan Date: Wed, 24 Aug 2005 13:50:44 +0000 (+0000) Subject: 0.05 X-Git-Tag: HTML_Widgets_SelectLayers_0_05 X-Git-Url: http://git.freeside.biz/gitweb/?p=HTML-Widgets-SelectLayers.git;a=commitdiff_plain;h=f1b912124552474bb635f697e1a6fd34f2ddb40d 0.05 --- diff --git a/Changes b/Changes index ddb72ce..9ae3de3 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,11 @@ Revision history for Perl extension HTML::Widgets::SelectLayers. +0.05 Wed Aug 24 06:31:24 PDT 2005 + - Long overdue: remove NN4 support. + - Add under_position option, based on a patch from Ricardo SIGNES + - set zIndex foo, hopefully selected layer will be active in IE + properly now + 0.04 Fri Jan 30 23:23:28 2004 - fix for pre-5.8 versions. *sigh* diff --git a/SelectLayers.pm b/SelectLayers.pm index e7cca4c..f37c90a 100644 --- a/SelectLayers.pm +++ b/SelectLayers.pm @@ -3,7 +3,7 @@ package HTML::Widgets::SelectLayers; use strict; use vars qw($VERSION); -$VERSION = '0.04'; +$VERSION = '0.05'; =head1 NAME @@ -35,7 +35,7 @@ HTML::Widgets::SelectLayers - Perl extension for selectable HTML layers }, ); - print '
'. + print ''. ''. ''. ''. @@ -48,15 +48,15 @@ is visible at any given time, controlled by a ESELECTE box. For an example see http://www.420.am/selectlayers/ This HTML generated by this module uses JavaScript, but nevertheless attempts -to be as cross-browser as possible, testing for features via DOM support rather -than specific browsers or versions. It has been tested under Mozilla 0.9.8, -Netscape 4.77, IE 5.5, Konqueror 2.2.2, and Opera 5.0. +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, MSIE 6.0, +Konqueror 3.3.2, and Opera 8.0.2. =head1 FORMS -Not all browsers seem happy with forms that span layers. The generated HTML -will have a E/FORME tag before the layers and will generate -EFORME and E/FORME tags for each layer. To facilitate +My understanding is that forms cannot span EDIVEs elements. The +generated HTML will have a E/FORME tag before the layers and will +generate EFORME and E/FORME tags for each layer. To facilitate ESUBMITE 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 B options below. @@ -105,6 +105,8 @@ unique_key - (optional) prepended to all JavaScript function/variable/object html_beween - (optional) HTML between the ESELECTE and the layers. +under_position - (optional) specifies the positioning of any HTML appearing after the widget. I, the default, positions subsequent HTML underneath the current layer (or immediately under the select box if no layer has yet been selected), reflowing when layers are changed. I calculates the size of the largest layer and keeps the subsequent HTML in a single position underneath it. Note that I works by positioning subsequent HTML in a EDIVE, so you should probably close it yourself with a E/DIVE before your E/HTMLE end tag. I is a bit experimental and might have some quirks with truncating the end of the page under IE; you might have better results by just making all your layers the exact same size at the moment. + =cut sub new { @@ -137,34 +139,35 @@ sub html { my $form_select = exists($self->{form_select}) ? $self->{form_select} : []; + my $under_position = + exists($self->{under_position}) ? $self->{under_position} : 'static'; + my $hidden = lc($under_position) eq 'absolute' + ? 'visibility: hidden; position: absolute; z-index: 0' + : 'display: none; z-index: 0'; + #my $show = lc($under_position) eq 'absolute' + # ? 'visibility: visible' + # : 'display: "" '; + my $html = $self->_safeonload. $self->_visualize. "". $self->_changed. $self->_fixup. - $self->_select. $between. ''; + $self->_select. $between. ''. + ""; #foreach my $layer ( 'konq_kludge', keys %$options ) { foreach my $layer ( keys %$options ) { #start layer - my $visibility = "hidden"; + $html .= < - if (document.getElementById) { - document.write("
"); - } else { -END - $visibility="show" if $visibility eq "visible"; - $html .= <"); - } - +
END #form fields $html .= < +
END foreach my $f ( @$form_text, @$form_checkbox, @$form_radio, @$form_select ) { @@ -179,18 +182,24 @@ END #end form & layer $html .= < - +
END } + if ( $under_position eq 'absolute' ) { + $html .= < + //var max = ${key}maxHeight; + document.write("
"); + +END + } + $html; } @@ -253,7 +262,7 @@ sub _select {