Skip to content

Commit

Permalink
Add version number in title
Browse files Browse the repository at this point in the history
  • Loading branch information
Vianpyro committed Sep 24, 2024
1 parent 3d7536e commit f5ea060
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<body>
<header>
<h1>Flashcards</h1>
<h1 id="app-title">Flashcards</h1>

<div id="file-input-buttons">
<div id="import-quizz">
Expand Down
10 changes: 9 additions & 1 deletion src/javascript/flashcard.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
document.addEventListener("DOMContentLoaded", () => {
// Get references to various HTML elements
const appTitle = document.getElementById("app-title");
const flipper = document.querySelector("#flipper");
const nextButton = document.getElementById("next-button");
const randomButton = document.getElementById("shuffle-button");
Expand Down Expand Up @@ -159,7 +160,6 @@ document.addEventListener("DOMContentLoaded", () => {
}
});


// Handle the "Add Flashcard" button click event
addFlashcard.addEventListener("click", () => {
const newFlashcard = {
Expand Down Expand Up @@ -255,6 +255,14 @@ document.addEventListener("DOMContentLoaded", () => {
}
}
});

// Retrieve the latest version of the application on Github
fetch("https://api.github.com/repos/Vianpyro/flashcards/releases/latest")
.then(response => response.json())
.then(data => {
const latestVersion = data.name;
appTitle.title = latestVersion;
});
});

// Display a Base64 image
Expand Down

0 comments on commit f5ea060

Please sign in to comment.