[Jifty-commit] r7573 - jifty/trunk/lib/Jifty/Web/Form/Field

Jifty commits jifty-commit at lists.jifty.org
Thu Oct 22 16:56:09 EDT 2009


Author: sartak
Date: Thu Oct 22 16:56:09 2009
New Revision: 7573

Added:
   jifty/trunk/lib/Jifty/Web/Form/Field/Wikitext.pm

Log:
Add Wikitext widget that renders using Text::WikiFormat

Added: jifty/trunk/lib/Jifty/Web/Form/Field/Wikitext.pm
==============================================================================
--- (empty file)
+++ jifty/trunk/lib/Jifty/Web/Form/Field/Wikitext.pm	Thu Oct 22 16:56:09 2009
@@ -0,0 +1,28 @@
+package Jifty::Web::Form::Field::Wikitext;
+use warnings;
+use strict;
+use base qw/Jifty::Web::Form::Field::Textarea/;
+
+use Text::WikiFormat;
+
+__PACKAGE__->mk_accessors(qw(rows cols));
+
+=head1 NAME
+
+Jifty::Web::Form::Field::Wikitext - A textarea that renders wiki syntax
+
+=head2 canonicalize_value
+
+Renders the value using L<Text::WikiFormat>.
+
+=cut
+
+sub canonicalize_value {
+    my $self = shift;
+    my $text = shift;
+
+    return Text::WikiFormat::format($text);
+}
+
+1;
+


More information about the Jifty-commit mailing list