?
Referenced as Pull Request for: # 6218
avatar Qlimax90
Qlimax90
27 Feb 2015

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

avatar Qlimax90 Qlimax90 - open - 27 Feb 2015
avatar joomla-cms-bot joomla-cms-bot - change - 27 Feb 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 27 Feb 2015
Category JavaScript Plugins
avatar zero-24
zero-24 - comment - 27 Feb 2015

@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.
avatar brianteeman
brianteeman - comment - 27 Feb 2015

Closing as we have a PR


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6212.
avatar brianteeman brianteeman - change - 27 Feb 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-02-27 13:57:42
Closed_By brianteeman
avatar brianteeman brianteeman - change - 27 Feb 2015
Closed_Date 2015-02-27 13:57:42 2015-02-27 13:57:43
avatar brianteeman brianteeman - close - 27 Feb 2015

Add a Comment

Login with GitHub to post a comment