2021-04-12 20:43:43 +02:00
|
|
|
class contactMailButton extends HTMLElement {
|
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
this.addButton();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-09-26 22:40:39 +02:00
|
|
|
async addButton() {
|
2021-04-12 20:43:43 +02:00
|
|
|
let sitekey = await (await fetch("/API/config.php?name=sitekey")).text();
|
2021-05-24 18:19:25 +02:00
|
|
|
console.log(sitekey);
|
2021-04-12 20:43:43 +02:00
|
|
|
this.innerHTML = `E-Mail: <button id="emailButton" class="h-captcha" data-sitekey="${sitekey}" data-callback="onSubmit">laden</button><br>`;
|
2021-09-26 22:40:39 +02:00
|
|
|
const script = document.createElement("script");
|
|
|
|
script.src = "https://hCaptcha.com/1/api.js";
|
|
|
|
document.head.append(script);
|
2021-04-12 20:43:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
customElements.define("jl-contact_mail_button", contactMailButton);
|