? .DS_Store
? 647228_6_ajax_link.patch
? ajax_bind_once_2.patch
? ajax_link.patch
? d7ajax.kpf
? drupal.ajax-link.12.patch
? drupal.ajax-link.9.patch
? drupal.ajax_bind_once_769258.17.patch
? drupal.ajax_method_645800_03.patch
? drupal.ajax_method_645800_10.patch
? drupal.ajax_method_645800_13.patch
? sites/all/modules/examples
? sites/all/modules/quicktabs
? sites/default/files
? sites/default/private
? sites/default/settings.php
Index: includes/ajax.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/ajax.inc,v
retrieving revision 1.29
diff -u -p -r1.29 ajax.inc
--- includes/ajax.inc	31 Mar 2010 19:34:56 -0000	1.29
+++ includes/ajax.inc	26 Apr 2010 06:04:39 -0000
@@ -20,11 +20,10 @@
  * forms, it can be used with the #ajax property.
  * The #ajax property can be used to bind events to the AJAX framework. By
  * default, #ajax uses 'system/ajax' as its path for submission and thus calls
- * @link ajax_form_callback ajax_form_callback @endlink and a defined
- * #ajax['callback'] function. However, you may optionally specify a different
- * path to request or a different callback function to invoke, which can return
- * updated HTML or can also return a richer set of
- * @link ajax_commands AJAX framework commands @endlink.
+ * ajax_form_callback() and a defined #ajax['callback'] function. 
+ * However, you may optionally specify a different path to request or a
+ * different callback function to invoke, which can return updated HTML or can
+ * also return a richer set of @link ajax_commands AJAX framework commands @endlink.
  *
  * Standard form handling is as follows:
  *   - A form element has a #ajax member.
@@ -124,9 +123,10 @@
  *   selected automatically for the type of form widget being used, and
  *   is only needed if you need to override the default behavior.
  * - #ajax['method']: The jQuery method to use to place the new HTML.
- *   Defaults to 'replace'. May be: 'replace', 'append', 'prepend',
- *   'before', 'after', or 'html'. See the jQuery documentation for more
- *   information on these methods.
+ *   Defaults to 'replaceWith'. May be: 'replaceWith', 'append', 'prepend',
+ *   'before', 'after', or 'html'. See the
+ *   @link http://api.jquery.com/category/manipulation/ jQuery manipulators documentation @endlink
+ *   for more information on these methods.
  * - #ajax['progress']: Choose either a throbber or progress bar that is
  *   displayed while awaiting a response from the callback, and add an optional
  *   message. Possible keys: 'type', 'message', 'url', 'interval'.
@@ -336,13 +336,16 @@ function ajax_deliver($page_callback_res
     }
   }
   else {
-    // Like normal page callbacks, simple AJAX callbacks can return html
-    // content, as a string or renderable array, to replace what was previously
-    // there in the wrapper. In this case, in addition to the content, we want
-    // to add the status messages, but inside the new wrapper, so that they get
-    // replaced on subsequent AJAX calls for the same wrapper.
+    // Like normal page callbacks, simple AJAX callbacks can return HTML
+    // content, as a string or render array. This HTML is inserted in some
+    // relationship to #ajax['wrapper'], as determined by which jQuery DOM
+    // manipulation method is used. The method used is specified by
+    // #ajax['method']. The default method is 'replaceWith', which completely
+    // replaces the old wrapper element and its content with the new HTML.
     $html = is_string($page_callback_result) ? $page_callback_result : drupal_render($page_callback_result);
-    $commands[] = ajax_command_replace(NULL, $html);
+    $commands[] = ajax_command_insert(NULL, $html);
+    // Add the status messages inside the new content's wrapper element, so that
+    // on subsequent AJAX requests, it is treated as old content.
     $commands[] = ajax_command_prepend(NULL, theme('status_messages'));
   }
 
@@ -460,7 +463,7 @@ function ajax_process_form($element, &$f
       'selector' => '#' . $element['#id'],
       'effect' => 'none',
       'speed' => 'none',
-      'method' => 'replace',
+      'method' => 'replaceWith',
       'progress' => array('type' => 'throbber'),
     );
 
