# HG changeset patch # User David Soria Parra # Date 1290453042 -3600 # Node ID a6c7665d9f67a4d704ec14b9b2f6f7a4ee413d0d # Parent c3b461c0b97fc1d0c022fc3acdbdcca065fc062c# Parent 987caba84824a3b7fa7779e6b9fa0e94429c969b Merge diff -r c3b461c0b97f -r a6c7665d9f67 .hgsubstate diff -r c3b461c0b97f -r a6c7665d9f67 static/css/styles.css --- a/static/css/styles.css Mon Nov 22 20:10:34 2010 +0100 +++ b/static/css/styles.css Mon Nov 22 20:10:42 2010 +0100 @@ -43,6 +43,7 @@ dt { font-weight: bold; margin-top: 10px; } dt em { font-style: normal; display: block; font-weight: normal; } +dd em { font-style: normal; font-weight: bolder; } dd { background: url(../images/bullet.gif) no-repeat 10px .5em; padding-left: 20px; } /* @@ -65,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-style: normal; font-weight: bolder; } /* * Quotes diff -r c3b461c0b97f -r a6c7665d9f67 static/js/download.js --- a/static/js/download.js Mon Nov 22 20:10:34 2010 +0100 +++ b/static/js/download.js Mon Nov 22 20:10:42 2010 +0100 @@ -1,40 +1,74 @@ -function Download() { - this.downloads = {}; +function Download (source) { + this.version = source[0]; + this.regex = source[1]; + this.url = source[2]; + this.desc = source[3]; } Download.prototype = { + matches: function (ua) { + if (ua.match(this.regex)) + return true; + return false; + }, - parse_os: function() { - var OSName="Source code"; - if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows"; - if (navigator.appVersion.indexOf("Mac")!=-1) { - if (navigator.userAgent.indexOf("10.6")!=-1 || /* firefox */ - navigator.userAgent.indexOf("10_6") !=-1) { /* chrome */ - OSName="Mac OS X 10.6"; - } else { - OSName="Mac OS X 10.5"; - } + download: function () { + document.location.href = this.url; + return false; + }, + + attr: function (key) { + return this[key]; + }, + + write: function (key) { + document.write(this[key]); + } +} + + +var Downloader = { + downloads: [], + + init: function (sources) { + for (i in sources) { + var source = new Download(sources[i]); + this.downloads.push(source); } - if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX"; - if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux"; - - return OSName; }, - os_detection: function() { - document.write(this.parse_os()); + select: function () { + var ua = navigator.userAgent; + for (i in this.downloads) { + if (this.downloads[i].matches(ua)) { + return this.downloads[i]; + } + } + return null; }, - os_link: function() { - var os = this.parse_os(); - if (this.downloads[os]) { - document.location.href = this.downloads[os]; - return false; + listall: function () { + // copy the download list + var downloads = this.downloads.slice(0); + // alpha-sort it by description (case-folded) + downloads.sort(function (a, b) { + a = a.desc.toLowerCase(); + b = b.desc.toLowerCase(); + return (b < a) - (a < b); + }); + + var desc; + for (i in downloads) { + var dl = downloads[i]; + var ua = navigator.userAgent; + if (dl.matches(ua)) + desc = '' + dl.desc + ''; + else + desc = dl.desc; + document.write('\n' + desc + '' + + '' + + 'download' + + ''); } - return true; - }, - - register_download:function(type, url) { - this.downloads[type] = url; } -} +}; diff -r c3b461c0b97f -r a6c7665d9f67 static/manual.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/static/manual.dat Mon Nov 22 20:10:42 2010 +0100 @@ -0,0 +1,2 @@ +10 1.7.1 .*Macintosh.*10.6.* http://mercurial.berkwood.com/binaries/Mercurial-1.7.1-py2.6-macosx10.6.zip Mercurial 1.7.1 for MacOS X 10.6 +10 1.7.1 .*Macintosh.*10.5.* http://mercurial.berkwood.com/binaries/Mercurial-1.7.1-py2.5-macosx10.5.zip Mercurial 1.7.1 for MacOS X 10.5 diff -r c3b461c0b97f -r a6c7665d9f67 templates/base.html --- a/templates/base.html Mon Nov 22 20:10:34 2010 +0100 +++ b/templates/base.html Mon Nov 22 20:10:42 2010 +0100 @@ -1,5 +1,3 @@ -{% from 'data' import downloads %} - @@ -8,16 +6,12 @@ + + - - @@ -58,19 +52,16 @@
{% block sidebar %} - + Download now - Mercurial {{ downloads['current'] }} - + Mercurial +
Another OS?
Get Mercurial for:
Mac OS X
Windows
other
- -
Requirements
-
Python 2.4 (already included in binary packages)
{% endblock %}