JHtmlBehavior

Utility class for javascript behaviors

abstract
package

Joomla.Platform

subpackage

HTML

since

11.1

Methods

_calendartranslation

Internal method to translate the JavaScript Calendar

_calendartranslation() : string
static
since

11.1

Response

stringJavaScript that translates the object

_getJSObject

Internal method to get a JavaScript object notation string from an array

_getJSObject(array $array = array()) : string
static
since

11.1

Arguments

$array

arrayThe array to convert to JavaScript object notation

Response

stringJavaScript object notation representation of the array

calendar

Add unobtrusive javascript support for a calendar control.

calendar() : void
static
since

11.1

caption

Add unobtrusive javascript support for image captions.

caption(string $selector = 'img.caption') : void
static
since

11.1

Arguments

$selector

stringThe selector for which a caption behaviour is to be applied.

colorpicker

Add unobtrusive javascript support for a color picker.

colorpicker() : void
static
since

11.2

combobox

Add unobtrusive javascript support for a combobox effect.

combobox() : void
static

Note that this control is only reliable in absolutely positioned elements. Avoid using a combobox in a slider or dynamic pane.

since

11.1

formvalidation

Add unobtrusive javascript support for form validation.

formvalidation() : void
static

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

11.1

framework

Method to load the MooTools framework into the document head

framework(string $extras = false, boolean $debug = null) : void
static

If debugging mode is on an uncompressed version of MooTools is included for easier debugging.

since

11.1

Arguments

$extras

stringMooTools file to load

$debug

booleanIs 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
static
since

11.4

Arguments

$terms

arrayArray of words that should be highlighted.

$start

stringID 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

stringID of the element that end this section. Note this element will be removed from the DOM.

$className

stringClass name of the element highlights are wrapped in.

$tag

stringTag that will be used to wrap the highlighted words.

keepalive

Keep session alive, for example, while editing or creating an article.

keepalive() : void
static
since

11.1

modal

Add unobtrusive javascript support for modal links.

modal(string $selector = 'a.modal', array $params = array()) : void
static
since

11.1

Arguments

$selector

stringThe selector for which a modal behaviour is to be applied.

$params

arrayAn array of parameters for the modal behaviour. Options for the modal behaviour can be:

  • ajaxOptions
  • size
  • shadow
  • overlay
  • onOpen
  • onClose
  • onUpdate
  • onResize
  • onShow
  • onHide

mootools

Deprecated. Use JHtmlBehavior::framework() instead.

mootools(boolean $debug = null) : void
static deprecated
since

11.1

deprecated

12.1

Arguments

$debug

booleanIs debugging mode on? [optional]

multiselect

JavaScript behavior to allow shift select in grids

multiselect(string $id = 'adminForm') : void
static
since

11.1

Arguments

$id

stringThe id of the form for which a multiselect behaviour is to be applied.

noframes

Break us out of any containing iframes

noframes(string $location = 'top.location.href') : void
static
since

11.1

Arguments

$location

stringLocation to display in

switcher

Add unobtrusive javascript support for submenu switcher support in Global Configuration and System Information.

switcher() : void
static
since

11.1

tooltip

Add unobtrusive javascript support for a hover tooltips.

tooltip(string $selector = '.hasTip', array $params = array()) : void
static

Add a title attribute to any element in the form title="title::text"

Uses the core Tips class in MooTools.

since

11.1

Arguments

$selector

stringThe class selector for the tooltip.

$params

arrayAn 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
static
since

11.1

Arguments

$id

stringAn index

$params

arrayAn array of options.

$root

arrayThe root node

uploader

This method does nothing.

uploader() : void
static
since

11.1

Properties

loaded

array containing information for loaded files

static

Type(s)

array