Index: mollom.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.js,v retrieving revision 1.5 diff -u -p -r1.5 mollom.js --- mollom.js 29 Jan 2010 22:06:15 -0000 1.5 +++ mollom.js 5 Feb 2010 14:17:13 -0000 @@ -20,8 +20,8 @@ Drupal.behaviors.mollomPrivacy = { */ Drupal.behaviors.mollomCaptcha = { attach: function (context) { - $('a.mollom-audio-captcha', context).click(getAudioCaptcha); - $('a.mollom-image-captcha', context).click(getImageCaptcha); + $('.mollom-audio-captcha', context).click(getAudioCaptcha); + $('.mollom-image-captcha', context).click(getImageCaptcha); } }; @@ -36,10 +36,10 @@ function getAudioCaptcha() { function(data) { // When data is successfully loaded, replace // contents of captcha-div with an audio CAPTCHA: - $('a.mollom-captcha', context).parent().html(data); + $('.mollom-captcha', context).parent().html(data); // Add an onclick-event handler for the new link: - $('a.mollom-image-captcha', context).click(getImageCaptcha); + $('.mollom-image-captcha', context).click(getImageCaptcha); }); return false; } @@ -55,10 +55,10 @@ function getImageCaptcha() { function(data) { // When data is successfully loaded, replace // contents of captcha-div with an image CAPTCHA: - $('a.mollom-captcha', context).parent().html(data); + $('.mollom-captcha', context).parent().html(data); // Add an onclick-event handler for the new link: - $('a.mollom-audio-captcha', context).click(getAudioCaptcha); + $('.mollom-audio-captcha', context).click(getAudioCaptcha); }); return false; } Index: mollom.pages.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.pages.inc,v retrieving revision 1.4 diff -u -p -r1.4 mollom.pages.inc --- mollom.pages.inc 14 Jan 2010 18:42:50 -0000 1.4 +++ mollom.pages.inc 5 Feb 2010 14:18:32 -0000 @@ -13,20 +13,40 @@ */ function mollom_captcha_js($type, $session_id) { $output = ''; + $data = array('author_ip' => ip_address(), 'session_id' => $session_id); - if ($type == 'audio') { - $response = mollom('mollom.getAudioCaptcha', array('author_ip' => ip_address(), 'session_id' => $session_id)); - if ($response) { - $output = ''; - $output .= ' (' . t('use image CAPTCHA') . ')'; - } - } - elseif ($type == 'image') { - $response = mollom('mollom.getImageCaptcha', array('author_ip' => ip_address(), 'session_id' => $session_id)); - if ($response) { - $output = 'Mollom CAPTCHA'; - $output .= ' (' . t('play audio CAPTCHA') . ')'; - } + switch ($type) { + case 'audio': + $response = mollom('mollom.getAudioCaptcha', $data); + if ($response) { + $source = url(drupal_get_path('module', 'mollom') . '/mollom-captcha-player.swf', array( + 'query' => array('url' => $response['url']), + )); + $output = ''; + $output .= ''; + $output .= ''; + $output .= ''; + $output .= ''; + $output .= ''; + $output .= ''; + $output .= ''; + $output .= ''; + $output .= ''; + + $output = '' . $output . ''; + $output .= ' (' . t('use image CAPTCHA') . ')'; + } + break; + + case 'image': + $response = mollom('mollom.getImageCaptcha', $data); + if ($response) { + $output .= 'Mollom CAPTCHA'; + + $output = '' . $output . ''; + $output .= ' (' . t('play audio CAPTCHA') . ')'; + } + break; } print $output; @@ -53,7 +73,19 @@ function mollom_report_form($form, &$for '#type' => 'value', '#value' => $id, ); - $form['feedback'] = _mollom_feedback_options(); + $form['feedback'] = array( + '#type' => 'radios', + '#title' => t('Optionally report this to Mollom'), + '#options' => array( + 'none' => t("Don't send feedback to Mollom"), + 'spam' => t('Report as spam or unsolicited advertising'), + 'profanity' => t('Report as obscene, violent or profane content'), + 'low-quality' => t('Report as low-quality content or writing'), + 'unwanted' => t('Report as unwanted, taunting or off-topic content'), + ), + '#default_value' => 'none', + '#description' => t("Mollom is a web service that helps you moderate your site's content: see http://mollom.com for more information. By sending feedback to Mollom, you teach Mollom about the content you like and dislike, allowing Mollom to do a better job helping you moderate your site's content. If you want to report multiple posts at once, you can use Mollom's bulk operations on the content and comment administration pages."), + ); return confirm_form($form, t('Are you sure you want to delete and report the content as inappropriate?'), @@ -105,21 +137,3 @@ function mollom_report_form_submit($form } } -/** - * Return a list of the possible feedback options for content. - */ -function _mollom_feedback_options() { - return array( - '#type' => 'radios', - '#title' => t('Optionally report this to Mollom'), - '#options' => array( - 'none' => t("Don't send feedback to Mollom"), - 'spam' => t('Report as spam or unsolicited advertising'), - 'profanity' => t('Report as obscene, violent or profane content'), - 'low-quality' => t('Report as low-quality content or writing'), - 'unwanted' => t('Report as unwanted, taunting or off-topic content'), - ), - '#default_value' => 'none', - '#description' => t("Mollom is a web service that helps you moderate your site's content: see http://mollom.com for more information. By sending feedback to Mollom, you teach Mollom about the content you like and dislike, allowing Mollom to do a better job helping you moderate your site's content. If you want to report multiple posts at once, you can use Mollom's bulk operations on the content and comment administration pages."), - ); -}