Agregado boton OS

This commit is contained in:
Israel Paredes 2023-03-11 13:39:04 -06:00
parent e70bd5e50d
commit bc1e952c35

View file

@ -40,8 +40,40 @@
</div>
<div class="q">
<h2>Office 7.5</h2>
<a href="https://repos.libreoffice.gob.mx/windows/general/x86_64/Office_7.4.4.0_Win_x86-64_en-MX_es.msi" download class="download-button">Descargar</a>
<!--Selección de OS-->
<!--button id="download-button">Descargar</button-->
<download class="download-button" id="download-button">Descargar</a>
<script>
var downloadButton = document.getElementById("download-button");
var OSName = "Unknown OS";
if (navigator.platform.indexOf("Win") != -1) OSName = "Windows";
if (navigator.platform.indexOf("Mac") != -1) OSName = "MacOS";
if (navigator.platform.indexOf("Linux") != -1) OSName = "Linux";
switch (OSName) {
case "Windows":
downloadButton.addEventListener("click", function() {
window.location.href = "https://repos.libreoffice.gob.mx/windows/general/x86_64/Office_7.4.4.0_Win_x86-64_en-MX_es.msi";
});
break;
case "MacOS":
downloadButton.addEventListener("click", function() {
window.location.href = "https://repos.libreoffice.gob.mx/macOS/";
});
break;
case "Linux":
downloadButton.addEventListener("click", function() {
window.location.href = "https://repos.libreoffice.gob.mx/debs-rpm/";
});
break;
default:
downloadButton.disabled = true;
break;
}
</script>
</div>
<div>
<br>