3 input#modalContact.modal(type="checkbox")
4 div(role="dialog" data-checkbox="modalContact"
5 aria-labelledby="contactTitle")
7 label.modal-close(for="modalContact")
8 h3#contactTitle.section {{ st.tr["Contact form"] }}
10 label(for="userEmail") {{ st.tr["Email"] }}
11 input#userEmail(type="email")
13 label(for="mailSubject") {{ st.tr["Subject"] }}
14 input#mailSubject(type="text")
16 label(for="mailContent") {{ st.tr["Content"] }}
20 button(type="button" @click="trySendMessage") Send
21 p#emailSent {{ st.tr["Email sent!"] }}
25 import { ajax } from "../utils/ajax";
26 import { store } from "@/store";
27 import { checkNameEmail } from "@/data/userCheck";
30 name: "my-contact-form",
37 // Note: not using Vue here, but would be possible
38 trySendMessage: function() {
39 let email = document.getElementById("userEmail");
40 let subject = document.getElementById("mailSubject");
41 let content = document.getElementById("mailContent");
42 const error = checkNameEmail({email: email});
45 if (content.value.trim().length == 0)
46 return alert("Empty message");
47 if (subject.value.trim().length == 0 && !confirm("No subject. Send anyway?"))
56 subject: subject.value,
57 content: content.value,
62 let emailSent = document.getElementById("emailSent");
63 emailSent.style.display = "inline-block";
64 setTimeout(() => { emailSent.style.display = "none"; }, 2000);
72 <style lang="sass" scoped>