From fa39282ef779a331ba2e3096f791c5a663994e16 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 19 Feb 2011 00:09:11 +0000 Subject: - Patch #1056108 by 1V: consistent use of 'JavaScript' and 'Ajax'. --- modules/book/book.module | 8 ++-- modules/dashboard/dashboard.module | 4 +- modules/field/field.form.inc | 2 +- modules/field/tests/field.test | 4 +- modules/field_ui/field_ui.admin.inc | 6 +-- modules/field_ui/field_ui.js | 10 ++-- modules/file/file.field.inc | 10 ++-- modules/file/file.js | 6 +-- modules/file/file.module | 6 +-- modules/file/tests/file.test | 10 ++-- modules/menu/menu.module | 2 +- modules/overlay/overlay-parent.js | 2 +- modules/overlay/overlay.module | 6 +-- modules/poll/poll.module | 6 +-- modules/poll/poll.test | 2 +- modules/simpletest/drupal_web_test_case.php | 30 ++++++------ modules/simpletest/tests/ajax.test | 28 +++++------ modules/simpletest/tests/ajax_forms_test.module | 64 ++++++++++++------------- modules/simpletest/tests/ajax_test.module | 4 +- modules/simpletest/tests/form.test | 12 ++--- modules/simpletest/tests/form_test.file.inc | 4 +- modules/system/system.api.php | 4 +- modules/system/system.module | 8 ++-- 23 files changed, 119 insertions(+), 119 deletions(-) (limited to 'modules') diff --git a/modules/book/book.module b/modules/book/book.module index 760eb5b62..6a94c979d 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -419,7 +419,7 @@ function book_form_node_form_alter(&$form, &$form_state, $form_id) { * rebuild so that the "Parent item" options are changed to reflect the newly * selected book. When JavaScript is enabled, the submit button that triggers * this handler is hidden, and the "Book" dropdown directly triggers the - * book_form_update() AJAX callback instead. + * book_form_update() Ajax callback instead. * * @see book_form_update() */ @@ -432,7 +432,7 @@ function book_pick_book_nojs_submit($form, &$form_state) { * Build the parent selection form element for the node form or outline tab. * * This function is also called when generating a new set of options during the - * AJAX callback, so an array is returned that can be used to replace an existing + * Ajax callback, so an array is returned that can be used to replace an existing * form element. */ function _book_parent_select($book_link) { @@ -479,7 +479,7 @@ function _book_parent_select($book_link) { * Build the common elements of the book form for the node and outline forms. */ function _book_add_form_elements(&$form, &$form_state, $node) { - // If the form is being processed during the AJAX callback of our book bid + // If the form is being processed during the Ajax callback of our book bid // dropdown, then $form_state will hold the value that was selected. if (isset($form_state['values']['book'])) { $node->book = $form_state['values']['book']; @@ -563,7 +563,7 @@ function _book_add_form_elements(&$form, &$form_state, $node) { /** * Renders a new parent page select element when the book selection changes. * - * This function is called via AJAX when the selected book is changed on a node + * This function is called via Ajax when the selected book is changed on a node * or book outline form. * * @return diff --git a/modules/dashboard/dashboard.module b/modules/dashboard/dashboard.module index 561569798..e8397012d 100644 --- a/modules/dashboard/dashboard.module +++ b/modules/dashboard/dashboard.module @@ -486,7 +486,7 @@ function dashboard_dashboard_regions() { } /** - * AJAX callback to show disabled blocks in the dashboard customization mode. + * Ajax callback to show disabled blocks in the dashboard customization mode. */ function dashboard_show_disabled() { global $theme_key; @@ -507,7 +507,7 @@ function dashboard_show_disabled() { } /** - * AJAX callback to display the rendered contents of a specific block. + * Ajax callback to display the rendered contents of a specific block. * * @param $module * The block's module name. diff --git a/modules/field/field.form.inc b/modules/field/field.form.inc index 4acd1fdfa..49f16a9a3 100644 --- a/modules/field/field.form.inc +++ b/modules/field/field.form.inc @@ -414,7 +414,7 @@ function field_add_more_js($form, $form_state) { return; } - // Add a DIV around the delta receiving the AJAX effect. + // Add a DIV around the delta receiving the Ajax effect. $delta = $element['#max_delta']; $element[$delta]['#prefix'] = '
' . (isset($element[$delta]['#prefix']) ? $element[$delta]['#prefix'] : ''); $element[$delta]['#suffix'] = (isset($element[$delta]['#suffix']) ? $element[$delta]['#suffix'] : '') . '
'; diff --git a/modules/field/tests/field.test b/modules/field/tests/field.test index 336323774..d87c7a5b2 100644 --- a/modules/field/tests/field.test +++ b/modules/field/tests/field.test @@ -1497,7 +1497,7 @@ class FieldFormTestCase extends FieldTestCase { $field_values[$weight]['value'] = (string) $value; $pattern[$weight] = "]*value=\"$value\" [^>]*"; } - // Press 'add more' button through AJAX, and place the expected HTML result + // Press 'add more' button through Ajax, and place the expected HTML result // as the tested content. $commands = $this->drupalPostAJAX(NULL, $edit, $this->field_name . '_add_more'); $this->content = $commands[1]['data']; @@ -1694,7 +1694,7 @@ class FieldFormTestCase extends FieldTestCase { $this->assertFieldValues($entity_1, 'field_unlimited', LANGUAGE_NONE, array(3, 2)); $this->assertFieldValues($entity_2, 'field_unlimited', LANGUAGE_NONE, array(13, 12)); - // Test the 'add more' buttons. Only AJAX submission is tested, because + // Test the 'add more' buttons. Only Ajax submission is tested, because // the two 'add more' buttons present in the form have the same #value, // which confuses drupalPost(). // 'Add more' button in the first entity: diff --git a/modules/field_ui/field_ui.admin.inc b/modules/field_ui/field_ui.admin.inc index 843cfe50a..b28014400 100644 --- a/modules/field_ui/field_ui.admin.inc +++ b/modules/field_ui/field_ui.admin.inc @@ -875,7 +875,7 @@ function field_ui_display_overview_form($form, &$form_state, $entity_type, $bund 'class' => array('field-ui-overview'), 'id' => 'field-display-overview', ), - // Add AJAX wrapper. + // Add Ajax wrapper. '#prefix' => '
', '#suffix' => '
', ); @@ -1157,7 +1157,7 @@ function field_ui_display_overview_form($form, &$form_state, $entity_type, $bund 'callback' => 'field_ui_display_overview_multistep_js', 'wrapper' => 'field-display-overview-wrapper', 'effect' => 'fade', - // The button stays hidden, so we hide the AJAX spinner too. Ad-hoc + // The button stays hidden, so we hide the Ajax spinner too. Ad-hoc // spinners will be added manually by the client-side script. 'progress' => 'none', ), @@ -1218,7 +1218,7 @@ function field_ui_display_overview_multistep_submit($form, &$form_state) { } /** - * AJAX handler for multistep buttons on the 'Manage display' screen. + * Ajax handler for multistep buttons on the 'Manage display' screen. */ function field_ui_display_overview_multistep_js($form, &$form_state) { $trigger = $form_state['triggering_element']; diff --git a/modules/field_ui/field_ui.js b/modules/field_ui/field_ui.js index cd27bffd8..4d3d0cc61 100644 --- a/modules/field_ui/field_ui.js +++ b/modules/field_ui/field_ui.js @@ -167,7 +167,7 @@ Drupal.fieldUIOverview = { refreshRows = rowHandler.regionChange(region); // Update the row region. rowHandler.region = region; - // AJAX-update the rows. + // Ajax-update the rows. Drupal.fieldUIOverview.AJAXRefreshRows(refreshRows); } } @@ -206,7 +206,7 @@ Drupal.fieldUIOverview = { }, /** - * Triggers AJAX refresh of selected rows. + * Triggers Ajax refresh of selected rows. * * The 'format type' selects can trigger a series of changes in child rows. * The #ajax behavior is therefore not attached directly to the selects, but @@ -215,7 +215,7 @@ Drupal.fieldUIOverview = { * @param rows * A hash object, whose keys are the names of the rows to refresh (they * will receive the 'ajax-new-content' effect on the server side), and - * whose values are the DOM element in the row that should get an AJAX + * whose values are the DOM element in the row that should get an Ajax * throbber. */ AJAXRefreshRows: function (rows) { @@ -234,7 +234,7 @@ Drupal.fieldUIOverview = { .addClass('progress-disabled') .after($throbber); - // Fire the AJAX update. + // Fire the Ajax update. $('input[name=refresh_rows]').val(rowNames.join(' ')); $('input#edit-refresh').mousedown(); @@ -295,7 +295,7 @@ Drupal.fieldUIDisplayOverview.field.prototype = { * @param region * The name of the new region for the row. * @return - * A hash object indicating which rows should be AJAX-updated as a result + * A hash object indicating which rows should be Ajax-updated as a result * of the change, in the format expected by * Drupal.displayOverview.AJAXRefreshRows(). */ diff --git a/modules/file/file.field.inc b/modules/file/file.field.inc index 385114c00..89d0eaa51 100644 --- a/modules/file/file.field.inc +++ b/modules/file/file.field.inc @@ -448,7 +448,7 @@ function file_field_widget_form(&$form, &$form_state, $field, $instance, $langco 'description' => '', ); - // Retrieve any values set in $form_state, as will be the case during AJAX + // Retrieve any values set in $form_state, as will be the case during Ajax // rebuilds of this form. if (isset($form_state['values'])) { $path = array_merge($element['#field_parents'], array($field['field_name'], $langcode)); @@ -650,7 +650,7 @@ function file_field_widget_process($element, &$form_state, $form) { ); } - // Adjust the AJAX settings so that on upload and remove of any individual + // Adjust the Ajax settings so that on upload and remove of any individual // file, the entire group of file fields is updated together. if ($field['cardinality'] != 1) { $parents = array_slice($element['#array_parents'], 0, -1); @@ -681,7 +681,7 @@ function file_field_widget_process($element, &$form_state, $form) { /** * An element #process callback for a group of file_generic fields. * - * Adds the weight field to each row so it can be ordered and adds a new AJAX + * Adds the weight field to each row so it can be ordered and adds a new Ajax * wrapper around the entire group so it can be replaced all at once. */ function file_field_widget_process_multiple($element, &$form_state, $form) { @@ -710,7 +710,7 @@ function file_field_widget_process_multiple($element, &$form_state, $form) { } } - // Add a new wrapper around all the elements for AJAX replacement. + // Add a new wrapper around all the elements for Ajax replacement. $element['#prefix'] = '
'; $element['#suffix'] = '
'; @@ -770,7 +770,7 @@ function theme_file_widget($variables) { $element = $variables['element']; $output = ''; - // The "form-managed-file" class is required for proper AJAX functionality. + // The "form-managed-file" class is required for proper Ajax functionality. $output .= '
'; if ($element['fid']['#value'] != 0) { // Add the file size after the file name. diff --git a/modules/file/file.js b/modules/file/file.js index 15629df5b..094abbc78 100644 --- a/modules/file/file.js +++ b/modules/file/file.js @@ -5,7 +5,7 @@ * Provides JavaScript additions to the managed file field type. * * This file provides progress bar support (if available), popup windows for - * file previews, and disabling of other file fields during AJAX uploads (which + * file previews, and disabling of other file fields during Ajax uploads (which * prevents separate file fields from accidentally uploading files). */ @@ -90,7 +90,7 @@ Drupal.file = Drupal.file || { disableFields: function (event){ var clickedButton = this; - // Only disable upload fields for AJAX buttons. + // Only disable upload fields for Ajax buttons. if (!$(clickedButton).hasClass('ajax-processed')) { return; } @@ -105,7 +105,7 @@ Drupal.file = Drupal.file || { // working with. Filter out fields that are already disabled so that they // do not get enabled when we re-enable these fields at the end of behavior // processing. Re-enable in a setTimeout set to a relatively short amount - // of time (1 second). All the other mousedown handlers (like Drupal's AJAX + // of time (1 second). All the other mousedown handlers (like Drupal's Ajax // behaviors) are excuted before any timeout functions are called, so we // don't have to worry about the fields being re-enabled too soon. // @todo If the previous sentence is true, why not set the timeout to 0? diff --git a/modules/file/file.module b/modules/file/file.module index 13a8024b2..500a3cbbc 100644 --- a/modules/file/file.module +++ b/modules/file/file.module @@ -221,7 +221,7 @@ function file_file_download($uri, $field_type = 'file') { } /** - * Menu callback; Shared AJAX callback for file uploads and deletions. + * Menu callback; Shared Ajax callback for file uploads and deletions. * * This rebuilds the form element for a particular field item. As long as the * form processing is properly encapsulated in the widget element the form @@ -265,7 +265,7 @@ function file_ajax_upload() { $form = $form[$parent]; } - // Add the special AJAX class if a new file was added. + // Add the special Ajax class if a new file was added. if (isset($form['#file_upload_delta']) && $current_file_count < $form['#file_upload_delta']) { $form[$current_file_count]['#attributes']['class'][] = 'ajax-new-content'; } @@ -453,7 +453,7 @@ function file_managed_file_process($element, &$form_state, $form) { ); } - // Prefix and suffix used for AJAX replacement. + // Prefix and suffix used for Ajax replacement. $element['#prefix'] = '
'; $element['#suffix'] = '
'; diff --git a/modules/file/tests/file.test b/modules/file/tests/file.test index 9794ea7c1..c619ca773 100644 --- a/modules/file/tests/file.test +++ b/modules/file/tests/file.test @@ -254,7 +254,7 @@ class FileManagedFileElementTestCase extends FileFieldTestCase { $this->drupalPost($path . '/' . $last_fid, array(), t('Save')); $this->assertRaw(t('The file id is %fid.', array('%fid' => $last_fid)), t('Empty submission did not change an existing file.')); - // Now, test the Upload and Remove buttons, with and without AJAX. + // Now, test the Upload and Remove buttons, with and without Ajax. foreach (array(FALSE, TRUE) as $ajax) { // Upload, then Submit. $last_fid_prior = $this->getLastFileId(); @@ -302,7 +302,7 @@ class FileManagedFileElementTestCase extends FileFieldTestCase { } /** - * Test class to test file field widget, single and multi-valued, with and without AJAX, with public and private files. + * Test class to test file field widget, single and multi-valued, with and without Ajax, with public and private files. */ class FileFieldWidgetTestCase extends FileFieldTestCase { public static function getInfo() { @@ -314,7 +314,7 @@ class FileFieldWidgetTestCase extends FileFieldTestCase { } /** - * Tests upload and remove buttons, with and without AJAX, for a single-valued File field. + * Tests upload and remove buttons, with and without Ajax, for a single-valued File field. */ function testSingleValuedWidget() { // Use 'page' instead of 'article', so that the 'article' image field does @@ -371,7 +371,7 @@ class FileFieldWidgetTestCase extends FileFieldTestCase { } /** - * Tests upload and remove buttons, with and without AJAX, for a multi-valued File field. + * Tests upload and remove buttons, with and without Ajax, for a multi-valued File field. */ function testMultiValuedWidget() { // Use 'page' instead of 'article', so that the 'article' image field does @@ -390,7 +390,7 @@ class FileFieldWidgetTestCase extends FileFieldTestCase { // Visit the node creation form, and upload 3 files. Since the field has // cardinality of 3, ensure the "Upload" button is displayed until after // the 3rd file, and after that, isn't displayed. - // @todo This is only testing a non-AJAX upload, because drupalPostAJAX() + // @todo This is only testing a non-Ajax upload, because drupalPostAJAX() // does not yet emulate jQuery's file upload. $this->drupalGet("node/add/$type_name"); for ($delta = 0; $delta < 3; $delta++) { diff --git a/modules/menu/menu.module b/modules/menu/menu.module index ded4bd21c..df2871931 100644 --- a/modules/menu/menu.module +++ b/modules/menu/menu.module @@ -352,7 +352,7 @@ function menu_parent_options($menus, $item) { /** * Page callback. - * Get all available menus and menu items as Javascript array. + * Get all the available menus and menu items as a JavaScript array. */ function menu_parent_options_js() { $available_menus = array(); diff --git a/modules/overlay/overlay-parent.js b/modules/overlay/overlay-parent.js index d176234cf..5b17cf75e 100644 --- a/modules/overlay/overlay-parent.js +++ b/modules/overlay/overlay-parent.js @@ -678,7 +678,7 @@ Drupal.overlay.eventhandlerDispatchEvent = function (event) { * Make a regular admin link into a URL that will trigger the overlay to open. * * @param link - * A Javascript Link object (i.e. an element). + * A JavaScript Link object (i.e. an element). * @param parentLocation * (optional) URL to override the parent window's location with. * diff --git a/modules/overlay/overlay.module b/modules/overlay/overlay.module index 7cf44b95c..279165006 100644 --- a/modules/overlay/overlay.module +++ b/modules/overlay/overlay.module @@ -626,7 +626,7 @@ function overlay_overlay_parent_initialize() { $type = str_replace('', variable_get('site_frontpage', 'node'), $type); } drupal_add_js(array('overlay' => array('paths' => $paths)), 'setting'); - // Pass along the AJAX callback for rerendering sections of the parent window. + // Pass along the Ajax callback for rerendering sections of the parent window. drupal_add_js(array('overlay' => array('ajaxCallback' => 'overlay-ajax')), 'setting'); } @@ -643,7 +643,7 @@ function overlay_overlay_child_initialize() { // the initial rendered content of those regions here, so that we can compare // it to the same content rendered in overlay_exit(), at the end of the page // request. This allows us to check if anything actually did change, and, if - // so, trigger an immediate AJAX refresh of the parent window. + // so, trigger an immediate Ajax refresh of the parent window. if (!empty($_POST) || isset($_GET['token'])) { foreach (overlay_supplemental_regions() as $region) { overlay_store_rendered_content($region, overlay_render_region($region)); @@ -945,7 +945,7 @@ function overlay_trigger_refresh() { /** * Prints the markup obtained by rendering a single region of the page. * - * This function is intended to be called via AJAX. + * This function is intended to be called via Ajax. * * @param $region * The name of the page region to render. diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 60d364523..65fd5abd1 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -242,7 +242,7 @@ function poll_form($node, &$form_state) { $type = node_type_get_type($node); // The submit handlers to add more poll choices require that this form is - // cached, regardless of whether AJAX is used. + // cached, regardless of whether Ajax is used. $form_state['cache'] = TRUE; $form['title'] = array( @@ -296,7 +296,7 @@ function poll_form($node, &$form_state) { } // We name our button 'poll_more' to avoid conflicts with other modules using - // AJAX-enabled buttons with the id 'more'. + // Ajax-enabled buttons with the id 'more'. $form['choice_wrapper']['poll_more'] = array( '#type' => 'submit', '#value' => t('More choices'), @@ -362,7 +362,7 @@ function poll_form($node, &$form_state) { * return just the changed part of the form. */ function poll_more_choices_submit($form, &$form_state) { - // If this is a AJAX POST, add 1, otherwise add 5 more choices to the form. + // If this is a Ajax POST, add 1, otherwise add 5 more choices to the form. if ($form_state['values']['poll_more']) { $n = $_GET['q'] == 'system/ajax' ? 1 : 5; $form_state['choice_count'] = count($form_state['values']['choice']) + $n; diff --git a/modules/poll/poll.test b/modules/poll/poll.test index c22cc3570..218dcac5e 100644 --- a/modules/poll/poll.test +++ b/modules/poll/poll.test @@ -426,7 +426,7 @@ class PollJSAddChoice extends DrupalWebTestCase { 'choice[new:1][chtext]' => $this->randomName(), ); - // Press 'add choice' button through AJAX, and place the expected HTML result + // Press 'add choice' button through Ajax, and place the expected HTML result // as the tested content. $commands = $this->drupalPostAJAX(NULL, $edit, array('op' => t('More choices'))); $this->content = $commands[1]['data']; diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index 17cbb1ffa..abe20d88e 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -1769,17 +1769,17 @@ class DrupalWebTestCase extends DrupalTestCase { * button with the value t('Delete'), and execute different code depending * on which one is clicked. * - * This function can also be called to emulate an AJAX submission. In this + * This function can also be called to emulate an Ajax submission. In this * case, this value needs to be an array with the following keys: - * - path: A path to submit the form values to for AJAX-specific processing, + * - path: A path to submit the form values to for Ajax-specific processing, * which is likely different than the $path parameter used for retrieving * the initial form. Defaults to 'system/ajax'. * - triggering_element: If the value for the 'path' key is 'system/ajax' or - * another generic AJAX processing path, this needs to be set to the name + * another generic Ajax processing path, this needs to be set to the name * of the element. If the name doesn't identify the element uniquely, then * this should instead be an array with a single key/value pair, * corresponding to the element name and value. The callback for the - * generic AJAX processing path uses this to find the #ajax information + * generic Ajax processing path uses this to find the #ajax information * for the element, including which specific callback to use for * processing the request. * @@ -1829,7 +1829,7 @@ class DrupalWebTestCase extends DrupalTestCase { $action = isset($form['action']) ? $this->getAbsoluteUrl((string) $form['action']) : $this->getUrl(); if ($ajax) { $action = $this->getAbsoluteUrl(!empty($submit['path']) ? $submit['path'] : 'system/ajax'); - // AJAX callbacks verify the triggering element if necessary, so while + // Ajax callbacks verify the triggering element if necessary, so while // we may eventually want extra code that verifies it in the // handleForm() function, it's not currently a requirement. $submit_matches = TRUE; @@ -1886,26 +1886,26 @@ class DrupalWebTestCase extends DrupalTestCase { } /** - * Execute an AJAX submission. + * Execute an Ajax submission. * * This executes a POST as ajax.js does. It uses the returned JSON data, an * array of commands, to update $this->content using equivalent DOM * manipulation as is used by ajax.js. It also returns the array of commands. * * @param $path - * Location of the form containing the AJAX enabled element to test. Can be + * Location of the form containing the Ajax enabled element to test. Can be * either a Drupal path or an absolute path or NULL to use the current page. * @param $edit * Field data in an associative array. Changes the current input fields * (where possible) to the values indicated. * @param $triggering_element - * The name of the form element that is responsible for triggering the AJAX + * The name of the form element that is responsible for triggering the Ajax * functionality to test. May be a string or, if the triggering element is * a button, an associative array where the key is the name of the button * and the value is the button label. i.e.) array('op' => t('Refresh')). * @param $ajax_path - * (optional) Override the path set by the AJAX settings of the triggering - * element. In the absence of both the triggering element's AJAX path and + * (optional) Override the path set by the Ajax settings of the triggering + * element. In the absence of both the triggering element's Ajax path and * $ajax_path 'system/ajax' will be used. * @param $options * (optional) Options to be forwarded to url(). @@ -1918,11 +1918,11 @@ class DrupalWebTestCase extends DrupalTestCase { * element is not enough to identify the form. Note this is not the Drupal * ID of the form but rather the HTML ID of the form. * @param $ajax_settings - * (optional) An array of AJAX settings which if specified will be used in - * place of the AJAX settings of the triggering element. + * (optional) An array of Ajax settings which if specified will be used in + * place of the Ajax settings of the triggering element. * * @return - * An array of AJAX commands. + * An array of Ajax commands. * * @see drupalPost() * @see ajax.js @@ -1936,7 +1936,7 @@ class DrupalWebTestCase extends DrupalTestCase { $content = $this->content; $drupal_settings = $this->drupalSettings; - // Get the AJAX settings bound to the triggering element. + // Get the Ajax settings bound to the triggering element. if (!isset($ajax_settings)) { if (is_array($triggering_element)) { $xpath = '//*[@name="' . key($triggering_element) . '" and @value="' . current($triggering_element) . '"]'; @@ -1965,7 +1965,7 @@ class DrupalWebTestCase extends DrupalTestCase { } // Unless a particular path is specified, use the one specified by the - // AJAX settings, or else 'system/ajax'. + // Ajax settings, or else 'system/ajax'. if (!isset($ajax_path)) { $ajax_path = isset($ajax_settings['url']) ? $ajax_settings['url'] : 'system/ajax'; } diff --git a/modules/simpletest/tests/ajax.test b/modules/simpletest/tests/ajax.test index 2a2469334..2d8c40919 100644 --- a/modules/simpletest/tests/ajax.test +++ b/modules/simpletest/tests/ajax.test @@ -11,9 +11,9 @@ class AJAXTestCase extends DrupalWebTestCase { } /** - * Assert that a command with the required properties exists within the array of AJAX commands returned by the server. + * Assert that a command with the required properties exists within the array of Ajax commands returned by the server. * - * The AJAX framework, via the ajax_deliver() and ajax_render() functions, + * The Ajax framework, via the ajax_deliver() and ajax_render() functions, * returns an array of commands. This array sometimes includes commands * automatically provided by the framework in addition to commands returned by * a particular page callback. During testing, we're usually interested that a @@ -28,7 +28,7 @@ class AJAXTestCase extends DrupalWebTestCase { * additional settings that aren't part of $needle. * * @param $haystack - * An array of AJAX commands returned by the server. + * An array of Ajax commands returned by the server. * @param $needle * Array of info we're expecting in one of those commands. * @param $message @@ -56,7 +56,7 @@ class AJAXTestCase extends DrupalWebTestCase { } /** - * Tests primary AJAX framework functions. + * Tests primary Ajax framework functions. */ class AJAXFrameworkTestCase extends AJAXTestCase { protected $profile = 'testing'; @@ -87,7 +87,7 @@ class AJAXFrameworkTestCase extends AJAXTestCase { ); $this->assertCommand($commands, $expected, t('ajax_render() loads settings added with drupal_add_js().')); - // Verify that AJAX settings are loaded for #type 'link'. + // Verify that Ajax settings are loaded for #type 'link'. $this->drupalGet('ajax-test/link'); $settings = $this->drupalGetSettings(); $this->assertEqual($settings['ajax']['ajax-link']['url'], url('filter/tips')); @@ -120,7 +120,7 @@ class AJAXFrameworkTestCase extends AJAXTestCase { } /** - * Tests AJAX framework commands. + * Tests Ajax framework commands. */ class AJAXCommandsTestCase extends AJAXTestCase { public static function getInfo() { @@ -132,7 +132,7 @@ class AJAXCommandsTestCase extends AJAXTestCase { } /** - * Test the various AJAX Commands. + * Test the various Ajax Commands. */ function testAJAXCommands() { $form_path = 'ajax_forms_test_ajax_commands_form'; @@ -324,7 +324,7 @@ class AJAXFormValuesTestCase extends AJAXTestCase { } /** - * Tests that AJAX-enabled forms work when multiple instances of the same form are on a page. + * Tests that Ajax-enabled forms work when multiple instances of the same form are on a page. */ class AJAXMultiFormTestCase extends AJAXTestCase { public static function getInfo() { @@ -338,7 +338,7 @@ class AJAXMultiFormTestCase extends AJAXTestCase { function setUp() { parent::setUp(array('form_test')); - // Create a multi-valued field for 'page' nodes to use for AJAX testing. + // Create a multi-valued field for 'page' nodes to use for Ajax testing. $field_name = 'field_ajax_test'; $field = array( 'field_name' => $field_name, @@ -363,7 +363,7 @@ class AJAXMultiFormTestCase extends AJAXTestCase { */ function testMultiForm() { // HTML IDs for elements within the field are potentially modified with - // each AJAX submission, but these variables are stable and help target the + // each Ajax submission, but these variables are stable and help target the // desired elements. $field_name = 'field_ajax_test'; $field_xpaths = array( @@ -399,7 +399,7 @@ class AJAXMultiFormTestCase extends AJAXTestCase { } /** - * Miscellaneous AJAX tests using ajax_test module. + * Miscellaneous Ajax tests using ajax_test module. */ class AJAXElementValidation extends AJAXTestCase { public static function getInfo() { @@ -411,12 +411,12 @@ class AJAXElementValidation extends AJAXTestCase { } /** - * Try to post an AJAX change to a form that has a validated element. + * Try to post an Ajax change to a form that has a validated element. * - * The drivertext field is AJAX-enabled. An additional field is not, but + * The drivertext field is Ajax-enabled. An additional field is not, but * is set to be a required field. In this test the required field is not * filled in, and we want to see if the activation of the "drivertext" - * AJAX-enabled field fails due to the required field being empty. + * Ajax-enabled field fails due to the required field being empty. */ function testAJAXElementValidation() { $web_user = $this->drupalCreateUser(); diff --git a/modules/simpletest/tests/ajax_forms_test.module b/modules/simpletest/tests/ajax_forms_test.module index 21784dfa3..c7dc36c6b 100644 --- a/modules/simpletest/tests/ajax_forms_test.module +++ b/modules/simpletest/tests/ajax_forms_test.module @@ -3,7 +3,7 @@ /** * @file - * Simpletest mock module for AJAX forms testing. + * Simpletest mock module for Ajax forms testing. */ /** @@ -67,7 +67,7 @@ function ajax_forms_test_simple_form($form, &$form_state) { } /** - * AJAX callback triggered by select. + * Ajax callback triggered by select. */ function ajax_forms_test_simple_form_select_callback($form, $form_state) { $commands = array(); @@ -77,7 +77,7 @@ function ajax_forms_test_simple_form_select_callback($form, $form_state) { } /** - * AJAX callback triggered by checkbox. + * Ajax callback triggered by checkbox. */ function ajax_forms_test_simple_form_checkbox_callback($form, $form_state) { $commands = array(); @@ -88,7 +88,7 @@ function ajax_forms_test_simple_form_checkbox_callback($form, $form_state) { /** - * Form to display the AJAX Commands. + * Form to display the Ajax Commands. * @param $form * @param $form_state * @return unknown_type @@ -154,7 +154,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { ), ); - // Shows the AJAX 'css' command. + // Shows the Ajax 'css' command. $form['css_command_example'] = array( '#value' => t("Set the the '#box' div to be blue."), '#type' => 'submit', @@ -165,7 +165,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { ); - // Shows the AJAX 'data' command. But there is no use of this information, + // Shows the Ajax 'data' command. But there is no use of this information, // as this would require a javascript client to use the data. $form['data_command_example'] = array( '#value' => t("AJAX data command: Issue command."), @@ -176,7 +176,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { '#suffix' => '
Data attached to this div.
', ); - // Shows the AJAX 'invoke' command. + // Shows the Ajax 'invoke' command. $form['invoke_command_example'] = array( '#value' => t("AJAX invoke command: Invoke addClass() method."), '#type' => 'submit', @@ -186,7 +186,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { '#suffix' => '
Original contents
', ); - // Shows the AJAX 'html' command. + // Shows the Ajax 'html' command. $form['html_command_example'] = array( '#value' => t("AJAX html: Replace the HTML in a selector."), '#type' => 'submit', @@ -196,7 +196,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { '#suffix' => '
Original contents
', ); - // Shows the AJAX 'insert' command. + // Shows the Ajax 'insert' command. $form['insert_command_example'] = array( '#value' => t("AJAX insert: Let client insert based on #ajax['method']."), '#type' => 'submit', @@ -207,7 +207,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { '#suffix' => '
Original contents
', ); - // Shows the AJAX 'prepend' command. + // Shows the Ajax 'prepend' command. $form['prepend_command_example'] = array( '#value' => t("AJAX 'prepend': Click to prepend something"), '#type' => 'submit', @@ -217,7 +217,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { '#suffix' => '
Something will be prepended to this div.
', ); - // Shows the AJAX 'remove' command. + // Shows the Ajax 'remove' command. $form['remove_command_example'] = array( '#value' => t("AJAX 'remove': Click to remove text"), '#type' => 'submit', @@ -227,7 +227,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { '#suffix' => '
text to be removed
', ); - // Shows the AJAX 'restripe' command. + // Shows the Ajax 'restripe' command. $form['restripe_command_example'] = array( '#type' => 'submit', '#value' => t("AJAX 'restripe' command"), @@ -242,7 +242,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) {
', ); - // Demonstrates the AJAX 'settings' command. The 'settings' command has + // Demonstrates the Ajax 'settings' command. The 'settings' command has // nothing visual to "show", but it can be tested via SimpleTest and via // Firebug. $form['settings_command_example'] = array( @@ -262,7 +262,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { } /** - * AJAX callback for 'after'. + * Ajax callback for 'after'. */ function ajax_forms_test_advanced_commands_after_callback($form, $form_state) { $selector = '#after_div'; @@ -273,7 +273,7 @@ function ajax_forms_test_advanced_commands_after_callback($form, $form_state) { } /** - * AJAX callback for 'alert'. + * Ajax callback for 'alert'. */ function ajax_forms_test_advanced_commands_alert_callback($form, $form_state) { $commands = array(); @@ -282,7 +282,7 @@ function ajax_forms_test_advanced_commands_alert_callback($form, $form_state) { } /** - * AJAX callback for 'append'. + * Ajax callback for 'append'. */ function ajax_forms_test_advanced_commands_append_callback($form, $form_state) { $selector = '#append_div'; @@ -292,7 +292,7 @@ function ajax_forms_test_advanced_commands_append_callback($form, $form_state) { } /** - * AJAX callback for 'before'. + * Ajax callback for 'before'. */ function ajax_forms_test_advanced_commands_before_callback($form, $form_state) { $selector = '#before_div'; @@ -303,14 +303,14 @@ function ajax_forms_test_advanced_commands_before_callback($form, $form_state) { } /** - * AJAX callback for 'changed'. + * Ajax callback for 'changed'. */ function ajax_forms_test_advanced_commands_changed_callback($form, $form_state) { $commands[] = ajax_command_changed('#changed_div'); return array('#type' => 'ajax', '#commands' => $commands); } /** - * AJAX callback for 'changed' with asterisk marking inner div. + * Ajax callback for 'changed' with asterisk marking inner div. */ function ajax_forms_test_advanced_commands_changed_asterisk_callback($form, $form_state) { $commands = array(); @@ -319,7 +319,7 @@ function ajax_forms_test_advanced_commands_changed_asterisk_callback($form, $for } /** - * AJAX callback for 'css'. + * Ajax callback for 'css'. */ function ajax_forms_test_advanced_commands_css_callback($form, $form_state) { $selector = '#css_div'; @@ -331,7 +331,7 @@ function ajax_forms_test_advanced_commands_css_callback($form, $form_state) { } /** - * AJAX callback for 'data'. + * Ajax callback for 'data'. */ function ajax_forms_test_advanced_commands_data_callback($form, $form_state) { $selector = '#data_div'; @@ -342,7 +342,7 @@ function ajax_forms_test_advanced_commands_data_callback($form, $form_state) { } /** - * AJAX callback for 'invoke'. + * Ajax callback for 'invoke'. */ function ajax_forms_test_advanced_commands_invoke_callback($form, $form_state) { $commands = array(); @@ -351,7 +351,7 @@ function ajax_forms_test_advanced_commands_invoke_callback($form, $form_state) { } /** - * AJAX callback for 'html'. + * Ajax callback for 'html'. */ function ajax_forms_test_advanced_commands_html_callback($form, $form_state) { $commands = array(); @@ -360,7 +360,7 @@ function ajax_forms_test_advanced_commands_html_callback($form, $form_state) { } /** - * AJAX callback for 'insert'. + * Ajax callback for 'insert'. */ function ajax_forms_test_advanced_commands_insert_callback($form, $form_state) { $commands = array(); @@ -369,7 +369,7 @@ function ajax_forms_test_advanced_commands_insert_callback($form, $form_state) { } /** - * AJAX callback for 'prepend'. + * Ajax callback for 'prepend'. */ function ajax_forms_test_advanced_commands_prepend_callback($form, $form_state) { $commands = array(); @@ -378,7 +378,7 @@ function ajax_forms_test_advanced_commands_prepend_callback($form, $form_state) } /** - * AJAX callback for 'remove'. + * Ajax callback for 'remove'. */ function ajax_forms_test_advanced_commands_remove_callback($form, $form_state) { $commands = array(); @@ -387,7 +387,7 @@ function ajax_forms_test_advanced_commands_remove_callback($form, $form_state) { } /** - * AJAX callback for 'restripe'. + * Ajax callback for 'restripe'. */ function ajax_forms_test_advanced_commands_restripe_callback($form, $form_state) { $commands = array(); @@ -396,7 +396,7 @@ function ajax_forms_test_advanced_commands_restripe_callback($form, $form_state) } /** - * AJAX callback for 'settings'. + * Ajax callback for 'settings'. */ function ajax_forms_test_advanced_commands_settings_callback($form, $form_state) { $commands = array(); @@ -407,12 +407,12 @@ function ajax_forms_test_advanced_commands_settings_callback($form, $form_state) /** * This form and its related submit and callback functions demonstrate - * not validating another form element when a single AJAX element is triggered. + * not validating another form element when a single Ajax element is triggered. * - * The "drivertext" element is an AJAX-enabled textfield, free-form. + * The "drivertext" element is an Ajax-enabled textfield, free-form. * The "required_field" element is a textfield marked required. * - * The correct behavior is that the AJAX-enabled drivertext element should + * The correct behavior is that the Ajax-enabled drivertext element should * be able to trigger without causing validation of the "required_field". */ function ajax_forms_test_validation_form($form, &$form_state) { @@ -451,7 +451,7 @@ function ajax_forms_test_validation_form_submit($form, $form_state) { } /** - * AJAX callback for the 'drivertext' element of the validation form. + * Ajax callback for the 'drivertext' element of the validation form. */ function ajax_forms_test_validation_form_callback($form, $form_state) { drupal_set_message("ajax_forms_test_validation_form_callback invoked"); diff --git a/modules/simpletest/tests/ajax_test.module b/modules/simpletest/tests/ajax_test.module index 70f87f512..d4e9c817e 100644 --- a/modules/simpletest/tests/ajax_test.module +++ b/modules/simpletest/tests/ajax_test.module @@ -3,7 +3,7 @@ /** * @file - * Helper module for AJAX framework tests. + * Helper module for Ajax framework tests. */ /** @@ -45,7 +45,7 @@ function ajax_test_render() { } /** - * Menu callback; Returns AJAX element with #error property set. + * Menu callback; Returns Ajax element with #error property set. */ function ajax_test_error() { $message = ''; diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test index a73ac16c2..279b53e67 100644 --- a/modules/simpletest/tests/form.test +++ b/modules/simpletest/tests/form.test @@ -1132,13 +1132,13 @@ class FormsRebuildTestCase extends DrupalWebTestCase { } /** - * Tests that a form's action is retained after an AJAX submission. + * Tests that a form's action is retained after an Ajax submission. * - * The 'action' attribute of a form should not change after an AJAX submission - * followed by a non-AJAX submission, which triggers a validation error. + * The 'action' attribute of a form should not change after an Ajax submission + * followed by a non-Ajax submission, which triggers a validation error. */ function testPreserveFormActionAfterAJAX() { - // Create a multi-valued field for 'page' nodes to use for AJAX testing. + // Create a multi-valued field for 'page' nodes to use for Ajax testing. $field_name = 'field_ajax_test'; $field = array( 'field_name' => $field_name, @@ -1157,14 +1157,14 @@ class FormsRebuildTestCase extends DrupalWebTestCase { $this->web_user = $this->drupalCreateUser(array('create page content')); $this->drupalLogin($this->web_user); - // Get the form for adding a 'page' node. Submit an "add another item" AJAX + // Get the form for adding a 'page' node. Submit an "add another item" Ajax // submission and verify it worked by ensuring the updated page has two text // field items in the field for which we just added an item. $this->drupalGet('node/add/page'); $this->drupalPostAJAX(NULL, array(), array('field_ajax_test_add_more' => t('Add another item')), 'system/ajax', array(), array(), 'page-node-form'); $this->assert(count($this->xpath('//div[contains(@class, "field-name-field-ajax-test")]//input[@type="text"]')) == 2, t('AJAX submission succeeded.')); - // Submit the form with the non-AJAX "Save" button, leaving the title field + // Submit the form with the non-Ajax "Save" button, leaving the title field // blank to trigger a validation error, and ensure that a validation error // occurred, because this test is for testing what happens when a form is // re-rendered without being re-built, which is what happens when there's diff --git a/modules/simpletest/tests/form_test.file.inc b/modules/simpletest/tests/form_test.file.inc index 808863ede..5a637baf8 100644 --- a/modules/simpletest/tests/form_test.file.inc +++ b/modules/simpletest/tests/form_test.file.inc @@ -11,7 +11,7 @@ * hook_menu(). */ function form_test_load_include_menu($form, &$form_state) { - // Submit the form via AJAX. That way the FAPI has to care about including + // Submit the form via Ajax. That way the FAPI has to care about including // the file specified in hook_menu(). $ajax_wrapper_id = drupal_html_id('form-test-load-include-menu-ajax-wrapper'); $form['ajax_wrapper'] = array( @@ -43,7 +43,7 @@ function form_test_load_include_submit($form, $form_state) { function form_test_load_include_menu_ajax($form) { // We don't need to return anything, since #ajax['method'] is 'append', which // does not remove the original #ajax['wrapper'] element, and status messages - // are automatically added by the AJAX framework as long as there's a wrapper + // are automatically added by the Ajax framework as long as there's a wrapper // element to add them to. return ''; } diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 4c4e225fa..92ca1e937 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -824,7 +824,7 @@ function hook_css_alter(&$css) { } /** - * Alter the commands that are sent to the user through the AJAX framework. + * Alter the commands that are sent to the user through the Ajax framework. * * @param $commands * An array of all commands that will be sent to the user. @@ -3894,7 +3894,7 @@ function hook_date_formats_alter(&$formats) { function hook_page_delivery_callback_alter(&$callback) { // jQuery sets a HTTP_X_REQUESTED_WITH header of 'XMLHttpRequest'. // If a page would normally be delivered as an html page, and it is called - // from jQuery, deliver it instead as an AJAX response. + // from jQuery, deliver it instead as an Ajax response. if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' && $callback == 'drupal_deliver_html_page') { $callback = 'ajax_deliver'; } diff --git a/modules/system/system.module b/modules/system/system.module index b5dfc5498..8d09febf3 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -295,10 +295,10 @@ function system_element_info() { '#theme' => 'page', '#theme_wrappers' => array('html'), ); - // By default, we don't want AJAX commands being rendered in the context of an + // By default, we don't want Ajax commands being rendered in the context of an // HTML page, so we don't provide defaults for #theme or #theme_wrappers. // However, modules can set these properties (for example, to provide an HTML - // debugging page that displays rather than executes AJAX commands). + // debugging page that displays rather than executes Ajax commands). $types['ajax'] = array( '#header' => TRUE, '#commands' => array(), @@ -1079,7 +1079,7 @@ function _system_batch_theme() { * Implements hook_library(). */ function system_library() { - // Drupal's AJAX framework. + // Drupal's Ajax framework. $libraries['drupal.ajax'] = array( 'title' => 'Drupal AJAX', 'website' => 'http://api.drupal.org/api/drupal/includes--ajax.inc/group/ajax/7', @@ -3451,7 +3451,7 @@ function system_page_alter(&$page) { */ function system_run_automated_cron() { // If the site is not fully installed, suppress the automated cron run. - // Otherwise it could be triggered prematurely by AJAX requests during + // Otherwise it could be triggered prematurely by Ajax requests during // installation. if (($threshold = variable_get('cron_safe_threshold', DRUPAL_CRON_DEFAULT_THRESHOLD)) > 0 && variable_get('install_task') == 'done') { $cron_last = variable_get('cron_last', NULL); -- cgit v1.2.3