Show the rest of the filename if we truncate.
authorSteinar H. Gunderson <sesse@samfundet.no>
Tue, 9 Aug 2005 22:26:38 +0000 (22:26 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Tue, 9 Aug 2005 22:26:38 +0000 (22:26 +0000)
last.pl

diff --git a/last.pl b/last.pl
index 6024739..3576ba9 100755 (executable)
--- a/last.pl
+++ b/last.pl
@@ -58,9 +58,13 @@ for my $t (@thumbnails[0..$pdfweb::config::show_last-1]) {
        close DESC;
 
        if (length($desc) > 30) {
-               $desc = substr($desc, 0, 30) . " ...";
+               # Is this <abbr> abuse?
+               $desc = HTML::Entities::encode_entities(substr($desc, 0, 30)) . " <abbr title=\"" .
+                       HTML::Entities::encode_entities($desc)
+               . "\">...</abbr>";
+       } else {
+               $desc = HTML::Entities::encode_entities($desc);
        }
-       $desc = HTML::Entities::encode_entities($desc);
 
        my $time = (stat($t))[9];
        my $date = POSIX::strftime("%Y-%m-%d %H:%M", localtime($time));