X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FHTML%2FZoom%2FFilterBuilder.pm;h=3e487674f5f2719a229c802d1d8e7ced312ccee1;hb=2d0662c077bfd275682acfad25d407e0724ec34f;hp=79a15060aa66ed55c688e66adf1bdb04094349fb;hpb=f0ddc273d86f2229d0a20103206ccc7d82078289;p=catagits%2FHTML-Zoom.git diff --git a/lib/HTML/Zoom/FilterBuilder.pm b/lib/HTML/Zoom/FilterBuilder.pm index 79a1506..3e48767 100644 --- a/lib/HTML/Zoom/FilterBuilder.pm +++ b/lib/HTML/Zoom/FilterBuilder.pm @@ -46,7 +46,7 @@ sub _parse_attribute_args { # allow ->add_to_attribute(name => 'value') # or ->add_to_attribute({ name => 'name', value => 'value' }) - warn "WARNING: Long form args (name => 'class', value => 'x') will be replaced with an incompatible form in the *very near future*." + die "WARNING: Long form arg (name => 'class', value => 'x') is deprecated" if(@_ == 1 && $_[0]->{'name'} && $_[0]->{'value'}); my ($name, $value) = @_ > 1 ? @_ : @{$_[0]}{qw(name value)}; return ($name, $self->_zconfig->parser->html_escape($value)); @@ -463,8 +463,7 @@ Sets an attribute of a given name to a given value for all matching selections. ->select('p') ->set_attribute(class=>'paragraph') ->select('div') - ->set_attribute({name=>'class', value=>'divider'}); - + ->set_attribute({class=>'paragraph', name=>'divider'}); Overrides existing values, if such exist. When multiple L calls are made against the same or overlapping selection sets, the final @@ -475,19 +474,9 @@ call wins. Adds a value to an existing attribute, or creates one if the attribute does not yet exist. You may call this method with either an Array or HashRef of Args. -Here's the 'long form' HashRef: - $html_zoom ->select('p') - ->set_attribute(class=>'paragraph') - ->then - ->add_to_attribute({name=>'class', value=>'divider'}); - -And the exact same effect using the 'short form' Array: - - $html_zoom - ->select('p') - ->set_attribute(class=>'paragraph') + ->set_attribute({class => 'paragraph', name => 'test'}) ->then ->add_to_attribute(class=>'divider');