From 03dffe3efdde4fd0d849b9523249d0ad42037dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Sun, 16 Apr 2017 19:49:40 +0300 Subject: cmd/faucet: add optional recaptcha validation support --- cmd/faucet/faucet.html | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'cmd/faucet/faucet.html') diff --git a/cmd/faucet/faucet.html b/cmd/faucet/faucet.html index 570145ea2..39fcf77fe 100644 --- a/cmd/faucet/faucet.html +++ b/cmd/faucet/faucet.html @@ -51,9 +51,10 @@
- + -
+ {{if .Recaptcha}} +
{{end}}
@@ -89,8 +90,9 @@ var server; // Define the function that submits a gist url to the server - var submit = function() { - server.send(JSON.stringify({url: $("#gist")[0].value})); + var submit = function({{if .Recaptcha}}captcha{{end}}) { + server.send(JSON.stringify({url: $("#gist")[0].value{{if .Recaptcha}}, captcha: captcha{{end}}}));{{if .Recaptcha}} + grecaptcha.reset();{{end}} }; // Define a method to reconnect upon server loss var reconnect = function() { @@ -138,6 +140,7 @@ } // Establish a websocket connection to the API server reconnect(); - + {{if .Recaptcha}} + {{end}} -- cgit v1.2.3