Skip to content

CI_Jquery

Mathieu Nayrolles edited this page Jan 20, 2016 · 1 revision

CI_Jquery

Jquery Class

Properties

$_javascript_folder

protected string $_javascript_folder = 'js'

JavaScript directory location

  • Visibility: protected

$jquery_code_for_load

public array $jquery_code_for_load = array()

JQuery code for load

  • Visibility: public

$jquery_code_for_compile

public array $jquery_code_for_compile = array()

JQuery code for compile

  • Visibility: public

$jquery_corner_active

public boolean $jquery_corner_active = FALSE

JQuery corner active flag

  • Visibility: public

$jquery_table_sorter_active

public boolean $jquery_table_sorter_active = FALSE

JQuery table sorter active flag

  • Visibility: public

$jquery_table_sorter_pager_active

public boolean $jquery_table_sorter_pager_active = FALSE

JQuery table sorter pager active

  • Visibility: public

$jquery_ajax_img

public string $jquery_ajax_img = ''

JQuery AJAX image

  • Visibility: public

$_javascript_location

protected string $_javascript_location = 'js'

JavaScript location

  • Visibility: protected

Methods

__construct

void CI_Javascript::__construct(array $params)

Constructor

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $params array

_blur

string CI_Jquery::_blur($element, $js)

Blur

Outputs a jQuery blur event

  • Visibility: protected

Arguments

  • $element mixed
  • $js mixed

_change

string CI_Jquery::_change($element, $js)

Change

Outputs a jQuery change event

  • Visibility: protected

Arguments

  • $element mixed
  • $js mixed

_click

string CI_Jquery::_click($element, $js, $ret_false)

Click

Outputs a jQuery click event

  • Visibility: protected

Arguments

  • $element mixed
  • $js mixed
  • $ret_false mixed

_dblclick

string CI_Jquery::_dblclick($element, $js)

Double Click

Outputs a jQuery dblclick event

  • Visibility: protected

Arguments

  • $element mixed
  • $js mixed

_error

string CI_Jquery::_error($element, $js)

Error

Outputs a jQuery error event

  • Visibility: protected

Arguments

  • $element mixed
  • $js mixed

_focus

string CI_Jquery::_focus($element, $js)

Focus

Outputs a jQuery focus event

  • Visibility: protected

Arguments

  • $element mixed
  • $js mixed

_hover

string CI_Jquery::_hover($element, $over, $out)

Hover

Outputs a jQuery hover event

  • Visibility: protected

Arguments

  • $element mixed
  • $over mixed
  • $out mixed

_keydown

string CI_Jquery::_keydown($element, $js)

Keydown

Outputs a jQuery keydown event

  • Visibility: protected

Arguments

  • $element mixed
  • $js mixed

_keyup

string CI_Jquery::_keyup($element, $js)

Keyup

Outputs a jQuery keydown event

  • Visibility: protected

Arguments

  • $element mixed
  • $js mixed

_load

string CI_Jquery::_load($element, $js)

Load

Outputs a jQuery load event

  • Visibility: protected

Arguments

  • $element mixed
  • $js mixed

_mousedown

string CI_Jquery::_mousedown($element, $js)

Mousedown

Outputs a jQuery mousedown event

  • Visibility: protected

Arguments

  • $element mixed
  • $js mixed

_mouseout

string CI_Jquery::_mouseout($element, $js)

Mouse Out

Outputs a jQuery mouseout event

  • Visibility: protected

Arguments

  • $element mixed
  • $js mixed

_mouseover

string CI_Jquery::_mouseover($element, $js)

Mouse Over

Outputs a jQuery mouseover event

  • Visibility: protected

Arguments

  • $element mixed
  • $js mixed

_mouseup

string CI_Jquery::_mouseup($element, $js)

Mouseup

Outputs a jQuery mouseup event

  • Visibility: protected

Arguments

  • $element mixed
  • $js mixed

_output

void CI_Jquery::_output(array $array_js)

Output

Outputs script directly

  • Visibility: protected

Arguments

  • $array_js array - <p>= array()</p>

_resize

string CI_Jquery::_resize($element, $js)

