Mercurial > hg-website
diff static/js/download.js @ 350:987caba84824
downloads: highlight preferred options with <em>
author | David Champion <dgc@uchicago.edu> |
---|---|
date | Sun, 21 Nov 2010 01:26:01 -0600 |
parents | fb3ce83c1a48 |
children | e4d31654a9d3 |
line wrap: on
line diff
--- a/static/js/download.js Sat Nov 20 19:53:07 2010 -0600 +++ b/static/js/download.js Sun Nov 21 01:26:01 2010 -0600 @@ -57,9 +57,15 @@ return (b < a) - (a < b); }); + var desc; for (i in downloads) { var dl = downloads[i]; - document.write('<tr>\n<td>' + dl.desc + '</td>' + + var ua = navigator.userAgent; + if (dl.matches(ua)) + desc = '<em>' + dl.desc + '</em>'; + else + desc = dl.desc; + document.write('<tr>\n<td>' + desc + '</td>' + '<td></td>' + '<td><a href="' + dl.url + '">download</a></td>' + '</tr>');