net.dontdrinkandroot.wicket.javascript

## Class JQueryScript

- java.lang.Object
- - net.dontdrinkandroot.wicket.javascript.JQueryScript

    public class JQueryScript
    extends Object

### Field Summary

Fields
`static String` `ANIMATE_TEMPLATE`
`static String` `CHILDREN_TEMPLATE`
`static String` `CLICK_TEMPLATE`
`static Integer` `DEFAULT_ANIMATION_DURATION`
`static String` `DEFAULT_EASING_FUNCTION`
`static String` `FADEIN_TEMPLATE`
`static String` `FADEOUT_TEMPLATE`
`static String` `FADETOGGLE_TEMPLATE`
`static String` `HIDE_TEMPLATE`
`static String` `HOVER_INTENT_TEMPLATE`
`static String` `KEYPRESS_TEMPLATE`
`protected StringBuffer` `scriptBuffer`
`static String` `SHOW_TEMPLATE`
`static String` `SLIDEDOWN_TEMPLATE`
`static String` `SLIDETOGGLE_TEMPLATE`
`static String` `SLIDEUP_TEMPLATE`
`static String` `TOGGLE_TEMPLATE`

### Constructor Summary

Constructors
Constructor and Description
`JQueryScript()` Create a new JQuery Script using this as a selector.
`JQueryScript(org.apache.wicket.Component component)` Create a new JQuery Script using the components markupid as a selector.
`JQueryScript(String selector)` Create a new JQuery Script using the given selector.

### Method Summary

Methods
`JQueryScript` `addClass(String string)`
`JQueryScript` `animate(Properties properties, Integer duration, String easing, CharSequence callbackScript)` Perform a custom animation of a set of CSS properties.
`JQueryScript` `append(String script)`
`JQueryScript` `children(String selector)` Get the children of each element in the set of matched elements, optionally filtered by a selector.
`JQueryScript` `click(String callbackScript)`
`JQueryScript` `fadeIn()` Display the matched elements by fading them to opaque.
`JQueryScript` `fadeIn(Integer duration, CharSequence callbackScript)` Display the matched elements by fading them to opaque.
`JQueryScript` `fadeIn(Integer duration, String easing, CharSequence callbackScript)` Display the matched elements by fading them to opaque.
`JQueryScript` `fadeOut()` Hide the matched elements by fading them to transparent.
`JQueryScript` `fadeOut(Integer duration, String easing, String callbackScript)` Hide the matched elements by fading them to transparent.
`JQueryScript` `fadeToggle()` Display or hide the matched elements by animating their opacity.
`JQueryScript` `fadeToggle(Integer duration, String easing, String callbackScript)` Display or hide the matched elements by animating their opacity.
`JQueryScript` `hide()` Hide the matched elements.
`JQueryScript` `hide(Integer duration, String easing, String callbackScript)` Hide the matched elements.
`JQueryScript` `hoverIntent(CharSequence callBackIn, CharSequence callBackOut)` Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.
`JQueryScript` `removeClass(String string)`
`JQueryScript` `show()` Display the matched elements.
`JQueryScript` `show(Integer duration, String easing, String callbackScript)` Display the matched elements.
`JQueryScript` `siblings(String selector)`
`JQueryScript` `slideDown()` Display the matched elements with a sliding motion.
`JQueryScript` `slideDown(Integer duration, String easing, String callbackScript)` Display the matched elements with a sliding motion.
`JQueryScript` `slideToggle()` Display or hide the matched elements with a sliding motion.
`JQueryScript` `slideToggle(Integer duration, String easing, String callbackScript)` Display or hide the matched elements with a sliding motion.
`JQueryScript` `slideUp()` Hide the matched elements with a sliding motion.
`JQueryScript` `slideUp(Integer duration, String easing, String callbackScript)` Hide the matched elements with a sliding motion.
`JQueryScript` `toggle()` Display or hide the matched elements.
`JQueryScript` `toggle(Integer duration, String easing, String callbackScript)` Display or hide the matched elements.
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### DEFAULT_ANIMATION_DURATION

    public static Integer DEFAULT_ANIMATION_DURATION

#### DEFAULT_EASING_FUNCTION

    public static String DEFAULT_EASING_FUNCTION

#### ANIMATE_TEMPLATE

    public static String ANIMATE_TEMPLATE

#### CHILDREN_TEMPLATE

    public static String CHILDREN_TEMPLATE

