[Jifty-commit] r905 - in jifty/branches/jifty-jsan: lib/Jifty/Web/Form

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sun Apr 23 21:15:08 EDT 2006


Author: trs
Date: Sun Apr 23 21:15:08 2006
New Revision: 905

Modified:
   jifty/branches/jifty-jsan/   (props changed)
   jifty/branches/jifty-jsan/MANIFEST
   jifty/branches/jifty-jsan/lib/Jifty/Web/Form/Link.pm

Log:
 r9971 at zot (orig r902):  trs | 2006-04-23 15:52:58 -0400
 
 r9972 at zot (orig r903):  trs | 2006-04-23 15:53:05 -0400
  r9970 at zot:  tom | 2006-04-23 15:52:41 -0400
  Support setting link targets
 


Modified: jifty/branches/jifty-jsan/MANIFEST
==============================================================================
--- jifty/branches/jifty-jsan/MANIFEST	(original)
+++ jifty/branches/jifty-jsan/MANIFEST	Sun Apr 23 21:15:08 2006
@@ -266,3 +266,4 @@
 t/TestApp/t/01-config.t
 t/TestApp/t/02-dispatch.t
 t/TestApp/t/03-static.t
+t/TestApp/web/templates/after

Modified: jifty/branches/jifty-jsan/lib/Jifty/Web/Form/Link.pm
==============================================================================
--- jifty/branches/jifty-jsan/lib/Jifty/Web/Form/Link.pm	(original)
+++ jifty/branches/jifty-jsan/lib/Jifty/Web/Form/Link.pm	Sun Apr 23 21:15:08 2006
@@ -25,8 +25,8 @@
 
 =cut
 
-sub accessors { shift->SUPER::accessors(), qw(url escape_label tooltip); }
-__PACKAGE__->mk_accessors(qw(url escape_label tooltip));
+sub accessors { shift->SUPER::accessors(), qw(url escape_label tooltip target); }
+__PACKAGE__->mk_accessors(qw(url escape_label tooltip target));
 
 =head2 new PARAMHASH
 
@@ -41,7 +41,12 @@
 
 =item tooltip
 
-Additional information about the link target.
+Additional information about the link.
+
+=item target
+
+Target of the link.  Mostly useful when specified as "_blank" to open
+a new window or as the name of a already existing window.
 
 =item escape_label
 
@@ -65,6 +70,7 @@
         tooltip      => undef,
         escape_label => 1,
         class        => '',
+        target       => '',
         @_
     );
 
@@ -99,9 +105,10 @@
         if ( $tooltip and $self->escape_label );
 
     Jifty->web->out(qq(<a));
-    Jifty->web->out(qq( id="@{[$self->id]}"))       if $self->id;
-    Jifty->web->out(qq( class="@{[$self->class]}")) if $self->class;
+    Jifty->web->out(qq( id="@{[$self->id]}"))         if $self->id;
+    Jifty->web->out(qq( class="@{[$self->class]}"))   if $self->class;
     Jifty->web->out(qq( title="@{[$self->tooltip]}")) if $tooltip;
+    Jifty->web->out(qq( target="@{[$self->target]}")) if $self->target;
     Jifty->web->out(qq( href="@{[$self->url]}"));
     Jifty->web->out( $self->javascript() );
     Jifty->web->out(qq(>$label</a>));


More information about the Jifty-commit mailing list