[PATCH 3 of 3 hg-website] downloads: highlight preferred options with <em>

David Champion dgc at uchicago.edu
Sun Nov 21 12:46:10 CST 2010


# HG changeset patch
# User David Champion <dgc at uchicago.edu>
# Date 1290324361 21600
# Node ID d45e35d2e657183f599a782a27b9f88593a49f28
# Parent  1c5884f6563b9db3fa3267c94535227f6c80e857
downloads: highlight preferred options with <em>

diff -r 1c5884f6563b -r d45e35d2e657 static/css/styles.css
--- a/static/css/styles.css	Sat Nov 20 19:53:07 2010 -0600
+++ b/static/css/styles.css	Sun Nov 21 01:26:01 2010 -0600
@@ -66,6 +66,7 @@
 .latest thead td, .latest thead th { background: #00B5F1; color: #fff; font-weight: bold; }
 thead td, thead th { background: #999; color: #fff; font-weight: bold; }
 tbody td { border-bottom: 1px solid #ccc; }
+tbody td em { font-weight: bolder; }
 
 /*
  * Quotes
diff -r 1c5884f6563b -r d45e35d2e657 static/js/download.js
--- 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
@@ -58,9 +58,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>');




More information about the Mercurial-devel mailing list