#### HIDE_TEMPLATE

    public static String HIDE_TEMPLATE

#### SHOW_TEMPLATE

    public static String SHOW_TEMPLATE

#### HOVER_INTENT_TEMPLATE

    public static String HOVER_INTENT_TEMPLATE

#### FADEIN_TEMPLATE

    public static String FADEIN_TEMPLATE

#### FADETOGGLE_TEMPLATE

    public static String FADETOGGLE_TEMPLATE

#### FADEOUT_TEMPLATE

    public static String FADEOUT_TEMPLATE

#### TOGGLE_TEMPLATE

    public static String TOGGLE_TEMPLATE

#### SLIDEDOWN_TEMPLATE

    public static String SLIDEDOWN_TEMPLATE

#### SLIDEUP_TEMPLATE

    public static String SLIDEUP_TEMPLATE

#### SLIDETOGGLE_TEMPLATE

    public static String SLIDETOGGLE_TEMPLATE

#### KEYPRESS_TEMPLATE

    public static String KEYPRESS_TEMPLATE

#### CLICK_TEMPLATE

    public static String CLICK_TEMPLATE

#### scriptBuffer

    protected final StringBuffer scriptBuffer

### Constructor Detail

#### JQueryScript

    public JQueryScript()

Create a new JQuery Script using this as a selector.

#### JQueryScript

    public JQueryScript(org.apache.wicket.Component component)

Create a new JQuery Script using the components markupid as a selector. This will fail if the markupid is not set, so always use `Component.setMarkupId(String)`.

Parameters:
  `component` - The component to be selected.

#### JQueryScript

    public JQueryScript(String selector)

Create a new JQuery Script using the given selector.

Parameters:
  `selector` - The selector to use.

### Method Detail

#### animate

    public JQueryScript animate(Properties properties,
                       Integer duration,
                       String easing,
                       CharSequence callbackScript)

Perform a custom animation of a set of CSS properties.

Parameters:
  `properties` - A map of CSS properties that the animation will move toward.
  `duration` - A number determining how long the animation will run (in milliseconds), defaults to 400.
  `easing` - A string indicating which easing function to use for the transition, defaults to "swing".
  `callbackScript` - A script to call once the animation is complete, defaults to an empty script.
Returns:
  This script for chaining.

#### children

    public JQueryScript children(String selector)

Get the children of each element in the set of matched elements, optionally filtered by a selector.

Parameters:
  `selector` - The selector to use.
Returns:
  This script for chaining.

#### fadeIn

    public JQueryScript fadeIn()

Display the matched elements by fading them to opaque.

Returns:
  This script for chaining.

#### fadeIn

    public JQueryScript fadeIn(Integer duration,
                      CharSequence callbackScript)

Display the matched elements by fading them to opaque.

Parameters:
  `duration` - A number determining how long the animation will run (in milliseconds), defaults to 400.
  `callbackScript` - A script to call once the animation is complete, defaults to an empty script.
Returns:
  This script for chaining.

#### fadeIn

    public JQueryScript fadeIn(Integer duration,
                      String easing,
                      CharSequence callbackScript)

Display the matched elements by fading them to opaque.

Parameters:
  `duration` - A number determining how long the animation will run (in milliseconds), defaults to 400.
  `easing` - A string indicating which easing function to use for the transition, defaults to "swing".
  `callbackScript` - A script to call once the animation is complete, defaults to an empty script.
Returns:
  This script for chaining.

#### fadeOut

    public JQueryScript fadeOut()

Hide the matched elements by fading them to transparent.

Returns:
  This script for chaining.

#### fadeOut

    public JQueryScript fadeOut(Integer duration,
                       String easing,
                       String callbackScript)

Hide the matched elements by fading them to transparent.

Parameters:
  `duration` - A number determining how long the animation will run (in milliseconds), defaults to 400.
  `easing` - A string indicating which easing function to use for the transition, defaults to "swing".
  `callbackScript` - A script to call once the animation is complete, defaults to an empty script.
Returns:
  This script for chaining.

#### fadeToggle

    public JQueryScript fadeToggle()

Display or hide the matched elements by animating their opacity.

Parameters:
  `duration` - A number determining how long the animation will run (in milliseconds), defaults to 400.
  `easing` - A string indicating which easing function to use for the transition, defaults to "swing".
  `callbackScript` - A script to call once the animation is complete, defaults to an empty script.
Returns:
  This script for chaining.

