CoreFiles by mySites.guru
recaptcha.js37 lines, 1,095 bytes, from Joomla_3.9.0-beta3-Beta-Full_Package.zip
Raw History Compare with 3.9.0-beta2
md5
aab3b9c8c4360edd934cdce8d2456afa
sha1
747f6a7566bd7a95211155e2c15bce18fd9ff3a4
sha256
7c216f2de8150da44f897b141e30b0076913d019e5a81b2d010b576b0bdea9bf
/**
 * @package		Joomla.JavaScript
 * @copyright	Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */
window.JoomlaInitReCaptchaInvisible = function() {
	'use strict';

	var items = document.getElementsByClassName('g-recaptcha'),
	    item,
	    option_keys = ['sitekey', 'badge', 'size', 'tabindex', 'callback', 'expired-callback', 'error-callback'],
	    options = {},
	    option_key_fq
	;

	for (var i = 0, l = items.length; i < l; i++) {
		item = items[i];
		if (item.dataset) {
			options = item.dataset;
		} else {
			for (var j = 0; j < option_keys.length; j++) {
				option_key_fq = ('data-' + option_keys[j]);
				if (item.hasAttribute(option_key_fq)) {
					options[option_keys[j]] = item.getAttribute(option_key_fq);
				}
			}
		}

		// Set the widget id of the recaptcha item
		item.setAttribute(
			'data-recaptcha-widget-id',
			grecaptcha.render(item, options)
		);
		// Execute the invisible reCAPTCHA
		grecaptcha.execute(item.getAttribute('data-recaptcha-widget-id'));
	}
};

The same content is in 10 releases, Joomla 3.9.0-alpha to 3.9.1. See them all, or every version of this file.