Migrate back to Git LFS
This commit is contained in:
parent
6b34b62aa2
commit
4b6498ede3
237 changed files with 36953 additions and 0 deletions
39
website/res/js/updated.js
Normal file
39
website/res/js/updated.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
const updatedInit = () => {
|
||||
const lastUpdatedElement = document.getElementById("lastUpdated");
|
||||
const updatedLink = document.createElement("a");
|
||||
updatedLink.href =
|
||||
"https://codeberg.org/nadimkobeissi/appliedcryptography/commits/branch/main";
|
||||
fetch(
|
||||
"https://codeberg.org/api/v1/repos/nadimkobeissi/appliedcryptography/commits?limit=1&sha=main",
|
||||
)
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
if (Array.isArray(data) && data.length > 0) {
|
||||
const latestCommitDate = new Date(data[0].commit.author.date);
|
||||
const options = {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
hour: "numeric",
|
||||
minute: "numeric",
|
||||
hour12: true,
|
||||
};
|
||||
const formattedDate = latestCommitDate.toLocaleString(
|
||||
undefined,
|
||||
options,
|
||||
);
|
||||
updatedLink.innerText = formattedDate;
|
||||
lastUpdatedElement.innerHTML = "";
|
||||
lastUpdatedElement.appendChild(updatedLink);
|
||||
const period = document.createElement("span");
|
||||
period.innerText = ".";
|
||||
lastUpdatedElement.appendChild(period);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Error fetching commit data:", error);
|
||||
updatedLink.innerText = "View history";
|
||||
lastUpdatedElement.innerHTML = "";
|
||||
lastUpdatedElement.appendChild(updatedLink);
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue