diff options
author | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-02-02 22:19:25 +0100 |
---|---|---|
committer | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-02-02 22:19:25 +0100 |
commit | d88b31550ae2aeb0e3bcc11ba82d4838f8a5fd31 (patch) | |
tree | 792bff97d41430b5c36a08c8ec3ac54db97375b6 /user_guide/libraries | |
parent | 5c59c7dc3254616b18057922ce012f22c18b147b (diff) | |
parent | 75f5ff5d99533a423e68686d89889d172c37d98e (diff) |
Merged recent changes and tweaked multi-env changes.
Diffstat (limited to 'user_guide/libraries')
29 files changed, 189 insertions, 275 deletions
diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 05f7cc0e9..e8182d080 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -191,7 +191,7 @@ Previous Topic: <a href="../doc_style/index.html">Writing Documentaio <a href="../index.html">User Guide Home</a> · Next Topic: <a href="calendar.html">Calendar Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/caching.html b/user_guide/libraries/caching.html index e4651dc4a..3d3354436 100644 --- a/user_guide/libraries/caching.html +++ b/user_guide/libraries/caching.html @@ -186,7 +186,7 @@ Previous Topic: <a href="errors.html">Error Handling</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="profiling.html">Profiling Your Application</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 2c052424d..347b3d92b 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -242,7 +242,7 @@ Previous Topic: <a href="benchmark.html">Benchmark Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="cart.html">Cart Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index ba95b24c5..bc0721bb4 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -339,7 +339,7 @@ Previous Topic: <a href="calendar.html">Calendar Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="config.html">Config Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 10892de38..98b6052a9 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -191,7 +191,7 @@ Previous Topic: <a href="calendar.html">Calendaring Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="../database/index.html">Database Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index b863ef4c1..a02d6587f 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -300,7 +300,7 @@ Previous Topic: <a href="../database/index.html">Database Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="encryption.html">Encryption Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index fbffd63c6..f6fb2b81d 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -217,7 +217,7 @@ Previous Topic: <a href="email.html">Email Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="file_uploading.html">File Uploading Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 54725d035..c5eab4695 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -444,7 +444,7 @@ Previous Topic: <a href="encryption.html">Encryption Helper</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="form_validation.html">Form Validation Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">Ellislab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">Ellislab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index eae2036c1..935dca61f 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -1211,7 +1211,7 @@ Previous Topic: <a href="file_uploading.html">File Uploading Class</a <a href="../index.html">User Guide Home</a> · Next Topic: <a href="ftp.html">FTP Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 493177655..e3c06741d 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -309,7 +309,7 @@ Previous Topic: <a href="form_validation.html">Form Validation Class< <a href="../index.html">User Guide Home</a> · Next Topic: <a href="table.html">HTML Table Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 98ed4f6dd..0f023cff1 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -660,7 +660,7 @@ Previous Topic: <a href="table.html">HTML Table Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="input.html">Input Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index d838cf020..552c49afd 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -262,7 +262,7 @@ Previous Topic: <a href="image_lib.html">Image Manipulation Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="loader.html">Loader Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index 0f1d0a090..18b7181b0 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -2,7 +2,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> -<title>CodeIgniter User Guide : Input Class</title> +<title>JavaScript Driver : CodeIgniter User Guide</title> <style type='text/css' media='all'>@import url('../userguide.css');</style> <link rel='stylesheet' type='text/css' media='all' href='../userguide.css' /> @@ -42,7 +42,8 @@ <td id="breadcrumb"> <a href="http://codeigniter.com/">CodeIgniter Home</a> › <a href="../index.html">User Guide Home</a> › -Input Class +<a href="../general/drivers.html">Drivers</a> › +JavaScript Driver </td> <td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" /> <input type="submit" class="submit" name="sa" value="Go" /></form></td> </tr> @@ -55,11 +56,12 @@ Input Class <!-- START CONTENT --> <div id="content"> +<p class="important"><strong>Note:</strong> This driver is experimental. Its feature set and implementation may change in future releases.</p><br> -<h1>Javascript Class</h1> -<p>Rewrite this paragraph: <a href="http://jquery.com/">jQuery</a> is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. CodeIgniter provides a library to help you with certain common functions that you may want to use within jQuery. Please note that CodeIgniter does not require the jQuery library to run, and that any scripting library will work equally well. The jQuery library is simply presented as a convenience if you choose to use it.</p> +<h1>Javascript Driver</h1> +<p>CodeIgniter provides a library to help you with certain common functions that you may want to use with Javascript. Please note that CodeIgniter does not require the jQuery library to run, and that any scripting library will work equally well. The jQuery library is simply presented as a convenience if you choose to use it.</p> <h2>Initializing the Class</h2> -<p>To initialize the jQuery class manually in your controller constructor, use the <dfn>$this->load->library</dfn> function. Currently, the only available library is jQuery, which will automatically be loaded like this:</p> +<p>To initialize the Javascript class manually in your controller constructor, use the <dfn>$this->load->library</dfn> function. Currently, the only available library is jQuery, which will automatically be loaded like this:</p> <code>$this->load->library('javascript');</code> @@ -72,20 +74,161 @@ Input Class <p>Once loaded, the jQuery library object will be available using: <dfn>$this->javascript</dfn></p> <h2>Setup and Configuration</h2> <h3>Set these variables in your view</h3> -<p>As a javascript library, your files must be available to your application. For your convenience, the needed files to run this library are available for <a href="http://codeigniter.com/downloads/">download</a> from our site.</p> -<p>As javascript is a client side language, the library must be able to write content into your final output. This generally means a view. You'll need to include the following variables in the <head> sections of your output.</p> +<p>As a Javascript library, your files must be available to your application.</p> +<p>As Javascript is a client side language, the library must be able to write content into your final output. This generally means a view. You'll need to include the following variables in the <head> sections of your output.</p> <p><code><?php echo $library_src;?><br /> <?php echo $script_head;?> </code></p> <p>$library_src, is where the actual library file will be loaded, as well as any subsequent plugin script calls; $script_head is where specific events, functions and other commands will be rendered.</p> <h3>Set the path to the librarys with config items</h3> -<p>There are some configuration items in javascript library. These can either be set in application/config.php, within its own confg/javascript.php file, or within any controller usings the set_item() function. </p> +<p>There are some configuration items in Javascript library. These can either be set in application/config.php, within its own config/javascript.php file, or within any controller usings the set_item() function. </p> <p>An image to be used as an "ajax loader", or progress indicator. Without one, the simple text message of "loading" will appear when Ajax calls need to be made.</p> -<p><code>$config['javascript_location'] = 'http://localhost/codeigniter/themes/js/jquery/');<br /> +<p><code>$config['javascript_location'] = 'http://localhost/codeigniter/themes/js/jquery/';<br /> $config['javascript_ajax_img'] = 'images/ajax-loader.gif';</code></p> <p>If you keep your files in the same directories they were downloaded from, then you need not set this configuration items.</p> -<p>For information on outputting events, effects, etc., refer to the <a href="jquery.html">jQuery Class</a> documentation.</p> +<h2>The jQuery Class</h2> + +<p>To initialize the jQuery class manually in your controller constructor, use the <dfn>$this->load->library</dfn> function:</p> + +<code>$this->load->library('jquery');</code> + +<p>You may send an optional parameter to determine whether or not a script tag for the main jQuery file will be automatically included when loading the library. It will be created by default. To prevent this, load the library as follows:</p> + +<code>$this->load->library('jquery', FALSE);</code> + +<p>Once loaded, the jQuery library object will be available using: <dfn>$this->jquery</dfn></p> + +<h2>jQuery Events</h2> + +<p>Events are set using the following syntax.</p> + +<p><code>$this->jquery->event('element_path', code_to_run());</code></p> + +<p>In the above example:</p> + +<ul> + <li>"event" is any of blur, change, click, dblclick, error, focus, hover, keydown, keyup, load, mousedown, mouseup, mouseover, mouseup, resize, scroll, or unload.</li> + <li>"element_path" is any valid <a href="http://docs.jquery.com/Selectors">jQuery selector</a>. Due to jQuery's unique selector syntax, this is usually an element id, or CSS selector. For example "#notice_area" would effect <div id="notice_area">, and "#content a.notice" would effect all anchors with a class of "notice" in the div with id "content".</li> + <li>"code_to_run()" is script your write yourself, or an action such as an effect from the jQuery library below.</li> + </ul> + +<h2>Effects</h2> + +<p>The query library supports a powerful <a href="http://docs.jquery.com/Effects">Effects</a> repertoire. Before an effect can be used, it must be loaded:</p> + +<p><code>$this->jquery->effect([optional path] plugin name); +// for example +$this->jquery->effect('bounce'); +</code></p> + +<h3>hide() / show()</h3> + +<p>Each of this functions will affect the visibility of an item on your page. hide() will set an item invisible, show() will reveal it.</p> +<p><code>$this->jquery->hide(target, optional speed, optional extra information);<br /> + $this->jquery->show(target, optional speed, optional extra information);</code></p> + +<ul> + <li>"target" will be any valid jQuery selector or selectors.</li> + <li>"speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.</li> + <li>"extra information" is optional, and could include a callback, or other additional information.</li> +</ul> + +<h3>toggle()</h3> + +<p>toggle() will change the visibility of an item to the opposite of its current state, hiding visible elements, and revealing hidden ones.</p> +<p><code>$this->jquery->toggle(target);</code></p> +<ul> + <li>"target" will be any valid jQuery selector or selectors.</li> +</ul> + +<h3>animate()</h3> + +<p><code> $this->jquery->animate(target, parameters, optional speed, optional extra information);</code></p> +<ul> + <li>"target" will be any valid jQuery selector or selectors.</li> + <li>"paramters" in jQuery would generally include a series of CSS properties that you wish to change.</li> + <li>"speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.</li> + <li>"extra information" is optional, and could include a callback, or other additional information.</li> +</ul> +<p>For a full summary, see <a href="http://docs.jquery.com/Effects/animate">http://docs.jquery.com/Effects/animate</a></p> +<p>Here is an example of an animate() called on a div with an id of "note", and triggered by a click using the jQuery library's click() event.</p> +<p><code> $params = array(<br /> + 'height' => 80,<br /> + 'width' => '50%',<br /> + 'marginLeft' => 125<br /> +);<br /> +$this->jquery->click('#trigger', $this->jquery->animate('#note', $params, normal));</code></p> + +<h3>fadeIn() / fadeOut()</h3> + +<p><code>$this->jquery->fadeIn(target, optional speed, optional extra information);<br /> + $this->jquery->fadeOut(target, optional speed, optional extra information);</code></p> +<ul> + <li>"target" will be any valid jQuery selector or selectors.</li> + <li>"speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.</li> + <li>"extra information" is optional, and could include a callback, or other additional information.</li> +</ul> + +<h3>toggleClass()</h3> + +<p>This function will add or remove a CSS class to its target.</p> +<p><code>$this->jquery->toggleClass(target, class)</code></p> +<ul> + <li>"target" will be any valid jQuery selector or selectors.</li> + <li>"class" is any CSS classname. Note that this class must be defined and available in a CSS that is already loaded.</li> + </ul> + +<h3>fadeIn() / fadeOut()</h3> + +<p>These effects cause an element(s) to disappear or reappear over time.</p> +<p><code>$this->jquery->fadeIn(target, optional speed, optional extra information);<br /> + $this->jquery->fadeOut(target, optional speed, optional extra information);</code></p> +<ul> + <li>"target" will be any valid jQuery selector or selectors.</li> + <li>"speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.</li> + <li>"extra information" is optional, and could include a callback, or other additional information.</li> +</ul> + +<h3>slideUp() / slideDown() / slideToggle()</h3> + +<p>These effects cause an element(s) to slide.</p> +<p><code>$this->jquery->slideUp(target, optional speed, optional extra information);<br /> + $this->jquery->slideDown(target, optional speed, optional extra information);<br /> +$this->jquery->slideToggle(target, optional speed, optional extra information);</code></p> +<ul> + <li>"target" will be any valid jQuery selector or selectors.</li> + <li>"speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.</li> + <li>"extra information" is optional, and could include a callback, or other additional information.</li> +</ul> + +<h2>Plugins</h2> + +<p> + +<p>Some select jQuery plugins are made available using this library.</p> + +<h3>corner()</h3> +<p>Used to add distinct corners to page elements. For full details see <a href="http://www.malsup.com/jquery/corner/">http://www.malsup.com/jquery/corner/</a></p> +<p><code>$this->jquery->corner(target, corner_style);</code></p> +<ul> + <li>"target" will be any valid jQuery selector or selectors.</li> + <li>"corner_style" is optional, and can be set to any valid style such as round, sharp, bevel, bite, dog, etc. Individual corners can be set by following the style with a space and using "tl" (top left), "tr" (top right), "bl" (bottom left), or "br" (bottom right).</li> +</ul> +<p><code>$this->jquery->corner("#note", "cool tl br");</code></p> + +<h3>tablesorter()</h3> + +<p>description to come</p> + +<h3>modal()</h3> + +<p>description to come</p> + +<h3>calendar()</h3> + +<p>description to come</p> + </div> <!-- END CONTENT --> @@ -97,7 +240,7 @@ Previous Topic: <a href="input.html">Input Class</a> <a href="#top">Top of Page</a> · <a href="../index.html">User Guide Home</a> · Next Topic: <a href="language.html">Language Class</a></p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/jquery.html b/user_guide/libraries/jquery.html deleted file mode 100644 index d8307f347..000000000 --- a/user_guide/libraries/jquery.html +++ /dev/null @@ -1,236 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - -<title>CodeIgniter User Guide : Input Class</title> - -<style type='text/css' media='all'>@import url('../userguide.css');</style> -<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' /> - -<script type="text/javascript" src="../nav/nav.js"></script> -<script type="text/javascript" src="../nav/prototype.lite.js"></script> -<script type="text/javascript" src="../nav/moo.fx.js"></script> -<script type="text/javascript" src="../nav/user_guide_menu.js"></script> - -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<meta http-equiv='expires' content='-1' /> -<meta http-equiv= 'pragma' content='no-cache' /> -<meta name='robots' content='all' /> -<meta name='author' content='ExpressionEngine Dev Team' /> -<meta name='description' content='CodeIgniter User Guide' /> - -</head> -<body> - -<!-- START NAVIGATION --> -<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div> -<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="153" height="44" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div> -<div id="masthead"> -<table cellpadding="0" cellspacing="0" border="0" style="width:100%"> -<tr> -<td><h1>CodeIgniter User Guide Version 2.0.0</h1></td> -<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td> -</tr> -</table> -</div> -<!-- END NAVIGATION --> - - -<!-- START BREADCRUMB --> -<table cellpadding="0" cellspacing="0" border="0" style="width:100%"> -<tr> -<td id="breadcrumb"> -<a href="http://codeigniter.com/">CodeIgniter Home</a> › -<a href="../index.html">User Guide Home</a> › -Input Class -</td> -<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" /> <input type="submit" class="submit" name="sa" value="Go" /></form></td> -</tr> -</table> -<!-- END BREADCRUMB --> - -<br clear="all" /> - - -<!-- START CONTENT --> -<div id="content"> - - -<h1>jQuery Class</h1> - -<p><a href="http://jquery.com/">jQuery</a> is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. CodeIgniter provides a library to help you with certain common functions that you may want to use within jQuery. Please note that CodeIgniter does not require the jQuery library to run, and that any scripting library will work equally well. The jQuery library is simply presented as a convenience if you choose to use it.</p> - -<h2>Initializing the Class</h2> - -<p>To initialize the jQuery class manually in your controller constructor, use the <dfn>$this->load->library</dfn> function:</p> - -<code>$this->load->library('jquery');</code> - -<p>You may send an optional parameter to determine whether or not a script tag for the main jQuery file will be automatically included when loading the library. It will be created by default. To prevent this, load the library as follows:</p> - -<code>$this->load->library('jquery', FALSE);</code> - -<p>Once loaded, the jQuery library object will be available using: <dfn>$this->jquery</dfn></p> - -<h2>Setup and Configuration</h2> - -<p>As a javascript library, jquery.js must be available to your application. For your convenience, the needed files to run this library are available for <a href="http://codeigniter.com/downloads/">download</a> from our site.</p> - -<p>As javascript is a client side language, the library must be able to write content into your final output. This generally means a view. You'll need to include the following variables in the <head> sections of your output.</p> - -<p><code><?php echo $jquery_script;?><br /> -<?php echo $script_head;?></code></p> - -<p>There are 2 configuration items in jQuery library. These can either be set in application/config.php, or within any controller. The first is the path from the root of your site to the jquery library ('js' is the default) and the second is an image to be used as an "ajax loader", or progress indicator. Without one, the simple text message of "loading" will appear when Ajax calls need to be made.</p> - -<p><code>$config['javascript_folder'] = 'js';<br /> - $config['javascript_ajax_img'] = 'images/ajax-loader.gif';</code></p> - -<p>If you keep your files in the same directories they were downloaded from, then you needed set this configuration items.</p> - -<h2>Events</h2> - -<p>Events are set using the following syntax.</p> - -<p><code>$this->jquery->event('element_path', code_to_run());</code></p> - -<p>In the above example:</p> - -<ul> - <li>"event" is any of blur, change, click, dblclick, error, focus, hover, keydown, keyup, load, mousedown, mouseup, mouseover, mouseup, resize, scroll, or unload.</li> - <li>"element_path" is any valid <a href="http://docs.jquery.com/Selectors">jQuery selector</a>. Due to jQuery's unique selector syntax, this is usually an element id, or CSS selector. For example "#notice_area" would effect <div id="notice_area">, and "#content a.notice" would effect all anchors with a class of "notice" in the div with id "content".</li> - <li>"code_to_run()" is script your write yourself, or an action such as an effect from the jQuery library below.</li> - </ul> - -<h2>Effects</h2> - -<p>The query library supports a powerful <a href="http://docs.jquery.com/Effects">Effects</a> repertoire. Before an effect can be used, it must be loaded:</p> - -<p><code>$this->jquery->effect([optional path] plugin name); -// for example -$this->jquery->effect('bounce'); -</code></p> - -<h3>hide() / show()</h3> - -<p>Each of this functions will affect the visibility of an item on your page. hide() will set an item invisible, show() will reveal it.</p> -<p><code>$this->jquery->hide(target, optional speed, optional extra information);<br /> - $this->jquery->show(target, optional speed, optional extra information);</code></p> - -<ul> - <li>"target" will be any valid jQuery selector or selectors.</li> - <li>"speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.</li> - <li>"extra information" is optional, and could include a callback, or other additional information.</li> -</ul> - -<h3>toggle()</h3> - -<p>toggle() will change the visibility of an item to the opposite of its current state, hiding visible elements, and revealing hidden ones.</p> -<p><code>$this->jquery->toggle(target);</code></p> -<ul> - <li>"target" will be any valid jQuery selector or selectors.</li> -</ul> - -<h3>animate()</h3> - -<p><code> $this->jquery->animate(target, parameters, optional speed, optional extra information);</code></p> -<ul> - <li>"target" will be any valid jQuery selector or selectors.</li> - <li>"paramters" in jQuery would generally include a series of CSS properties that you wish to change.</li> - <li>"speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.</li> - <li>"extra information" is optional, and could include a callback, or other additional information.</li> -</ul> -<p>For a full summary, see <a href="http://docs.jquery.com/Effects/animate">http://docs.jquery.com/Effects/animate</a></p> -<p>Here is an example of an animate() called on a div with an id of "note", and triggered by a click using the jQuery library's click() event.</p> -<p><code> $params = array(<br /> - 'height' => 80,<br /> - 'width' => '50%',<br /> - 'marginLeft' => 125<br /> -);<br /> -$this->jquery->click('#trigger', $this->jquery->animate('#note', $params, normal));</code></p> - -<h3>fadeIn() / fadeOut()</h3> - -<p><code>$this->jquery->fadeIn(target, optional speed, optional extra information);<br /> - $this->jquery->fadeOut(target, optional speed, optional extra information);</code></p> -<ul> - <li>"target" will be any valid jQuery selector or selectors.</li> - <li>"speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.</li> - <li>"extra information" is optional, and could include a callback, or other additional information.</li> -</ul> - -<h3>toggleClass()</h3> - -<p>This function will add or remove a CSS class to its target.</p> -<p><code>$this->jquery->toggleClass(target, class)</code></p> -<ul> - <li>"target" will be any valid jQuery selector or selectors.</li> - <li>"class" is any CSS classname. Note that this class must be defined and available in a CSS that is already loaded.</li> - </ul> - -<h3>fadeIn() / fadeOut()</h3> - -<p>These effects cause an element(s) to disappear or reappear over time.</p> -<p><code>$this->jquery->fadeIn(target, optional speed, optional extra information);<br /> - $this->jquery->fadeOut(target, optional speed, optional extra information);</code></p> -<ul> - <li>"target" will be any valid jQuery selector or selectors.</li> - <li>"speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.</li> - <li>"extra information" is optional, and could include a callback, or other additional information.</li> -</ul> - -<h3>slideUp() / slideDown() / slideToggle()</h3> - -<p>These effects cause an element(s) to slide.</p> -<p><code>$this->jquery->slideUp(target, optional speed, optional extra information);<br /> - $this->jquery->slideDown(target, optional speed, optional extra information);<br /> -$this->jquery->slideToggle(target, optional speed, optional extra information);</code></p> -<ul> - <li>"target" will be any valid jQuery selector or selectors.</li> - <li>"speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.</li> - <li>"extra information" is optional, and could include a callback, or other additional information.</li> -</ul> - -<h2>Plugins</h2> - -<p> - -<p>Some select jQuery plugins are made available using this library.</p> - -<h3>corner()</h3> -<p>Used to add distinct corners to page elements. For full details see <a href="http://www.malsup.com/jquery/corner/">http://www.malsup.com/jquery/corner/</a></p> -<p><code>$this->jquery->corner(target, corner_style);</code></p> -<ul> - <li>"target" will be any valid jQuery selector or selectors.</li> - <li>"corner_style" is optional, and can be set to any valid style such as round, sharp, bevel, bite, dog, etc. Individual corners can be set by following the style with a space and using "tl" (top left), "tr" (top right), "bl" (bottom left), or "br" (bottom right).</li> -</ul> -<p><code>$this->jquery->corner("#note", "cool tl br");</code></p> - -<h3>tablesorter()</h3> - -<p>description to come</p> - -<h3>modal()</h3> - -<p>description to come</p> - -<h3>calendar()</h3> - -<p>description to come</p> - -</div> -<!-- END CONTENT --> - - -<div id="footer"> -<p> -Previous Topic: <a href="input.html">Input Class</a> - · -<a href="#top">Top of Page</a> · -<a href="../index.html">User Guide Home</a> · -Next Topic: <a href="language.html">Language Class</a></p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> -</div> - -</body> -</html>
\ No newline at end of file diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index c37f00926..dfdccad04 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -130,7 +130,7 @@ Previous Topic: <a href="loader.html">Loader Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="output.html">Output Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 34e3929a9..af312f4aa 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -248,7 +248,7 @@ Previous Topic: <a href="input.html">Input Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="language.html">Language Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index a1427de7b..ab8f1d683 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -155,7 +155,7 @@ Previous Topic: <a href="language.html">Language Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="pagination.html">Pagination Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 42c102c8d..da07c79be 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -222,7 +222,7 @@ Previous Topic: <a href="output.html">Output Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="sessions.html">Session Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index ece61c1fa..5bb403a7f 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -205,7 +205,7 @@ Previous Topic: <a href="trackback.html">Trackback Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="typography.html">Typography</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/security.html b/user_guide/libraries/security.html index 6d6216d95..943f72a0f 100644 --- a/user_guide/libraries/security.html +++ b/user_guide/libraries/security.html @@ -104,11 +104,18 @@ Note: This function should only be used to deal with data upon submission. It's <p>If it is acceptable for the user input to include relative paths, e.g. <kbd>file/in/some/approved/folder.txt</kbd>, you can set the second optional parameter, <samp>$relative_path</samp> to TRUE.</p> - + <code>$filename = $this->security->sanitize_filename($this->input->post('filename'), TRUE);</code> <!-- @todo write docs for CSRF methods --> +<h2>Cross-site request forgery (CSRF)</h2> + +<p>You can enable csrf protection by opening your <kbd>application/config/config.php</kbd> file and setting this:</p> +<code>$config['csrf_protection'] = TRUE;</code> + +<p>If you use the <a href="../helpers/form_helper.html">form helper</a> the <var>form_open()</var> function will automatically insert a hidden csrf field in your forms.</p> + </div> <!-- END CONTENT --> @@ -121,7 +128,7 @@ Previous Topic: <a href="pagination.html">Pagination Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="sessions.html">Session Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 2d295d72e..c8757995c 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -315,7 +315,7 @@ Previous Topic: <a href="security.html">Security Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="trackback.html">Trackback Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 094d7aac6..9de70775a 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -308,7 +308,7 @@ Previous Topic: <a href="ftp.html"> FTP Class</a> &mi <a href="../index.html">User Guide Home</a> · Next Topic: <a href="image_lib.html">Image Manipulation Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index a07b8d1f8..32b1ee258 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -239,7 +239,7 @@ Previous Topic: <a href="sessions.html">Session Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="parser.html">Template Parser Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/typography.html b/user_guide/libraries/typography.html index e78af5f9a..9c4272b37 100644 --- a/user_guide/libraries/typography.html +++ b/user_guide/libraries/typography.html @@ -153,7 +153,7 @@ Previous Topic: <a href="parser.html">Template Parser</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="unit_testing.html">Unit Testing Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 84db54431..49c5881e1 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -219,7 +219,7 @@ Previous Topic: <a href="typography.html">Typography Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="uri.html">URI Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index b2f5ac3d9..0dbaffa49 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -245,7 +245,7 @@ Previous Topic: <a href="unit_testing.html">Unit Testing Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="user_agent.html">User Agent Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index d2f79d2ec..8989fb2e1 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -219,7 +219,7 @@ Previous Topic: <a href="uri.html">URI Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="xmlrpc.html">XML-RPC Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 87ca09480..7a8934d39 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -512,7 +512,7 @@ Previous Topic: <a href="user_agent.html">User Agent Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="zip.html">Zip Encoding Class</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index d57dd48ac..48e2562be 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -281,7 +281,7 @@ Previous Topic: <a href="xmlrpc.html"> XML-RPC Class</a> <a href="../index.html">User Guide Home</a> · Next Topic: <a href="../helpers/array_helper.html">Array Helper</a> </p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> |