comparison 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
comparison
equal deleted inserted replaced
349:fb3ce83c1a48 350:987caba84824
55 a = a.desc.toLowerCase(); 55 a = a.desc.toLowerCase();
56 b = b.desc.toLowerCase(); 56 b = b.desc.toLowerCase();
57 return (b < a) - (a < b); 57 return (b < a) - (a < b);
58 }); 58 });
59 59
60 var desc;
60 for (i in downloads) { 61 for (i in downloads) {
61 var dl = downloads[i]; 62 var dl = downloads[i];
62 document.write('<tr>\n<td>' + dl.desc + '</td>' + 63 var ua = navigator.userAgent;
64 if (dl.matches(ua))
65 desc = '<em>' + dl.desc + '</em>';
66 else
67 desc = dl.desc;
68 document.write('<tr>\n<td>' + desc + '</td>' +
63 '<td></td>' + 69 '<td></td>' +
64 '<td><a href="' + dl.url + '">download</a></td>' + 70 '<td><a href="' + dl.url + '">download</a></td>' +
65 '</tr>'); 71 '</tr>');
66 } 72 }
67 } 73 }