JHtmlBehavior
Utility class for JavaScript behaviors
since |
1.5 |
---|---|
package |
Joomla.Libraries |
Methods
_getJSObject
Internal method to get a JavaScript object notation string from an array
_getJSObject(array $array = array()) : string
since |
1.5 |
---|---|
deprecated |
4.0 - Use JHtml::getJSObject() instead. |
Arguments
- $array
array
The array to convert to JavaScript object notation
Response
string
JavaScript object notation representation of the array
calendar
Add unobtrusive JavaScript support for a calendar control.
calendar() : void
since |
1.5 |
---|---|
deprecated |
4.0 |
calendartranslation
Internal method to translate the JavaScript Calendar
calendartranslation() : string
since |
1.5 |
---|
Response
string
JavaScript that translates the object
caption
Add unobtrusive JavaScript support for image captions.
caption(string $selector = 'img.caption') : void
since |
1.5 |
---|---|
Deprecated |
4.0 Use native HTML figure tags. |
Arguments
- $selector
string
The selector for which a caption behaviour is to be applied.
colorpicker
Add unobtrusive JavaScript support for a color picker.
colorpicker() : void
since |
1.7 |
---|---|
deprecated |
4.0 Use directly the field or the layout |
combobox
Add unobtrusive JavaScript support for a combobox effect.
combobox() : void
Note that this control is only reliable in absolutely positioned elements. Avoid using a combobox in a slider or dynamic pane.
since |
1.5 |
---|
core
Method to load core.js into the document head.
core() : void
Core.js defines the 'Joomla' namespace and contains functions which are used across extensions
since |
3.3 |
---|
formvalidation
Add unobtrusive JavaScript support for form validation.
formvalidation() : void
To enable form validation the form tag must have class="form-validate". Each field that needs to be validated needs to have class="validate". Additional handlers can be added to the handler for username, password, numeric and email. To use these add class="validate-email" and so on.
since |
1.5 |
---|---|
Deprecated |
3.4 Use formvalidator instead |
formvalidator
Add unobtrusive JavaScript support for form validation.
formvalidator() : void
To enable form validation the form tag must have class="form-validate". Each field that needs to be validated needs to have class="validate". Additional handlers can be added to the handler for username, password, numeric and email. To use these add class="validate-email" and so on.
since |
3.4 |
---|
framework
Method to load the MooTools framework into the document head
framework(boolean $extras = false, mixed $debug = null) : void
If debugging mode is on an uncompressed version of MooTools is included for easier debugging.
since |
1.6 |
---|---|
deprecated |
4.0 Update scripts to jquery |
Arguments
- $extras
boolean
Flag to determine whether to load MooTools More in addition to Core- $debug
mixed
Is debugging mode on? [optional]
highlighter
Highlight some words via Javascript.
highlighter(array $terms, string $start = 'highlighter-start', string $end = 'highlighter-end', string $className = 'highlight', string $tag = 'span') : void
since |
2.5 |
---|
Arguments
- $terms
array
Array of words that should be highlighted.- $start
string
ID of the element that marks the begin of the section in which words should be highlighted. Note this element will be removed from the DOM.- $end
string
ID of the element that end this section. Note this element will be removed from the DOM.- $className
string
Class name of the element highlights are wrapped in.- $tag
string
Tag that will be used to wrap the highlighted words.
keepalive
Keep session alive, for example, while editing or creating an article.
keepalive() : void
since |
1.5 |
---|
modal
Add unobtrusive JavaScript support for modal links.
modal(string $selector = 'a.modal', array $params = array()) : void
since |
1.5 |
---|---|
deprecated |
4.0 Use the modal equivalent from bootstrap |
Arguments
- $selector
string
The selector for which a modal behaviour is to be applied.- $params
array
An array of parameters for the modal behaviour. Options for the modal behaviour can be:- ajaxOptions
- size
- shadow
- overlay
- onOpen
- onClose
- onUpdate
- onResize
- onShow
- onHide
multiselect
JavaScript behavior to allow shift select in grids
multiselect(string $id = 'adminForm') : void
since |
1.7 |
---|
Arguments
- $id
string
The id of the form for which a multiselect behaviour is to be applied.
noframes
Break us out of any containing iframes
noframes() : void
since |
1.5 |
---|---|
deprecated |
4.0 Add a X-Frame-Options HTTP Header with the SAMEORIGIN value instead. |
polyfill
Add javascript polyfills.
polyfill(string|array $polyfillTypes = null, string $conditionalBrowser = null) : void
since |
3.7.0 |
---|
Arguments
- $polyfillTypes
string|array
The polyfill type(s). Examples: event, array('event', 'classlist').- $conditionalBrowser
string
An IE conditional expression. Example: lt IE 9 (lower than IE 9).
simplecolorpicker
Add unobtrusive JavaScript support for a simple color picker.
simplecolorpicker() : void
since |
3.1 |
---|---|
deprecated |
4.0 Use directly the field or the layout |
switcher
Add unobtrusive JavaScript support for submenu switcher support
switcher() : void
since |
1.5 |
---|
tabstate
Add unobtrusive JavaScript support to keep a tab state.
tabstate() : void
Note that keeping tab state only works for inner tabs if in accordance with the following example:
parent tab = permissions
child tab = permission-<identifier>
Each tab header <a>
tag also should have a unique href attribute
since |
3.2 |
---|
tooltip
Add unobtrusive JavaScript support for a hover tooltips.
tooltip(string $selector = '.hasTip', array $params = array()) : void
Add a title attribute to any element in the form title="title::text"
Uses the core Tips class in MooTools.
since |
1.5 |
---|
Arguments
- $selector
string
The class selector for the tooltip.- $params
array
An array of options for the tooltip. Options for the tooltip can be:- maxTitleChars integer The maximum number of characters in the tooltip title (defaults to 50).
- offsets object The distance of your tooltip from the mouse (defaults to {'x': 16, 'y': 16}).
- showDelay integer The millisecond delay the show event is fired (defaults to 100).
- hideDelay integer The millisecond delay the hide hide is fired (defaults to 100).
- className string The className your tooltip container will get.
- fixed boolean If set to true, the toolTip will not follow the mouse.
- onShow function The default function for the show event, passes the tip element and the currently hovered element.
- onHide function The default function for the hide event, passes the currently hovered element.
tree
Add unobtrusive javascript support for a collapsible tree.
tree(string $id, array $params = array(), array $root = array()) : void
since |
1.5 |
---|
Arguments
- $id
string
An index- $params
array
An array of options.- $root
array
The root node
Properties
loaded
Array containing information for loaded files
since |
2.5 |
---|
Type(s)
array