r6710 - in /trunk/libhtml-fillinform-perl: Changes MANIFEST META.yml README debian/changelog lib/HTML/FillInForm.pm t/20_scalarref.t t/21_disable_fields.t t/22_undef.t
dmn at users.alioth.debian.org
dmn at users.alioth.debian.org
Thu Aug 16 07:04:55 UTC 2007
Author: dmn
Date: Thu Aug 16 07:04:55 2007
New Revision: 6710
URL: http://svn.debian.org/wsvn/?sc=1&rev=6710
Log:
* New upstream release
Added:
trunk/libhtml-fillinform-perl/t/20_scalarref.t
- copied unchanged from r6709, branches/upstream/libhtml-fillinform-perl/current/t/20_scalarref.t
trunk/libhtml-fillinform-perl/t/21_disable_fields.t
- copied unchanged from r6709, branches/upstream/libhtml-fillinform-perl/current/t/21_disable_fields.t
trunk/libhtml-fillinform-perl/t/22_undef.t
- copied unchanged from r6709, branches/upstream/libhtml-fillinform-perl/current/t/22_undef.t
Modified:
trunk/libhtml-fillinform-perl/Changes
trunk/libhtml-fillinform-perl/MANIFEST
trunk/libhtml-fillinform-perl/META.yml
trunk/libhtml-fillinform-perl/README
trunk/libhtml-fillinform-perl/debian/changelog
trunk/libhtml-fillinform-perl/lib/HTML/FillInForm.pm
Modified: trunk/libhtml-fillinform-perl/Changes
URL: http://svn.debian.org/wsvn/trunk/libhtml-fillinform-perl/Changes?rev=6710&op=diff
==============================================================================
--- trunk/libhtml-fillinform-perl/Changes (original)
+++ trunk/libhtml-fillinform-perl/Changes Thu Aug 16 07:04:55 2007
@@ -1,3 +1,22 @@
+1.07 - August 2nd, 2007
+
+Added 'disable_fields' method [rt.cpan.org #6342] (Trevor Schellhorn)
+
+Support IE down-level revealed HTML comments [rt.cpan.org #19468] (Michael Peters)
+
+hash is not reset before each() is called [rt.cpan.org #24980] (Simon P. Ditner)
+
+Fix a bug the last plaintext part might be chopped if called via
+scalarref [rt.cpan.org #21750] (Tatsuhiko Miyagawa)
+
+Add support for ID attribute on form tags (name attribute is
+deprecated in xhtml) [rt.cpan.org #27376] (Anthony Ettinger)
+
+Fix bug when passing 0 in array ref to textfields, also see
+[rt.cpan.org #22195] (Paul Miller)
+
+No longer generate warning if empty array as the value for a select attribute is passed (Dave Rolsky)
+
1.06 - October 13th, 2005
Distinguish between selects with and without the multiple attribute set (Alexander Hartmaier)
Modified: trunk/libhtml-fillinform-perl/MANIFEST
URL: http://svn.debian.org/wsvn/trunk/libhtml-fillinform-perl/MANIFEST?rev=6710&op=diff
==============================================================================
--- trunk/libhtml-fillinform-perl/MANIFEST (original)
+++ trunk/libhtml-fillinform-perl/MANIFEST Thu Aug 16 07:04:55 2007
@@ -23,5 +23,8 @@
t/17_xhtml.t
t/18_ignore_fdat.t
t/19_extra.t
+t/20_scalarref.t
+t/21_disable_fields.t
+t/22_undef.t
t/data/form1.html
META.yml Module meta-data (added by MakeMaker)
Modified: trunk/libhtml-fillinform-perl/META.yml
URL: http://svn.debian.org/wsvn/trunk/libhtml-fillinform-perl/META.yml?rev=6710&op=diff
==============================================================================
--- trunk/libhtml-fillinform-perl/META.yml (original)
+++ trunk/libhtml-fillinform-perl/META.yml Thu Aug 16 07:04:55 2007
@@ -1,7 +1,7 @@
# 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.06
+version: 1.07
version_from: lib/HTML/FillInForm.pm
installdirs: site
requires:
Modified: trunk/libhtml-fillinform-perl/README
URL: http://svn.debian.org/wsvn/trunk/libhtml-fillinform-perl/README?rev=6710&op=diff
==============================================================================
--- trunk/libhtml-fillinform-perl/README (original)
+++ trunk/libhtml-fillinform-perl/README Thu Aug 16 07:04:55 2007
@@ -16,7 +16,7 @@
See:
http://rpmfind.net/linux/RPM/cooker/cooker/i586/Mandrake/RPMS/perl-HTML-FillInForm-0.29-2mdk.noarch.html
-Copyright (c) 2002 Thomas J. Mather, tjmather at maxmind.com
+Copyright (c) 2002-2007 Thomas J. Mather, tjmather at 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.
Modified: trunk/libhtml-fillinform-perl/debian/changelog
URL: http://svn.debian.org/wsvn/trunk/libhtml-fillinform-perl/debian/changelog?rev=6710&op=diff
==============================================================================
--- trunk/libhtml-fillinform-perl/debian/changelog (original)
+++ trunk/libhtml-fillinform-perl/debian/changelog Thu Aug 16 07:04:55 2007
@@ -1,3 +1,9 @@
+libhtml-fillinform-perl (1.07-1) UNRELEASED; urgency=low
+
+ * New upstream release
+
+ -- Damyan Ivanov <dmn at debian.org> Thu, 16 Aug 2007 10:04:37 +0300
+
libhtml-fillinform-perl (1.06-3) unstable; urgency=low
* Bumped up standards-version to 3.7.2 (no changes needed)
Modified: trunk/libhtml-fillinform-perl/lib/HTML/FillInForm.pm
URL: http://svn.debian.org/wsvn/trunk/libhtml-fillinform-perl/lib/HTML/FillInForm.pm?rev=6710&op=diff
==============================================================================
--- trunk/libhtml-fillinform-perl/lib/HTML/FillInForm.pm (original)
+++ trunk/libhtml-fillinform-perl/lib/HTML/FillInForm.pm Thu Aug 16 07:04:55 2007
@@ -12,7 +12,7 @@
require 5.005;
use vars qw($VERSION @ISA);
-$VERSION = '1.06';
+$VERSION = '1.07';
@ISA = qw(HTML::Parser);
@@ -38,9 +38,15 @@
? @{ $option{ignore_fields} } : $option{ignore_fields} if exists( $option{ignore_fields} );
$self->{ignore_fields} = \%ignore_fields;
+ my %disable_fields;
+ %disable_fields = map { $_ => 1 } ( ref $option{'disable_fields'} eq 'ARRAY' )
+ ? @{ $option{disable_fields} } : $option{ignore_fields} if exists( $option{disable_fields} );
+ $self->{disable_fields} = \%disable_fields;
+
if (my $fdat = $option{fdat}){
# Copy the structure to prevent side-effects.
my %copy;
+ keys %$fdat; # reset fdat if each or Dumper was called on fdat
while(my($key, $val) = each %$fdat) {
next if exists $ignore_fields{$key};
$copy{ $key } = ref $val eq 'ARRAY' ? [ @$val ] : $val;
@@ -89,6 +95,8 @@
$self->parse($_);
}
}
+
+ $self->eof;
return delete $self->{output};
}
@@ -120,6 +128,13 @@
$self->{output} .= '>';
delete $self->{option_no_value};
}
+
+ # Check if we need to disable this field
+ $attr->{disable} = 1
+ if exists $attr->{'name'} and
+ exists $self->{disable_fields}{ $attr->{'name'} } and
+ $self->{disable_fields}{ $attr->{'name'} } and
+ not ( exists $attr->{disable} and $attr->{disable} );
if ($tagname eq 'input'){
my $value = exists $attr->{'name'} ? $self->_get_param($attr->{'name'}) : undef;
# force hidden fields to have a value
@@ -129,13 +144,22 @@
# check for input type, noting that default type is text
if (!exists $attr->{'type'} ||
$attr->{'type'} =~ /^(text|textfield|hidden|)$/i){
- $value = (shift @$value || '') if ref($value) eq 'ARRAY';
+ if ( ref($value) eq 'ARRAY' ) {
+ $value = shift @$value;
+ $value = '' unless defined $value;
+ }
$attr->{'value'} = $value;
} elsif (lc $attr->{'type'} eq 'password' && $self->{fill_password}) {
- $value = (shift @$value || '') if ref($value) eq 'ARRAY';
+ if ( ref($value) eq 'ARRAY' ) {
+ $value = shift @$value;
+ $value = '' unless defined $value;
+ }
$attr->{'value'} = $value;
} elsif (lc $attr->{'type'} eq 'radio'){
- $value = ($value->[0] || '') if ref($value) eq 'ARRAY';
+ if ( ref($value) eq 'ARRAY' ) {
+ $value = $value->[0];
+ $value = '' unless defined $value;
+ }
# value for radio boxes default to 'on', works with netscape
$attr->{'value'} = 'on' unless exists $attr->{'value'};
if ($attr->{'value'} eq $value){
@@ -168,10 +192,10 @@
$self->{output} .= ">";
} elsif ($tagname eq 'option'){
my $value = $self->_get_param($self->{selectName});
-
- if (defined($value)){
+ $value = [ $value ] unless ( ref($value) eq 'ARRAY' );
+
+ if ( defined $value->[0] ){
$value = $self->escapeHTMLStringOrList($value);
- $value = [ $value ] unless ( ref($value) eq 'ARRAY' );
delete $attr->{selected} if exists $attr->{selected};
if(defined($attr->{'value'})){
@@ -179,7 +203,7 @@
if ($self->{selectMultiple}){
# check if the option tag belongs to a multiple option select
- foreach my $v ( @$value ) {
+ foreach my $v ( grep { defined } @$value ) {
if ( $attr->{'value'} eq $v ){
$attr->{selected} = 'selected';
}
@@ -322,8 +346,25 @@
}
sub comment {
- my ( $self, $text ) = @_;
- $self->{output} .= '<!--' . $text . '-->';
+ my ( $self, $text ) = @_;
+ # if it begins with '[if ' and doesn't end with '<![endif]'
+ # it's a "downlevel-revealed" conditional comment (stupid IE)
+ # or
+ # if it ends with '[endif]' then it's the end of a
+ # "downlevel-revealed" conditional comment
+ if(
+ (
+ ( index($text, '[if ') == 0 )
+ &&
+ ( $text !~ /<!\[endif\]$/ )
+ )
+ ||
+ ( $text eq '[endif]' )
+ ) {
+ $self->{output} .= '<!' . $text . '>';
+ } else {
+ $self->{output} .= '<!--' . $text . '-->';
+ }
}
sub process {
@@ -434,6 +475,12 @@
$output = $fif->fill(scalarref => \$html,
fobject => $q,
ignore_fields => ['prev','next']);
+
+To disable the form from being edited, use the C<disable_fields> options:
+
+ $output = $fif->fill(scalarref => \$html,
+ fobject => $q,
+ disable_fields => [ 'uid', 'gid' ]);
Note that this module does not clear fields if you set the value to undef.
It will clear fields if you set the value to an empty array or an empty string. For example:
@@ -547,5 +594,11 @@
Bill Moseley
James Tolley
Dan Kubb
+ Alexander Hartmaier
+ Paul Miller
+ Anthony Ettinger
+ Simon P. Ditner
+ Michael Peters
+ Trevor Schellhorn
Thanks!
More information about the Pkg-perl-cvs-commits
mailing list