phpMv  -UI toolkit 2.2.5
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
JsUtilsActionsTrait Class Reference
+ Inheritance diagram for JsUtilsActionsTrait:

Public Member Functions

 _add_event ($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true)
 
 _genericCallValue ($jQueryCall, $element='this', $param="", $immediatly=false)
 Execute a generic jQuery call with a value. More...
 
 _genericCallElement ($jQueryCall, $to='this', $element, $immediatly=false)
 Execute a generic jQuery call with 2 elements. More...
 
 addClass ($element='this', $class='', $immediatly=false)
 add class to element More...
 
 after ($to, $element, $immediatly=false)
 Insert content, specified by the parameter, after each element in the set of matched elements. More...
 
 before ($to, $element, $immediatly=false)
 Insert content, specified by the parameter, before each element in the set of matched elements. More...
 
 attr ($element='this', $attributeName, $value="", $immediatly=false)
 Get or set the value of an attribute for the first element in the set of matched elements or set one or more attributes for every matched element. More...
 
 val ($element='this', $value='', $immediatly=false)
 Get or set the value of the first element in the set of matched elements or set one or more attributes for every matched element. More...
 
 html ($element='this', $value='', $immediatly=false)
 Get or set the html of an attribute for the first element in the set of matched elements. More...
 
 animate ($element='this', $params=array(), $speed='', $extra='', $immediatly=false)
 Outputs a javascript library animate event. More...
 
 append ($to, $element, $immediatly=false)
 Insert content, specified by the parameter $element, to the end of each element in the set of matched elements $to. More...
 
 prepend ($to, $element, $immediatly=false)
 Insert content, specified by the parameter $element, to the beginning of each element in the set of matched elements $to. More...
 
 fadeIn ($element='this', $speed='', $callback='', $immediatly=false)
 Execute a javascript library hide action. More...
 
 fadeOut ($element='this', $speed='', $callback='', $immediatly=false)
 Execute a javascript library hide action. More...
 
 slideUp ($element='this', $speed='', $callback='', $immediatly=false)
 Execute a javascript library slideUp action. More...
 
 removeClass ($element='this', $class='', $immediatly=false)
 Execute a javascript library removeClass action. More...
 
 slideDown ($element='this', $speed='', $callback='', $immediatly=false)
 Execute a javascript library slideDown action. More...
 
 slideToggle ($element='this', $speed='', $callback='', $immediatly=false)
 Execute a javascript library slideToggle action. More...
 
 hide ($element='this', $speed='', $callback='', $immediatly=false)
 Execute a javascript library hide action. More...
 
 toggle ($element='this', $speed='', $callback='', $immediatly=false)
 Execute a javascript library toggle action. More...
 
 toggleClass ($element='this', $class='', $immediatly=false)
 Execute a javascript library toggle class action. More...
 
 trigger ($element='this', $event='click', $immediatly=false)
 Execute all handlers and behaviors attached to the matched elements for the given event. More...
 
 show ($element='this', $speed='', $callback='', $immediatly=false)
 Execute a javascript library show action. More...
 
 sortable ($element, $options=array())
 Creates a jQuery sortable. More...
 
 tablesorter ($table='', $options='')
 Table Sorter Plugin. More...
 
 condition ($condition, $jsCodeIfTrue, $jsCodeIfFalse=null, $immediatly=false)
 Allows to attach a condition. More...
 
 doJQuery ($element, $jqueryCall, $param="", $jsCallback="")
 Calls the JQuery callback $someThing on $element with facultative parameter $param. More...
 
 doJQueryDeferred ($element, $jqueryCall, $param="", $jsCallback="")
 Calls the JQuery callback $someThing on $element with facultative parameter $param. More...
 
 doJQueryOn ($event, $element, $elementToModify, $jqueryCall, $param="", $parameters=array())
 Calls the JQuery callback $jqueryCall on $element with facultative parameter $param in response to an event $event. More...
 
 exec ($js, $immediatly=false)
 Executes the code $js. More...
 
 execAtLast ($js)
 Executes the code $js. More...
 
 execOn ($event, $element, $js, $parameters=array())
 Executes the javascript code $js when $event fires on $element. More...
 
 setJsonToElement ($json, $elementClass="_element", $immediatly=true)
 
 setDraggable ($element, $parameters=[])
 Sets an element draggable (HTML5 drag and drop) More...
 
 asDropZone ($element, $jsCallback="", $parameters=[])
 Declares an element as a drop zone (HTML5 drag and drop) More...
 
 interval ($jsCode, $time, $globalName=null, $immediatly=true)
 Calls a function or evaluates an expression at specified intervals (in milliseconds) More...
 
 clearInterval ($globalName, $immediatly=true)
 Clears an existing interval. More...
 

