Commits

php committed b7d326b

Detect Mac OS 10.6

Comments (0)

Files changed (3)

 94b9005489e807fa19bca790e7f9c9714fd3b32c content
-2c5ea51eb0a0c7f440b45c1728ca6697952add3b rendered
+101489a15253f144f1059b4a64e03a8a17caff59 rendered

static/js/download.js

     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";
 

templates/base.html

         {% 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>