From: Kay Sievers Date: Wed, 31 Aug 2005 01:47:13 +0000 (+0200) Subject: Show tooltips (like this one :)) containing full titles for truncated commit titles... X-Git-Tag: v1.4.0~1^2~62 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c24fd7b7cc9178af7e1e02d4a0fde549533b56c6;p=git.git Show tooltips (like this one :)) containing full titles for truncated commit titles in the summary and shortlog views. Thanks for the patch to: Timo Hirvonen --- diff --git a/gitweb.cgi b/gitweb.cgi index 6ce922333..e58f246c4 100755 --- a/gitweb.cgi +++ b/gitweb.cgi @@ -15,7 +15,7 @@ use CGI::Carp qw(fatalsToBrowser); use Fcntl ':mode'; my $cgi = new CGI; -my $version = "240"; +my $version = "241"; my $my_url = $cgi->url(); my $my_uri = $cgi->url(-absolute => 1); my $rss_link = ""; @@ -980,9 +980,14 @@ sub git_summary { if ($i-- > 0) { print "$co{'age_string'}\n" . "" . escapeHTML(chop_str($co{'author_name'}, 10)) . "\n" . - "" . - $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit", -class => "list"}, - "" . escapeHTML($co{'title_short'}) . "") . + ""; + if (length($co{'title_short'}) < length($co{'title'})) { + print $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit", -class => "list", -title => "$co{'title'}"}, + "" . escapeHTML($co{'title_short'}) . ""); + } else { + print $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit", -class => "list"}, + "" . escapeHTML($co{'title'}) . ""); + } "\n" . "" . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit"}, "commit") . @@ -2232,8 +2237,15 @@ sub git_shortlog { $alternate ^= 1; print "$co{'age_string_date'}\n" . "" . escapeHTML(chop_str($co{'author_name'}, 10)) . "\n" . - "" . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit", -class => "list"}, "" . - escapeHTML($co{'title_short'}) . "") . "\n" . + ""; + if (length($co{'title_short'}) < length($co{'title'})) { + print $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit", -class => "list", -title => "$co{'title'}"}, + "" . escapeHTML($co{'title_short'}) . ""); + } else { + print $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit", -class => "list"}, + "" . escapeHTML($co{'title_short'}) . ""); + } + print "\n" . "" . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit"}, "commit") . " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$commit"}, "commitdiff") .