show new comment Form only when clicking button, to prevent hcaptcha from loading
This commit is contained in:
parent
6cbb0eccc5
commit
e0615bf0ed
|
@ -1,13 +1,16 @@
|
|||
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%;
|
||||
}
|
Loading…
Reference in a new issue