@@ -553,6 +556,37 @@ function ajax_command_alert($text) {
 }
 
 /**
+ * Creates a Drupal AJAX 'insert' command using the method in #ajax['method'].
+ *
+ * This command instructs the client to insert the given HTML using whichever
+ * jQuery DOM manipulation method has been specified in the #ajax['method']
+ * variable of the element that triggered the request.
+ *
+ * This command is implemented by Drupal.ajax.prototype.commands.insert()
+ * defined in misc/ajax.js.
+ *
+ * @param $selector
+ *   A jQuery selector string. If the command is a response to a request from
+ *   an #ajax form element then this value can be NULL.
+ * @param $html
+ *   The data to use with the jQuery method.
+ * @param $settings
+ *   An optional array of settings that will be used for this command only.
+ *
+ * @return
+ *   An array suitable for use with the ajax_render() function.
+ */
+function ajax_command_insert($selector, $html, $settings = NULL) {
+  return array(
+    'command' => 'insert',
+    'method' => NULL,
+    'selector' => $selector,
+    'data' => $html,
+    'settings' => $settings,
+  );
+}
+
+/**
  * Creates a Drupal AJAX 'insert/replaceWith' command.
  *
  * The 'insert/replaceWith' command instructs the client to use jQuery's
@@ -573,7 +607,7 @@ function ajax_command_alert($text) {
  * @return
  *   An array suitable for use with the ajax_render() function.
  *
- * @see http://docs.jquery.com/Manipulation/replaceWith#content
+ * See @link http://docs.jquery.com/Manipulation/replaceWith#content jQuery replaceWith command @endlink
  */
 function ajax_command_replace($selector, $html, $settings = NULL) {
   return array(
Index: misc/ajax.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/ajax.js,v
retrieving revision 1.15
diff -u -p -r1.15 ajax.js
--- misc/ajax.js	7 Apr 2010 17:30:43 -0000	1.15
+++ misc/ajax.js	26 Apr 2010 06:04:40 -0000
@@ -93,7 +93,7 @@ Drupal.ajax = function (base, element, e
     selector: '#' + base,
     effect: 'none',
     speed: 'slow',
-    method: 'replace',
+    method: 'replaceWith',
     progress: {
       type: 'bar',
       message: 'Please wait...'
Index: modules/field/field.form.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.form.inc,v
retrieving revision 1.47
diff -u -p -r1.47 field.form.inc
--- modules/field/field.form.inc	13 Apr 2010 15:23:02 -0000	1.47
+++ modules/field/field.form.inc	26 Apr 2010 06:04:40 -0000
@@ -215,7 +215,6 @@ function field_multiple_value_form($fiel
           '#ajax' => array(
             'callback' => 'field_add_more_js',
             'wrapper' => $wrapper_id,
-            'method' => 'replace',
             'effect' => 'fade',
           ),
           // The field_add_more_submit() and field_add_more_js() handlers will
Index: modules/file/file.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/file/file.module,v
retrieving revision 1.25
diff -u -p -r1.25 file.module
--- modules/file/file.module	13 Apr 2010 15:23:03 -0000	1.25
+++ modules/file/file.module	26 Apr 2010 06:04:41 -0000
@@ -351,7 +351,6 @@ function file_managed_file_process($elem
   $ajax_settings = array(
     'path' => 'file/ajax/' . implode('/', $element['#parents']) . '/' . $form['form_build_id']['#value'],
     'wrapper' => $element['#id'] . '-ajax-wrapper',
-    'method' => 'replace',
     'effect' => 'fade',
     'progress' => array(
       'type' => $element['#progress_indicator'],
Index: modules/poll/poll.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v
retrieving revision 1.345
diff -u -p -r1.345 poll.module
--- modules/poll/poll.module	24 Apr 2010 14:49:14 -0000	1.345
+++ modules/poll/poll.module	26 Apr 2010 06:04:42 -0000
@@ -297,7 +297,6 @@ function poll_form($node, &$form_state) 
     '#ajax' => array(
       'callback' => 'poll_choice_js',
       'wrapper' => 'poll-choices',
-      'method' => 'replace',
       'effect' => 'fade',
     ),
   );
Index: modules/simpletest/tests/ajax.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/ajax.test,v
retrieving revision 1.9
diff -u -p -r1.9 ajax.test
--- modules/simpletest/tests/ajax.test	11 Apr 2010 18:33:44 -0000	1.9
+++ modules/simpletest/tests/ajax.test	26 Apr 2010 06:04:42 -0000
@@ -146,6 +146,11 @@ class AJAXCommandsTestCase extends AJAXT
     $command = $commands[0];
     $this->assertTrue($command['command'] == 'insert' && $command['method'] == 'html' && $command['data'] == 'replacement text', "'html' AJAX command issued with correct data");
 
+    // Tests the 'insert' command.
+    $commands = $this->discardSettings($this->drupalPostAJAX($form_path, $edit, array('op' => t("AJAX insert: Let client insert based on #ajax['method']."))));
+    $command = $commands[0];
+    $this->assertTrue($command['command'] == 'insert' && $command['method'] == NULL && $command['data'] == 'insert replacement text', "'insert' AJAX command issued with correct data");
+
     // Tests the 'prepend' command.
     $commands = $this->discardSettings($this->drupalPostAJAX($form_path, $edit, array('op' => t("AJAX 'prepend': Click to prepend something"))));
     $command = $commands[0];
Index: modules/simpletest/tests/ajax_forms_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/ajax_forms_test.module,v
retrieving revision 1.5
diff -u -p -r1.5 ajax_forms_test.module
--- modules/simpletest/tests/ajax_forms_test.module	26 Mar 2010 18:58:12 -0000	1.5
+++ modules/simpletest/tests/ajax_forms_test.module	26 Apr 2010 06:04:42 -0000
@@ -186,6 +186,17 @@ function ajax_forms_test_ajax_commands_f
     '#suffix' => '<div id="html_div">Original contents</div>',
   );
 
+  // Shows the AJAX 'insert' command.
+  $form['insert_command_example'] = array(
+    '#value' => t("AJAX insert: Let client insert based on #ajax['method']."),
+    '#type' => 'submit',
+    '#ajax' => array(
+      'callback' => 'ajax_forms_test_advanced_commands_insert_callback',
+      'method' => 'prepend',
+    ),
+    '#suffix' => '<div id="insert_div">Original contents</div>',
+  );
+
   // Shows the AJAX 'prepend' command.
   $form['prepend_command_example'] = array(
     '#value' => t("AJAX 'prepend': Click to prepend something"),
@@ -321,6 +332,15 @@ function ajax_forms_test_advanced_comman
 }
 
 /**
+ * AJAX callback for 'insert'.
+ */
+function ajax_forms_test_advanced_commands_insert_callback($form, $form_state) {
+  $commands = array();
+  $commands[] = ajax_command_insert('#insert_div', 'insert replacement text');
+  return array('#type' => 'ajax', '#commands' => $commands);
+}
+
+/**
  * AJAX callback for 'prepend'.
  */
 function ajax_forms_test_advanced_commands_prepend_callback($form, $form_state) {
