소스 검색

Add an option to add an ID on recaptcha

Amauri CHAMPEAUX 4 년 전
부모
커밋
874cd193e5
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      tarteaucitron.services.js

+ 7 - 1
tarteaucitron.services.js

@@ -1536,7 +1536,13 @@ tarteaucitron.services.recaptcha = {
         "use strict";
         window.tacRecaptchaOnLoad = tarteaucitron.user.recaptchaOnLoad || function() {};
         tarteaucitron.fallback(['g-recaptcha'], '');
-        tarteaucitron.addScript('https://www.google.com/recaptcha/api.js?onload=tacRecaptchaOnLoad');
+
+        if (tarteaucitron.user.recaptchaapi === undefined) {
+            tarteaucitron.addScript('https://www.google.com/recaptcha/api.js?onload=tacRecaptchaOnLoad');
+        } else {
+            tarteaucitron.addScript('https://www.google.com/recaptcha/api.js?onload=tacRecaptchaOnLoad&render=' + tarteaucitron.user.recaptchaapi);
+        }
+        
     },
     "fallback": function () {
         "use strict";