php avatar 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>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.