#### fadeToggle

    public JQueryScript fadeToggle(Integer duration,
                          String easing,
                          String callbackScript)

Display or hide the matched elements by animating their opacity.

Parameters:
  `duration` - A number determining how long the animation will run (in milliseconds), defaults to 400.
  `easing` - A string indicating which easing function to use for the transition, defaults to "swing".
  `callbackScript` - A script to call once the animation is complete, defaults to an empty script.
Returns:
  This script for chaining.

#### hide

    public JQueryScript hide()

Hide the matched elements.

Returns:
  This script for chaining.

#### hoverIntent

    public JQueryScript hoverIntent(CharSequence callBackIn,
                           CharSequence callBackOut)

Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.

Parameters:
  `callBackIn` - A script to execute when the mouse pointer enters the element.
  `callBackOut` - A script to execute when the mouse pointer leaves the element.
Returns:

#### hide

    public JQueryScript hide(Integer duration,
                    String easing,
                    String callbackScript)

Hide the matched elements.

Parameters:
  `duration` - A number determining how long the animation will run (in milliseconds), defaults to 0 (hiding immediately).
  `easing` - A string indicating which easing function to use for the transition, defaults to "swing".
  `callbackScript` - A script to call once the animation is complete, defaults to an empty script.
Returns:
  This script for chaining.

#### click

    public JQueryScript click(String callbackScript)

#### show

    public JQueryScript show()

Display the matched elements.

Returns:
  This script for chaining.

#### show

    public JQueryScript show(Integer duration,
                    String easing,
                    String callbackScript)

Display the matched elements.

Parameters:
  `duration` - A number determining how long the animation will run (in milliseconds), defaults to 0 (showing immediately).
  `easing` - A string indicating which easing function to use for the transition, defaults to "swing".
  `callbackScript` - A script to call once the animation is complete, defaults to an empty script.
Returns:
  This script for chaining.

#### slideDown

    public JQueryScript slideDown()

Display the matched elements with a sliding motion.

Returns:
  This script for chaining.

#### slideDown

    public JQueryScript slideDown(Integer duration,
                         String easing,
                         String callbackScript)

Display the matched elements with a sliding motion.

Parameters:
  `duration` - A number determining how long the animation will run (in milliseconds), defaults to 400.
  `easing` - A string indicating which easing function to use for the transition, defaults to "swing".
  `callbackScript` - A script to call once the animation is complete, defaults to an empty script.
Returns:
  This script for chaining.

#### slideUp

    public JQueryScript slideUp()

Hide the matched elements with a sliding motion.

Returns:
  This script for chaining.

#### slideUp

    public JQueryScript slideUp(Integer duration,
                       String easing,
                       String callbackScript)

Hide the matched elements with a sliding motion.

Parameters:
  `duration` - A number determining how long the animation will run (in milliseconds), defaults to 400.
  `easing` - A string indicating which easing function to use for the transition, defaults to "swing".
  `callbackScript` - A script to call once the animation is complete, defaults to an empty script.
Returns:
  This script for chaining.

#### slideToggle

    public JQueryScript slideToggle()

Display or hide the matched elements with a sliding motion.

Returns:
  This script for chaining.

#### slideToggle

    public JQueryScript slideToggle(Integer duration,
                           String easing,
                           String callbackScript)

Display or hide the matched elements with a sliding motion.

Parameters:
  `duration` - A number determining how long the animation will run (in milliseconds), defaults to 400.
  `easing` - A string indicating which easing function to use for the transition, defaults to "swing".
  `callbackScript` - A script to call once the animation is complete, defaults to an empty script.
Returns:
  This script for chaining.

#### toggle

    public JQueryScript toggle()

Display or hide the matched elements.

Returns:
  This script for chaining.

#### toggle

    public JQueryScript toggle(Integer duration,
                      String easing,
                      String callbackScript)

Display or hide the matched elements.

Parameters:
  `duration` - A number determining how long the animation will run (in milliseconds), defaults to 0 (toggling immediately).
  `easing` - A string indicating which easing function to use for the transition, defaults to "swing".
  `callbackScript` - A script to call once the animation is complete, defaults to an empty script.
Returns:
  This script for chaining.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### siblings

    public JQueryScript siblings(String selector)

#### removeClass

    public JQueryScript removeClass(String string)

#### addClass

    public JQueryScript addClass(String string)

#### append

    public JQueryScript append(String script)