Archived
1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
SOD/views/mixin.pug
2020-08-21 11:11:36 +02:00

16 lines
701 B
Text

mixin submit(value)
div.recaptcha.recaptcha-cb
input(type="submit" value!=value)
if !test
p !{captcha}
script.
function cb(token) {
document.querySelectorAll("div.recaptcha.recaptcha-cb").forEach(el => {
el.classList.remove("recaptcha-cb");
let input = document.createElement("input");
input.setAttribute("type", "hidden");
input.setAttribute("name", "g-recaptcha-response");
input.setAttribute("value", token);
el.appendChild(input);
});
}