diff options
author | Pavel Kanyshev <aerohub@users.noreply.github.com> | 2017-06-18 23:38:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-18 23:38:13 +0300 |
commit | 62eb6af39511cc9301f8273c07c239ffa95a12cb (patch) | |
tree | 1dd18b974ff8b820f907d1f6e822fa9a02e56597 | |
parent | 44ae4440253bdb469ddd26ed68e3adc7fcdf87f8 (diff) | |
parent | 3802cc2dcb1ad453d5d109fd1060e904de464b48 (diff) |
Merge pull request #13 from stp-ip/upstreamChanges
Improvements to recaptcha
-rw-r--r-- | layouts/partials/footer_scripts.html | 4 | ||||
-rw-r--r-- | layouts/partials/header.html | 3 | ||||
-rw-r--r-- | static/assets/js/contact.js | 3 |
3 files changed, 7 insertions, 3 deletions
diff --git a/layouts/partials/footer_scripts.html b/layouts/partials/footer_scripts.html index b97f45f..7a04e84 100644 --- a/layouts/partials/footer_scripts.html +++ b/layouts/partials/footer_scripts.html @@ -24,3 +24,7 @@ {{ range .Site.Params.custom_js }} <script src="{{ . | absURL }}"></script> {{ end }} + + {{ with .Site.Params.contact.captcha }} + <script src='https://www.google.com/recaptcha/api.js' async defer></script> + {{ end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 59022e8..6c84fae 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -36,7 +36,4 @@ <!--[if lte IE 9]><link rel="stylesheet" href="/assets/css/ie9.css" /><![endif]--> <noscript><link rel="stylesheet" href="/assets/css/noscript.css" /></noscript> - {{ with .Site.Params.contact.captcha }} - <script src='https://www.google.com/recaptcha/api.js' async defer></script> - {{ end }} </head> diff --git a/static/assets/js/contact.js b/static/assets/js/contact.js index 4132e8a..b24132b 100644 --- a/static/assets/js/contact.js +++ b/static/assets/js/contact.js @@ -22,5 +22,8 @@ $('form[id=contactForm]').submit(function(){ // Callback function for captcha function onSubmit(token) { + if (!token) { + return; + } $('form[id=contactForm]').submit(); } |