CoreFiles by mySites.guru
recaptcha.js36 lines, 1,192 bytes, from Joomla_4.0.0-beta1-Beta-Full_Package.zip
Raw History Compare with 3.9.0-beta4
md5
41bde1bc6bf5c46d2b5bd3ca7c088043
sha1
cacb677f311b09bd7b335a795c793ae8fd715a9e
sha256
6298f96048712ce33f1394f3b35aecf668a40fcc183abdb44cccd709190974ad
/**
* PLEASE DO NOT MODIFY THIS FILE. WORK ON THE ES6 VERSION.
* OTHERWISE YOUR CHANGES WILL BE REPLACED ON THE NEXT BUILD.
**/

/**
 * @package     Joomla.JavaScript
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
(function (window, document) {
  'use strict';

  window.JoomlainitReCaptcha2 = function () {
    var elements = [].slice.call(document.getElementsByClassName('g-recaptcha'));
    var optionKeys = ['sitekey', 'theme', 'size', 'tabindex', 'callback', 'expired-callback', 'error-callback'];
    elements.forEach(function (element) {
      var options = {};

      if (element.dataset) {
        options = element.dataset;
      } else {
        optionKeys.forEach(function (key) {
          var optionKeyFq = "data-".concat(key);

          if (element.hasAttribute(optionKeyFq)) {
            options[key] = element.getAttribute(optionKeyFq);
          }
        });
      } // Set the widget id of the recaptcha item


      element.setAttribute('data-recaptcha-widget-id', window.grecaptcha.render(element, options));
    });
  };
})(window, document);

The same content is in 5 releases, Joomla 4.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.