diff --git a/vendor/magento/module-re-captcha-contact/etc/frontend/di.xml b/vendor/magento/module-re-captcha-contact/etc/frontend/di.xml new file mode 100644 index 00000000..ee228c25 --- /dev/null +++ b/vendor/magento/module-re-captcha-contact/etc/frontend/di.xml @@ -0,0 +1,25 @@ + + + + + + + + Magento\ReCaptchaContact\Model\ButtonLock\ContactUsFormSubmit + + + + + + + contact_us_form_submit + contact + + + diff --git a/vendor/magento/module-re-captcha-customer/Plugin/Customer/DisableCreateAccountButton.php b/vendor/magento/module-re-captcha-customer/Plugin/Customer/DisableCreateAccountButton.php deleted file mode 100644 index ea6e3ebc..00000000 --- a/vendor/magento/module-re-captcha-customer/Plugin/Customer/DisableCreateAccountButton.php +++ /dev/null @@ -1,46 +0,0 @@ -isCaptchaEnabled = $isCaptchaEnabled; - } - - /** - * Temporally disable button Create Account while captcha is loading - * - * @param CreateAccountButton $subject - * @return bool - * @throws InputException - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function afterDisabled(CreateAccountButton $subject): bool - { - $key = 'customer_create'; - return $this->isCaptchaEnabled->isCaptchaEnabledFor($key); - } -} diff --git a/vendor/magento/module-re-captcha-customer/Plugin/Customer/DisableForgotPasswordButton.php b/vendor/magento/module-re-captcha-customer/Plugin/Customer/DisableForgotPasswordButton.php deleted file mode 100644 index 6c3d7df6..00000000 --- a/vendor/magento/module-re-captcha-customer/Plugin/Customer/DisableForgotPasswordButton.php +++ /dev/null @@ -1,46 +0,0 @@ -isCaptchaEnabled = $isCaptchaEnabled; - } - - /** - * Temporally disable Forgot password button while captcha is loading - * - * @param ForgotPasswordButton $subject - * @return bool - * @throws InputException - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function afterDisabled(ForgotPasswordButton $subject): bool - { - $key = 'customer_forgot_password'; - return $this->isCaptchaEnabled->isCaptchaEnabledFor($key); - } -} diff --git a/vendor/magento/module-re-captcha-customer/Plugin/Customer/DisableLoginButton.php b/vendor/magento/module-re-captcha-customer/Plugin/Customer/DisableLoginButton.php deleted file mode 100644 index b0713fa3..00000000 --- a/vendor/magento/module-re-captcha-customer/Plugin/Customer/DisableLoginButton.php +++ /dev/null @@ -1,47 +0,0 @@ -isCaptchaEnabled = $isCaptchaEnabled; - } - - /** - * Temporally disable Login button while captcha is loading - * - * @param LoginButton $subject - * @return bool - * @throws InputException - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function afterDisabled(LoginButton $subject): bool - { - $key = 'customer_login'; - return $this->isCaptchaEnabled->isCaptchaEnabledFor($key); - } -} diff --git a/vendor/magento/module-re-captcha-customer/etc/frontend/di.xml b/vendor/magento/module-re-captcha-customer/etc/frontend/di.xml index 73640968..e32489da 100644 --- a/vendor/magento/module-re-captcha-customer/etc/frontend/di.xml +++ b/vendor/magento/module-re-captcha-customer/etc/frontend/di.xml @@ -20,16 +20,38 @@ - - - - - - - - + + + + Magento\ReCaptchaCustomer\Model\ButtonLock\CustomerCreateFormSubmit + Magento\ReCaptchaCustomer\Model\ButtonLock\CustomerEditFormSubmit + Magento\ReCaptchaCustomer\Model\ButtonLock\CustomerForgotPasswordFormSubmit + Magento\ReCaptchaCustomer\Model\ButtonLock\CustomerLoginFormSubmit + + + + + customer_create_form_submit + customer_create + + + + + customer_edit_form_submit + customer_edit + + + + + customer_forgot_password_form_submit + customer_forgot_password + + + + + customer_login_form_submit + customer_login + + diff --git a/vendor/magento/module-re-captcha-frontend-ui/view/frontend/web/js/reCaptcha.js b/vendor/magento/module-re-captcha-frontend-ui/view/frontend/web/js/reCaptcha.js index 14f2af32..43c476ec 100644 --- a/vendor/magento/module-re-captcha-frontend-ui/view/frontend/web/js/reCaptcha.js +++ b/vendor/magento/module-re-captcha-frontend-ui/view/frontend/web/js/reCaptcha.js @@ -174,7 +174,11 @@ define( } else { this.tokenField = null; } - if ($('#send2').length > 0) {$('#send2').prop('disabled', false);} + let submitButton = parentForm.find('button:not([type]), [type=submit]'); + + if (submitButton.length) { + submitButton.prop('disabled', false); + } }, /** diff --git a/vendor/magento/module-re-captcha-newsletter/etc/frontend/di.xml b/vendor/magento/module-re-captcha-newsletter/etc/frontend/di.xml new file mode 100644 index 00000000..4622e4c3 --- /dev/null +++ b/vendor/magento/module-re-captcha-newsletter/etc/frontend/di.xml @@ -0,0 +1,24 @@ + + + + + + + + Magento\ReCaptchaNewsletter\Model\ButtonLock\NewsletterFormSubmit + + + + + + newsletter_form_submit + newsletter + + + diff --git a/vendor/magento/module-re-captcha-review/etc/frontend/di.xml b/vendor/magento/module-re-captcha-review/etc/frontend/di.xml new file mode 100644 index 00000000..509158d4 --- /dev/null +++ b/vendor/magento/module-re-captcha-review/etc/frontend/di.xml @@ -0,0 +1,24 @@ + + + + + + + + Magento\ReCaptchaReview\Model\ButtonLock\ReviewFormSubmit + + + + + + review_form_submit + product_review + + + diff --git a/vendor/magento/module-re-captcha-send-friend/etc/frontend/di.xml b/vendor/magento/module-re-captcha-send-friend/etc/frontend/di.xml new file mode 100644 index 00000000..b48b3cb7 --- /dev/null +++ b/vendor/magento/module-re-captcha-send-friend/etc/frontend/di.xml @@ -0,0 +1,24 @@ + + + + + + + + Magento\ReCaptchaSendFriend\Model\ButtonLock\SendFriendFormSubmit + + + + + + sendfriend_form_submit + sendfriend + + + diff --git a/vendor/magento/module-re-captcha-ui/Model/ButtonLock.php b/vendor/magento/module-re-captcha-ui/Model/ButtonLock.php new file mode 100644 index 00000000..8b349ee5 --- /dev/null +++ b/vendor/magento/module-re-captcha-ui/Model/ButtonLock.php @@ -0,0 +1,59 @@ +isCaptchaEnabled = $isCaptchaEnabled; + $this->reCaptchaId = $reCaptchaId; + $this->buttonCode = $buttonCode; + } + + /** + * @inheritDoc + */ + public function getCode(): string + { + return $this->buttonCode; + } + + /** + * @inheritDoc + */ + public function isDisabled(): bool + { + return $this->isCaptchaEnabled->isCaptchaEnabledFor($this->reCaptchaId); + } +}