Changeset - 40c6fb22f3d6
[Not reviewed]
default
0 2 0
Søren Løvborg - 10 years ago 2015-08-14 16:11:48
sorenl@unity3d.com
misc: remove alt-text from Gravatar images

The alternative text should convey the same information as the image,
something which the text "gravatar" does not. (In a context where the
gravatar is used on its own, the username could be a useful alt-text
- and title-text - but it's not apparent that this is ever the case.)
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/helpers.py
Show inline comments
 
@@ -847,13 +847,13 @@ def gravatar(email_address, cls='', size
 

	
 
    """
 
    src = gravatar_url(email_address, size*2, ssl_enabled)
 

	
 
    #  here it makes sense to use style="width: ..." (instead of, say, a
 
    # stylesheet) because we using this to generate a high-res (retina) size
 
    tmpl = """<img alt="gravatar" class="{cls}" style="width: {size}px; height: {size}px" src="{src}"/>"""
 
    tmpl = '<img alt="" class="{cls}" style="width: {size}px; height: {size}px" src="{src}"/>'
 

	
 
    # if src is empty then there was no gravatar, so we use a font icon
 
    if not src:
 
        tmpl = """<i class="icon-user {cls}" style="font-size: {size}px;"></i>"""
 

	
 
    tmpl = tmpl.format(cls=cls, size=size, src=src)
kallithea/public/js/base.js
Show inline comments
 
@@ -1064,13 +1064,13 @@ var autocompleteHighlightMatch = functio
 
        + "<span class='match'>"
 
        + full.substr(matchindex, snippet.length)
 
        + "</span>" + full.substring(matchindex + snippet.length);
 
};
 

	
 
var gravatar = function(link, size, cssclass) {
 
    var elem = '<img alt="gravatar" class="{2}" style="width: {0}px; height: {0}px" src="{1}"/>'.format(size, link, cssclass);
 
    var elem = '<img alt="" class="{2}" style="width: {0}px; height: {0}px" src="{1}"/>'.format(size, link, cssclass);
 
    if (!link) {
 
        elem = '<i class="icon-user {1}" style="font-size: {0}px;"></i>'.format(size, cssclass);
 
    }
 
    return elem;
 
}
 

	
0 comments (0 inline, 0 general)