phpMv  -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Ajax\common\traits Namespace Reference

Functions

 _showHideWithEffect ($action, $element='this', $speed='', $callback='', $immediatly=false)
 show or hide with effect More...
 
 _validate_speed ($speed)
 Ensures the speed parameter is valid for jQuery. More...
 
 _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='id', $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="", $immediatly=false)
 Call the JQuery method $jqueryCall on $element with parameters $param. 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="", $preventDefault=false, $stopPropagation=false, $jsCallback="", $immediatly=true)
 
 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...
 
 counter ($counterSelector, $value=0, $limit=0, $globalName=null, $countDown=true, $immediatly=true)
 Associates a counter to the element designated by $counterSelector Triggers the events counter-start and counter-end on finished with the parameters value and limit. More...
 
 counterOn ($element, $event, $counterSelector, $value=0, $limit=0, $globalName=null, $countDown=true)
 Associates a counter to the element designated by $counterSelector when $event is triggered on $element. More...
 
 activateLink ($target, $property='href', $href=null)
 Activates an element if it is active (add the class active) More...
 
 _activateLink ($target, $property='href', $href=null)
 Returns the javascript code for activate an element if it is active (add the class active) More...
 
 getUrl ($url)
 
 _add_event ($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true, $listenerOn=false)
 
 _ajax ($method, $url, $responseElement='', $parameters=[])
 
 createAjaxParameters (&$original, $parameters)
 
 implodeAjaxParameters ($ajaxParameters)
 
 _addJsCondition ($jsCondition, $jsSource)
 
 _getAjaxUrl ($url, $attr)
 
 onPopstate ()
 
 autoActiveLinks ($previousURL="window.location.href")
 
 _getOnAjaxDone ($responseElement, $jqueryDone, $ajaxTransition, $jsCallback, $history=null)
 
 removeLoader ($hasLoader)
 
 _getResponseElement ($responseElement)
 
 _getFormElement ($formElement)
 
 _correctAjaxUrl ($url)
 
static _correctParams ($params, $ajaxParameters=[])
 
