This repository has been archived by the owner on Mar 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue #6 + Fix reCaptcha renewal
- Loading branch information
1 parent
3a23b9d
commit 5fa25c1
Showing
6 changed files
with
151 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* MageSpecialist | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to info@magespecialist.it so we can send you a copy immediately. | ||
* | ||
* @category MSP | ||
* @package MSP_ReCaptcha | ||
* @copyright Copyright (c) 2017 Skeeller srl (http://www.magespecialist.it) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
var config = { | ||
config: { | ||
mixins: { | ||
'Magento_Ui/js/view/messages': { | ||
'MSP_ReCaptcha/js/ui-messages-mixin': true | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* MageSpecialist | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to info@magespecialist.it so we can send you a copy immediately. | ||
* | ||
* @category MSP | ||
* @package MSP_ReCaptcha | ||
* @copyright Copyright (c) 2017 Skeeller srl (http://www.magespecialist.it) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
define(['ko'], function (ko) { | ||
'use strict'; | ||
|
||
return { | ||
ids: ko.observableArray([]), | ||
captchaList: ko.observableArray([]) | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* MageSpecialist | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to info@magespecialist.it so we can send you a copy immediately. | ||
* | ||
* @category MSP | ||
* @package MSP_ReCaptcha | ||
* @copyright Copyright (c) 2017 Skeeller srl (http://www.magespecialist.it) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
define(['MSP_ReCaptcha/js/registry'], function (registry) { | ||
'use strict'; | ||
|
||
return function (originalComponent) { | ||
'use strict'; | ||
|
||
return originalComponent.extend({ | ||
initialize: function () { | ||
this._super(); | ||
|
||
this.messageContainer.errorMessages.subscribe(function (newValue) { | ||
registry.captchaList().forEach(function (captcha) { | ||
grecaptcha.reset(captcha); | ||
}); | ||
}, null, "arrayChange"); | ||
|
||
return this; | ||
} | ||
}); | ||
}; | ||
}); |