Protected Member Functions

 _showHideWithEffect ($action, $element='this', $speed='', $callback='', $immediatly=false)
 show or hide with effect More...
 

Private Member Functions

 _validate_speed ($speed)
 Ensures the speed parameter is valid for jQuery. More...
 
 _doJQuery ($element, $jqueryCall, $param="", $jsCallback="", $immediatly=false)
 Call the JQuery method $jqueryCall on $element with parameters $param. More...
 
 _doJQueryOn ($event, $element, $elementToModify, $jqueryCall, $param="", $preventDefault=false, $stopPropagation=false, $jsCallback="", $immediatly=true)
 

Detailed Description

Definition at line 12 of file JsUtilsActionsTrait.php.

Member Function Documentation

◆ _add_event()

_add_event (   $element,
  $js,
  $event,
  $preventDefault = false,
  $stopPropagation = false,
  $immediatly = true 
)
abstract

◆ _doJQuery()

_doJQuery (   $element,
  $jqueryCall,
  $param = "",
  $jsCallback = "",
  $immediatly = false 
)
private

Call the JQuery method $jqueryCall on $element with parameters $param.

Parameters
string$element
string$jqueryCall
mixed$param
string$jsCallbackjavascript code to execute after the jquery call
boolean$immediatly
Returns
string

Definition at line 422 of file JsUtilsActionsTrait.php.

◆ _doJQueryOn()

_doJQueryOn (   $event,
  $element,
  $elementToModify,
  $jqueryCall,
  $param = "",
  $preventDefault = false,
  $stopPropagation = false,
  $jsCallback = "",
  $immediatly = true 
)
private
Parameters
string$event
string$element
string$elementToModify
string$jqueryCall
string | array$param
boolean$preventDefault
boolean$stopPropagation
string$jsCallbackjavascript code to execute after the jquery call
boolean$immediatly
Returns
string

Definition at line 470 of file JsUtilsActionsTrait.php.

◆ _genericCallElement()

_genericCallElement (   $jQueryCall,
  $to = 'this',
  $element,
  $immediatly = false 
)

Execute a generic jQuery call with 2 elements.

Parameters
string$jQueryCall
string$to
string$element
boolean$immediatlydelayed if false
Returns
string

Definition at line 80 of file JsUtilsActionsTrait.php.

◆ _genericCallValue()

_genericCallValue (   $jQueryCall,
  $element = 'this',
  $param = "",
  $immediatly = false 
)

Execute a generic jQuery call with a value.

Parameters
string$jQueryCall
string$element
string$param
boolean$immediatlydelayed if false

Definition at line 60 of file JsUtilsActionsTrait.php.

◆ _showHideWithEffect()

_showHideWithEffect (   $action,
  $element = 'this',
  $speed = '',
  $callback = '',
  $immediatly = false 
)
protected

show or hide with effect

Parameters
string$action
string$elementelement
string$speedOne of 'slow', 'normal', 'fast', or time in milliseconds
string$callbackJavascript callback function
boolean$immediatlydefers the execution if set to false
Returns
string

Definition at line 25 of file JsUtilsActionsTrait.php.

◆ _validate_speed()

_validate_speed (   $speed)
private

Ensures the speed parameter is valid for jQuery.

Parameters
string | int$speed
Returns
string

Definition at line 41 of file JsUtilsActionsTrait.php.

◆ addClass()

addClass (   $element = 'this',
  $class = '',
  $immediatly = false 
)

