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

Public Member Functions

 setDi (DiInterface $di)
 
 getDi ()
 
 getUrl ($url)
 
 addViewElement ($identifier, $content, &$view)
 
 createScriptVariable (&$view, $view_var, $output)
 
 forward ($initialController, $controller, $action, $params=array())
 
 renderContent ($initialControllerInstance, $viewName, $params=NULL)
 
 fromDispatcher ($dispatcher)
 
- Public Member Functions inherited from JsUtils
 getUrl ($url)
 Generates an URL Used internally by phpMv. More...
 
 addViewElement ($identifier, $content, &$view)
 Adds the array of controls q in the $view element Used internally by phpMv. More...
 
 createScriptVariable (&$view, $view_var, $output)
 Creates the script variable script_foot Used internally by phpMv. More...
 
 forward ($initialController, $controller, $action, $params)
 Forwards to. More...
 
 renderContent ($initialControllerInstance, $viewName, $params=NULL)
 render the content of an existing view : $viewName and set the response to the modal content Used internally by phpMv More...
 
 fromDispatcher ($dispatcher)
 Collects url parts from the request dispatcher : controllerName, actionName, parameters Used internally by phpMv. More...
 
 ui (JqueryUI $ui=NULL)
 getter or setter of the jQuery-UI variable More...
 
 bootstrap (Bootstrap $bootstrap=NULL)
 getter or setter of the Twitter Bootstrap variable More...
 
 semantic (Semantic $semantic=NULL)
 getter or setter of the Semantic-UI variable More...
 
 config ($config=NULL)
 
 __construct ($params=array(), $injected=NULL)
 
 __set ($property, $value)
 
 getParam ($key)
 
 output ($array_js)
 Outputs the called javascript to the screen. More...
 
 compile (&$view=NULL, $view_var='script_foot', $script_tags=TRUE)
 gather together all script needing to be output More...
 
 clear_compile ()
 Clears the array of script events collected for output. More...
 
 getScript ($offset=0)
 
 scriptCount ()
 
 inline ($script, $cdata=TRUE)
 Outputs a <script> tag. More...
 
 generate_json ($result=NULL, $match_array_type=FALSE)
 Can be passed a database result or associative array and returns a JSON formatted string. More...
 
 _prep_args ($result, $is_key=FALSE)
 Ensures a standard json value and escapes values. More...
 
 _add_event ($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true)
 Constructs the syntax for an event, and adds to into the array for compilation. More...
 
 getInjected ()
 
- Public Member Functions inherited from JsUtilsEventsTrait
 _add_event ($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true)
 
 blur ($element='this', $js='')
 Outputs a javascript library blur event. More...
 
 change ($element='this', $js='', $preventDefault=false, $stopPropagation=false)
 Outputs a javascript library change event. More...
 
 click ($element='this', $js='', $ret_false=TRUE, $preventDefault=false, $stopPropagation=false)
 Outputs a javascript library click event. More...
 
 contextmenu ($element='this', $js='')
 Outputs a javascript library contextmenu event. More...
 
 dblclick ($element='this', $js='')
 Outputs a javascript library dblclick event. More...
 
 error ($element='this', $js='')
 Outputs a javascript library error event. More...
 
 focus ($element='this', $js='')
 Outputs a javascript library focus event. More...
 
 hover ($element='this', $over, $out)
 Outputs a javascript library hover event. More...
 
 keydown ($element='this', $js='')
 Outputs a javascript library keydown event. More...
 
 keypress ($element='this', $js='')
 Outputs a javascript library keypress event. More...
 
 keyup ($element='this', $js='')
 Outputs a javascript library keydown event. More...
 
 load ($element='this', $js='')
 Outputs a javascript library load event. More...
 
 mousedown ($element='this', $js='')
 Outputs a javascript library mousedown event. More...
 
 mouseout ($element='this', $js='')
 Outputs a javascript library mouseout event. More...
 
 mouseover ($element='this', $js='')
 Outputs a javascript library mouseover event. More...
 
 mouseup ($element='this', $js='')
 Outputs a javascript library mouseup event. More...
 
 unload ($element='this', $js='')
 Outputs a javascript library unload event. More...
 
 resize ($element='this', $js='')
 Outputs a javascript library resize event. More...
 
 scroll ($element='this', $js='')
 Outputs a javascript library scroll event. More...
 
- Public Member Functions inherited from JsUtilsActionsTrait
 _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...
 
- Public Member Functions inherited from JsUtilsAjaxTrait
 getUrl ($url)
 
 _add_event ($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true)
 
 interval ($jsCode, $time, $globalName=null, $immediatly=true)
 
 setAjaxLoader ($loader)
 
 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=[])
 
 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...
 
 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...
 
 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...
 
 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=[])
 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...
 
- Public Member Functions inherited from JsUtilsInternalTrait
 addToCompile ($jsScript)
 

Protected Attributes

 $_di
 
- Protected Attributes inherited from JsUtils
 $params
 
 $injected
 
 $_ui
 
 $_bootstrap
 
 $_semantic
 
 $config
 
- Protected Attributes inherited from JsUtilsEventsTrait
 $jquery_events
 
- Protected Attributes inherited from JsUtilsAjaxTrait
 $ajaxTransition
 
 $ajaxLoader ="<div class=\"ui active centered inline text loader\">Loading</div>"
 
- Protected Attributes inherited from JsUtilsInternalTrait
 $jquery_code_for_compile =array ()
 
 $jquery_code_for_compile_at_last =array ()
 

Additional Inherited Members

- Static Public Member Functions inherited from JsUtilsAjaxTrait
static _correctParams ($params)
 
static _implodeParams ($parameters)
 
- Protected Member Functions inherited from JsUtils
 initialize ()
 To override for special initialization of the component. More...
 
- Protected Member Functions inherited from JsUtilsActionsTrait
 _showHideWithEffect ($action, $element='this', $speed='', $callback='', $immediatly=false)
 show or hide with effect More...
 
- Protected Member Functions inherited from JsUtilsAjaxTrait
 _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, $hasLoader=false, $history=null)
 
 _getResponseElement ($responseElement)
 
 _correctAjaxUrl ($url)
 
 addLoading (&$retour, $responseElement, $ajaxLoader=null)
 
 setAjaxDataCall ($params)
 
 setDefaultParameters (&$parameters, $default)
 
- Protected Member Functions inherited from JsUtilsInternalTrait
 _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 ()
 

Detailed Description

Definition at line 10 of file JsUtils.php.

Member Function Documentation

◆ addViewElement()

addViewElement (   $identifier,
  $content,
$view 
)

Definition at line 25 of file JsUtils.php.

◆ createScriptVariable()

createScriptVariable ( $view,
  $view_var,
  $output 
)

Definition at line 34 of file JsUtils.php.

◆ forward()

forward (   $initialController,
  $controller,
  $action,
  $params = array() 
)

Definition at line 38 of file JsUtils.php.

◆ fromDispatcher()

fromDispatcher (   $dispatcher)

Definition at line 57 of file JsUtils.php.

◆ getDi()

getDi ( )

Definition at line 17 of file JsUtils.php.

◆ getUrl()

getUrl (   $url)

Definition at line 21 of file JsUtils.php.

◆ renderContent()

renderContent (   $initialControllerInstance,
  $viewName,
  $params = NULL 
)

Definition at line 49 of file JsUtils.php.

◆ setDi()

setDi ( DiInterface  $di)

Definition at line 12 of file JsUtils.php.

Field Documentation

◆ $_di

$_di
protected

Definition at line 11 of file JsUtils.php.


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