Re: [PATCH] gitweb: Cleanup Git logo and Git logo target generation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano wrote:

> Having said that, I am wondering if it is worth doing something
> like this:
> 
> 
> sub img_button {
> 	my $it = $_[0];
> 	my @attr = ();
>         for my $attr (qw(src width height alt class id)) {
> 		next unless exists $it->{$attr};
>                 push @attr, "$attr=\"" . esc_attr($it->{$attr}) . '"';
> 	}
> 	my $img = '<img ' . join(' ', @attr) . ' />';
> 	print $cgi->a({ -href => esc_url($it->{'url'}),
>         		-title => esc_attr($it->{'title'}),
>                       }, $img);
> }
> 
> our %logo = (
> 	# logo image button
> 	src => '++GITWEB_LOGO++',
>         width => 72,
>         height => 27,
> 	alt => 'git logo',
> 
> 	# where that link leads to
>         url => 'http:/git.or.cz/',
> 	title => 'git homepage',
> );

You forgot to add style, i.e. either id => 'logo' or class => 'logo'. 

I'm not sure if it is worth complication. We have similar situation 
(although without image) with $home_link and $home_link_str (as with 
$logo, $logo_url, $logo_label).

I wonder how many people use non-standard logo image, or non standard 
favicon...
-- 
Jakub Narebski
Poland
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]