From: Jakub Narebski Date: Tue, 20 Jun 2006 08:12:31 GMT Subject: [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells Message-ID: <200606201012.31684.jnareb@gmail.com> This allows to see full, unshortened value on mouseover using 'title' attribute for element. For now it means only author name and project owner name. Ugly solution using $cgi->start_td({-title => VALUE}) Doesn't work well with values outside us-ascii, but that might be considered web browser bug (misfeature), not a bug in gitweb. --- The idea is to have full value available on mouseover, be it commit title, author of the commit, project owner, tag name/title or project description. For now only author name and project owner name are implemented, and implementation is ugly and results is not perfect. gitweb/gitweb.cgi | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) b72280ac4649d54375732de771f7d92c7d350258 diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi index 1b254df..9a09b20 100755 --- a/gitweb/gitweb.cgi +++ b/gitweb/gitweb.cgi @@ -887,7 +887,7 @@ sub git_project_list { $alternate ^= 1; print "" . $cgi->a({-href => "$my_uri?" . esc_param("p=$pr->{'path'};a=summary"), -class => "list"}, esc_html($pr->{'path'})) . "\n" . "$pr->{'descr'}\n" . - "" . chop_str($pr->{'owner'}, 15) . "\n"; + $cgi->start_td({-title => $pr->{'owner'}}) . chop_str($pr->{'owner'}, 15) . "\n"; my $colored_age; if ($pr->{'commit'}{'age'} < 60*60*2) { $colored_age = "$pr->{'commit'}{'age_string'}"; @@ -1057,7 +1057,7 @@ sub git_summary { $ref = " " . esc_html($refs->{$commit}) . ""; } print "$co{'age_string'}\n" . - "" . esc_html(chop_str($co{'author_name'}, 10)) . "\n" . + $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 10)) . "\n" . ""; if (length($co{'title_short'}) < length($co{'title'})) { print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list", -title => "$co{'title'}"}, @@ -2306,7 +2306,7 @@ sub git_history { } $alternate ^= 1; print "$co{'age_string_date'}\n" . - "" . esc_html(chop_str($co{'author_name'}, 15, 3)) . "\n" . + $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 15, 3)) . "\n" . "" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list"}, "" . esc_html(chop_str($co{'title'}, 50)) . "$ref") . "\n" . "" . @@ -2396,7 +2396,7 @@ sub git_search { } $alternate ^= 1; print "$co{'age_string_date'}\n" . - "" . esc_html(chop_str($co{'author_name'}, 15, 5)) . "\n" . + $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 15, 5)) . "\n" . "" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$co{'id'}"), -class => "list"}, "" . esc_html(chop_str($co{'title'}, 50)) . "
"); my $comment = $co{'comment'}; @@ -2449,7 +2449,7 @@ sub git_search { } $alternate ^= 1; print "$co{'age_string_date'}\n" . - "" . esc_html(chop_str($co{'author_name'}, 15, 5)) . "\n" . + $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 15, 5)) . "\n" . "" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$co{'id'}"), -class => "list"}, "" . esc_html(chop_str($co{'title'}, 50)) . "
"); @@ -2537,7 +2537,7 @@ sub git_shortlog { } $alternate ^= 1; print "$co{'age_string_date'}\n" . - "" . esc_html(chop_str($co{'author_name'}, 10)) . "\n" . + $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 10)) . "\n" . ""; if (length($co{'title_short'}) < length($co{'title'})) { print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list", -title => "$co{'title'}"}, -- 1.3.0