Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
fa39282e
Commit
fa39282e
authored
Feb 19, 2011
by
Dries Buytaert
Browse files
- Patch
#1056108
by 1V: consistent use of 'JavaScript' and 'Ajax'.
parent
7205ff14
Changes
31
Expand all
Hide whitespace changes
Inline
Side-by-side
MAINTAINERS.txt
View file @
fa39282e
...
...
@@ -19,7 +19,7 @@ Drupal 7
Component maintainers
---------------------
A
JAX
system
A
jax
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>
...
...
includes/ajax.inc
View file @
fa39282e
This diff is collapsed.
Click to expand it.
includes/cache-install.inc
View file @
fa39282e
...
...
@@ -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, A
JAX
requests triggered by the installer). If we
// same time (for example, A
jax
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
...
...
includes/common.inc
View file @
fa39282e
...
...
@@ -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
j
ava
s
cript code that, when used
* // will return an onmouseout attribute with
J
ava
S
cript 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 A
JAX
version of the page. The page callback
* version of the page and an A
jax
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 A
JAX
* delivery callback function will send it as an HTML page or an A
jax
* 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
id
s, a counter is appended to the
id
string. Therefore,
* For already existing
ID
s, 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 A
JAX
requests on the same page, A
JAX
requests
* Two consecutive hyphens separate the counter from the original
ID
. To manage
* uniqueness across multiple A
jax
requests on the same page, A
jax
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
id
s submitted via A
JAX
, any multiple consecutive
* To allow reverse-parsing of
ID
s submitted via A
jax
, 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 A
JAX
request, then content returned by this page request will
// be merged with content already on the base page. The HTML
id
s must be
// If this is an A
jax
request, then content returned by this page request will
// be merged with content already on the base page. The HTML
ID
s must be
// unique for the fully merged content. Therefore, initialize $seen_ids to
// take into account
id
s that are already in use on the base page.
// take into account
ID
s 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
//
id
s to the POST data of A
JAX
submissions. Direct use of $_POST is
//
ID
s to the POST data of A
jax
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
// A
JAX
requests.
// A
jax
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 A
JAX
loading, in a theme-independent way.
* drag-and-drop or dynamic A
jax
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 Java
s
cript file is added.
// first time a Java
S
cript 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 Java
s
cript to validate as XHTML, all Java
s
cript containing
// For inline Java
S
cript to validate as XHTML, all Java
S
cript 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 Java
s
cript may look for arguments in the
url
and act on them, some
// Since Java
S
cript 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, Java
s
cript and CSS have been added already, as they require
// Libraries, Java
S
cript 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 Java
s
cript equivalent.
* Converts a PHP variable into its Java
S
cript 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 A
JAX
request URL.
// If #ajax['path] was not specified, use the href as A
jax
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,
j
ava
s
cript
* When caching elements, it is necessary to collect all libraries,
J
ava
S
cript
* 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.
...
...
includes/form.inc
View file @
fa39282e
...
...
@@ -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 A
JAX
forms.) This is
* which may or may not be a button (in the case of A
jax
forms.) This is
* often used to distinguish between various buttons in a submit handler,
* and is also used in A
JAX
handlers.
* and is also used in A
jax
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 A
JAX
submissions,
* to do this. One example where this is needed is to handle A
jax
submissions,
* so ajax_process_form() sets this for all forms that include an element with
* a #ajax property. (In A
JAX
, the handler has no way to build the form
* a #ajax property. (In A
jax
, 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 A
JAX
operations.
* likely to occur during AHAH or A
jax
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.
*
* A
JAX
form submissions are almost always multi-step workflows, so that is one
* A
jax
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 A
JAX
-enabled forms.
* for more information about creating A
jax
-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 A
JAX
callbacks and similar partial form rebuilds. The
* #action properties in A
jax
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. A
JAX
or
// If only parts of the form will be returned to the browser (e.g.
,
A
jax
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 A
JAX
and other partial
// #action defaults to request_uri(), but in case of A
jax
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., A
JAX
// However, for forms that have not been fully executed (e.g., A
jax
// 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 A
JAX
and non-HTML front-ends,
// @todo D8: Simplify this logic; considering A
jax
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 A
JAX
* defines $form_state['no_redirect'] when building a form in an A
jax
* 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 A
JAX
submission triggered by a
// which is particularly useful during an A
jax
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 A
JAX
.
// Detect if the element triggered the submission via A
jax
.
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 A
JAX
, then it
// If the form was submitted by the browser rather than via A
jax
, 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
* A
JAX
or some other scriptable environment. These environments can set the
* A
jax
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 A
JAX
(that is done in
* This does not detect button clicks processed by A
jax
(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).
...
...
includes/theme.inc
View file @
fa39282e
...
...
@@ -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 A
JAX
request can be rendered using the same theme.
// later A
jax
request can be rendered using the same theme.
// @see ajax_base_page_theme()
$setting
[
'ajaxPageState'
]
=
array
(
'theme'
=>
$theme_key
,
...
...
misc/ajax.js
View file @
fa39282e
...
...
@@ -2,25 +2,25 @@
(
function
(
$
)
{
/**
* Provides A
JAX
page updating via jQuery $.ajax (Asynchronous JavaScript and XML).
* Provides A
jax
page updating via jQuery $.ajax (Asynchronous JavaScript and XML).
*
* A
JAX
is a method of making a request via Java
s
cript while viewing an HTML
* A
jax
is a method of making a request via Java
S
cript 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 A
JAX
capabilities.
* to provide A
jax
capabilities.
*/
Drupal
.
ajax
=
Drupal
.
ajax
||
{};
/**
* Attaches the A
JAX
behavior to each A
JAX
form element.
* Attaches the A
jax
behavior to each A
jax
form element.
*/
Drupal
.
behaviors
.
AJAX
=
{
attach
:
function
(
context
,
settings
)
{
// Load all A
JAX
behaviors specified in the settings.
// Load all A
jax
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 A
JAX
behaviors to all items showing the class.
// Bind A
jax
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 A
JAX
.
// This class means to submit the form to the action using A
jax
.
$
(
'
.use-ajax-submit:not(.ajax-processed)
'
).
addClass
(
'
ajax-processed
'
).
each
(
function
()
{
var
element_settings
=
{};
// A
JAX
submits specified in this manner automatically submit to the
// A
jax
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 = {
};
/**
* A
JAX
object.
* A
jax
object.
*
* All A
JAX
objects on a page are accessible through the global Drupal.ajax
* All A
jax
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 A
JAX
enabled button has the ID 'edit-submit', you can
* For example, if your A
jax
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 A
JAX
to links as well.
// bind A
jax
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 A
JAX
behaviors
// If necessary, enable keyboard submission so that A
jax
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 A
JAX
object will, if instructed, bind to a key press response. This
* The A
jax
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 A
JAX
response.
* Handle an event that triggers an A
jax
response.
*
* When an event that triggers an A
JAX
response happens, this method will
* perform the actual A
JAX
call. It is bound to the event using
* When an event that triggers an A
jax
response happens, this method will
* perform the actual A
jax
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 A
JAX
request before it is sent.
* Prepare the A
jax
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 A
JAX
request is in progress. ajax.ajaxing prevents
// interaction while the A
jax
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 A
JAX
content to be inserted in places where DIV elements are not
// enable A
jax
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
...
...
misc/drupal.js
View file @
fa39282e
...
...
@@ -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-Java
s
cript UIs. Behaviors are registered in the Drupal.behaviors
* default non-Java
S
cript 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/A
JAX
in their
* runs on initial page load. Developers implementing AHAH/A
jax
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/A
JAX
in their solutions should call this
* Developers implementing AHAH/A
jax
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 A
JAX
form is submitted, this is called with the
* - serialize: When an A
jax
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 A
JAX
response.
* Build an error message from an A
jax
response.
*/
Drupal
.
ajaxError
=
function
(
xmlhttp
,
uri
)
{
var
statusCode
,
statusText
,
pathText
,
responseText
,
readyStateText
,
message
;
...
...
modules/book/book.module
View file @
fa39282e
...
...
@@ -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() A
JAX
callback instead.
* book_form_update() A
jax
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
* A
JAX
callback, so an array is returned that can be used to replace an existing
* A
jax
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 A
JAX
callback of our book bid
// If the form is being processed during the A
jax
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 A
JAX
when the selected book is changed on a node
* This function is called via A
jax
when the selected book is changed on a node
* or book outline form.
*
* @return
...
...
modules/dashboard/dashboard.module
View file @
fa39282e
...
...
@@ -486,7 +486,7 @@ function dashboard_dashboard_regions() {
}
/**
* A
JAX
callback to show disabled blocks in the dashboard customization mode.
* A
jax
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() {
}
/**
* A
JAX
callback to display the rendered contents of a specific block.
* A
jax
callback to display the rendered contents of a specific block.
*
* @param $module
* The block's module name.
...
...
modules/field/field.form.inc
View file @
fa39282e
...
...
@@ -414,7 +414,7 @@ function field_add_more_js($form, $form_state) {
return
;
}
// Add a DIV around the delta receiving the A
JAX
effect.
// Add a DIV around the delta receiving the A
jax
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>'
;
...
...
modules/field/tests/field.test
View file @
fa39282e
...
...
@@ -1497,7 +1497,7 @@ class FieldFormTestCase extends FieldTestCase {
$field_values
[
$weight
][
'value'
]
=
(
string
)
$value
;
$pattern
[
$weight
]
=
"<input [^>]*value=
\"
$value
\"
[^>]*"
;
}
// Press 'add more' button through A
JAX
, and place the expected HTML result
// Press 'add more' button through A
jax
, 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 A
JAX
submission is tested, because
// Test the 'add more' buttons. Only A
jax
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:
...
...
modules/field_ui/field_ui.admin.inc
View file @
fa39282e
...
...
@@ -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 A
JAX
wrapper.
// Add A
jax
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 A
JAX
spinner too. Ad-hoc
// The button stays hidden, so we hide the A
jax
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) {
}
/**
* A
JAX
handler for multistep buttons on the 'Manage display' screen.
* A
jax
handler for multistep buttons on the 'Manage display' screen.
*/
function
field_ui_display_overview_multistep_js
(
$form
,
&
$form_state
)
{
$trigger
=
$form_state
[
'triggering_element'
];
...
...
modules/field_ui/field_ui.js
View file @
fa39282e
...
...
@@ -167,7 +167,7 @@ Drupal.fieldUIOverview = {
refreshRows
=
rowHandler
.
regionChange
(
region
);
// Update the row region.
rowHandler
.
region
=
region
;
// A
JAX
-update the rows.
// A
jax
-update the rows.
Drupal
.
fieldUIOverview
.
AJAXRefreshRows
(
refreshRows
);
}
}
...
...
@@ -206,7 +206,7 @@ Drupal.fieldUIOverview = {
},
/**
* Triggers A
JAX
refresh of selected rows.
* Triggers A
jax
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 A
JAX
* whose values are the DOM element in the row that should get an A
jax
* throbber.
*/
AJAXRefreshRows
:
function
(
rows
)
{
...
...
@@ -234,7 +234,7 @@ Drupal.fieldUIOverview = {
.
addClass
(
'
progress-disabled
'
)
.
after
(
$throbber
);
// Fire the A
JAX
update.
// Fire the A
jax
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 A
JAX
-updated as a result
* A hash object indicating which rows should be A
jax
-updated as a result
* of the change, in the format expected by