Skip to content

Auto corrected by following Format Javascript Code #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions js/app.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
document.addEventListener("DOMContentLoaded", function(event) {
document.addEventListener("DOMContentLoaded", function (event) {
var currentLinks = document.querySelectorAll('a[href="' + window.location.pathname + '"]');
currentLinks.forEach(function(link) { link.classList.add('current'); });
currentLinks.forEach(function (link) {
link.classList.add("current");
});

var macDownloadLink = document.getElementById('mac-download');
var macDownloadLink = document.getElementById("mac-download");
if (macDownloadLink) {
macDownloadLink.addEventListener('click', function(event) {
macDownloadLink.addEventListener("click", function (event) {
event.preventDefault();
fetch('https://api.github.com/repos/synvert-hq/synvert-gui/releases/latest')
.then(response => response.json())
.then(data => {
const zipAsset = data.assets.find(asset => asset.content_type === 'application/zip');
fetch("https://api.github.com/repos/synvert-hq/synvert-gui/releases/latest")
.then((response) => response.json())
.then((data) => {
const zipAsset = data.assets.find((asset) => asset.content_type === "application/zip");
if (zipAsset) {
window.location.href = zipAsset.browser_download_url;
}
})
.catch(error => console.error('Error:', error));
.catch((error) => console.error("Error:", error));
});
}

var winDownloadLink = document.getElementById('win-download');
var winDownloadLink = document.getElementById("win-download");
if (winDownloadLink) {
winDownloadLink.addEventListener('click', function(event) {
winDownloadLink.addEventListener("click", function (event) {
event.preventDefault();
fetch('https://api.github.com/repos/synvert-hq/synvert-gui/releases/latest')
.then(response => response.json())
.then(data => {
const zipAsset = data.assets.find(asset => asset.content_type === 'application/x-msdos-program');
fetch("https://api.github.com/repos/synvert-hq/synvert-gui/releases/latest")
.then((response) => response.json())
.then((data) => {
const zipAsset = data.assets.find((asset) => asset.content_type === "application/x-msdos-program");
if (zipAsset) {
window.location.href = zipAsset.browser_download_url;
}
})
.catch(error => console.error('Error:', error));
.catch((error) => console.error("Error:", error));
});
}
});
});