add class to element

Parameters
string$element
string$classto add
boolean$immediatlydefers the execution if set to false
Returns
string

Definition at line 96 of file JsUtilsActionsTrait.php.

◆ after()

after (   $to,
  $element,
  $immediatly = false 
)

Insert content, specified by the parameter, after each element in the set of matched elements.

Parameters
string$to
string$element
boolean$immediatlydefers the execution if set to false
Returns
string

Definition at line 107 of file JsUtilsActionsTrait.php.

◆ animate()

animate (   $element = 'this',
  $params = array(),
  $speed = '',
  $extra = '',
  $immediatly = false 
)

Outputs a javascript library animate event.

Parameters
string$elementelement
array | string$params
string$speedOne of 'slow', 'normal', 'fast', or time in milliseconds
string$extra
boolean$immediatlydefers the execution if set to false
Returns
string

Definition at line 171 of file JsUtilsActionsTrait.php.

◆ append()

append (   $to,
  $element,
  $immediatly = false 
)

Insert content, specified by the parameter $element, to the end of each element in the set of matched elements $to.

Parameters
string$to
string$element
boolean$immediatlydefers the execution if set to false
Returns
string

Definition at line 205 of file JsUtilsActionsTrait.php.

◆ asDropZone()

asDropZone (   $element,
  $jsCallback = "",
  $parameters = [] 
)

Declares an element as a drop zone (HTML5 drag and drop)

Parameters
string$elementThe element selector
array$parametersdefault : array("attr"=>"id","stopPropagation"=>false,"immediatly"=>true,"jqueryDone"=>"append")
string$jsCallbackthe js script to call when element is dropped

Definition at line 566 of file JsUtilsActionsTrait.php.

◆ attr()

attr (   $element = 'this',
  $attributeName,
  $value = "",
  $immediatly = false 
)

Get or set the value of an attribute for the first element in the set of matched elements or set one or more attributes for every matched element.

Parameters
string$element
string$attributeName
string$value
boolean$immediatlydelayed if false

Definition at line 129 of file JsUtilsActionsTrait.php.

◆ before()

before (   $to,
  $element,
  $immediatly = false 
)

Insert content, specified by the parameter, before each element in the set of matched elements.

Parameters
string$to
string$element
boolean$immediatlydefers the execution if set to false
Returns
string

Definition at line 118 of file JsUtilsActionsTrait.php.

◆ clearInterval()

clearInterval (   $globalName,
  $immediatly = true 
)

Clears an existing interval.

Parameters
string$globalNameThe interval global name
boolean$immediatlydelayed if false
Returns
string

Definition at line 602 of file JsUtilsActionsTrait.php.

◆ condition()

condition (   $condition,
  $jsCodeIfTrue,
  $jsCodeIfFalse = null,
  $immediatly = false 
)

Allows to attach a condition.

Parameters
string$condition
string$jsCodeIfTrue
string$jsCodeIfFalse
boolean$immediatlydefers the execution if set to false

Definition at line 402 of file JsUtilsActionsTrait.php.

◆ doJQuery()

doJQuery (   $element,
  $jqueryCall,
  $param = "",
  $jsCallback = "" 
)

Calls the JQuery callback $someThing on $element with facultative parameter $param.

Parameters
string$elementthe element
string$jqueryCallthe JQuery callback
mixed$paramarray or string parameters
string$jsCallbackjavascript code to execute after the jquery call
Returns
mixed

Definition at line 441 of file JsUtilsActionsTrait.php.

◆ doJQueryDeferred()

doJQueryDeferred (   $element,
  $jqueryCall,
  $param = "",
  $jsCallback = "" 
)

Calls the JQuery callback $someThing on $element with facultative parameter $param.

Parameters
string$elementthe element
string$jqueryCallthe JQuery callback
mixed$paramarray or string parameters
string$jsCallbackjavascript code to execute after the jquery call
Returns
mixed

Definition at line 453 of file JsUtilsActionsTrait.php.

◆ doJQueryOn()

doJQueryOn (   $event,
  $element,
  $elementToModify,
  $jqueryCall,
  $param = "",
  $parameters = array() 
)

