phpDocumentor Swift
[ class tree: Swift ] [ index: Swift ] [ all elements ]

Class: SwiftJQuery

Source Location: /classes/SwiftJQuery.php

Class SwiftJQuery

Method Summary
SwiftJQuery   __construct()   Creates a new SwiftJQuery object.
string   createAjaxCallback()   Creates an Ajax Callback function which can be passed into the createAjaxFunction method.
string   createAjaxFunction()   Creates and returns an AJAX function.
string   createAjaxGetFunction()   Creates and returns an AJAX function using the GET method.
string   createAjaxPostFunction()   Creates and returns an AJAX function using the POST method.
string   createAlertFunction()   Creates a JavaScript function popup an alert message.
string   createChainFunction()   Creates a JavaScript function that upon execution with call all of the function provided in the $func_array.
string   createClearFunction()   Creates a JavaScript function that clears the current value of the $id_to_clear
string   createDropDownMenu()   Automatically creates and returns an JQuery drop down menu script with the specified CSS classes for the parent buttons and child buttons.
string   createEventHook()   Creates a JQuery event on the specified $id to execute the $callback function.
string   createFadeInFunction()   Creates a JavaScript function that fades in the $id_to_fade
string   createFadeOutFunction()   Creates a JavaScript function that fades out the $id_to_fade
string   createFadeToFunction()   Creates a JavaScript function that fades the $id_to_fade to the specified opacity.
string   createFadeToggleFunction()   Creates a JavaScript function that toggles the fading of the $id_to_fade
string   createHideFunction()   Creates a JavaScript function that hides the $id_to_hide
string   createIntervalClearFunction()   Creates a JavaScript function that clears the specified JavaScript interval variable.
string   createIntervalHook()   Creates a JavaScript timer that executes the $callback function every $delay milliseconds.
string   createSetFunction()   Creates a JavaScript function that sets the value of $id_to_set to the value inside $id_to_get
string   createShowFunction()   Creates a JavaScript function that shows the $id_to_show
string   createSlideDownFunction()   Creates a JavaScript function that slides down the $id_to_slide
string   createSlideToggleFunction()   Creates a JavaScript function that toggles the sliding of the $id_to_slide
string   createSlideUpFunction()   Creates a JavaScript function that slides up the $id_to_slide
string   createTimeoutClearFunction()   Creates a JavaScript function that clears the specified JavaScript timeout variable.
string   createTimeoutHook()   Creates a JavaScript timer that executes the $callback once after waiting $delay milliseconds.
string   createToggleFunction()   Creates a JavaScript function that toggles the $id_to_toggle
string   getJQuery()   Returns a HTML script tag which includes the jquery.js engine into the web page.
int   scriptToFile()   Writes all JavaScript functions and events created so far to a file (will overwrite existing file).
string   scriptToHtml()   Returns a string formated for HTML that contains all JavaScript functions and events created so far.

[ Top ]
Methods
Constructor __construct  [line 53]

  SwiftJQuery __construct( [boolean $debug_comments = false]  )

Creates a new SwiftJQuery object.

Parameters:
boolean   $debug_comments:  True to create debug comments. Otherwise false. Default: false

API Tags:
Return:  The new SwiftJQuery object.
Access:  public


[ Top ]
createAjaxCallback  [line 102]

  string createAjaxCallback( string $func_name, string $id, [string $action = 'html'], [string $callback = null]  )

Creates an Ajax Callback function which can be passed into the createAjaxFunction method.

Parameters:
string   $func_name:  The name of the function.
string   $id:  The ID of the element to perform action on.
string   $action:  The JQuery action to perform on the $id provided. Default: html
string   $callback:  The name of a JavaScript function to call after completing AJAX callback function.

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createAjaxFunction  [line 157]

  string createAjaxFunction( string $func_name, string $url, [string $method = "get"], array $data_ids, string $callback  )

Creates and returns an AJAX function.

Parameters:
string   $func_name:  The name of the function.
string   $url:  The URL for the AJAX call.
string   $method:  The request method for the AJAX call. Default: get
array   $data_ids:  An array of HTML element ID's whose value's will be used as query variables for the AJAX call.
string   $callback:  The name of a AJAX callback function (Optional)

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createAjaxGetFunction  [line 201]

  string createAjaxGetFunction( string $func_name, string $url, array $data_ids, string $callback  )

Creates and returns an AJAX function using the GET method.

Parameters:
string   $func_name:  The name of the function.
string   $url:  The URL for the AJAX call.
array   $data_ids:  An array of HTML element ID's whose value's will be used as query variables for the AJAX call.
string   $callback:  The name of a AJAX callback function (Optional)

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createAjaxPostFunction  [line 189]

  string createAjaxPostFunction( string $func_name, string $url, array $data_ids, string $callback  )

Creates and returns an AJAX function using the POST method.

