Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
albertcht authored Jan 26, 2021
2 parents 915e57f + 393b597 commit 76e5f1c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
19 changes: 14 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
{
"name": "albertcht/invisible-recaptcha",
"description": "Invisible reCAPTCHA For Laravel.",
"keywords": ["recaptcha", "no-captcha", "captcha", "invisible", "invisible-recaptcha", "laravel", "laravel5", "php"],
"keywords": [
"recaptcha",
"no-captcha",
"captcha",
"invisible",
"invisible-recaptcha",
"laravel",
"laravel5",
"php"
],
"license": "MIT",
"authors": [
{
Expand All @@ -11,12 +20,12 @@
],
"require": {
"php": "^5.6.4 || ^7.0",
"illuminate/support": "^5.0|^6.0|^7.0",
"guzzlehttp/guzzle": "^6.2"
"illuminate/support": "^5.0|^6.0|^7.0|^8.0",
"illuminate/view": "^5.0|^6.0|^7.0|^8.0",
"guzzlehttp/guzzle": "^6.2|^7.0"
},
"require-dev": {
"phpunit/phpunit": "^8.0",
"illuminate/view": "^5.0|^6.0|^7.0"
"phpunit/phpunit": "^8.0|^9.3"
},
"autoload": {
"psr-4": {
Expand Down
7 changes: 4 additions & 3 deletions src/InvisibleReCaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function renderCaptchaHTML()
}

/**
* Render the footer JS neccessary for the recaptcha integration.
* Render the footer JS necessary for the recaptcha integration.
*
* @return string
*/
Expand All @@ -135,11 +135,12 @@ public function renderFooterJS($lang = null, $nonce = null)
$html .= ' nonce="' . $nonce . '"';
}
$html .= '></script>' . PHP_EOL;
$html .= '<script>var _submitForm,_captchaForm,_captchaSubmit,_execute=true;</script>';
$html .= '<script>var _submitForm,_captchaForm,_captchaSubmit,_execute=true,_captchaBadge;</script>';
$html .= "<script>window.addEventListener('load', _loadCaptcha);" . PHP_EOL;
$html .= "function _loadCaptcha(){";
if ($this->getOption('hideBadge', false)) {
$html .= "document.querySelector('.grecaptcha-badge').style = 'display:none;!important'" . PHP_EOL;
$html .= "_captchaBadge=document.querySelector('.grecaptcha-badge');";
$html .= "if(_captchaBadge){_captchaBadge.style = 'display:none;!important';}" . PHP_EOL;
}
$html .= '_captchaForm=document.querySelector("#_g-recaptcha").closest("form");';
$html .= "_captchaSubmit=_captchaForm.querySelector('[type=submit]');";
Expand Down

0 comments on commit 76e5f1c

Please sign in to comment.