Skip to content
Snippets Groups Projects
Commit e0615bf0 authored by Jonas Leder's avatar Jonas Leder
Browse files

show new comment Form only when clicking button, to prevent hcaptcha from loading

parent 6cbb0ecc
No related branches found
No related tags found
No related merge requests found
class newComment extends HTMLElement {
constructor() {
super();
this.setupForm();
this.innerHTML = `
<button class="bigButton" id="showCommentButton">Neues Kommentar verfassen</button>
`;
document.getElementById("showCommentButton").onclick = this.setupForm;
}
async setupForm(){
let sitekey = await (await fetch("/API/config.php?name=sitekey")).text();
this.innerHTML = `
this.parentElement.innerHTML = `
<form action="/API/newComment.php" method="post">
<label for="name">Name:</label><br>
<input type="text" id="name" name="name"><br><br>
......
......@@ -65,3 +65,16 @@
.emailBox {
display: inline;
}
.bigButton {
background-color: $accent-color;
color: #fff;
text-transform: uppercase;
padding: 15px;
font-size: 14px;
cursor: pointer;
outline: 0;
border: 0;
transition: background-color $link-hover-animation-time linear;
width: 100%;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment