CoreFiles by mySites.guru
recaptcha.es6.js37 lines, 1,152 bytes, from Joomla_4.0.0-alpha8-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha7
md5
590f39c1b526dcf48a0483c21b3d1a1b
sha1
77039e934f1f0125516c0a46167f32dcd652bfdf
sha256
0cca0b21515518d8690b003b17e62cac7d2ef43be0dcafe7ea8182bab5d53f7f
/**
* 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 = () => {
  'use strict';

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

    if (item.dataset) {
      options = item.dataset;
    } else {
      [].slice.call(optionKeys).forEach(optionData => {
        const 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.