- Source:
Generates the themed representation of a Drupal object.
All requests for themed output must go through this function. It examines
the request and routes it to the appropriate theme function. If the current
theme does not provide an override function, the generic theme function is
called.
Example
Drupal.theme('placeholder', text);
Methods
(static) ajaxProgressBar($element) → {string}
- Source:
Provide a wrapper for the AJAX progress bar element.
Parameters:
Name | Type | Description |
---|---|---|
$element |
jQuery | Progress bar element. |
Returns:
The HTML markup for the progress bar.
- Type
- string
(static) ajaxProgressIndicatorFullscreen() → {string}
- Source:
An animated progress throbber and container element for AJAX operations.
Returns:
The HTML markup for the throbber.
- Type
- string
(static) ajaxProgressMessage(message) → {string}
- Source:
Formats text accompanying the AJAX progress throbber.
Parameters:
Name | Type | Description |
---|---|---|
message |
string | The message shown on the UI. |
Returns:
The HTML markup for the throbber.
- Type
- string
(static) ajaxProgressThrobber(messageopt) → {string}
- Source:
An animated progress throbber and container element for AJAX operations.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
string |
<optional> |
(optional) The message shown on the UI. |
Returns:
The HTML markup for the throbber.
- Type
- string
(static) ajaxWrapperMultipleRootElements($elements)
- Source:
- Deprecated:
- in drupal:8.6.0 and is removed from drupal:10.0.0. Use data with desired wrapper.
- See:
- To Do:
-
- Add deprecation warning after it is possible. For more information see: https://www.drupal.org/project/drupal/issues/2973400
Provide a wrapper for multiple root elements via Ajax.
Parameters:
Name | Type | Description |
---|---|---|
$elements |
jQuery | Response elements after parsing. |
(static) ajaxWrapperNewContent($newContent, ajax, response)
- Source:
- Deprecated:
- in drupal:8.6.0 and is removed from drupal:10.0.0. Use data with desired wrapper.
- See:
- To Do:
-
- Add deprecation warning after it is possible. For more information see: https://www.drupal.org/project/drupal/issues/2973400
Provide a wrapper for new content via Ajax.
Wrap the inserted markup when inserting multiple root elements with an
ajax effect.
Parameters:
Name | Type | Description |
---|---|---|
$newContent |
jQuery | Response elements after parsing. |
ajax |
Drupal.Ajax | Drupal.Ajax object created by Drupal.ajax. |
response |
object | The response from the Ajax request. |
(static) checkbox() → {string}
- Source:
Theme function for a checkbox.
Returns:
The HTML markup for the checkbox.
- Type
- string
(static) dateHelp(dateDesc) → {string}
- Source:
Theme function for no-native-datepicker date input help text.
Parameters:
Name | Type | Description |
---|---|---|
dateDesc |
string | The help text. |
Returns:
The HTML markup for the help text.
- Type
- string
(static) dateTimeHelp(dateId, timeId, dateDesc, timeDesc) → {string}
- Source:
Theme function for no-native-datepicker date+time inputs help text.
Parameters:
Name | Type | Description |
---|---|---|
dateId |
string | The date input aria-describedby value. |
timeId |
string | The time input aria-describedby value. |
dateDesc |
string | The date help text. |
timeDesc |
string | The time help text. |
Returns:
The HTML markup for the help text.
- Type
- string
(static) message(message, options) → {HTMLElement}
- Source:
Theme function for a message.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
message |
object | The message object.
Properties
|
|||||||||
options |
object | The message context.
Properties
|
Returns:
A DOM Node.
- Type
- HTMLElement
(static) placeholder(str) → {string}
- Source:
Formats text for emphasized display in a placeholder inside a sentence.
Parameters:
Name | Type | Description |
---|---|---|
str |
string | The text to format (plain-text). |
Returns:
The formatted text (html).
- Type
- string
(static) progressBar(id) → {string}
- Source:
Theme function for the progress bar.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The id for the progress bar. |
Returns:
The HTML for the progress bar.
- Type
- string
(static) tableDragChangedMarker() → {string}
- Source:
Returns:
Markup for the marker.
- Type
- string
(static) tableDragChangedWarning() → {string}
- Source:
Returns:
Markup for the warning.
- Type
- string
(static) tableDragIndentation() → {string}
- Source:
Returns:
Markup for the indentation.
- Type
- string
(static) verticalTab(settings) → {object}
- Source:
Theme function for a vertical tab.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
settings |
object | An object with the following keys:
Properties
|
Returns:
This function has to return an object with at least these keys:
- item: The root tab jQuery element
- link: The anchor tag that acts as the clickable area of the tab
(jQuery version)
- summary: The jQuery element that contains the tab summary
- Type
- object