MonitorControl/docs/changelog.html
2021-12-11 14:52:47 +01:00

30 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" href="./styles/changelog.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Changelog</title>
<script src="./scripts/marked.min.js"></script>
<script src="./scripts/marked-footnotes.min.js"></script>
<script>
const urlSearchParams = new URLSearchParams(window.location.search);
const params = Object.fromEntries(urlSearchParams.entries());
if (params?.tag) {
const url = `https://api.github.com/repos/MonitorControl/MonitorControl/releases/tags/${params.tag}`;
let request = new XMLHttpRequest();
request.open('GET', url, true);
request.onload = (event) => {
const response = JSON.parse(event.target.response);
const el = document.createElement('div');
el.innerHTML = marked(response.body);
document.body.appendChild(el);
document.title = `Changelog ${params.tag}`;
};
request.send();
}
</script>
</head>
</html>