Skip to content
Snippets Groups Projects
Verified Commit 1083903e authored by meskio's avatar meskio :tent:
Browse files

Detect the platform on javascript

parent 52406dc6
No related branches found
No related tags found
No related merge requests found
......@@ -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;
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment