changeset 315:5bd86f67ebb3

Merge http://hg.grauw.nl/hg-website/
author David Soria Parra <dsp@php.net>
date Mon, 24 May 2010 10:51:18 +0200
parents 8ed8a4121eac (current diff) 657b465caaa2 (diff)
children f510cd3f37fc
files
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/static/js/download.js	Fri May 21 09:14:41 2010 +0200
+++ b/static/js/download.js	Mon May 24 10:51:18 2010 +0200
@@ -1,5 +1,5 @@
 function Download() {
-    this.downloads = new Array();
+    this.downloads = {};
 }
 
 Download.prototype = {
@@ -26,7 +26,12 @@
     },
 
     os_link: function() {
-        document.location.href = this.downloads[this.parse_os()];
+        var os = this.parse_os();
+        if (this.downloads[os]) {
+            document.location.href = this.downloads[os];
+            return false;
+        }
+        return true;
     },
 
     register_download:function(type, url) {
--- a/templates/base.html	Fri May 21 09:14:41 2010 +0200
+++ b/templates/base.html	Mon May 24 10:51:18 2010 +0200
@@ -58,7 +58,7 @@
                     </div>
                     <div class="col">
                         {% block sidebar %}
-                        <a class="download typeface-js" href="#" onClick="javascript:dl.os_link()">
+                        <a class="download typeface-js" href="/downloads" onClick="javascript:return dl.os_link();">
                                     <strong>Download now</strong>
                                     Mercurial <em>{{ downloads['current'] }}</em>
                                     <span><script language="javascript">dl.os_detection();</script></span>