Archived
1
0
This repository has been archived on 2019-09-17. You can view files and clone it, but cannot push or open issues or pull requests.
Files
google-taenia/index.html
2019-04-29 15:09:10 +02:00

63 lines
2.1 KiB
HTML

<!DOCTYPE HTML>
<html lang="nl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>T.A.E.N.I.A.</title>
<link rel="stylesheet" href="style.css">
<link rel="icon" href="favicon.png">
<script>
var submit = null;
function handleFormSubmit(event) {
// Manually construct the submit event, because GET forms use incorrect URL encoding for mail clients.
event.preventDefault();
const form = event.target;
const bodyText = document.getElementById("body-text").value;
window.location = form.action + "?"
+ "subject=" + encodeURI(form.dataset.chosen)
+ "&body=" + encodeURI(bodyText);
}
window.addEventListener("load", function () {
const form = document.getElementsByTagName("form")[0];
form.addEventListener("submit", handleFormSubmit);
const handleClick = function (event) {
form.dataset.chosen = event.target.value;
};
const buttons = form.querySelectorAll("input[type=submit]");
for (let i = 0; i < buttons.length; ++i) {
buttons[i].addEventListener("click", handleClick);
}
form.dataset.chosen = buttons[0].value;
})
</script>
</head>
<body>
<div class="viewport">
<img id="logo" src="google-logo.svg" alt="Googl.I.A.">
<form action="mailto:taeniabestuur@gmail.com">
<input class="search" id="body-text" name="body" autofocus>
<div class="buttons">
<input type="submit" name="subject" value="T.A.E.N.I.A. zoeken">
<input type="submit" name="subject" value="Moederdier red mij">
</div>
</form>
<p>Volg de hele week <a href="https://dcw.ssr-leiden.nl/" target="_blank">de strijd tegen nepnieuws.</a></p>
<p>Google aangeboden in: <a href="http://www.dispuut-mocca.nl/" target="_blank">Overleden dispuut</a></p>
</div>
<div id="bottom-bar">
<div>
<a href="https://www.ssr-leiden.nl/">SSR Leiden</a>
</div>
</div>
</body>
</html>