Calls the JQuery callback $jqueryCall on $element with facultative parameter $param in response to an event $event.

Parameters
string$event
string$element
string$elementToModify
string$jqueryCall
string$param
array$parametersdefault : array("preventDefault"=>false,"stopPropagation"=>false,"jsCallback"=>'',"immediatly"=>true)

Definition at line 483 of file JsUtilsActionsTrait.php.

◆ exec()

exec (   $js,
  $immediatly = false 
)

Executes the code $js.

Parameters
string$jsCode to execute
boolean$immediatlydelayed if false
Returns
String

Definition at line 498 of file JsUtilsActionsTrait.php.

◆ execAtLast()

execAtLast (   $js)

Executes the code $js.

Parameters
string$jsCode to execute
boolean$immediatlydelayed if false
Returns
String

Definition at line 511 of file JsUtilsActionsTrait.php.

◆ execOn()

execOn (   $event,
  $element,
  $js,
  $parameters = array() 
)

Executes the javascript code $js when $event fires on $element.

Parameters
string$event
string$element
string$jsCode to execute
array$parametersdefault : array("preventDefault"=>false,"stopPropagation"=>false,"immediatly"=>true)
Returns
String

Definition at line 525 of file JsUtilsActionsTrait.php.

◆ fadeIn()

fadeIn (   $element = 'this',
  $speed = '',
  $callback = '',
  $immediatly = false 
)

Execute a javascript library hide action.

Parameters
string$elementelement
string$speedOne of 'slow', 'normal', 'fast', or time in milliseconds
string$callbackJavascript callback function
boolean$immediatlydefers the execution if set to false
Returns
string

Definition at line 229 of file JsUtilsActionsTrait.php.

◆ fadeOut()

fadeOut (   $element = 'this',
  $speed = '',
  $callback = '',
  $immediatly = false 
)

Execute a javascript library hide action.

Parameters
string$elementelement
string$speedOne of 'slow', 'normal', 'fast', or time in milliseconds
string$callbackJavascript callback function
boolean$immediatlydefers the execution if set to false
Returns
string

Definition at line 242 of file JsUtilsActionsTrait.php.

◆ hide()

hide (   $element = 'this',
  $speed = '',
  $callback = '',
  $immediatly = false 
)

Execute a javascript library hide action.

Parameters
string$elementelement
string$speedOne of 'slow', 'normal', 'fast', or time in milliseconds
string$callbackJavascript callback function
boolean$immediatlydefers the execution if set to false
Returns
string

Definition at line 306 of file JsUtilsActionsTrait.php.

◆ html()

html (   $element = 'this',
  $value = '',
  $immediatly = false 
)

Get or set the html of an attribute for the first element in the set of matched elements.

Parameters
string$element
string$value
boolean$immediatlydefers the execution if set to false

Definition at line 157 of file JsUtilsActionsTrait.php.

◆ interval()

interval (   $jsCode,
  $time,
  $globalName = null,
  $immediatly = true 
)

Calls a function or evaluates an expression at specified intervals (in milliseconds)

Parameters
string$jsCodeThe code to execute
int$timeThe time interval in milliseconds
string$globalNameThe global name of the interval, used to clear it
boolean$immediatlydelayed if false
Returns
string

Definition at line 584 of file JsUtilsActionsTrait.php.

◆ prepend()

prepend (   $to,
  $element,
  $immediatly = false 
)

Insert content, specified by the parameter $element, to the beginning of each element in the set of matched elements $to.

Parameters
string$to
string$element
boolean$immediatlydefers the execution if set to false
Returns
string

Definition at line 216 of file JsUtilsActionsTrait.php.

◆ removeClass()

removeClass (   $element = 'this',
  $class = '',
  $immediatly = false 
)

Execute a javascript library removeClass action.

Parameters
string$elementelement
string$classClass to add
boolean$immediatlydefers the execution if set to false
Returns
string

Definition at line 267 of file JsUtilsActionsTrait.php.

◆ setDraggable()

setDraggable (   $element,
  $parameters = [] 
)

