CoreFiles by mySites.guru
recaptcha.js35 lines, 981 bytes, from Joomla_3.9.0-beta4-Beta-Full_Package.zip
Raw History Compare with 3.9.0-beta3
md5
7dc03db6ea267e39717b44b2ac848f16
sha1
49797f7fc58718b0640bb6638f758c98a97fa375
sha256
a833e47689beaf3fd5a4e490a1c661a392252b9b3fd7c67633406c0b567802fe
/**
 * @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.JoomlaInitReCaptcha2 = function() {
	'use strict';

	var items = document.getElementsByClassName('g-recaptcha'),
	    item,
	    option_keys = ['sitekey', 'theme', '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)
		);
	}
};

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.