CoreFiles by mySites.guru
recaptcha.js37 lines, 1,166 bytes, from Joomla_4.0.0-alpha9-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha8
md5
340de9db60629b11bcf521a39291056f
sha1
5a574bee17dce9d7b0aa16500707ee4bc01c1bb3
sha256
16402b96048b62144bb28fbc2de9b9ea357e5209649ca5d9b2178b72d75ee67d
/**
* 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 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
window.JoomlaInitReCaptcha2 = function () {
  'use strict';

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

    if (item.dataset) {
      options = item.dataset;
    } else {
      [].slice.call(optionKeys).forEach(function (optionData) {
        var optionKeyFq = "data-".concat(optionData);

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


    item.setAttribute('data-recaptcha-widget-id',
    /* global grecaptcha */
    grecaptcha.render(item, options));
  });
};

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