Skip to content
This repository has been archived by the owner on Aug 17, 2021. It is now read-only.

Commit

Permalink
[release]
Browse files Browse the repository at this point in the history
  • Loading branch information
Ismael Ambrosi committed Nov 22, 2017
1 parent 164429d commit a187773
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-recaptcha",
"version": "4.1.1",
"version": "4.1.2",
"keywords": ["angular", "captcha", "recaptcha", "vividcortex", "human", "form", "validation", "signup", "security", "login"],
"main": "release/angular-recaptcha.js",
"ignore": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-recaptcha",
"version": "4.1.1",
"version": "4.1.2",
"description": "An AngularJS module to ease usage of reCaptcha inside a form",
"author": "VividCortex",
"license": "MIT",
Expand Down
12 changes: 10 additions & 2 deletions release/angular-recaptcha.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license angular-recaptcha build:2017-10-13
* @license angular-recaptcha build:2017-11-22
* https://github.com/vividcortex/angular-recaptcha
* Copyright (c) 2017 VividCortex
**/
Expand Down Expand Up @@ -118,7 +118,7 @@
provider.onLoadFunctionName = onLoadFunctionName;
};

provider.$get = ['$rootScope','$window', '$q', '$document', function ($rootScope, $window, $q, $document) {
provider.$get = ['$rootScope','$window', '$q', '$document', '$interval', function ($rootScope, $window, $q, $document, $interval) {
var deferred = $q.defer(), promise = deferred.promise, instances = {}, recaptcha;

$window.vcRecaptchaApiLoadedCallback = $window.vcRecaptchaApiLoadedCallback || [];
Expand Down Expand Up @@ -156,6 +156,14 @@
// Check if grecaptcha is not defined already.
if (ng.isDefined($window.grecaptcha)) {
callback();
} else if ($window.document.querySelector('script[src^="https://www.google.com/recaptcha/api.js"]')) {
// wait for script to be loaded.
var intervalWait = $interval(function() {
if (ng.isDefined($window.grecaptcha)) {
$interval.cancel(intervalWait);
callback();
}
}, 25);
} else {
// Generate link on demand
var script = $window.document.createElement('script');
Expand Down
4 changes: 2 additions & 2 deletions release/angular-recaptcha.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a187773

Please sign in to comment.