Re: [PATCHv6 6/8] gitweb: add 'alt' to avatar images

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

 



On Thu, 25 June 2009, Giuseppe Bilotta wrote:

> Without it, text-only browsers display the URL of the avatar, which can
> be long and not very informative. 

Actually different text-only web browsers behave differently (with
default settings).

Before this patch:
 * lynx show basename of the URL of the avatar, which ain't pretty
   [avatar.php?gravatar_id=955680802bc3d50476786bb3ca9cfc52&size=16]
 * elinks doesn't show by default images at all, which means that only
     used for padding will be visible (don't use  ?)
 * w3m show basename of avatar URL without extension nor query string:
   [avatar]

After this patch:
 * lynx   show alt text, i.e. 'gravatar' (no [] to mark as image)
 * elinks show alt text, i.e. 'gravatar' (no [] to mark as image)
 * w3m show alt text, i.e. gravatar, in separate color (also no [])

Lynx Version 2.8.5rel.1
ELinks 0.10.3
w3m version w3m/0.5.1+cvs-1.946

> We use the avatar provider name for the alt text.

I am not sure if 'type of avatar' wouldn't be easier to understand than
'avatar provider name'.  OTOH the latter is more correct.  Perhaps
"We use the avatar provider (type of avatar) for the alt text"?
But that is just nitpicking...

> 
> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@xxxxxxxxx>
> ---
>  gitweb/gitweb.perl |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index d3bc849..3e6786b 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -3294,7 +3294,7 @@ sub git_get_avatar {
>  	# as needed. If no variant puts something in $url, we assume avatars
>  	# are completely disabled/unavailable.
>  	if ($url) {
> -		return $pre_white . "<img class=\"avatar\" src=\"$url\" />" . $post_white;
> +		return $pre_white . "<img class=\"avatar\" src=\"$url\" alt=\"$git_avatar\" />" . $post_white;
>  	} else {
>  		return "";
>  	}

Nice, simple improvement.

> -- 
> 1.6.3.rc1.192.gdbfcb
> 
> 

-- 
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]