Mercurial > hg-website
comparison static/js/download.js @ 303:59e0087c784a
Move javascript directory to js directory
We have a nameclash on the server as a common javascript directory is mapped to
/javascript. So that we do not clash we use our own one named js.
author | David Soria Parra <dsp@php.net> |
---|---|
date | Tue, 09 Mar 2010 02:24:24 +0100 |
parents | static/javascript/download.js@dd7fababf8b6 |
children | b7d326bc57f9 |
comparison
equal
deleted
inserted
replaced
302:dc2f9b48714e | 303:59e0087c784a |
---|---|
1 function Download() { | |
2 this.downloads = new Array(); | |
3 } | |
4 | |
5 Download.prototype = { | |
6 | |
7 parse_os: function() { | |
8 var OSName="Source code"; | |
9 if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows"; | |
10 if (navigator.appVersion.indexOf("Mac")!=-1) OSName="Mac OS X"; | |
11 if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX"; | |
12 if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux"; | |
13 | |
14 return OSName; | |
15 }, | |
16 | |
17 os_detection: function() { | |
18 document.write(this.parse_os()); | |
19 }, | |
20 | |
21 os_link: function() { | |
22 document.location.href = this.downloads[this.parse_os()]; | |
23 }, | |
24 | |
25 register_download:function(type, url) { | |
26 this.downloads[type] = url; | |
27 } | |
28 } |