Parameters:
string   $func_name:  The name of the function.
string   $url:  The URL for the AJAX call.
array   $data_ids:  An array of HTML element ID's whose value's will be used as query variables for the AJAX call.
string   $callback:  The name of a AJAX callback function (Optional)

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createAlertFunction  [line 588]

  string createAlertFunction( string $func_name, string $msg  )

Creates a JavaScript function popup an alert message.

Parameters:
string   $func_name:  The name of the JavaScript function.
string   $msg:  The message to display inside the alert box.

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createChainFunction  [line 134]

  string createChainFunction( string $func_name, array $func_array  )

Creates a JavaScript function that upon execution with call all of the function provided in the $func_array.

Parameters:
string   $func_name:  The name of the function.
array   $func_array:  An array of JavaScript function names, $func_array[0] = $value, where $value is the function name.

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createClearFunction  [line 329]

  string createClearFunction( string $func_name, string $id_to_clear  )

Creates a JavaScript function that clears the current value of the $id_to_clear

Parameters:
string   $func_name:  The name of the JavaScript function.
string   $id_to_clear:  The ID of the HTML element to clear.

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createDropDownMenu  [line 75]

  string createDropDownMenu( string $top_class, string $sub_class  )

Automatically creates and returns an JQuery drop down menu script with the specified CSS classes for the parent buttons and child buttons.

Parameters:
string   $top_class:  The CSS class for the top/parent buttons of your menu
string   $sub_class:  The CSS class for the sub/child buttons of your menu

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createEventHook  [line 212]

  string createEventHook( string $id, string $event, string $callback  )

Creates a JQuery event on the specified $id to execute the $callback function.

Parameters:
string   $id:  The ID of the HTML element to put the event hook on.
string   $event:  The type of JQuery event/action to hook on the element.
string   $callback:  The name of the JavaScript function to call when event occurs on the element.

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createFadeInFunction  [line 445]

  string createFadeInFunction( string $func_name, string $id_to_fade, [integer $animation_time = 1000], [string $callback = null]  )

Creates a JavaScript function that fades in the $id_to_fade

Parameters:
string   $func_name:  The name of the JavaScript function.
string   $id_to_fade:  The ID of the HTML element to fade.
integer   $animation_time:  The number of milliseconds the fade animation should last. Default = 1000
string   $callback:  The name of a JavaScript function to call after fading the element.

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createFadeOutFunction  [line 421]

  string createFadeOutFunction( string $func_name, string $id_to_fade, [integer $animation_time = 1000], [string $callback = null]  )

Creates a JavaScript function that fades out the $id_to_fade

Parameters:
string   $func_name:  The name of the JavaScript function.
string   $id_to_fade:  The ID of the HTML element to fade.
integer   $animation_time:  The number of milliseconds the fade animation should last. Default = 1000
string   $callback:  The name of a JavaScript function to call after fading the element.

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createFadeToFunction  [line 494]

  string createFadeToFunction( string $func_name, string $id_to_fade, [integer $animation_time = 1000], [double $opacity = 0.5], [string $callback = null]  )

Creates a JavaScript function that fades the $id_to_fade to the specified opacity.

Parameters:
string   $func_name:  The name of the JavaScript function.
string   $id_to_fade:  The ID of the HTML element to fade.
integer   $animation_time:  The number of milliseconds the fade animation should last. Default = 1000
double   $opacity:  The percentage of opacity the element should fade to. Default = 0.5
string   $callback:  The name of a JavaScript function to call after fading the element.

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createFadeToggleFunction  [line 469]

  string createFadeToggleFunction( string $func_name, string $id_to_fade, [integer $animation_time = 1000], [string $callback = null]  )

Creates a JavaScript function that toggles the fading of the $id_to_fade

Parameters:
string   $func_name:  The name of the JavaScript function.
string   $id_to_fade:  The ID of the HTML element to fade.
integer   $animation_time:  The number of milliseconds the fade animation should last. Default = 1000
string   $callback:  The name of a JavaScript function to call after fading the element. (Optional)

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createHideFunction  [line 349]

  string createHideFunction( string $func_name, string $id_to_hide, [integer $animation_time = 1000], [string $callback = null]  )

Creates a JavaScript function that hides the $id_to_hide

Parameters:
string   $func_name:  The name of the JavaScript function.
string   $id_to_hide:  The ID of the HTML element to hide.
integer   $animation_time:  The number of milliseconds the hide animation should last. Default = 1000
string   $callback:  The name of a JavaScript function to call after hiding the element.

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createIntervalClearFunction  [line 252]

  string createIntervalClearFunction( string $func_name, [string $interval_var = 'interval_var']  )

Creates a JavaScript function that clears the specified JavaScript interval variable.

Parameters:
string   $func_name:  The name of the JavaScript function.
string   $interval_var:  The name of the JavaScript variable that holds the timer. Default = interval_var

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createIntervalHook  [line 231]

  string createIntervalHook( integer $delay, string $callback, [string $interval_var = 'interval_var']  )

Creates a JavaScript timer that executes the $callback function every $delay milliseconds.

