Hi everyone,
in /plugins/captcha/recaptcha/recaptcha.php from line 55 to 79, is there any reason why the new recaptcha is loading the mootools library? Especially on line 76 Mootools gets loaded by JHtml::_('script', $file, true, true);
I think the following code would be better:
switch ($version)
{
case '1.0':
$theme = $this->params->get('theme', 'clean');
$file = $app->isSSLConnection() ? 'https' : 'http';
$file .= '://www.google.com/recaptcha/api/js/recaptcha_ajax.js';
$document->addScriptDeclaration('jQuery( document ).ready(function()
{
Recaptcha.create("' . $pubkey . '", "' . $id . '", {theme: "' . $theme . '",' . $lang . 'tabindex: 0});});'
);
break;
case '2.0':
$theme = $this->params->get('theme2', 'light');
$file = $app->isSSLConnection() ? 'https' : 'http';
$file .= '://www.google.com/recaptcha/api.js?hl=' . JFactory::getLanguage()
->getTag() . '&onload=onloadCallback&render=explicit';
$document->addScriptDeclaration('var onloadCallback = function() {'
. 'grecaptcha.render("' . $id . '", {sitekey: "' . $pubkey . '", theme: "' . $theme . '"});'
. '}'
);
break;
}
$document->addScript($file);
Best regards
Labels |
Added:
?
|
Category | ⇒ | JavaScript Plugins |
Closing as we have a PR
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-02-27 13:57:42 |
Closed_By | ⇒ | brianteeman |
Closed_Date | 2015-02-27 13:57:42 | ⇒ | 2015-02-27 13:57:43 |
@Qlimax90 can you submit the changes as PR?
If you need help or don't know how you can have a look here: https://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6212.