[Slashdotjp-dev 570] CVS update: slashjp/Slash/Display

アーカイブの一覧に戻る

Tatsuki SUGIURA sugi****@users*****
2006年 7月 14日 (金) 10:54:25 JST


Index: slashjp/Slash/Display/Display.pm
diff -u slashjp/Slash/Display/Display.pm:1.4 slashjp/Slash/Display/Display.pm:1.5
--- slashjp/Slash/Display/Display.pm:1.4	Wed Jul 12 20:41:39 2006
+++ slashjp/Slash/Display/Display.pm	Fri Jul 14 10:54:25 2006
@@ -1,7 +1,7 @@
 # This code is a part of Slash, and is released under the GPL.
 # Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: Display.pm,v 1.4 2006/07/12 11:41:39 sugi Exp $
+# $Id: Display.pm,v 1.5 2006/07/14 01:54:25 sugi Exp $
 
 package Slash::Display;
 
@@ -50,7 +50,7 @@
 use base 'Exporter';
 use vars qw($VERSION @EXPORT @EXPORT_OK $CONTEXT %FILTERS $TEMPNAME);
 
-($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.5 $ ' =~ /\$Revision:\s+([^\s]+)/;
 @EXPORT	   = qw(slashDisplay slashDisplayName);
 @EXPORT_OK = qw(get_template);
 my(%objects);
@@ -357,6 +357,7 @@
 	strip_notags		=> \&strip_notags,
 	strip_plaintext		=> \&strip_plaintext,
 	strip_mode		=> [ $strip_mode, 1 ],
+	chopEntity		=> [ \&chopEntityFactory, 1],
 	%FILTERS
 );
 
@@ -577,6 +578,15 @@
 	}
 }
 
+sub chopEntityFactory {
+	my $l = $_[1];
+	return sub {
+		my $s = shift;
+		my $r = &chopEntity($s, $l || 80);
+		$r . ($s ne $r ? "..." : "");
+	};
+}
+
 1;
 
 __END__


Slashdotjp-dev メーリングリストの案内
アーカイブの一覧に戻る