mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
captcha: fix page load
This commit is contained in:
1 parent
653d18b57b
commit
6317c9057f
2 files changed
+5
-4
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/recaptcha",
|
"name": "@hydrooj/recaptcha",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "Google reCAPTCHA",
|
"description": "Google reCAPTCHA",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
(() => {
|
(() => {
|
||||||
const { AutoloadPage } = window.Hydro;
|
const { NamedPage } = window.Hydro;
|
||||||
|
|
||||||
const page = new AutoloadPage('recaptcha', () => {
|
const page = new NamedPage('user_register', () => {
|
||||||
function captcha(event) {
|
function captcha(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
grecaptcha.ready(function () {
|
grecaptcha.ready(function () {
|
||||||
@@ -11,7 +11,8 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
document.getElementById('submit').onclick = captcha;
|
const element = document.getElementById('submit');
|
||||||
|
if (element) element.onclick = captcha;
|
||||||
});
|
});
|
||||||
|
|
||||||
window.Hydro.extraPages.push(page);
|
window.Hydro.extraPages.push(page);
|
||||||
|
|||||||
Reference in new issue
Block a user