Mercurial > hg-website
changeset 308:b7d326bc57f9
Detect Mac OS 10.6
author | David Soria Parra <dsp@php.net> |
---|---|
date | Mon, 03 May 2010 09:57:58 +0200 |
parents | 422c3b7cc6d4 |
children | 52ae579c3db4 |
files | .hgsubstate static/js/download.js templates/base.html |
diffstat | 3 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgsubstate Mon May 03 09:26:55 2010 +0200 +++ b/.hgsubstate Mon May 03 09:57:58 2010 +0200 @@ -1,2 +1,2 @@ 94b9005489e807fa19bca790e7f9c9714fd3b32c content -2c5ea51eb0a0c7f440b45c1728ca6697952add3b rendered +101489a15253f144f1059b4a64e03a8a17caff59 rendered
--- a/static/js/download.js Mon May 03 09:26:55 2010 +0200 +++ b/static/js/download.js Mon May 03 09:57:58 2010 +0200 @@ -7,7 +7,14 @@ parse_os: function() { var OSName="Source code"; if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows"; - if (navigator.appVersion.indexOf("Mac")!=-1) OSName="Mac OS X"; + 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";
--- a/templates/base.html Mon May 03 09:26:55 2010 +0200 +++ b/templates/base.html Mon May 03 09:57:58 2010 +0200 @@ -14,7 +14,8 @@ {% set download = downloads[downloads['current']] %} var dl = new Download(); dl.register_download('Windows', "{{ download['Windows']}}"); - dl.register_download('Mac OS X', "{{ download['Mac OS X 10.6']}}"); + dl.register_download('Mac OS X 10.6', "{{ download['Mac OS X 10.6']}}"); + dl.register_download('Mac OS X 10.5', "{{ download['Mac OS X 10.5']}}"); dl.register_download('UNIX', "{{ download['Source code']}}"); dl.register_download('Linux', "{{ download['Source code']}}"); </script>