3 input#modalContact.modal(type="checkbox")
4 div(role="dialog" aria-labelledby="contactTitle")
6 label.modal-close(for="modalContact")
7 h3#contactTitle.section {{ $tr["Contact form"] }}
9 label(for="userEmail") {{ $tr["Email"] }}
10 input#userEmail(type="email")
12 label(for="mailSubject") {{ $tr["Subject"] }}
13 input#mailSubject(type="text")
15 label(for="mailContent") {{ $tr["Content"] }}
19 button(type="button" onClick="trySendMessage()") Send
20 p#emailSent {{ $tr["Email sent!"] }}
24 import { ajax } from "../utils/ajax";
28 // Note: not using Vue here, but would be possible
29 trySendMessage: function() {
30 let email = document.getElementById("userEmail");
31 let subject = document.getElementById("mailSubject");
32 let content = document.getElementById("mailContent");
33 const error = checkNameEmail({email: email});
36 if (content.value.trim().length == 0)
37 return alert("Empty message");
38 if (subject.value.trim().length == 0 && !confirm("No subject. Send anyway?"))
47 subject: subject.value,
48 content: content.value,
53 let emailSent = document.getElementById("emailSent");
54 emailSent.style.display = "inline-block";
55 setTimeout(() => { emailSent.style.display = "none"; }, 2000);