From 67df5f61adc904798056a8281e17da7e52fcd5cb Mon Sep 17 00:00:00 2001 From: gnits Date: Sat, 12 Apr 2014 00:58:58 +0200 Subject: Recaptcha controls converted to jQuery Prototype-style calls replaced with jQuery-style calls --- framework/Web/UI/WebControls/TReCaptcha.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'framework/Web/UI/WebControls/TReCaptcha.php') diff --git a/framework/Web/UI/WebControls/TReCaptcha.php b/framework/Web/UI/WebControls/TReCaptcha.php index 31fcf1ca..a5a360c3 100644 --- a/framework/Web/UI/WebControls/TReCaptcha.php +++ b/framework/Web/UI/WebControls/TReCaptcha.php @@ -227,7 +227,7 @@ class TReCaptcha extends TWebControl implements IValidatable public function renderContents($writer) { - $readyscript = 'Event.fire(document, '.TJavaScript::quoteString('captchaready:'.$this->getClientID()).')'; + $readyscript = 'jQuery(document).trigger('.TJavaScript::quoteString('captchaready:'.$this->getClientID()).')'; $cs = $this->Page->ClientScript; $id = $this->getClientID(); $divid = $id.'_1_recaptchadiv'; @@ -250,7 +250,7 @@ class TReCaptcha extends TWebControl implements IValidatable */ $writer->write($html); - $cs->registerEndScript('ReCaptcha::EventScript', 'Event.observe(document, "dom:loaded", function() { '.$readyscript.'; } );'); + $cs->registerEndScript('ReCaptcha::EventScript', 'jQuery(document).ready(function() { '.$readyscript.'; } );'); } else { @@ -258,7 +258,7 @@ class TReCaptcha extends TWebControl implements IValidatable $options['callback'] = new TJavaScriptLiteral('function() { '.$readyscript.'; '.$this->getCallbackScript().'; }'); $cs->registerScriptFile('ReCaptcha::AjaxScript', 'http://www.google.com/recaptcha/api/js/recaptcha_ajax.js'); $cs->registerEndScript('ReCaptcha::CreateScript::'.$id, implode(' ', array( - 'if (!$('.TJavaScript::quoteString($this->getResponseFieldName()).'))', + 'if (!jQuery('.TJavaScript::quoteString('#'.$this->getResponseFieldName()).'))', '{', 'Recaptcha.destroy();', 'Recaptcha.create(', -- cgit v1.2.3