Thread (6 messages) flat view 6 messages, 3 authors, 2016-06-15

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

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:42:42

Possibly related (same subject, not in this thread)

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help