Parameters:
integer   $delay:  The number of milliseconds to delay between calls
string   $callback:  The name of the JavaScript function to call.
string   $interval_var:  The name of the JavaScript variable to store the timer in. Default = interval_var

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createSetFunction  [line 311]

  string createSetFunction( string $func_name, string $id_to_set, string $id_to_get  )

Creates a JavaScript function that sets the value of $id_to_set to the value inside $id_to_get

Parameters:
string   $func_name:  The name of the JavaScript function.
string   $id_to_set:  The ID of the HTML element to set.
string   $id_to_get:  The ID of the HTML element to get.

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createShowFunction  [line 373]

  string createShowFunction( string $func_name, string $id_to_show, [integer $animation_time = 1000], [string $callback = null]  )

Creates a JavaScript function that shows the $id_to_show

Parameters:
string   $func_name:  The name of the JavaScript function.
string   $id_to_show:  The ID of the HTML element to show.
integer   $animation_time:  The number of milliseconds the show animation should last. Default = 1000
string   $callback:  The name of a JavaScript function to call after showing the element.

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createSlideDownFunction  [line 518]

  string createSlideDownFunction( string $func_name, string $id_to_slide, [integer $animation_time = 1000], [string $callback = null]  )

Creates a JavaScript function that slides down the $id_to_slide

Parameters:
string   $func_name:  The name of the JavaScript function.
string   $id_to_slide:  The ID of the HTML element to slide.
integer   $animation_time:  The number of milliseconds the slide animation should last. Default = 1000
string   $callback:  The name of a JavaScript function to call after sliding the element.

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createSlideToggleFunction  [line 566]

  string createSlideToggleFunction( string $func_name, string $id_to_slide, [integer $animation_time = 1000], [string $callback = null]  )

Creates a JavaScript function that toggles the sliding of the $id_to_slide

Parameters:
string   $func_name:  The name of the JavaScript function.
string   $id_to_slide:  The ID of the HTML element to slide.
integer   $animation_time:  The number of milliseconds the slide animation should last. Default = 1000
string   $callback:  The name of a JavaScript function to call after sliding the element. (Optional)

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createSlideUpFunction  [line 542]

  string createSlideUpFunction( string $func_name, string $id_to_slide, [integer $animation_time = 1000], [string $callback = null]  )

Creates a JavaScript function that slides up the $id_to_slide

Parameters:
string   $func_name:  The name of the JavaScript function.
string   $id_to_slide:  The ID of the HTML element to slide.
integer   $animation_time:  The number of milliseconds the slide animation should last. Default = 1000
string   $callback:  The name of a JavaScript function to call after sliding the element.

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createTimeoutClearFunction  [line 292]

  string createTimeoutClearFunction( string $func_name, [string $timeout_var = 'timeout_var']  )

Creates a JavaScript function that clears the specified JavaScript timeout variable.

Parameters:
string   $func_name:  The name of the JavaScript function.
string   $timeout_var:  The name of the JavaScript variable that holds the timer. Default = timeout_var

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createTimeoutHook  [line 271]

  string createTimeoutHook( integer $delay, string $callback, [string $timeout_var = 'timeout_var']  )

Creates a JavaScript timer that executes the $callback once after waiting $delay milliseconds.

Parameters:
integer   $delay:  The number of milliseconds to delay between calls
string   $callback:  The name of the JavaScript function to call.
string   $timeout_var:  The name of the JavaScript variable to store the timer in. Default = timeout_var

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
createToggleFunction  [line 397]

  string createToggleFunction( string $func_name, string $id_to_toggle, [integer $animation_time = 1000], [string $callback = null]  )

Creates a JavaScript function that toggles the $id_to_toggle

Parameters:
string   $func_name:  The name of the JavaScript function.
string   $id_to_toggle:  The ID of the HTML element to toggle.
integer   $animation_time:  The number of milliseconds the toggle animation should last. Default = 1000
string   $callback:  The name of a JavaScript function to call after toggling the element. (Optional)

API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]
getJQuery  [line 62]

  string getJQuery( )

Returns a HTML script tag which includes the jquery.js engine into the web page.

to ensure HTML5 compatability for MSIE.


API Tags:
Return:  An HTML script tag.
Access:  public


[ Top ]
scriptToFile  [line 613]

  int scriptToFile( string $filename  )

Writes all JavaScript functions and events created so far to a file (will overwrite existing file).

Parameters:
string   $filename:  The filename to write the javascript to.

API Tags:
Return:  Returns the number of bytes that were written to the file, or FALSE on failure.
Access:  public


[ Top ]
scriptToHtml  [line 604]

  string scriptToHtml( )

Returns a string formated for HTML that contains all JavaScript functions and events created so far.


API Tags:
Return:  A HTML compatible script tag with the JavaScript code.
Access:  public


[ Top ]

Documentation generated on Tue, 08 Oct 2013 05:37:16 +0200 by phpDocumentor 1.4.4