[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/media/plg_captcha_recaptcha_invisible/js/ -> recaptcha-es5.js (source)

   1  (function () {
   2    'use strict';
   3  
   4    /**
   5     * @package     Joomla.JavaScript
   6     * @copyright   (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
   7     * @license     GNU General Public License version 2 or later; see LICENSE.txt
   8     */
   9    (function (window, document) {
  10      window.JoomlainitReCaptchaInvisible = function () {
  11        var elements = [].slice.call(document.getElementsByClassName('g-recaptcha'));
  12        var optionKeys = ['sitekey', 'badge', 'size', 'tabindex', 'callback', 'expired-callback', 'error-callback'];
  13        elements.forEach(function (element) {
  14          var options = {};
  15  
  16          if (element.dataset) {
  17            options = element.dataset;
  18          } else {
  19            optionKeys.forEach(function (key) {
  20              var optionKeyFq = "data-" + optionKeys[key];
  21  
  22              if (element.hasAttribute(optionKeyFq)) {
  23                options[optionKeys[key]] = element.getAttribute(optionKeyFq);
  24              }
  25            });
  26          } // Set the widget id of the recaptcha item
  27  
  28  
  29          element.setAttribute('data-recaptcha-widget-id', window.grecaptcha.render(element, options)); // Execute the invisible reCAPTCHA
  30  
  31          window.grecaptcha.execute(element.getAttribute('data-recaptcha-widget-id'));
  32        });
  33      };
  34    })(window, document);
  35  
  36  })();


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer