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

17 lines
701 B
Text
Raw Normal View History

2020-08-20 22:46:46 +02:00
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);
});
}