? 180328_image_reload.patch
Index: image_captcha/image_captcha.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/captcha/image_captcha/image_captcha.js,v
retrieving revision 1.1
diff -b -u -p -r1.1 image_captcha.js
--- image_captcha/image_captcha.js	21 Jun 2009 16:01:53 -0000	1.1
+++ image_captcha/image_captcha.js	8 Dec 2009 10:10:28 -0000
@@ -33,4 +33,10 @@ $(document).ready(function(){
 	// Show or hide appropriately on page load.
 	smooth_distortion_shower(0)
 
+
+	// Add a click event to CAPTCHA images to reload the CAPTCHA image
+	$(".captcha_image").click(function() {
+		$(this).attr('src', $(this).attr('src').replace(/\?.*$/, '') + '?r=' + Math.random());
+	})
+
 });
Index: image_captcha/image_captcha.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/captcha/image_captcha/image_captcha.module,v
retrieving revision 1.31
diff -b -u -p -r1.31 image_captcha.module
--- image_captcha/image_captcha.module	22 Sep 2009 22:51:00 -0000	1.31
+++ image_captcha/image_captcha.module	8 Dec 2009 10:10:28 -0000
@@ -159,6 +159,9 @@ function image_captcha_captcha($op, $cap
         // build the result to return
         $result = array();
 
+        // Use javascript for some added usability (e.g. image reload).
+        drupal_add_js(drupal_get_path('module', 'image_captcha') .'/image_captcha.js');
+
         // Handle the case insesitivity option and change the code to lower case
         // before saving it as solution.
         if (CAPTCHA_DEFAULT_VALIDATION_CASE_SENSITIVE == variable_get('captcha_default_validation', CAPTCHA_DEFAULT_VALIDATION_CASE_INSENSITIVE)) {
@@ -175,7 +178,7 @@ function image_captcha_captcha($op, $cap
         $img_src = check_url(url("image_captcha/$captcha_sid/". time()));
         $result['form']['captcha_image'] = array(
           '#type' => 'markup',
-          '#value' => '<img src="'. $img_src .'" alt="'. t('Image CAPTCHA') .'" title="'. t('Image CAPTCHA') .'" />',
+          '#value' => '<img src="'. $img_src .'" class="captcha_image" id="captcha_image_'. $captcha_sid .'" alt="'. t('Image CAPTCHA') .'" title="'. t('Image CAPTCHA') .'" />',
           '#weight' => -2,
         );
         $result['form']['captcha_response'] = array(
