Commit fa39282e authored by Dries's avatar Dries

- Patch #1056108 by 1V: consistent use of 'JavaScript' and 'Ajax'.

parent 7205ff14
......@@ -19,7 +19,7 @@ Drupal 7
Component maintainers
---------------------
AJAX system
Ajax system
- Alex Bronstein 'effulgentsia' <http://drupal.org/user/78040>
- Randy Fay 'rfay' <http://drupal.org/user/30906>
- Earl Miles 'merlinofchaos' <http://drupal.org/user/26979>
......
This diff is collapsed.
......@@ -31,7 +31,7 @@ function clear($cid = NULL, $wildcard = FALSE) {
// If there is a database cache, attempt to clear it whenever possible. The
// reason for doing this is that the database cache can accumulate data
// during installation due to any full bootstraps that may occur at the
// same time (for example, AJAX requests triggered by the installer). If we
// same time (for example, Ajax requests triggered by the installer). If we
// didn't try to clear it whenever this function is called, the data in the
// cache would become stale; for example, the installer sometimes calls
// variable_set(), which updates the {variable} table and then clears the
......
......@@ -2238,7 +2238,7 @@ function drupal_http_header_attributes(array $attributes = array()) {
* drupal_attributes(array('title' => t('<script>steal_cookie();</script>')));
*
* // The statement below demonstrates dangerous use of drupal_attributes, and
* // will return an onmouseout attribute with javascript code that, when used
* // will return an onmouseout attribute with JavaScript code that, when used
* // as attribute in a tag, will cause users to be redirected to another site.
* //
* // In this case, the 'onmouseout' attribute should not be whitelisted --
......@@ -2383,9 +2383,9 @@ function l($text, $path, array $options = array()) {
* basis in hook_page_delivery_callback_alter().
*
* For example, the same page callback function can be used for an HTML
* version of the page and an AJAX version of the page. The page callback
* version of the page and an Ajax version of the page. The page callback
* function just needs to decide what content is to be returned and the
* delivery callback function will send it as an HTML page or an AJAX
* delivery callback function will send it as an HTML page or an Ajax
* response, as appropriate.
*
* In order for page callbacks to be reusable in different delivery formats,
......@@ -3665,17 +3665,17 @@ function drupal_html_class($class) {
* blocks, and other content to be output multiple times on the same page,
* without breaking (X)HTML validation.
*
* For already existing ids, a counter is appended to the id string. Therefore,
* For already existing IDs, a counter is appended to the ID string. Therefore,
* JavaScript and CSS code should not rely on any value that was generated by
* this function and instead should rely on manually added CSS classes or
* similarly reliable constructs.
*
* Two consecutive hyphens separate the counter from the original id. To manage
* uniqueness across multiple AJAX requests on the same page, AJAX requests
* Two consecutive hyphens separate the counter from the original ID. To manage
* uniqueness across multiple Ajax requests on the same page, Ajax requests
* POST an array of all IDs currently present on the page, which are used to
* prime this function's cache upon first invocation.
*
* To allow reverse-parsing of ids submitted via AJAX, any multiple consecutive
* To allow reverse-parsing of IDs submitted via Ajax, any multiple consecutive
* hyphens in the originally passed $id are replaced with a single hyphen.
*
* @param $id
......@@ -3685,10 +3685,10 @@ function drupal_html_class($class) {
* The cleaned ID.
*/
function drupal_html_id($id) {
// If this is an AJAX request, then content returned by this page request will
// be merged with content already on the base page. The HTML ids must be
// If this is an Ajax request, then content returned by this page request will
// be merged with content already on the base page. The HTML IDs must be
// unique for the fully merged content. Therefore, initialize $seen_ids to
// take into account ids that are already in use on the base page.
// take into account IDs that are already in use on the base page.
$seen_ids_init = &drupal_static(__FUNCTION__ . ':init');
if (!isset($seen_ids_init)) {
// Ideally, Drupal would provide an API to persist state information about
......@@ -3696,7 +3696,7 @@ function drupal_html_id($id) {
// function's $seen_ids static variable to that state information in order
// to have it properly initialized for this page request. However, no such
// page state API exists, so instead, ajax.js adds all of the in-use HTML
// ids to the POST data of AJAX submissions. Direct use of $_POST is
// IDs to the POST data of Ajax submissions. Direct use of $_POST is
// normally not recommended as it could open up security risks, but because
// the raw POST data is cast to a number before being returned by this
// function, this usage is safe.
......@@ -3743,7 +3743,7 @@ function drupal_html_id($id) {
// The counter needs to be appended with a delimiter that does not exist in
// the base ID. Requiring a unique delimiter helps ensure that we really do
// return unique IDs and also helps us re-create the $seen_ids array during
// AJAX requests.
// Ajax requests.
if (isset($seen_ids[$id])) {
$id = $id . '--' . ++$seen_ids[$id];
}
......@@ -3761,7 +3761,7 @@ function drupal_html_id($id) {
* page region that is output by the theme (Drupal core already handles this in
* the standard template preprocess implementation). Standardizing the class
* names in this way allows modules to implement certain features, such as
* drag-and-drop or dynamic AJAX loading, in a theme-independent way.
* drag-and-drop or dynamic Ajax loading, in a theme-independent way.
*
* @param $region
* The name of the page region (for example, 'page_top' or 'content').
......@@ -3946,7 +3946,7 @@ function drupal_add_js($data = NULL, $options = NULL) {
if (isset($data)) {
// Add jquery.js and drupal.js, as well as the basePath setting, the
// first time a Javascript file is added.
// first time a JavaScript file is added.
if (empty($javascript)) {
$javascript = array(
'settings' => array(
......@@ -3989,7 +3989,7 @@ function drupal_add_js($data = NULL, $options = NULL) {
default: // 'file' and 'external'
// Local and external files must keep their name as the associative key
// so the same JavaScript file is not be added twice.
// so the same JavaScript file is not added twice.
$javascript[$options['data']] = $options;
}
}
......@@ -4087,13 +4087,13 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
// page request.
$default_query_string = variable_get('css_js_query_string', '0');
// For inline Javascript to validate as XHTML, all Javascript containing
// For inline JavaScript to validate as XHTML, all JavaScript containing
// XHTML needs to be wrapped in CDATA. To make that backwards compatible
// with HTML 4, we need to comment out the CDATA-tag.
$embed_prefix = "\n<!--//--><![CDATA[//><!--\n";
$embed_suffix = "\n//--><!]]>\n";
// Since Javascript may look for arguments in the url and act on them, some
// Since JavaScript may look for arguments in the URL and act on them, some
// third-party code might require the use of a different query string.
$js_version_string = variable_get('drupal_js_version_query_string', 'v=');
......@@ -4311,7 +4311,7 @@ function drupal_process_attached($elements, $group = JS_DEFAULT, $dependency_che
}
// Add additional types of attachments specified in the render() structure.
// Libraries, Javascript and CSS have been added already, as they require
// Libraries, JavaScript and CSS have been added already, as they require
// special handling.
foreach ($elements['#attached'] as $callback => $options) {
if (function_exists($callback)) {
......@@ -4778,7 +4778,7 @@ function drupal_clear_js_cache() {
}
/**
* Converts a PHP variable into its Javascript equivalent.
* Converts a PHP variable into its JavaScript equivalent.
*
* We use HTML-safe strings, i.e. with <, > and & escaped.
*
......@@ -5320,7 +5320,7 @@ function drupal_pre_render_link($element) {
if (!isset($element['#id'])) {
$element['#id'] = $element['#options']['attributes']['id'] = drupal_html_id('ajax-link');
}
// If #ajax['path] was not specified, use the href as AJAX request URL.
// If #ajax['path] was not specified, use the href as Ajax request URL.
if (!isset($element['#ajax']['path'])) {
$element['#ajax']['path'] = $element['#href'];
$element['#ajax']['options'] = $element['#options'];
......@@ -5839,7 +5839,7 @@ function drupal_render_cache_set(&$markup, $elements) {
/**
* Collect #attached for an element and all child elements into a single array.
*
* When caching elements, it is necessary to collect all libraries, javascript
* When caching elements, it is necessary to collect all libraries, JavaScript
* and CSS into a single array, from both the element itself and all child
* elements. This allows drupal_render() to add these back to the page when the
* element is returned from cache.
......
......@@ -128,9 +128,9 @@
* - 'triggering_element': (read-only) The form element that triggered
* submission. This is the same as the deprecated
* $form_state['clicked_button']. It is the element that caused submission,
* which may or may not be a button (in the case of AJAX forms.) This is
* which may or may not be a button (in the case of Ajax forms.) This is
* often used to distinguish between various buttons in a submit handler,
* and is also used in AJAX handlers.
* and is also used in Ajax handlers.
* - 'cache': The typical form workflow involves two page requests. During the
* first page request, a form is built and returned for the user to fill in.
* Then the user fills the form in and submits it, triggering a second page
......@@ -139,9 +139,9 @@
* In some special use-cases, it is necessary or desired to persist the $form
* and $form_state variables from the initial page request to the one that
* processes the submission. A form builder function can set 'cache' to TRUE
* to do this. One example where this is needed is to handle AJAX submissions,
* to do this. One example where this is needed is to handle Ajax submissions,
* so ajax_process_form() sets this for all forms that include an element with
* a #ajax property. (In AJAX, the handler has no way to build the form
* a #ajax property. (In Ajax, the handler has no way to build the form
* itself, so must rely on the cached version created on each page load, so
* it's a classic example of this use case.) Note that the persistence of
* $form and $form_state across successive submissions of a multi-step form
......@@ -254,7 +254,7 @@ function drupal_get_form($form_id) {
* - must_validate: Ordinarily, a form is only validated once but there are
* times when a form is resubmitted internally and should be validated
* again. Setting this to TRUE will force that to happen. This is most
* likely to occur during AHAH or AJAX operations.
* likely to occur during AHAH or Ajax operations.
* - temporary: An array holding temporary data accessible during the current
* page request only. It may be used to temporary save any data that doesn't
* need to or shouldn't be cached during the whole form workflow, e.g. data
......@@ -396,9 +396,9 @@ function form_state_defaults() {
* function is called to generate a new $form, the next step in the form
* workflow, to be returned for rendering.
*
* AJAX form submissions are almost always multi-step workflows, so that is one
* Ajax form submissions are almost always multi-step workflows, so that is one
* common use-case during which form rebuilding occurs. See ajax_form_callback()
* for more information about creating AJAX-enabled forms.
* for more information about creating Ajax-enabled forms.
*
* @param $form_id
* The unique string identifying the desired form. If a function
......@@ -411,7 +411,7 @@ function form_state_defaults() {
* A keyed array containing the current state of the form.
* @param $old_form
* (optional) A previously built $form. Used to retain the #build_id and
* #action properties in AJAX callbacks and similar partial form rebuilds. The
* #action properties in Ajax callbacks and similar partial form rebuilds. The
* only properties copied from $old_form are the ones which both exist in
* $old_form and for which $form_state['rebuild_info']['copy'][PROPERTY] is
* TRUE. If $old_form is not passed, the entire $form is rebuilt freshly.
......@@ -427,7 +427,7 @@ function form_state_defaults() {
function drupal_rebuild_form($form_id, &$form_state, $old_form = NULL) {
$form = drupal_retrieve_form($form_id, $form_state);
// If only parts of the form will be returned to the browser (e.g. AJAX or
// If only parts of the form will be returned to the browser (e.g., Ajax or
// RIA clients), re-use the old #build_id to not require client-side code to
// manually update the hidden 'build_id' input element.
// Otherwise, a new #build_id is generated, to not clobber the previous
......@@ -441,7 +441,7 @@ function drupal_rebuild_form($form_id, &$form_state, $old_form = NULL) {
$form['#build_id'] = 'form-' . drupal_hash_base64(uniqid(mt_rand(), TRUE) . mt_rand());
}
// #action defaults to request_uri(), but in case of AJAX and other partial
// #action defaults to request_uri(), but in case of Ajax and other partial
// rebuilds, the form is submitted to an alternate URL, and the original
// #action needs to be retained.
if (isset($old_form['#action']) && !empty($form_state['rebuild_info']['copy']['#action'])) {
......@@ -882,13 +882,13 @@ function drupal_process_form($form_id, &$form, &$form_state) {
// yet complete. A new $form needs to be constructed based on the changes
// made to $form_state during this request. Normally, a submit handler sets
// $form_state['rebuild'] if a fully executed form requires another step.
// However, for forms that have not been fully executed (e.g., AJAX
// However, for forms that have not been fully executed (e.g., Ajax
// submissions triggered by non-buttons), there is no submit handler to set
// $form_state['rebuild']. It would not make sense to redisplay the
// identical form without an error for the user to correct, so we also
// rebuild error-free non-executed forms, regardless of
// $form_state['rebuild'].
// @todo D8: Simplify this logic; considering AJAX and non-HTML front-ends,
// @todo D8: Simplify this logic; considering Ajax and non-HTML front-ends,
// along with element-level #submit properties, it makes no sense to have
// divergent form execution based on whether the triggering element has
// #executes_submit_callback set to TRUE.
......@@ -1146,7 +1146,7 @@ function drupal_validate_form($form_id, &$form, &$form_state) {
* - If $form_state['no_redirect'] is TRUE, then the callback that originally
* built the form explicitly disallows any redirection, regardless of the
* redirection value in $form_state['redirect']. For example, ajax_get_form()
* defines $form_state['no_redirect'] when building a form in an AJAX
* defines $form_state['no_redirect'] when building a form in an Ajax
* callback to prevent any redirection. $form_state['no_redirect'] should NOT
* be altered by form builder functions or form validation/submit handlers.
* - If $form_state['programmed'] is TRUE, the form submission was usually
......@@ -1286,7 +1286,7 @@ function _form_validate(&$elements, &$form_state, $form_id = NULL) {
// If submit handlers won't run (due to the submission having been triggered
// by an element whose #executes_submit_callback property isn't TRUE), then
// it's safe to suppress all validation errors, and we do so by default,
// which is particularly useful during an AJAX submission triggered by a
// which is particularly useful during an Ajax submission triggered by a
// non-button. An element can override this default by setting the
// #limit_validation_errors property. For button element types,
// #limit_validation_errors defaults to FALSE (via system_element_info()),
......@@ -1962,12 +1962,12 @@ function _form_builder_handle_input_element($form_id, &$element, &$form_state) {
// form_state_values_clean(). Enforce the same input processing restrictions
// as above.
if ($process_input) {
// Detect if the element triggered the submission via AJAX.
// Detect if the element triggered the submission via Ajax.
if (_form_element_triggered_scripted_submission($element, $form_state)) {
$form_state['triggering_element'] = $element;
}
// If the form was submitted by the browser rather than via AJAX, then it
// If the form was submitted by the browser rather than via Ajax, then it
// can only have been triggered by a button, and we need to determine which
// button within the constraints of how browsers provide this information.
if (isset($element['#button_type'])) {
......@@ -1992,7 +1992,7 @@ function _form_builder_handle_input_element($form_id, &$element, &$form_state) {
* Helper function to handle the convoluted logic of button click detection.
*
* This detects button or non-button controls that trigger a form submission via
* AJAX or some other scriptable environment. These environments can set the
* Ajax or some other scriptable environment. These environments can set the
* special input key '_triggering_element_name' to identify the triggering
* element. If the name alone doesn't identify the element uniquely, the input
* key '_triggering_element_value' may also be set to require a match on element
......@@ -2017,7 +2017,7 @@ function _form_element_triggered_scripted_submission($element, &$form_state) {
* of the POST data, but with extra code to deal with the convoluted way in
* which browsers submit data for image button clicks.
*
* This does not detect button clicks processed by AJAX (that is done in
* This does not detect button clicks processed by Ajax (that is done in
* _form_element_triggered_scripted_submission()) and it does not detect form
* submissions from Internet Explorer in response to an ENTER key pressed in a
* textfield (form_builder() has extra code for that).
......
......@@ -104,7 +104,7 @@ function drupal_theme_initialize() {
drupal_static_reset('drupal_alter');
// Provide the page with information about the theme that's used, so that a
// later AJAX request can be rendered using the same theme.
// later Ajax request can be rendered using the same theme.
// @see ajax_base_page_theme()
$setting['ajaxPageState'] = array(
'theme' => $theme_key,
......
......@@ -2,25 +2,25 @@
(function ($) {
/**
* Provides AJAX page updating via jQuery $.ajax (Asynchronous JavaScript and XML).
* Provides Ajax page updating via jQuery $.ajax (Asynchronous JavaScript and XML).
*
* AJAX is a method of making a request via Javascript while viewing an HTML
* Ajax is a method of making a request via JavaScript while viewing an HTML
* page. The request returns an array of commands encoded in JSON, which is
* then executed to make any changes that are necessary to the page.
*
* Drupal uses this file to enhance form elements with #ajax['path'] and
* #ajax['wrapper'] properties. If set, this file will automatically be included
* to provide AJAX capabilities.
* to provide Ajax capabilities.
*/
Drupal.ajax = Drupal.ajax || {};
/**
* Attaches the AJAX behavior to each AJAX form element.
* Attaches the Ajax behavior to each Ajax form element.
*/
Drupal.behaviors.AJAX = {
attach: function (context, settings) {
// Load all AJAX behaviors specified in the settings.
// Load all Ajax behaviors specified in the settings.
for (var base in settings.ajax) {
if (!$('#' + base + '.ajax-processed').length) {
var element_settings = settings.ajax[base];
......@@ -37,7 +37,7 @@ Drupal.behaviors.AJAX = {
}
}
// Bind AJAX behaviors to all items showing the class.
// Bind Ajax behaviors to all items showing the class.
$('.use-ajax:not(.ajax-processed)').addClass('ajax-processed').each(function () {
var element_settings = {};
// Clicked links look better with the throbber than the progress bar.
......@@ -53,11 +53,11 @@ Drupal.behaviors.AJAX = {
Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings);
});
// This class means to submit the form to the action using AJAX.
// This class means to submit the form to the action using Ajax.
$('.use-ajax-submit:not(.ajax-processed)').addClass('ajax-processed').each(function () {
var element_settings = {};
// AJAX submits specified in this manner automatically submit to the
// Ajax submits specified in this manner automatically submit to the
// normal form action.
element_settings.url = $(this.form).attr('action');
// Form submit button clicks need to tell the form what was clicked so
......@@ -75,13 +75,13 @@ Drupal.behaviors.AJAX = {
};
/**
* AJAX object.
* Ajax object.
*
* All AJAX objects on a page are accessible through the global Drupal.ajax
* All Ajax objects on a page are accessible through the global Drupal.ajax
* object and are keyed by the submit button's ID. You can access them from
* your module's JavaScript file to override properties or functions.
*
* For example, if your AJAX enabled button has the ID 'edit-submit', you can
* For example, if your Ajax enabled button has the ID 'edit-submit', you can
* redefine the function that is called to insert the new content like this
* (inside a Drupal.behaviors attach block):
* @code
......@@ -134,7 +134,7 @@ Drupal.ajax = function (base, element, element_settings) {
this.wrapper = '#' + element_settings.wrapper;
// If there isn't a form, jQuery.ajax() will be used instead, allowing us to
// bind AJAX to links as well.
// bind Ajax to links as well.
if (this.element.form) {
this.form = $(this.element.form);
}
......@@ -179,7 +179,7 @@ Drupal.ajax = function (base, element, element_settings) {
return ajax.eventResponse(this, event);
});
// If necessary, enable keyboard submission so that AJAX behaviors
// If necessary, enable keyboard submission so that Ajax behaviors
// can be triggered through keyboard input as well as e.g. a mousedown
// action.
if (element_settings.keypress) {
......@@ -192,7 +192,7 @@ Drupal.ajax = function (base, element, element_settings) {
/**
* Handle a key press.
*
* The AJAX object will, if instructed, bind to a key press response. This
* The Ajax object will, if instructed, bind to a key press response. This
* will test to see if the key press is valid to trigger this event and
* if it is, trigger it for us and prevent other keypresses from triggering.
* In this case we're handling RETURN and SPACEBAR keypresses (event codes 13
......@@ -214,10 +214,10 @@ Drupal.ajax.prototype.keypressResponse = function (element, event) {
};
/**
* Handle an event that triggers an AJAX response.
* Handle an event that triggers an Ajax response.
*
* When an event that triggers an AJAX response happens, this method will
* perform the actual AJAX call. It is bound to the event using
* When an event that triggers an Ajax response happens, this method will
* perform the actual Ajax call. It is bound to the event using
* bind() in the constructor, and it uses the options specified on the
* ajax object.
*/
......@@ -315,7 +315,7 @@ Drupal.ajax.prototype.beforeSubmit = function (form_values, element, options) {
}
/**
* Prepare the AJAX request before it is sent.
* Prepare the Ajax request before it is sent.
*/
Drupal.ajax.prototype.beforeSend = function (xmlhttprequest, options) {
// For forms without file inputs, the jQuery Form plugin serializes the form
......@@ -347,7 +347,7 @@ Drupal.ajax.prototype.beforeSend = function (xmlhttprequest, options) {
}
// Disable the element that received the change to prevent user interface
// interaction while the AJAX request is in progress. ajax.ajaxing prevents
// interaction while the Ajax request is in progress. ajax.ajaxing prevents
// the element from triggering a new request, but does not prevent the user
// from changing its value.
$(this.element).addClass('progress-disabled').attr('disabled', true);
......@@ -488,7 +488,7 @@ Drupal.ajax.prototype.commands = {
// sufficiently tested whether attachBehaviors() can be successfully called
// with a context object that includes top-level text nodes. However, to
// give developers full control of the HTML appearing in the page, and to
// enable AJAX content to be inserted in places where DIV elements are not
// enable Ajax content to be inserted in places where DIV elements are not
// allowed (e.g., within TABLE, TR, and SPAN parents), we check if the new
// content satisfies the requirement of a single top-level element, and
// only use the container DIV created above when it doesn't. For more
......
......@@ -11,7 +11,7 @@ jQuery.noConflict();
* Attach all registered behaviors to a page element.
*
* Behaviors are event-triggered actions that attach to page elements, enhancing
* default non-Javascript UIs. Behaviors are registered in the Drupal.behaviors
* default non-JavaScript UIs. Behaviors are registered in the Drupal.behaviors
* object using the method 'attach' and optionally also 'detach' as follows:
* @code
* Drupal.behaviors.behaviorName = {
......@@ -25,7 +25,7 @@ jQuery.noConflict();
* @endcode
*
* Drupal.attachBehaviors is added below to the jQuery ready event and so
* runs on initial page load. Developers implementing AHAH/AJAX in their
* runs on initial page load. Developers implementing AHAH/Ajax in their
* solutions should also call this function after new page content has been
* loaded, feeding in an element to be processed, in order to attach all
* behaviors to the new content.
......@@ -61,7 +61,7 @@ Drupal.attachBehaviors = function (context, settings) {
/**
* Detach registered behaviors from a page element.
*
* Developers implementing AHAH/AJAX in their solutions should call this
* Developers implementing AHAH/Ajax in their solutions should call this
* function before page content is about to be removed, feeding in an element
* to be processed, in order to allow special behaviors to detach from the
* content.
......@@ -89,7 +89,7 @@ Drupal.attachBehaviors = function (context, settings) {
* IFRAME elements reload their "src" when being moved within the DOM,
* behaviors bound to IFRAME elements (like WYSIWYG editors) may need to
* take some action.
* - serialize: When an AJAX form is submitted, this is called with the
* - serialize: When an Ajax form is submitted, this is called with the
* form as the context. This provides every behavior within the form an
* opportunity to ensure that the field elements have correct content
* in them before the form is serialized. The canonical use-case is so
......@@ -302,7 +302,7 @@ Drupal.getSelection = function (element) {
};
/**
* Build an error message from an AJAX response.
* Build an error message from an Ajax response.
*/
Drupal.ajaxError = function (xmlhttp, uri) {
var statusCode, statusText, pathText, responseText, readyStateText, message;
......
......@@ -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
......
......@@ -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.
......
......@@ -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'] = '<div class="ajax-new-content">' . (isset($element[$delta]['#prefix']) ? $element[$delta]['#prefix'] : '');
$element[$delta]['#suffix'] = (isset($element[$delta]['#suffix']) ? $element[$delta]['#suffix'] : '') . '</div>';
......
......@@ -1497,7 +1497,7 @@ class FieldFormTestCase extends FieldTestCase {
$field_values[$weight]['value'] = (string) $value;
$pattern[$weight] = "<input [^>]*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:
......
......@@ -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' => '<div id="field-display-overview-wrapper">',
'#suffix' => '</div>',
);
......@@ -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'];
......
......@@ -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().
*/
......
......@@ -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'] = '<div id="' . $element['#id'] . '-ajax-wrapper">';
$element['#suffix'] = '</div>';
......@@ -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 .= '<div class="file-widget form-managed-file clearfix">';
if ($element['fid']['#value'] != 0) {
// Add the file size after the file name.
......
......@@ -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?
......
......@@ -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'] = '<div id="' . $element['#id'] . '-ajax-wrapper">';
$element['#suffix'] = '</div>';
......
......@@ -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 {