Unverified Commit 61cd7dfb authored by meskio's avatar meskio Committed by Kali Kaneko

Detect the platform on javascript

parent 4f12d3d5
......@@ -10,6 +10,8 @@
%link(rel="stylesheet" href="/assets/bootstrap.min.css")
%link(rel="stylesheet" href="/assets/font-awesome/css/font-awesome.min.css")
%link(rel="stylesheet" href="/assets/style.css")
%script(src="/assets/js/jquery.min.js")
%script(src="/assets/js/download.js")
%link(rel="icon" href="/favicon.ico" type="image/x-icon")
= html_head_base
%body.home
......@@ -30,7 +32,7 @@
.introtext
= render 'home/intro'
.download.text-left
%a.btn.btn-large.btn-primary{:href => 'install'}
%a.btn.btn-large.btn-primary.download{:href => 'install'}
%i.fa.fa-download.fa-2x
%span
= t :download_bitmask
......
$(document).ready(function() {
$(".download").click(function(e) {
e.preventDefault();
download();
});
});
function download() {
var link = "install";
if (navigator.platform.indexOf("Linux") != -1) {
link = "https://dl.bitmask.net/client/linux/stable/Bitmask-linux64-latest.tar.gz";
}
if (navigator.platform.indexOf("Mac") != -1) {
link = "https://dl.bitmask.net/client/osx/stable/Bitmask-latest.pkg";
}
if (navigator.platform.indexOf("Android") != -1) {
link = "install/android";
}
//if (navigator.platform.indexOf("Win") != -1) {
//}
window.location = link;
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment