diff --git a/PluginRecaptcha.class.php b/PluginRecaptcha.class.php index 876c62a..fce3769 100644 --- a/PluginRecaptcha.class.php +++ b/PluginRecaptcha.class.php @@ -30,6 +30,7 @@ public function Deactivate(){ } public function Init() { + $this->Viewer_AppendScript(Plugin::GetTemplatePath(__CLASS__)."js/script.js"); Config::Set('module.user.captcha_use_registration', false); } } diff --git a/classes/hooks/HookRecaptcha.class.php b/classes/hooks/HookRecaptcha.class.php index 06e069e..83561c3 100644 --- a/classes/hooks/HookRecaptcha.class.php +++ b/classes/hooks/HookRecaptcha.class.php @@ -18,14 +18,12 @@ public function RegisterHook() { } public function Recaptcha() { - $recaptcha = recaptcha_get_html(Config::Get('plugin.recaptcha.public_key'), null, Config::Get('plugin.recaptcha.use_ssl')); - $this->Viewer_Assign('recaptcha', $recaptcha); return $this->Viewer_Fetch(Plugin::GetTemplatePath(__CLASS__).'inject.recaptcha.tpl'); } public function Recaptcha_modal() { - $recaptcha = recaptcha_get_html(Config::Get('plugin.recaptcha.public_key'), null, Config::Get('plugin.recaptcha.use_ssl')); - $this->Viewer_Assign('recaptcha_modal', $recaptcha); + $recaptcha = recaptcha_get_html(Config::Get('plugin.recaptcha.public_key'), null, Config::Get('plugin.recaptcha.use_ssl')); + $this->Viewer_Assign('recaptcha', $recaptcha); return $this->Viewer_Fetch(Plugin::GetTemplatePath(__CLASS__).'inject.recaptcha_modal.tpl'); } } diff --git a/templates/skin/default/inject.recaptcha.tpl b/templates/skin/default/inject.recaptcha.tpl index 385e964..5f434c8 100644 --- a/templates/skin/default/inject.recaptcha.tpl +++ b/templates/skin/default/inject.recaptcha.tpl @@ -1,7 +1,7 @@
- {$recaptcha} +
\ No newline at end of file diff --git a/templates/skin/default/inject.recaptcha_modal.tpl b/templates/skin/default/inject.recaptcha_modal.tpl index 5844488..4dbd97b 100644 --- a/templates/skin/default/inject.recaptcha_modal.tpl +++ b/templates/skin/default/inject.recaptcha_modal.tpl @@ -1,4 +1,4 @@

- {$recaptcha_modal} +

\ No newline at end of file diff --git a/templates/skin/default/js/script.js b/templates/skin/default/js/script.js new file mode 100644 index 0000000..bf66bc1 --- /dev/null +++ b/templates/skin/default/js/script.js @@ -0,0 +1,6 @@ +jQuery(document).ready(function() { + setTimeout( + function() { + $('#registration-user-captcha').html($('#popup-registration-captcha').clone(true,true)); + },2000); +});