r1566 - in packages/libhtml-fillinform-perl/trunk: . debian lib/HTML

Gunnar Wolf gwolf at costa.debian.org
Mon Dec 5 17:43:22 UTC 2005


Author: gwolf
Date: 2005-12-05 17:43:22 +0000 (Mon, 05 Dec 2005)
New Revision: 1566

Modified:
   packages/libhtml-fillinform-perl/trunk/Changes
   packages/libhtml-fillinform-perl/trunk/META.yml
   packages/libhtml-fillinform-perl/trunk/Makefile.PL
   packages/libhtml-fillinform-perl/trunk/debian/changelog
   packages/libhtml-fillinform-perl/trunk/lib/HTML/FillInForm.pm
Log:
New upstream version


Modified: packages/libhtml-fillinform-perl/trunk/Changes
===================================================================
--- packages/libhtml-fillinform-perl/trunk/Changes	2005-12-05 17:42:25 UTC (rev 1565)
+++ packages/libhtml-fillinform-perl/trunk/Changes	2005-12-05 17:43:22 UTC (rev 1566)
@@ -1,3 +1,9 @@
+1.06 - October 13th, 2005
+
+Distinguish between selects with and without the multiple attribute set (Alexander Hartmaier)
+
+Added warnings to PREREQ_PM
+
 1.05 - December 19th, 2004
 
 Added new tests in 19_extra.t (Vsevolod (Simon) Ilyushchenko)

Modified: packages/libhtml-fillinform-perl/trunk/META.yml
===================================================================
--- packages/libhtml-fillinform-perl/trunk/META.yml	2005-12-05 17:42:25 UTC (rev 1565)
+++ packages/libhtml-fillinform-perl/trunk/META.yml	2005-12-05 17:43:22 UTC (rev 1566)
@@ -1,11 +1,12 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         HTML-FillInForm
-version:      1.05
+version:      1.06
 version_from: lib/HTML/FillInForm.pm
 installdirs:  site
 requires:
     HTML::Parser:                  3.26
+    warnings:                      0
 
 distribution_type: module
 generated_by: ExtUtils::MakeMaker version 6.17

Modified: packages/libhtml-fillinform-perl/trunk/Makefile.PL
===================================================================
--- packages/libhtml-fillinform-perl/trunk/Makefile.PL	2005-12-05 17:42:25 UTC (rev 1565)
+++ packages/libhtml-fillinform-perl/trunk/Makefile.PL	2005-12-05 17:43:22 UTC (rev 1566)
@@ -4,5 +4,8 @@
 WriteMakefile(
     'NAME'		=> 'HTML::FillInForm',
     'VERSION_FROM'	=> 'lib/HTML/FillInForm.pm', # finds $VERSION
-    'PREREQ_PM'		=> {HTML::Parser => 3.26}, # e.g., Module::Name => 1.1
+    'PREREQ_PM'		=> {
+	HTML::Parser => 3.26,
+        warnings => 0
+      },
 );

Modified: packages/libhtml-fillinform-perl/trunk/debian/changelog
===================================================================
--- packages/libhtml-fillinform-perl/trunk/debian/changelog	2005-12-05 17:42:25 UTC (rev 1565)
+++ packages/libhtml-fillinform-perl/trunk/debian/changelog	2005-12-05 17:43:22 UTC (rev 1566)
@@ -1,3 +1,9 @@
+libhtml-fillinform-perl (1.06-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Gunnar Wolf <gwolf at debian.org>  Mon,  5 Dec 2005 11:38:53 -0600
+
 libhtml-fillinform-perl (1.05-2) unstable; urgency=low
 
   * Added debian/watch

Modified: packages/libhtml-fillinform-perl/trunk/lib/HTML/FillInForm.pm
===================================================================
--- packages/libhtml-fillinform-perl/trunk/lib/HTML/FillInForm.pm	2005-12-05 17:42:25 UTC (rev 1565)
+++ packages/libhtml-fillinform-perl/trunk/lib/HTML/FillInForm.pm	2005-12-05 17:43:22 UTC (rev 1566)
@@ -12,7 +12,7 @@
 require 5.005;
 
 use vars qw($VERSION @ISA);
-$VERSION = '1.05';
+$VERSION = '1.06';
 
 @ISA = qw(HTML::Parser);
 
@@ -173,13 +173,26 @@
       $value = $self->escapeHTMLStringOrList($value);
       $value = [ $value ] unless ( ref($value) eq 'ARRAY' );
       delete $attr->{selected} if exists $attr->{selected};
-
+      
       if(defined($attr->{'value'})){
         # option tag has value attr - <OPTION VALUE="foo">bar</OPTION>
-	foreach my $v ( @$value ) {
-	  if ( $attr->{'value'} eq $v ) {
-	    $attr->{selected} = 'selected';
-	  }
+        
+        if ($self->{selectMultiple}){
+          # check if the option tag belongs to a multiple option select
+	  foreach my $v ( @$value ) {
+	    if ( $attr->{'value'} eq $v ){
+	      $attr->{selected} = 'selected';
+	    }
+          }
+        } else {
+          # if not every value of a fdat ARRAY belongs to a different select tag
+          if (not $self->{selectSelected}){
+	    if ( $attr->{'value'} eq $value->[0]){
+	      shift @$value if ref($value) eq 'ARRAY';
+	      $attr->{selected} = 'selected';
+              $self->{selectSelected} = 1; # remeber that an option tag is selected for this select tag
+	    }
+          }
         }
       } else {
         # option tag has no value attr - <OPTION>bar</OPTION>
@@ -208,6 +221,12 @@
     }
   } elsif ($tagname eq 'select'){
     $self->{selectName} = $attr->{'name'};
+    if (defined $attr->{'multiple'}){
+      $self->{selectMultiple} = 1; # helper var to remember if the select tag has the multiple attr set or not
+    } else {
+      $self->{selectMultiple} = 0;
+      $self->{selectSelected} = 0; # helper var to remember if an option was already selected in the current select tag
+    }
     $self->{output} .= $origtext;
   } else {
     $self->{output} .= $origtext;
@@ -452,11 +471,11 @@
 
 Using HTML::FillInForm from HTML::Mason is covered in the FAQ on
 the masonhq.com website at
-L<http://www.masonhq.com/docs/faq/#how_can_i_integrate_html_fillin>
+L<http://www.masonhq.com/?FAQ:HTTPAndHTML#h-how_can_i_populate_form_values_automatically_>
 
 =head1 VERSION
 
-This documentation describes HTML::FillInForm module version 1.04.
+This documentation describes HTML::FillInForm module version 1.06.
 
 =head1 SECURITY
 
@@ -490,18 +509,15 @@
 insert CGI data into forms, but require that you mix HTML with Perl.
 
 There is a nice review of the module available here:
-http://www.perlmonks.org/index.pl?node_id=274534
+L<http://www.perlmonks.org/index.pl?node_id=274534>
 
 =head1 AUTHOR
 
-(c) 2004 TJ Mather, Maxmind LLC, tjmather at maxmind.com
+(c) 2005 TJ Mather, tjmather at maxmind.com, L<http://www.maxmind.com/>
 
 All rights reserved. This package is free software; you can
 redistribute it and/or modify it under the same terms as Perl itself.
 
-Paid support is available from directly from the author of this package.
-Please see L<http://www.maxmind.com/app/opensourceservices> for more details.
-
 =head1 SEE ALSO
 
 L<HTML::Parser>, L<Data::FormValidator>, L<HTML::Template>, L<Apache::PageKit>




More information about the Pkg-perl-cvs-commits mailing list