[Jifty-commit] r1778 - in jifty/trunk: lib/Jifty/Web
lib/Jifty/Web/Form
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Tue Aug 8 14:19:32 EDT 2006
Author: jesse
Date: Tue Aug 8 14:19:01 2006
New Revision: 1778
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Web/Form/Clickable.pm
jifty/trunk/lib/Jifty/Web/Menu.pm
Log:
r15136 at pinglin: jesse | 2006-08-08 14:17:16 -0400
Added the ability to support target attributes in menu items and clickables
Modified: jifty/trunk/lib/Jifty/Web/Form/Clickable.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Form/Clickable.pm (original)
+++ jifty/trunk/lib/Jifty/Web/Form/Clickable.pm Tue Aug 8 14:19:01 2006
@@ -25,10 +25,10 @@
sub accessors {
shift->SUPER::accessors,
- qw(url escape_label tooltip continuation call returns submit preserve_state render_as_button render_as_link);
+ qw(url escape_label tooltip continuation call returns submit target preserve_state render_as_button render_as_link);
}
__PACKAGE__->mk_accessors(
- qw(url escape_label tooltip continuation call returns submit preserve_state render_as_button render_as_link)
+ qw(url escape_label tooltip continuation call returns submit target preserve_state render_as_button render_as_link)
);
=head2 new PARAMHASH
@@ -115,6 +115,12 @@
-- it allows you to make any simple GET request into a POST request,
while still appearing as a link (a GET request).
+=item target
+
+For things that start off as links, give them an html C<target> attribute.
+
+=cut
+
=item Anything from L<Jifty::Web::Form::Element>
Note that this includes the C<onclick> parameter, which allows
@@ -453,6 +459,7 @@
{ %$args,
escape_label => $self->escape_label,
url => $self->complete_url,
+ target => $self->target,
@_ }
);
return $link;
Modified: jifty/trunk/lib/Jifty/Web/Menu.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Menu.pm (original)
+++ jifty/trunk/lib/Jifty/Web/Menu.pm Tue Aug 8 14:19:01 2006
@@ -3,7 +3,7 @@
use base qw/Class::Accessor::Fast/;
use URI;
-__PACKAGE__->mk_accessors(qw(label parent sort_order link escape_label class));
+__PACKAGE__->mk_accessors(qw(label parent sort_order link target escape_label class));
=head2 new PARAMHASH
@@ -43,6 +43,12 @@
you're looking to do complex ajaxy things with menus, this is likely
the option you want.
+=head2 target [STRING]
+
+Get or set the frame or pseudo-target for this link. something like L<_blank>
+
+=cut
+
=head2 class [STRING]
Gets or sets the CSS class the link should have in addition to the default
@@ -266,6 +272,7 @@
return Jifty->web->link( label => _( $self->label ),
url => $self->url,
escape_label => $self->escape_label,
+ target => $self->target,
class => $self->class );
} else {
return _( $self->label );
More information about the Jifty-commit
mailing list