Resize

Outputs a jQuery resize event

  • Visibility: protected

Arguments

  • $element mixed
  • $js mixed

_scroll

string CI_Jquery::_scroll($element, $js)

Scroll

Outputs a jQuery scroll event

  • Visibility: protected

Arguments

  • $element mixed
  • $js mixed

_unload

string CI_Jquery::_unload($element, $js)

Unload

Outputs a jQuery unload event

  • Visibility: protected

Arguments

  • $element mixed
  • $js mixed

_addClass

string CI_Jquery::_addClass(string $element, string $class)

Add Class

Outputs a jQuery addClass event

  • Visibility: protected

Arguments

  • $element string
  • $class string

_animate

string CI_Jquery::_animate(string $element, array $params, string $speed, string $extra)

Animate

Outputs a jQuery animate event

  • Visibility: protected

Arguments

  • $element string
  • $params array
  • $speed string - <p>'slow', 'normal', 'fast', or time in milliseconds</p>
  • $extra string

_fadeIn

string CI_Jquery::_fadeIn($element, $speed, $callback)

Fade In

Outputs a jQuery hide event

  • Visibility: protected

Arguments

  • $element mixed
  • $speed mixed
  • $callback mixed

_fadeOut

string CI_Jquery::_fadeOut($element, $speed, $callback)

Fade Out

Outputs a jQuery hide event

  • Visibility: protected

Arguments

  • $element mixed
  • $speed mixed
  • $callback mixed

_hide

string CI_Jquery::_hide($element, $speed, $callback)

Hide

Outputs a jQuery hide action

  • Visibility: protected

Arguments

  • $element mixed
  • $speed mixed
  • $callback mixed

_removeClass

string CI_Jquery::_removeClass(string $element, string $class)

Remove Class

Outputs a jQuery remove class event

  • Visibility: protected

Arguments

  • $element string
  • $class string

_slideUp

string CI_Jquery::_slideUp($element, $speed, $callback)

Slide Up

Outputs a jQuery slideUp event

  • Visibility: protected

Arguments

  • $element mixed
  • $speed mixed
  • $callback mixed

_slideDown

string CI_Jquery::_slideDown($element, $speed, $callback)

Slide Down

Outputs a jQuery slideDown event

  • Visibility: protected

Arguments

  • $element mixed
  • $speed mixed
  • $callback mixed

_slideToggle

string CI_Jquery::_slideToggle($element, $speed, $callback)

Slide Toggle

Outputs a jQuery slideToggle event

  • Visibility: protected

Arguments

  • $element mixed
  • $speed mixed
  • $callback mixed

_toggle

string CI_Jquery::_toggle($element)

Toggle

Outputs a jQuery toggle event

  • Visibility: protected

Arguments

  • $element mixed

_toggleClass

string CI_Jquery::_toggleClass(string $element, string $class)

Toggle Class

Outputs a jQuery toggle class event

  • Visibility: protected

Arguments

  • $element string
  • $class string

_show

string CI_Jquery::_show($element, $speed, $callback)

Show

Outputs a jQuery show event

  • Visibility: protected

Arguments

  • $element mixed
  • $speed mixed
  • $callback mixed

_updater

string CI_Jquery::_updater($container, $controller, $options)

Updater

An Ajax call that populates the designated DOM node with returned content

  • Visibility: protected

Arguments

  • $container mixed
  • $controller mixed
  • $options mixed

_zebraTables

string CI_Jquery::_zebraTables(string $class, string $odd, string $hover)

Zebra tables

  • Visibility: protected

Arguments

  • $class string
  • $odd string
  • $hover string

corner

string CI_Jquery::corner(string $element, string $corner_style)

Corner Plugin

  • Visibility: public

Arguments

  • $element string
  • $corner_style string

modal

void CI_Jquery::modal(string $src, boolean $relative)

Modal window

Load a thickbox modal window

  • Visibility: public

Arguments

  • $src string
  • $relative boolean

effect

void CI_Jquery::effect(string $src, boolean $relative)

Effect

Load an Effect library

  • Visibility: public

Arguments

  • $src string
  • $relative boolean

