-
Notifications
You must be signed in to change notification settings - Fork 0
/
disallowbots.gotemplate.html
50 lines (47 loc) 路 1.76 KB
/
disallowbots.gotemplate.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>picopublish</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="/static/application.css">
<link rel="stylesheet" type="text/css" href="{{ .CaptchaURL }}/static/captcha.css">
<script src="{{ .CaptchaURL }}/static/captcha.js?v=3"></script>
</head>
<body>
<div class="header">
<h3>PicoPublish</h3>
<div style="float:right; padding-right:20px;">
<a href="https://git.sequentialread.com/forest/picopublish">source code</a>
</div>
</div>
<div class="header-shadow"></div>
<div class="splash content">
<h3>Please wait for a moment...</h3>
<form method="POST" action="" style="font-size: 11px;">
<input type="hidden" name="challenge" value="{{ .Challenge }}" />
<input type="hidden" name="nonce" />
<div class="captcha-container"
data-sqr-captcha-url="{{ .CaptchaURL }}"
data-sqr-captcha-challenge="{{ .Challenge }}"
data-sqr-captcha-callback="myCaptchaCallback">
</div>
</form>
</div>
<script>
window.myCaptchaCallback = (nonce) => {
document.querySelector("form input[name='nonce']").value = nonce;
setTimeout(function() {
document.querySelector("form").submit();
}, 500);
};
// note its important that the CSS is already loaded at this point,
// otherwise the script will wait to create the captcha element
// until the css is loaded, and so code inside sqrCaptchaTrigger will fail
// because it will try to update the captcha element that doesn't exist yet.
window.sqrCaptchaInit();
window.sqrCaptchaTrigger();
</script>
</body>
</html>