static _implodeParams ($parameters)
 
 addLoading (&$retour, $responseElement, $ajaxLoader=null)
 
 addResponseLoading (&$retour, $responseElement, $ajaxLoader=null)
 
 setAjaxDataCall ($params)
 
 setDefaultParameters (&$parameters, $default)
 
 setAjaxLoader ($loader)
 
 _get ($url, $responseElement='', $parameters=[])
 Performs an ajax GET request. More...
 
 get ($url, $responseElement='', $parameters=[])
 Performs an ajax GET request. More...
 
 ajax ($method, $url, $responseElement='', $parameters=[])
 Performs an ajax request. More...
 
 ajaxInterval ($method, $url, $interval, $globalName=null, $responseElement='', $parameters=[], $immediatly=true)
 Executes an ajax query at regular intervals. More...
 
 ajaxDeferred ($method, $url, $responseElement='', $parameters=[])
 Performs a deferred ajax request. More...
 
 _json ($url, $method="get", $parameters=[])
 Performs an ajax request and receives the JSON data types by assigning DOM elements with the same name. More...
 
 json ($url, $method="get", $parameters=[])
 Performs an ajax request and receives the JSON data types by assigning DOM elements with the same name. More...
 
 jsonOn ($event, $element, $url, $method='get', $parameters=array())
 Makes an ajax request and receives the JSON data types by assigning DOM elements with the same name when $event fired on $element. More...
 
 jsonDeferred ($url, $method='get', $parameters=[])
 Prepares an ajax request delayed and receives the JSON data types by assigning DOM elements with the same name. More...
 
 _jsonArray ($maskSelector, $url, $method='get', $parameters=[])
 Performs an ajax request and receives the JSON array data types by assigning DOM elements with the same name. More...
 
 jsonArray ($maskSelector, $url, $method='get', $parameters=[])
 Performs an ajax request and receives the JSON array data types by assigning DOM elements with the same name. More...
 
 jsonArrayDeferred ($maskSelector, $url, $method='get', $parameters=[])
 Peforms an ajax request delayed and receives a JSON array data types by copying and assigning them to the DOM elements with the same name. More...
 
 jsonArrayOn ($event, $element, $maskSelector, $url, $method='get', $parameters=array())
 Performs an ajax request and receives the JSON array data types by assigning DOM elements with the same name when $event fired on $element. More...
 
 getDeferred ($url, $responseElement="", $parameters=[])
 Prepares a Get ajax request for using on an event. More...
 
 getOn ($event, $element, $url, $responseElement="", $parameters=array())
 Performs a get to $url on the event $event on $element and display it in $responseElement. More...
 
 ajaxOn ($event, $element, $url, $responseElement='', $parameters=array())
 Performs an ajax request to $url on the event $event on $element and display it in $responseElement. More...
 
 ajaxOnClick ($element, $url, $responseElement='', $parameters=array())
 Performs a get to $url on the click event on $element and display it in $responseElement. More...
 
 getOnClick ($element, $url, $responseElement='', $parameters=array())
 Performs a get to $url on the click event on $element and display it in $responseElement. More...
 
 getHref ($element, $responseElement="", $parameters=array())
 Uses an hyperlink to make an ajax get request. More...
 
 postHref ($element, $responseElement="", $parameters=array())
 Uses an hyperlink to make an ajax get request. More...
 
 postFormAction ($element, $responseElement="", $parameters=array())
 Uses a form action to make an ajax post request. More...
 
 _post ($url, $params='{}', $responseElement='', $parameters=[])
 
 post ($url, $params="{}", $responseElement="", $parameters=[])
 Makes an ajax post. More...
 
 postDeferred ($url, $params="{}", $responseElement="", $parameters=[])
 Prepares a delayed ajax POST to use on an event. More...
 
 postOn ($event, $element, $url, $params="{}", $responseElement="", $parameters=array())
 Performs a post to $url on the event $event fired on $element and pass the parameters $params Display the result in $responseElement. More...
 
 postOnClick ($element, $url, $params='{}', $responseElement='', $parameters=array())
 Performs a post to $url on the click event fired on $element and pass the parameters $params Display the result in $responseElement. More...
 
 _postForm ($url, $form, $responseElement, $parameters=[])
 
 postForm ($url, $form, $responseElement, $parameters=[])
 Performs a post form with ajax. More...
 
 postFormDeferred ($url, $form, $responseElement, $parameters=[])
 Performs a delayed post form with ajax For use on an event. More...
 
 postFormOn ($event, $element, $url, $form, $responseElement="", $parameters=array())
 Performs a post form with ajax in response to an event $event on $element display the result in $responseElement. More...
 
 postFormOnClick ($element, $url, $form, $responseElement="", $parameters=array())
 Performs a post form with ajax in response to the click event on $element display the result in $responseElement. More...
 
 addCsrf ($name='csrf-token')
 
 blur ($element='this', $js='', $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library blur event. More...
 
 change ($element='this', $js='', $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library change event. More...
 
 click ($element='this', $js='', $ret_false=TRUE, $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library click event. More...
 
 contextmenu ($element='this', $js='', $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library contextmenu event. More...
 
 dblclick ($element='this', $js='', $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library dblclick event. More...
 
 error ($element='this', $js='')
 Outputs a javascript library error event. More...
 
 focus ($element='this', $js='', $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library focus event. More...
 
 hover ($element='this', $over='', $out='')
 Outputs a javascript library hover event. More...
 
 keydown ($element='this', $js='', $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library keydown event. More...
 
 keypress ($element='this', $js='', $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library keypress event. More...
 
 keyup ($element='this', $js='', $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library keydown event. More...
 
 load ($element='this', $js='', $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library load event. More...
 
 mousedown ($element='this', $js='', $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library mousedown event. More...
 
 mouseout ($element='this', $js='', $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library mouseout event. More...
 
 mouseleave ($element='this', $js='', $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library mouseleave event. More...
 
 mouseenter ($element='this', $js='', $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library mouseenter event. More...
 
 mouseover ($element='this', $js='', $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library mouseover event. More...
 
 mouseup ($element='this', $js='', $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library mouseup event. More...
 
 unload ($element='this', $js='', $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library unload event. More...
 
 resize ($element='this', $js='', $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library resize event. More...
 
 scroll ($element='this', $js='', $preventDefault=false, $stopPropagation=false, $listenerOn=false)
 Outputs a javascript library scroll event. More...
 
 _addToCompile ($jsScript)
 
 _compileLibrary (BaseGui $library, &$view=NULL)
 
 defer ($script)
 
 ready ($script)
 
 minify ($input)
 
 _open_script ($src='')
 Outputs an opening <script> More...
 
 _close_script ($extra="\)
 Outputs an closing </script> More...
 
 conflict ()
 
 addToCompile ($jsScript)
 

Variables

trait JsUtilsActionsTrait
 
trait JsUtilsAjaxTrait
 
 $ajaxLoader = "<div class=\"ui active centered inline text loader\">Loading</div>"
 
trait JsUtilsEventsTrait
 
trait JsUtilsInternalTrait
 
 $jquery_code_for_compile_at_last = array()
 

Function Documentation

◆ _activateLink()

Ajax\common\traits\_activateLink (   $target,
  $property = 'href',
  $href = null 
)

Returns the javascript code for activate an element if it is active (add the class active)

Parameters
string$targetthe container element
string$propertydefault: href
string$hrefthe active href (if null, window.location.href is used)
Returns
string

Definition at line 820 of file JsUtilsActionsTrait.php.

◆ _add_event()

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

◆ _addJsCondition()

Ajax\common\traits\_addJsCondition (   $jsCondition,
  $jsSource 
)
protected

Definition at line 119 of file JsUtilsAjaxTrait.php.

◆ _addToCompile()

Ajax\common\traits\_addToCompile (   $jsScript)
protected

Definition at line 12 of file JsUtilsInternalTrait.php.

◆ _ajax()

Ajax\common\traits\_ajax (   $method,
  $url,
  $responseElement = '',
  $parameters = [] 
)
protected

Definition at line 26 of file JsUtilsAjaxTrait.php.

◆ _close_script()

Ajax\common\traits\_close_script (   $extra = "\n")
protected

Outputs an closing </script>

Parameters
string$extra
Returns
string

Definition at line 84 of file JsUtilsInternalTrait.php.

◆ _compileLibrary()

Ajax\common\traits\_compileLibrary ( BaseGui  $library,
$view = NULL 
)
protected
Parameters
BaseGui$library
mixed$view

Definition at line 21 of file JsUtilsInternalTrait.php.

◆ _correctAjaxUrl()

Ajax\common\traits\_correctAjaxUrl (   $url)
protected

Definition at line 210 of file JsUtilsAjaxTrait.php.

◆ _correctParams()

static Ajax\common\traits\_correctParams (   $params,
  $ajaxParameters = [] 
)
static

Definition at line 219 of file JsUtilsAjaxTrait.php.

◆ _doJQuery()

Ajax\common\traits\_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 501 of file JsUtilsActionsTrait.php.

◆ _doJQueryOn()

Ajax\common\traits\_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 560 of file JsUtilsActionsTrait.php.

◆ _genericCallElement()

Ajax\common\traits\_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 94 of file JsUtilsActionsTrait.php.

◆ _genericCallValue()

Ajax\common\traits\_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 72 of file JsUtilsActionsTrait.php.

◆ _get()

Ajax\common\traits\_get (   $url,
  $responseElement = '',
  $parameters = [] 
)
private

Performs an ajax GET request.

Parameters
string$urlThe url of the request
string$responseElementselector of the HTML element displaying the answer

Definition at line 288 of file JsUtilsAjaxTrait.php.

◆ _getAjaxUrl()

Ajax\common\traits\_getAjaxUrl (   $url,
  $attr 
)
protected

Definition at line 126 of file JsUtilsAjaxTrait.php.

◆ _getFormElement()

Ajax\common\traits\_getFormElement (   $formElement)
protected

Definition at line 203 of file JsUtilsAjaxTrait.php.

◆ _getOnAjaxDone()

Ajax\common\traits\_getOnAjaxDone (   $responseElement,
  $jqueryDone,
  $ajaxTransition,
  $jsCallback,
  $history = null 
)
protected

Definition at line 159 of file JsUtilsAjaxTrait.php.

◆ _getResponseElement()

Ajax\common\traits\_getResponseElement (   $responseElement)
protected

Definition at line 196 of file JsUtilsAjaxTrait.php.

◆ _implodeParams()

static Ajax\common\traits\_implodeParams (   $parameters)
static

Definition at line 233 of file JsUtilsAjaxTrait.php.

◆ _json()

Ajax\common\traits\_json (   $url,
  $method = "get",
  $parameters = [] 
)
private

Performs an ajax request and receives the JSON data types by assigning DOM elements with the same name.

Parameters
string$urlthe request url
string$methodMethod used
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>"document","jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"before"=>null)

Definition at line 373 of file JsUtilsAjaxTrait.php.

◆ _jsonArray()

Ajax\common\traits\_jsonArray (   $maskSelector,
  $url,
  $method = 'get',
  $parameters = [] 
)
private

Performs an ajax request and receives the JSON array data types by assigning DOM elements with the same name.

Parameters
string$maskSelector
string$urlthe request url
string$methodMethod used, default : get
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>null,"jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"rowClass"=>"_json","before"=>null)

Definition at line 447 of file JsUtilsAjaxTrait.php.

◆ _open_script()

Ajax\common\traits\_open_script (   $src = '')
protected

Outputs an opening <script>

Parameters
string$src
Returns
string

Definition at line 72 of file JsUtilsInternalTrait.php.

◆ _post()

Ajax\common\traits\_post (   $url,
  $params = '{}',
  $responseElement = '',
  $parameters = [] 
)
private

Definition at line 705 of file JsUtilsAjaxTrait.php.

◆ _postForm()

Ajax\common\traits\_postForm (   $url,
  $form,
  $responseElement,
  $parameters = [] 
)
private

Definition at line 784 of file JsUtilsAjaxTrait.php.

◆ _showHideWithEffect()

Ajax\common\traits\_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 31 of file JsUtilsActionsTrait.php.

◆ _validate_speed()

Ajax\common\traits\_validate_speed (   $speed)
private

Ensures the speed parameter is valid for jQuery.

Parameters
string | int$speed
Returns
string

Definition at line 49 of file JsUtilsActionsTrait.php.

◆ activateLink()

Ajax\common\traits\activateLink (   $target,
  $property = 'href',
  $href = null 
)

Activates an element if it is active (add the class active)

Parameters
string$targetthe container element
string$propertydefault: href
string$hrefthe active href (if null, window.location.href is used)
Returns
string

Definition at line 805 of file JsUtilsActionsTrait.php.

◆ addClass()

Ajax\common\traits\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 113 of file JsUtilsActionsTrait.php.

◆ addCsrf()

Ajax\common\traits\addCsrf (   $name = 'csrf-token')

Definition at line 926 of file JsUtilsAjaxTrait.php.

◆ addLoading()

Ajax\common\traits\addLoading ( $retour,
  $responseElement,
  $ajaxLoader = null 
)
protected

Definition at line 242 of file JsUtilsAjaxTrait.php.

◆ addResponseLoading()

Ajax\common\traits\addResponseLoading ( $retour,
  $responseElement,
  $ajaxLoader = null 
)
protected

Definition at line 250 of file JsUtilsAjaxTrait.php.

◆ addToCompile()

Ajax\common\traits\addToCompile (   $jsScript)

Definition at line 92 of file JsUtilsInternalTrait.php.

◆ after()

Ajax\common\traits\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 126 of file JsUtilsActionsTrait.php.

◆ ajax()

Ajax\common\traits\ajax (   $method,
  $url,
  $responseElement = '',
  $parameters = [] 
)

Performs an ajax request.

Parameters
string$methodThe http method (get, post, delete, put, head)
string$urlThe url of the request
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)

Definition at line 319 of file JsUtilsAjaxTrait.php.

◆ ajaxDeferred()

Ajax\common\traits\ajaxDeferred (   $method,
  $url,
  $responseElement = '',
  $parameters = [] 
)

Performs a deferred ajax request.

Parameters
string$methodThe http method (get, post, delete, put, head)
string$urlThe url of the request
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)

Definition at line 358 of file JsUtilsAjaxTrait.php.

◆ ajaxInterval()

Ajax\common\traits\ajaxInterval (   $method,
  $url,
  $interval,
  $globalName = null,
  $responseElement = '',
  $parameters = [],
  $immediatly = true 
)

Executes an ajax query at regular intervals.

Parameters
string$methodThe http method (post, get...)
string$urlThe url of the request
int$intervalThe interval in milliseconds
string$globalNameThe interval name, for clear it
string$responseElement
array$parametersThe ajax parameters, default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
$immediatly
Returns
string

Definition at line 342 of file JsUtilsAjaxTrait.php.

◆ ajaxOn()

Ajax\common\traits\ajaxOn (   $event,
  $element,
  $url,
  $responseElement = '',
  $parameters = array() 
)

Performs an ajax request to $url on the event $event on $element and display it in $responseElement.

Parameters
string$eventthe event observed
string$elementthe element on which event is observed
string$urlThe url of the request
string$responseElementThe selector of the HTML element displaying the answer
array$parametersdefault : array("method"=>"get","preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)

Definition at line 577 of file JsUtilsAjaxTrait.php.

◆ ajaxOnClick()

Ajax\common\traits\ajaxOnClick (   $element,
  $url,
  $responseElement = '',
  $parameters = array() 
)

Performs a get to $url on the click event on $element and display it in $responseElement.

Parameters
string$elementthe element on which event is observed
string$urlThe url of the request
string$responseElementThe selector of the HTML element displaying the answer
array$parametersdefault : array("method"=>"get","preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)

Definition at line 601 of file JsUtilsAjaxTrait.php.

◆ animate()

Ajax\common\traits\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 201 of file JsUtilsActionsTrait.php.

◆ append()

Ajax\common\traits\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 237 of file JsUtilsActionsTrait.php.

◆ asDropZone()

Ajax\common\traits\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 668 of file JsUtilsActionsTrait.php.

◆ attr()

Ajax\common\traits\attr (   $element = 'this',
  $attributeName = 'id',
  $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 152 of file JsUtilsActionsTrait.php.

◆ autoActiveLinks()

Ajax\common\traits\autoActiveLinks (   $previousURL = "window.location.href")
protected

Definition at line 153 of file JsUtilsAjaxTrait.php.

◆ before()

Ajax\common\traits\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 139 of file JsUtilsActionsTrait.php.

◆ blur()

Ajax\common\traits\blur (   $element = 'this',
  $js = '',
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library blur event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
Returns
string

Definition at line 65 of file JsUtilsEventsTrait.php.

◆ change()

Ajax\common\traits\change (   $element = 'this',
  $js = '',
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library change event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
boolean$preventDefault
boolean$stopPropagation
boolean | string$listenerOnuse a selector for a delegated event handler
Returns
string

Definition at line 81 of file JsUtilsEventsTrait.php.

◆ clearInterval()

Ajax\common\traits\clearInterval (   $globalName,
  $immediatly = true 
)

Clears an existing interval.

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

Definition at line 712 of file JsUtilsActionsTrait.php.

◆ click()

Ajax\common\traits\click (   $element = 'this',
  $js = '',
  $ret_false = TRUE,
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library click event.

Parameters
string$elementelement to attach the event to
string | array$jscode to execute
boolean$ret_falseor not to return false
boolean$preventDefault
boolean$stopPropagation
boolean | string$listenerOnuse a selector for a delegated event handler
Returns
string

Definition at line 99 of file JsUtilsEventsTrait.php.

◆ condition()

Ajax\common\traits\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 479 of file JsUtilsActionsTrait.php.

◆ conflict()

Ajax\common\traits\conflict ( )
protected

Definition at line 88 of file JsUtilsInternalTrait.php.

◆ contextmenu()

Ajax\common\traits\contextmenu (   $element = 'this',
  $js = '',
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library contextmenu event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
boolean$preventDefault
boolean$stopPropagation
boolean | string$listenerOnuse a selector for a delegated event handler
Returns
string

Definition at line 125 of file JsUtilsEventsTrait.php.

◆ counter()

Ajax\common\traits\counter (   $counterSelector,
  $value = 0,
  $limit = 0,
  $globalName = null,
  $countDown = true,
  $immediatly = true 
)

Associates a counter to the element designated by $counterSelector Triggers the events counter-start and counter-end on finished with the parameters value and limit.

Parameters
string$counterSelectorSelector of the existing element wich display the counter
integer$valueThe initial value of the counter
integer$limitThe limit of the counter (minimum if countDown is true, maximum if not)
string$globalNameThe global name of the counter, to use with the clearInterval method
boolean$countDowncount down if true or elapse if false
boolean$immediatlydelayed if false
Returns
string

Definition at line 734 of file JsUtilsActionsTrait.php.

◆ counterOn()

Ajax\common\traits\counterOn (   $element,
  $event,
  $counterSelector,
  $value = 0,
  $limit = 0,
  $globalName = null,
  $countDown = true 
)

Associates a counter to the element designated by $counterSelector when $event is triggered on $element.

Parameters
string$elementThe triggering element
string$eventThe triggering event
string$counterSelectorSelector of the existing element wich display the counter
integer$valueThe initial value of the counter
integer$limitThe limit of the counter (minimum if countDown is true, maximum if not)
string$globalNameThe global name of the counter, to use with the clearInterval method
boolean$countDowncount down if true or elapse if false
Returns
string

Definition at line 790 of file JsUtilsActionsTrait.php.

◆ createAjaxParameters()

Ajax\common\traits\createAjaxParameters ( $original,
  $parameters 
)
protected

Definition at line 89 of file JsUtilsAjaxTrait.php.

◆ dblclick()

Ajax\common\traits\dblclick (   $element = 'this',
  $js = '',
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library dblclick event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
boolean$preventDefault
boolean$stopPropagation
boolean | string$listenerOnuse a selector for a delegated event handler
Returns
string

Definition at line 141 of file JsUtilsEventsTrait.php.

◆ defer()

Ajax\common\traits\defer (   $script)
protected

Definition at line 29 of file JsUtilsInternalTrait.php.

◆ doJQuery()

Ajax\common\traits\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 525 of file JsUtilsActionsTrait.php.

◆ doJQueryDeferred()

Ajax\common\traits\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 542 of file JsUtilsActionsTrait.php.

◆ doJQueryOn()

Ajax\common\traits\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 575 of file JsUtilsActionsTrait.php.

◆ error()

Ajax\common\traits\error (   $element = 'this',
  $js = '' 
)

Outputs a javascript library error event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
Returns
string

Definition at line 154 of file JsUtilsEventsTrait.php.

◆ exec()

Ajax\common\traits\exec (   $js,
  $immediatly = false 
)

Executes the code $js.

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

Definition at line 593 of file JsUtilsActionsTrait.php.

◆ execAtLast()

Ajax\common\traits\execAtLast (   $js)

Executes the code $js.

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

Definition at line 609 of file JsUtilsActionsTrait.php.

◆ execOn()

Ajax\common\traits\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 626 of file JsUtilsActionsTrait.php.

◆ fadeIn()

Ajax\common\traits\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 267 of file JsUtilsActionsTrait.php.

◆ fadeOut()

Ajax\common\traits\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 284 of file JsUtilsActionsTrait.php.

◆ focus()

Ajax\common\traits\focus (   $element = 'this',
  $js = '',
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library focus event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
boolean$preventDefault
boolean$stopPropagation
boolean | string$listenerOnuse a selector for a delegated event handler
Returns
string

Definition at line 170 of file JsUtilsEventsTrait.php.

◆ get()

Ajax\common\traits\get (   $url,
  $responseElement = '',
  $parameters = [] 
)

Performs an ajax GET request.

Parameters
string$urlThe url of the request
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)

Definition at line 302 of file JsUtilsAjaxTrait.php.

◆ getDeferred()

Ajax\common\traits\getDeferred (   $url,
  $responseElement = "",
  $parameters = [] 
)

Prepares a Get ajax request for using on an event.

Parameters
string$urlThe url of the request
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)

Definition at line 537 of file JsUtilsAjaxTrait.php.

◆ getHref()

Ajax\common\traits\getHref (   $element,
  $responseElement = "",
  $parameters = array() 
)

Uses an hyperlink to make an ajax get request.

Parameters
string$elementan hyperlink selector
string$responseElementthe target of the ajax request (data-target attribute of the element is used if responseElement is omited)
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"href","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>true,"before"=>null,"listenerOn"=>false)
Returns
$this

Definition at line 633 of file JsUtilsAjaxTrait.php.

◆ getOn()

Ajax\common\traits\getOn (   $event,
  $element,
  $url,
  $responseElement = "",
  $parameters = array() 
)

Performs a get to $url on the event $event on $element and display it in $responseElement.

Parameters
string$eventthe event
string$elementthe element on which event is observed
string$urlThe url of the request
string$responseElementThe selector of the HTML element displaying the answer
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)

Definition at line 557 of file JsUtilsAjaxTrait.php.

◆ getOnClick()

Ajax\common\traits\getOnClick (   $element,
  $url,
  $responseElement = '',
  $parameters = array() 
)

Performs a get to $url on the click event on $element and display it in $responseElement.

Parameters
string$elementthe element on which click is observed
string$urlThe url of the request
string$responseElementThe selector of the HTML element displaying the answer
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)

Definition at line 618 of file JsUtilsAjaxTrait.php.

◆ getUrl()

Ajax\common\traits\getUrl (   $url)
abstract

◆ hide()

Ajax\common\traits\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 367 of file JsUtilsActionsTrait.php.

◆ hover()

Ajax\common\traits\hover (   $element = 'this',
  $over = '',
  $out = '' 
)

Outputs a javascript library hover event.

Parameters
string$element
string$overcode for mouse over
string$outcode for mouse out
Returns
string

Definition at line 184 of file JsUtilsEventsTrait.php.

◆ html()

Ajax\common\traits\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 184 of file JsUtilsActionsTrait.php.

◆ implodeAjaxParameters()

Ajax\common\traits\implodeAjaxParameters (   $ajaxParameters)
protected

Definition at line 104 of file JsUtilsAjaxTrait.php.

◆ interval()

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

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 691 of file JsUtilsActionsTrait.php.

◆ json()

Ajax\common\traits\json (   $url,
  $method = "get",
  $parameters = [] 
)

Performs an ajax request and receives the JSON data types by assigning DOM elements with the same name.

Parameters
string$urlthe request url
string$methodMethod used
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>"document","jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"before"=>null)

Definition at line 395 of file JsUtilsAjaxTrait.php.

◆ jsonArray()

Ajax\common\traits\jsonArray (   $maskSelector,
  $url,
  $method = 'get',
  $parameters = [] 
)

Performs an ajax request and receives the JSON array data types by assigning DOM elements with the same name.

Parameters
string$maskSelector
string$urlthe request url
string$methodMethod used, default : get
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>null,"jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"rowClass"=>"_json","before"=>null)

Definition at line 484 of file JsUtilsAjaxTrait.php.

◆ jsonArrayDeferred()

Ajax\common\traits\jsonArrayDeferred (   $maskSelector,
  $url,
  $method = 'get',
  $parameters = [] 
)

Peforms an ajax request delayed and receives a JSON array data types by copying and assigning them to the DOM elements with the same name.

Parameters
string$maskSelector
string$urlthe request url
string$methodMethod used, default : get
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>null,"jsCondition"=>NULL,"headers"=>null,"rowClass"=>"_json","before"=>null)

Definition at line 499 of file JsUtilsAjaxTrait.php.

◆ jsonArrayOn()

Ajax\common\traits\jsonArrayOn (   $event,
  $element,
  $maskSelector,
  $url,
  $method = 'get',
  $parameters = array() 
)

Performs an ajax request and receives the JSON array data types by assigning DOM elements with the same name when $event fired on $element.

Parameters
string$element
string$event
string$urlthe request url
string$methodMethod used, default : get
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","params"=>"{}","method"=>"get","rowClass"=>"_json","immediatly"=>true,"before"=>null,"listenerOn"=>false)

Definition at line 516 of file JsUtilsAjaxTrait.php.

◆ jsonDeferred()

Ajax\common\traits\jsonDeferred (   $url,
  $method = 'get',
  $parameters = [] 
)

Prepares an ajax request delayed and receives the JSON data types by assigning DOM elements with the same name.

Parameters
string$urlthe request url
string$methodMethod used
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>"document","jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"before"=>null)

Definition at line 431 of file JsUtilsAjaxTrait.php.

◆ jsonOn()

Ajax\common\traits\jsonOn (   $event,
  $element,
  $url,
  $method = 'get',
  $parameters = array() 
)

Makes an ajax request and receives the JSON data types by assigning DOM elements with the same name when $event fired on $element.

Parameters
string$element
string$event
string$urlthe request address
string$methoddefault get
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","params"=>"{}","method"=>"get","immediatly"=>true,"before"=>null,"listenerOn"=>false)

Definition at line 411 of file JsUtilsAjaxTrait.php.

◆ keydown()

Ajax\common\traits\keydown (   $element = 'this',
  $js = '',
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library keydown event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
boolean$preventDefault
boolean$stopPropagation
boolean | string$listenerOnuse a selector for a delegated event handler
Returns
string

Definition at line 202 of file JsUtilsEventsTrait.php.

◆ keypress()

Ajax\common\traits\keypress (   $element = 'this',
  $js = '',
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library keypress event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
boolean$preventDefault
boolean$stopPropagation
boolean | string$listenerOnuse a selector for a delegated event handler
Returns
string

Definition at line 218 of file JsUtilsEventsTrait.php.

◆ keyup()

Ajax\common\traits\keyup (   $element = 'this',
  $js = '',
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library keydown event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
boolean$preventDefault
boolean$stopPropagation
boolean | string$listenerOnuse a selector for a delegated event handler
Returns
string

Definition at line 234 of file JsUtilsEventsTrait.php.

◆ load()

Ajax\common\traits\load (   $element = 'this',
  $js = '',
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library load event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
boolean$preventDefault
boolean$stopPropagation
boolean | string$listenerOnuse a selector for a delegated event handler
Returns
string

Definition at line 250 of file JsUtilsEventsTrait.php.

◆ minify()

Ajax\common\traits\minify (   $input)
protected

Definition at line 41 of file JsUtilsInternalTrait.php.

◆ mousedown()

Ajax\common\traits\mousedown (   $element = 'this',
  $js = '',
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library mousedown event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
boolean$preventDefault
boolean$stopPropagation
boolean | string$listenerOnuse a selector for a delegated event handler
Returns
string

Definition at line 266 of file JsUtilsEventsTrait.php.

◆ mouseenter()

Ajax\common\traits\mouseenter (   $element = 'this',
  $js = '',
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library mouseenter event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
boolean$preventDefault
boolean$stopPropagation
boolean | string$listenerOnuse a selector for a delegated event handler
Returns
string

Definition at line 314 of file JsUtilsEventsTrait.php.

◆ mouseleave()

Ajax\common\traits\mouseleave (   $element = 'this',
  $js = '',
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library mouseleave event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
boolean$preventDefault
boolean$stopPropagation
boolean | string$listenerOnuse a selector for a delegated event handler
Returns
string

Definition at line 298 of file JsUtilsEventsTrait.php.

◆ mouseout()

Ajax\common\traits\mouseout (   $element = 'this',
  $js = '',
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library mouseout event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
boolean$preventDefault
boolean$stopPropagation
boolean | string$listenerOnuse a selector for a delegated event handler
Returns
string

Definition at line 282 of file JsUtilsEventsTrait.php.

◆ mouseover()

Ajax\common\traits\mouseover (   $element = 'this',
  $js = '',
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library mouseover event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
boolean$preventDefault
boolean$stopPropagation
boolean | string$listenerOnuse a selector for a delegated event handler
Returns
string

Definition at line 330 of file JsUtilsEventsTrait.php.

◆ mouseup()

Ajax\common\traits\mouseup (   $element = 'this',
  $js = '',
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library mouseup event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
boolean$preventDefault
boolean$stopPropagation
boolean | string$listenerOnuse a selector for a delegated event handler
Returns
string

Definition at line 346 of file JsUtilsEventsTrait.php.

◆ onPopstate()

Ajax\common\traits\onPopstate ( )
protected

Definition at line 149 of file JsUtilsAjaxTrait.php.

◆ post()

Ajax\common\traits\post (   $url,
  $params = "{}",
  $responseElement = "",
  $parameters = [] 
)

Makes an ajax post.

Parameters
string$urlthe request url
string$responseElementselector of the HTML element displaying the answer
string$paramsJSON parameters
array$parametersdefault : array("jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)

Definition at line 722 of file JsUtilsAjaxTrait.php.

◆ postDeferred()

Ajax\common\traits\postDeferred (   $url,
  $params = "{}",
  $responseElement = "",
  $parameters = [] 
)

Prepares a delayed ajax POST to use on an event.

Parameters
string$urlthe request url
string$paramsJSON parameters
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)

Definition at line 740 of file JsUtilsAjaxTrait.php.

◆ postForm()

Ajax\common\traits\postForm (   $url,
  $form,
  $responseElement,
  $parameters = [] 
)

Performs a post form with ajax.

Parameters
string$urlThe url of the request
string$formThe form HTML id
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)

Definition at line 864 of file JsUtilsAjaxTrait.php.

◆ postFormAction()

Ajax\common\traits\postFormAction (   $element,
  $responseElement = "",
  $parameters = array() 
)

Uses a form action to make an ajax post request.

Parameters
string$elementa form selector
string$responseElementthe target of the ajax request (data-target attribute of the element is used if responseElement is omited)
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"href","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>true,"before"=>null,"listenerOn"=>false)
Returns
$this

Definition at line 684 of file JsUtilsAjaxTrait.php.

◆ postFormDeferred()

Ajax\common\traits\postFormDeferred (   $url,
  $form,
  $responseElement,
  $parameters = [] 
)

Performs a delayed post form with ajax For use on an event.

Parameters
string$urlThe url of the request
string$formThe form HTML id
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)

Definition at line 882 of file JsUtilsAjaxTrait.php.

◆ postFormOn()

Ajax\common\traits\postFormOn (   $event,
  $element,
  $url,
  $form,
  $responseElement = "",
  $parameters = array() 
)

Performs a post form with ajax in response to an event $event on $element display the result in $responseElement.

Parameters
string$event
string$element
string$url
string$form
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"validation"=>false,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)

Definition at line 900 of file JsUtilsAjaxTrait.php.

◆ postFormOnClick()

Ajax\common\traits\postFormOnClick (   $element,
  $url,
  $form,
  $responseElement = "",
  $parameters = array() 
)

Performs a post form with ajax in response to the click event on $element display the result in $responseElement.

Parameters
string$element
string$url
string$form
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"validation"=>false,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)

Definition at line 922 of file JsUtilsAjaxTrait.php.

◆ postHref()

Ajax\common\traits\postHref (   $element,
  $responseElement = "",
  $parameters = array() 
)

Uses an hyperlink to make an ajax get request.

Parameters
string$elementan hyperlink selector
string$responseElementthe target of the ajax request (data-target attribute of the element is used if responseElement is omited)
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"href","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>true,"before"=>null,"listenerOn"=>false)
Returns
$this

Definition at line 660 of file JsUtilsAjaxTrait.php.

◆ postOn()

Ajax\common\traits\postOn (   $event,
  $element,
  $url,
  $params = "{}",
  $responseElement = "",
  $parameters = array() 
)

Performs a post to $url on the event $event fired on $element and pass the parameters $params Display the result in $responseElement.

Parameters
string$event
string$element
string$urlThe url of the request
string$paramsThe parameters to send
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)

Definition at line 760 of file JsUtilsAjaxTrait.php.

◆ postOnClick()

Ajax\common\traits\postOnClick (   $element,
  $url,
  $params = '{}',
  $responseElement = '',
  $parameters = array() 
)

Performs a post to $url on the click event fired on $element and pass the parameters $params Display the result in $responseElement.

Parameters
string$element
string$urlThe url of the request
string$paramsThe parameters to send
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null,"before"=>null,"listenerOn"=>false)

Definition at line 780 of file JsUtilsAjaxTrait.php.

◆ prepend()

Ajax\common\traits\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 250 of file JsUtilsActionsTrait.php.

◆ ready()

Ajax\common\traits\ready (   $script)
protected

Definition at line 35 of file JsUtilsInternalTrait.php.

◆ removeClass()

Ajax\common\traits\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 316 of file JsUtilsActionsTrait.php.

◆ removeLoader()

Ajax\common\traits\removeLoader (   $hasLoader)
protected

Definition at line 183 of file JsUtilsAjaxTrait.php.

◆ resize()

Ajax\common\traits\resize (   $element = 'this',
  $js = '',
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library resize event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
boolean$preventDefault
boolean$stopPropagation
boolean | string$listenerOnuse a selector for a delegated event handler
Returns
string

Definition at line 379 of file JsUtilsEventsTrait.php.

◆ scroll()

Ajax\common\traits\scroll (   $element = 'this',
  $js = '',
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library scroll event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
boolean$preventDefault
boolean$stopPropagation
boolean | string$listenerOnuse a selector for a delegated event handler
Returns
string

Definition at line 396 of file JsUtilsEventsTrait.php.

◆ setAjaxDataCall()

Ajax\common\traits\setAjaxDataCall (   $params)
protected

Definition at line 259 of file JsUtilsAjaxTrait.php.

◆ setAjaxLoader()

Ajax\common\traits\setAjaxLoader (   $loader)

Definition at line 276 of file JsUtilsAjaxTrait.php.

◆ setDefaultParameters()

Ajax\common\traits\setDefaultParameters ( $parameters,
  $default 
)
protected

Definition at line 269 of file JsUtilsAjaxTrait.php.

◆ setDraggable()

Ajax\common\traits\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 648 of file JsUtilsActionsTrait.php.

◆ setJsonToElement()

Ajax\common\traits\setJsonToElement (   $json,
  $elementClass = "_element",
  $immediatly = true 
)

Definition at line 634 of file JsUtilsActionsTrait.php.

◆ show()

Ajax\common\traits\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 432 of file JsUtilsActionsTrait.php.

◆ slideDown()

Ajax\common\traits\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 333 of file JsUtilsActionsTrait.php.

◆ slideToggle()

Ajax\common\traits\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 350 of file JsUtilsActionsTrait.php.

◆ slideUp()

Ajax\common\traits\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 301 of file JsUtilsActionsTrait.php.

◆ sortable()

Ajax\common\traits\sortable (   $element,
  $options = array () 
)

Creates a jQuery sortable.

Parameters
string$element
array$options
Returns
string

Definition at line 443 of file JsUtilsActionsTrait.php.

◆ tablesorter()

Ajax\common\traits\tablesorter (   $table = '',
  $options = '' 
)

Table Sorter Plugin.

Parameters
string$tabletable name
string$optionsplugin location
Returns
string

Definition at line 466 of file JsUtilsActionsTrait.php.

◆ toggle()

Ajax\common\traits\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 384 of file JsUtilsActionsTrait.php.

◆ toggleClass()

Ajax\common\traits\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 398 of file JsUtilsActionsTrait.php.

◆ trigger()

Ajax\common\traits\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 410 of file JsUtilsActionsTrait.php.

◆ unload()

Ajax\common\traits\unload (   $element = 'this',
  $js = '',
  $preventDefault = false,
  $stopPropagation = false,
  $listenerOn = false 
)

Outputs a javascript library unload event.

Parameters
string$elementelement to attach the event to
string$jscode to execute
boolean$preventDefault
boolean$stopPropagation
boolean | string$listenerOnuse a selector for a delegated event handler
Returns
string

Definition at line 362 of file JsUtilsEventsTrait.php.

◆ val()

Ajax\common\traits\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 172 of file JsUtilsActionsTrait.php.

Variable Documentation

◆ $ajaxLoader

$ajaxLoader = "<div class=\"ui active centered inline text loader\">Loading</div>"
protected

Definition at line 18 of file JsUtilsAjaxTrait.php.

◆ $jquery_code_for_compile_at_last

array $jquery_code_for_compile_at_last = array()
protected

Definition at line 10 of file JsUtilsInternalTrait.php.

◆ JsUtilsActionsTrait

trait JsUtilsActionsTrait
Initial value:
{
abstract public function _add_event($element, $js, $event, $preventDefault = false, $stopPropagation = false, $immediatly = true, $listenerOn=false)
_add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true, $listenerOn=false)

Definition at line 13 of file JsUtilsActionsTrait.php.

◆ JsUtilsAjaxTrait

trait JsUtilsAjaxTrait
Initial value:
{
protected $ajaxTransition

Definition at line 14 of file JsUtilsAjaxTrait.php.

◆ JsUtilsEventsTrait

trait JsUtilsEventsTrait

Definition at line 12 of file JsUtilsEventsTrait.php.

◆ JsUtilsInternalTrait

trait JsUtilsInternalTrait
Initial value:
{
protected $jquery_code_for_compile = array()

Definition at line 6 of file JsUtilsInternalTrait.php.