CoreFiles by mySites.guru
recaptcha.js36 lines, 1,179 bytes, from Joomla_4.0.0-beta7-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta6
md5
b16061e9c0f1320616896e4ed30bf02e
sha1
27e9ce4bdb76df11d4a169c552bfae465861949f
sha256
a9f4345a2eb5ded8cc9e682494c07c50300e22cd607eb7c35a4fb7e50cfb7dee
/**
* 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   (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @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 2 releases, Joomla 4.0.0-beta6 to 4.0.0-beta7. See them all, or every version of this file.