[PATCH 2 of 3 hg-website] download: use sources.js instead of jinja static templates

David Soria Parra dsoria at gmx.net
Mon Nov 22 04:50:19 CST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 21.11.2010 19:46, David Champion wrote:
> # HG changeset patch
> # User David Champion <dgc at uchicago.edu>
> # Date 1290304387 21600
> # Node ID 1c5884f6563b9db3fa3267c94535227f6c80e857
> # Parent  7cb309f3e33aa9e2c222482b7d944d91107fcff1
> download: use sources.js instead of jinja static templates
>
> See http://mercurial.selenic.com/wiki/BinaryReleasePlan
>
> 1. [hg-website] update the main page (templates/base.html and
> static/js/download.js) to use sources.js as a dynamic binary release
> information source instead of using a jinja template maintained as part
> of the web site.  templates/data no longer required; removed.
>
> 2. [hg-website-content] update the /downloads page use the sources.js
> information also.
>
> This changes some of the detection and package naming, naturally, but
> that likely must be addressed in latest.dat files or in the protocol for
> creating sources.js.
>

The patches look okay, but please use 4 space indent instead of tabs and
resend the series. There is also a comment about a particular line below.

> diff -r 7cb309f3e33a -r 1c5884f6563b .hgsubstate
> --- a/.hgsubstate	Sat Nov 20 19:56:37 2010 -0600
> +++ b/.hgsubstate	Sat Nov 20 19:53:07 2010 -0600
> @@ -1,2 +1,2 @@
> -571b7970a0ba32b912ec07acad337b9d9669656b content
> +6e7e8b5aa2c317fb1d185265b87d64f054e6c9fa content
>  62caa522bc653951b323f79e9e8fd557a1dd2709 rendered
> diff -r 7cb309f3e33a -r 1c5884f6563b static/js/download.js
> --- a/static/js/download.js	Sat Nov 20 19:56:37 2010 -0600
> +++ b/static/js/download.js	Sat Nov 20 19:53:07 2010 -0600
> @@ -1,40 +1,69 @@
> -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";
> -            }
> -        }
> -        if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX";
> -        if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux";
> +	download: function () {
> +		//alert(this.url);

I don't think this comment is needed ;)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJM6krrAAoJEAT0aMuPE7Z1JsUP/3n+jcMgQRbPv9xfBsjYDmMW
sTFFwAcfZozRF2qbcGVBrw/2QBg8xgVGM3aCNM/nkefPiPutZTDeBFyNRB2Xh04J
Ty3W1TdA1JBACF4fkeXa0a4Tg887+zRTsZJQ/2jVvyJJraLlYE5rsJ8y8JqiT9H2
NmDCNLVvzjAbHQELmBdeBWGL6LALUh+7PSVs1PVOkV3jQU4pTEDjDOR/QFbSs9so
DLyKPS4hOc7aHpoirHf4VtX8L24e/Yx5b71HM03H2hMP5pZpurs3eEatMwYwohSr
vayYQrDhrzlPBIGT8GmhnXmPcwy/GA/kqNHSOMto7nUn/ihMExyw5XeppqPYN4bX
uqpIVqnWaV6ohM/v/SE0YNrMnL17QTkUR/AD2jyiWIUjrswDB/KxEWCk2PJ5O5fw
Y9TcrTScrRGAAMS+bUXAmNaihHI2GGbhJkTiOAAO2ashSxWURJIIuV0MtlPeFMf7
80AEhas1ufPLWa1vi2wbA9u+dxZX3UH0fLBvr4aSwmcznLez78cYDtV6f6Al1u7P
Hn6Zp1psJoykDNVb2+FDmLMsISanMF8R03BuPsUKMORkGRy1vN2MIN85AT8ZWwtU
CxYYPcm0gYXABtSJmKNzn3cdrF2b2hktjlUvgJTZ9prcRQJpHbsq0wmyKobfyGoS
pDiPxhNMAxFeqdt8q8Wb
=B0oU
-----END PGP SIGNATURE-----


More information about the Mercurial-devel mailing list