mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: speed up page load
This commit is contained in:
15 files changed
+80
-106
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import { addPage, NamedPage } from '@hydrooj/ui-default';
|
||||
/* global grecaptcha */
|
||||
|
||||
addPage(new NamedPage('user_register', () => {
|
||||
function captcha(event) {
|
||||
event.preventDefault();
|
||||
grecaptcha.ready(() => {
|
||||
grecaptcha.execute(UiContext.recaptchaKey, { action: 'submit' }).then((token) => {
|
||||
document.getElementById('_captcha').value = token;
|
||||
document.getElementById('_submit').click();
|
||||
});
|
||||
});
|
||||
}
|
||||
const element = document.getElementById('submit');
|
||||
if (element) element.onclick = captcha;
|
||||
}));
|
||||
Reference in new issue
Block a user