plugin

void CI_Jquery::plugin(string $src, boolean $relative)

Plugin

Load a plugin library

  • Visibility: public

Arguments

  • $src string
  • $relative boolean

ui

void CI_Jquery::ui(string $src, boolean $relative)

UI

Load a user interface library

  • Visibility: public

Arguments

  • $src string
  • $relative boolean

sortable

string CI_Jquery::sortable(string $element, array $options)

Sortable

Creates a jQuery sortable

  • Visibility: public

Arguments

  • $element string
  • $options array

tablesorter

string CI_Jquery::tablesorter($table, $options)

Table Sorter Plugin

  • Visibility: public

Arguments

  • $table mixed
  • $options mixed

_add_event

string CI_Jquery::_add_event($element, $js, $event)

Add Event

Constructs the syntax for an event, and adds to into the array for compilation

  • Visibility: protected

Arguments

  • $element mixed
  • $js mixed
  • $event mixed

_compile

void CI_Jquery::_compile(string $view_var, boolean $script_tags)

Compile

As events are specified, they are stored in an array This function compiles them all for output on a page

  • Visibility: protected

Arguments

  • $view_var string
  • $script_tags boolean

_clear_compile

void CI_Jquery::_clear_compile()

Clear Compile

Clears the array of script events collected for output

  • Visibility: protected

_document_ready

void CI_Jquery::_document_ready(array $js)

Document Ready

A wrapper for writing document.ready()

  • Visibility: protected

Arguments

  • $js array

script

string CI_Jquery::script(string $library_src, boolean $relative)

Script Tag

Outputs the script tag that loads the jquery.js file into an HTML document

  • Visibility: public

Arguments

  • $library_src string
  • $relative boolean

_prep_element

string CI_Jquery::_prep_element($element)

Prep Element

Puts HTML element in quotes for use in jQuery code unless the supplied element is the Javascript 'this' object, in which case no quotes are added

  • Visibility: protected

Arguments

  • $element mixed

_validate_speed

string CI_Jquery::_validate_speed($speed)

Validate Speed

Ensures the speed parameter is valid for jQuery

  • Visibility: protected

Arguments

  • $speed mixed

blur

string CI_Javascript::blur($element, $js)

Blur

Outputs a javascript library blur event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $js mixed

change

string CI_Javascript::change($element, $js)

Change

Outputs a javascript library change event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $js mixed

click

string CI_Javascript::click($element, $js, $ret_false)

Click

Outputs a javascript library click event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $js mixed
  • $ret_false mixed

dblclick

string CI_Javascript::dblclick($element, $js)

Double Click

Outputs a javascript library dblclick event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $js mixed

error

string CI_Javascript::error($element, $js)

Error

Outputs a javascript library error event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $js mixed

focus

string CI_Javascript::focus($element, $js)

Focus

Outputs a javascript library focus event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $js mixed

hover

string CI_Javascript::hover($element, $over, $out)

Hover

Outputs a javascript library hover event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $over mixed
  • $out mixed

keydown

string CI_Javascript::keydown($element, $js)

Keydown

Outputs a javascript library keydown event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $js mixed

keyup

string CI_Javascript::keyup($element, $js)

Keyup

Outputs a javascript library keydown event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $js mixed

load

string CI_Javascript::load($element, $js)

Load

Outputs a javascript library load event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $js mixed

mousedown

string CI_Javascript::mousedown($element, $js)

Mousedown

Outputs a javascript library mousedown event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $js mixed

mouseout

string CI_Javascript::mouseout($element, $js)

Mouse Out

Outputs a javascript library mouseout event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $js mixed

mouseover

string CI_Javascript::mouseover($element, $js)

Mouse Over

Outputs a javascript library mouseover event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $js mixed

mouseup

string CI_Javascript::mouseup($element, $js)

Mouseup

Outputs a javascript library mouseup event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $js mixed

output

string CI_Javascript::output($js)

Output

Outputs the called javascript to the screen

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $js mixed

ready

string CI_Javascript::ready(string $js)

Ready

Outputs a javascript library mouseup event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $js string - <p>Code to execute</p>