Sets an element draggable (HTML5 drag and drop)

Parameters
string$elementThe element selector
array$parametersdefault : array("attr"=>"id","preventDefault"=>false,"stopPropagation"=>false,"immediatly"=>true)

Definition at line 553 of file JsUtilsActionsTrait.php.

◆ setJsonToElement()

setJsonToElement (   $json,
  $elementClass = "_element",
  $immediatly = true 
)

Definition at line 534 of file JsUtilsActionsTrait.php.

◆ show()

show (   $element = 'this',
  $speed = '',
  $callback = '',
  $immediatly = false 
)

Execute a javascript library show action.

Parameters
string$elementelement
string$speedOne of 'slow', 'normal', 'fast', or time in milliseconds
string$callbackJavascript callback function
boolean$immediatlydefers the execution if set to false
Returns
string

Definition at line 359 of file JsUtilsActionsTrait.php.

◆ slideDown()

slideDown (   $element = 'this',
  $speed = '',
  $callback = '',
  $immediatly = false 
)

Execute a javascript library slideDown action.

Parameters
string$elementelement
string$speedOne of 'slow', 'normal', 'fast', or time in milliseconds
string$callbackJavascript callback function
boolean$immediatlydefers the execution if set to false
Returns
string

Definition at line 280 of file JsUtilsActionsTrait.php.

◆ slideToggle()

slideToggle (   $element = 'this',
  $speed = '',
  $callback = '',
  $immediatly = false 
)

Execute a javascript library slideToggle action.

Parameters
string$elementelement
string$speedOne of 'slow', 'normal', 'fast', or time in milliseconds
string$callbackJavascript callback function
boolean$immediatlydefers the execution if set to false
Returns
string

Definition at line 293 of file JsUtilsActionsTrait.php.

◆ slideUp()

slideUp (   $element = 'this',
  $speed = '',
  $callback = '',
  $immediatly = false 
)

Execute a javascript library slideUp action.

Parameters
string$elementelement
string$speedOne of 'slow', 'normal', 'fast', or time in milliseconds
string$callbackJavascript callback function
boolean$immediatlydefers the execution if set to false
Returns
string

Definition at line 255 of file JsUtilsActionsTrait.php.

◆ sortable()

sortable (   $element,
  $options = array() 
)

Creates a jQuery sortable.

Parameters
string$element
array$options
Returns
string

Definition at line 370 of file JsUtilsActionsTrait.php.

◆ tablesorter()

tablesorter (   $table = '',
  $options = '' 
)

Table Sorter Plugin.

Parameters
string$tabletable name
string$optionsplugin location
Returns
string

Definition at line 391 of file JsUtilsActionsTrait.php.

◆ toggle()

toggle (   $element = 'this',
  $speed = '',
  $callback = '',
  $immediatly = false 
)

Execute a javascript library toggle action.

Parameters
string$elementelement
string$speedOne of 'slow', 'normal', 'fast', or time in milliseconds
string$callbackJavascript callback function
boolean$immediatlydefers the execution if set to false
Returns
string

Definition at line 319 of file JsUtilsActionsTrait.php.

◆ toggleClass()

toggleClass (   $element = 'this',
  $class = '',
  $immediatly = false 
)

Execute a javascript library toggle class action.

Parameters
string$elementelement
string$class
boolean$immediatlydefers the execution if set to false
Returns
string

Definition at line 331 of file JsUtilsActionsTrait.php.

◆ trigger()

trigger (   $element = 'this',
  $event = 'click',
  $immediatly = false 
)

Execute all handlers and behaviors attached to the matched elements for the given event.

Parameters
string$element
string$event
boolean$immediatlydefers the execution if set to false

Definition at line 341 of file JsUtilsActionsTrait.php.

◆ val()

val (   $element = 'this',
  $value = '',
  $immediatly = false 
)

Get or set the value of the first element in the set of matched elements or set one or more attributes for every matched element.

Parameters
string$element
string$value
boolean$immediatlydefers the execution if set to false

Definition at line 147 of file JsUtilsActionsTrait.php.


The documentation for this class was generated from the following file: