Unverified Commit e10fb1d7 authored by meskio's avatar meskio Committed by Kali Kaneko

Add platform name to the download button

parent 6475c926
......@@ -34,7 +34,7 @@
.download.text-left
%a.btn.btn-large.btn-primary.download{:href => 'install'}
%i.fa.fa-download.fa-2x
%span
%span.download-text
= t :download_bitmask
= yield :content
#footer
......
$(document).ready(function() {
var platform = platformStr();
$(".download").click(function(e) {
e.preventDefault();
download();
download(platform);
});
if (["linux", "mac", "android"].indexOf(platform) != -1) {
$(".download-text").text("Download Bitmask for " + platform);
}
});
function download() {
function download(platform) {
var link = "install";
switch (platform) {
case "linux":
link = "https://dl.bitmask.net/client/linux/stable/Bitmask-linux64-latest.tar.gz";
break;
case "mac":
link = "https://dl.bitmask.net/client/osx/stable/Bitmask-latest.pkg";
break;
case "android":
link = "install/android";
break;
}
window.location = link;
};
function platformStr() {
if (navigator.platform.indexOf("Linux") != -1) {
link = "https://dl.bitmask.net/client/linux/stable/Bitmask-linux64-latest.tar.gz";
return "linux";
}
if (navigator.platform.indexOf("Mac") != -1) {
link = "https://dl.bitmask.net/client/osx/stable/Bitmask-latest.pkg";
return "mac";
}
if (navigator.platform.indexOf("Android") != -1) {
link = "install/android";
return "android";
}
//if (navigator.platform.indexOf("Win") != -1) {
//}
window.location = link;
};
if (navigator.platform.indexOf("Win") != -1) {
return "win";
}
return "other";
}
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