CoreFiles by mySites.guru
recaptcha.es6.js36 lines, 1,164 bytes, from Joomla_4.0.0-beta4-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta3
md5
53f965b71611da6a35d1e11690c028ca
sha1
5861aea66ba0c0df826d604816f2be1cdf3b6611
sha256
87b41ea2245ad8f43a9376ab6fcff424283ace8ea010233e66012c86a9f42d68
/**
* 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
 */
((window, document) => {
  'use strict';

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

      if (element.dataset) {
        options = element.dataset;
      } else {
        optionKeys.forEach(key => {
          const optionKeyFq = `data-${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.