[tor-commits] [atlas/master] Adds alt attributes to images for country flags and relay flags (Fixes: #21291)

irl at torproject.org irl at torproject.org
Fri Jan 27 13:08:37 UTC 2017


commit 29d59a8f4579278a2f1383d76238559487ca4c91
Author: Iain R. Learmonth <irl at fsfe.org>
Date:   Tue Jan 24 23:01:45 2017 +0000

    Adds alt attributes to images for country flags and relay flags (Fixes: #21291)
    
    In cases where there is no other text and the meaning is conveyed only in the
    icon, this adds alt text explaining the icon. In cases where the icon is next
    to text that explains the icon, the alt attribute is specified as an empty
    string as recommended by the HTML 5 specification.
---
 templates/details/bridge.html | 2 +-
 templates/details/router.html | 4 ++--
 templates/search/do.html      | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/templates/details/bridge.html b/templates/details/bridge.html
index 33f606c..99ffdd3 100644
--- a/templates/details/bridge.html
+++ b/templates/details/bridge.html
@@ -44,7 +44,7 @@
 
     <dt><span class="tip" data-content="Flags that the directory authorities assigned to this bridge." data-original-title="Bridge flags">Flags</span></dt>
     <dd><% _.each(relay.get('flags'), function(flag) { %>
-        <img class="inline" src="img/flags/<%= flag[1] %>.png">
+        <img class="inline" alt="" src="img/flags/<%= flag[1] %>.png">
         <span class="inline"><%= flag[0] %></span>
     <% }); %>
     </dd>
diff --git a/templates/details/router.html b/templates/details/router.html
index 7215b05..d94f5cf 100644
--- a/templates/details/router.html
+++ b/templates/details/router.html
@@ -76,13 +76,13 @@
 
     <dt><span class="tip" data-content="Flags that the directory authorities assigned to this relay." data-original-title="Relay flags">Flags</span></dt>
     <dd><% _.each(relay.get('flags'), function(flag) { %>
-        <img class="inline" src="img/flags/<%= flag[1] %>.png">
+        <img class="inline" alt="" src="img/flags/<%= flag[1] %>.png">
         <span class="inline"><%= flag[0] %></span>
     <% }); %>
     </dd>
 
     <dt><span class="tip" data-content="Country as found in a GeoIP database by resolving the relay's first onion-routing address." data-original-title="Country">Country</span></dt>
-    <dd><img class="inline country" title="<%= relay.get('countryname') %>" src="img/cc/<%= relay.get('country') %>.png"/> <%= relay.get('countryname') %></dd>
+    <dd><img class="inline country" title="<%= relay.get('countryname') %>" alt="" src="img/cc/<%= relay.get('country') %>.png"/> <%= relay.get('countryname') %></dd>
 
     <dt><span class="tip" data-content="Autonomous System Number" data-original-title="AS Number">AS Number</span></dt>
     <dd><%= _.escape(relay.get('as_no')) %></dd>
diff --git a/templates/search/do.html b/templates/search/do.html
index eac2abe..ebb2508 100644
--- a/templates/search/do.html
+++ b/templates/search/do.html
@@ -87,13 +87,13 @@
             </td>
 			<td>
             <% if ( relay.get('country')) { %>
-            <img class="inline country" title="<%= relay.get('countryname') %>" src="img/cc/<%= relay.get('country') %>.png"/>
+            <img class="inline country" title="<%= relay.get('countryname') %>" alt="<%= relay.get('countryname') %>" src="img/cc/<%= relay.get('country') %>.png"/>
             <% } %>
             </td>
 			<td><%= relay.get('or_address') %></td>
 			<td>
             <% _.each(relay.get('flags'), function(flag) { %>
-            <img class="inline flags" rel="tooltip" src="img/flags/<%= flag[1] %>.png" title="<%= flag[0] %>"/>
+            <img class="inline flags" rel="tooltip" src="img/flags/<%= flag[1] %>.png" alt="<%= flag[0] %>" title="<%= flag[0] %>"/>
             <% }); %>
             </td>
 			<td><%= relay.get('or_port') %></td>



More information about the tor-commits mailing list