resize

string CI_Javascript::resize($element, $js)

Resize

Outputs a javascript library resize event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $js mixed

scroll

string CI_Javascript::scroll($element, $js)

Scroll

Outputs a javascript library scroll event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $js mixed

unload

string CI_Javascript::unload($element, $js)

Unload

Outputs a javascript library unload event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $js mixed

addClass

string CI_Javascript::addClass($element, $class)

Add Class

Outputs a javascript library addClass event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $class mixed

animate

string CI_Javascript::animate(string $element, array $params, mixed $speed, string $extra)

Animate

Outputs a javascript library animate event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element string - <p>= 'this'</p>
  • $params array - <p>= array()</p>
  • $speed mixed - <p>'slow', 'normal', 'fast', or time in milliseconds</p>
  • $extra string

fadeIn

string CI_Javascript::fadeIn($element, $speed, $callback)

Fade In

Outputs a javascript library hide event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $speed mixed
  • $callback mixed

fadeOut

string CI_Javascript::fadeOut($element, $speed, $callback)

Fade Out

Outputs a javascript library hide event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $speed mixed
  • $callback mixed

slideUp

string CI_Javascript::slideUp($element, $speed, $callback)

Slide Up

Outputs a javascript library slideUp event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $speed mixed
  • $callback mixed

removeClass

string CI_Javascript::removeClass($element, $class)

Remove Class

Outputs a javascript library removeClass event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $class mixed

slideDown

string CI_Javascript::slideDown($element, $speed, $callback)

Slide Down

Outputs a javascript library slideDown event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $speed mixed
  • $callback mixed

slideToggle

string CI_Javascript::slideToggle($element, $speed, $callback)

Slide Toggle

Outputs a javascript library slideToggle event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $speed mixed
  • $callback mixed

hide

string CI_Javascript::hide($element, $speed, $callback)

Hide

Outputs a javascript library hide action

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $speed mixed
  • $callback mixed

toggle

string CI_Javascript::toggle($element)

Toggle

Outputs a javascript library toggle event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed

toggleClass

string CI_Javascript::toggleClass(string $element, string $class)

Toggle Class

Outputs a javascript library toggle class event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element string - <p>= 'this'</p>
  • $class string - <p>= ''</p>

show

string CI_Javascript::show($element, $speed, $callback)

Show

Outputs a javascript library show event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $speed mixed
  • $callback mixed

compile

string CI_Javascript::compile(string $view_var, boolean $script_tags)

Compile

gather together all script needing to be output

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $view_var string
  • $script_tags boolean

clear_compile

void CI_Javascript::clear_compile()

Clear Compile

Clears any previous javascript collected for output

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

external

string CI_Javascript::external(string $external_file, boolean $relative)

External

Outputs a <script> tag with the source as an external js file

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $external_file string
  • $relative boolean

inline

string CI_Javascript::inline($script, $cdata)

Inline

Outputs a <script> tag

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $script mixed
  • $cdata mixed

_open_script

string CI_Javascript::_open_script($src)

Open Script

Outputs an opening <script>

  • Visibility: protected
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $src mixed

_close_script

string CI_Javascript::_close_script($extra)

Close Script

Outputs an closing </script>

  • Visibility: protected
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $extra mixed

update

string CI_Javascript::update($element, $speed, $callback)

Update

Outputs a javascript library slideDown event

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $element mixed
  • $speed mixed
  • $callback mixed

generate_json

string CI_Javascript::generate_json($result, $match_array_type)

Generate JSON

Can be passed a database result or associative array and returns a JSON formatted string

  • Visibility: public
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $result mixed
  • $match_array_type mixed

_is_associative_array

boolean CI_Javascript::_is_associative_array($arr)

Is associative array

Checks for an associative array

  • Visibility: protected
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $arr mixed

_prep_args

string CI_Javascript::_prep_args(mixed $result, boolean $is_key)

Prep Args

Ensures a standard json value and escapes values

  • Visibility: protected
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.
  • This method is defined by CI_Javascript

Arguments

  • $result mixed
  • $is_key boolean - <p>= FALSE</p>
Clone this wiki locally