233 lines
No EOL
12 KiB
HTML
233 lines
No EOL
12 KiB
HTML
<!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
<html>
|
|
<head>
|
|
<title>YAHOO.ext.state.CookieProvider</title>
|
|
<link rel="stylesheet" type="text/css" href="../resources/reset.css"/>
|
|
<link rel="stylesheet" type="text/css" href="../resources/style.css" media="screen"/>
|
|
<link rel="stylesheet" type="text/css" href="../resources/print.css" media="print">
|
|
</head>
|
|
<body>
|
|
<div class="body-wrap">
|
|
<div class="top-tools"><img src="../resources/print.gif" width="16" height="16" align="absmiddle"> <a href="YAHOO.ext.state.CookieProvider.html" target="_blank">Print Friendly</a></div>
|
|
<h1>Class YAHOO.ext.state.CookieProvider</h1>
|
|
<table cellspacing="0">
|
|
<tr><td class="label">Package:</td><td>YAHOO.ext.state</td></tr>
|
|
<tr><td class="label">Class:</td><td>CookieProvider</td></tr>
|
|
<tr><td class="label">Extends:</td><td><a href="YAHOO.ext.state.Provider.html">Provider</a></td></tr>
|
|
<tr><td class="label">Defined In:</td><td><a href="State.js.html">State.js</a></td></tr>
|
|
</table>
|
|
<div class="description">
|
|
The default Provider implementation. The example below includes all valid configuration options and their
|
|
default values.
|
|
<pre><code>
|
|
var cp = new YAHOO.ext.state.CookieProvider({
|
|
path: '/',
|
|
expires: new Date(new Date().getTime()+(1000*60*60*24*7)); //7 days
|
|
domain: null,
|
|
secure: false
|
|
})
|
|
YAHOO.ext.state.Manager.setProvider(cp);
|
|
</code></pre> </div>
|
|
<hr />
|
|
<a name="properties"></a>
|
|
<h2>Public Properties</h2>
|
|
<div class="no-members">This class has no public properties.</div> <a name="methods"></a>
|
|
<h2>Public Methods</h2>
|
|
<table cellspacing="0" class="member-table">
|
|
<tr>
|
|
<th class="sig-header" colspan="2">Method</th>
|
|
<th class="msource-header">Defined By</th>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#CookieProvider">CookieProvider</a>(<code>Object config</code>)</td>
|
|
<td class="msource" rowspan="2">CookieProvider</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">Create a new CookieProvider</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon inherited" title="Inherited" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#clear">clear</a>() : void</td>
|
|
<td class="msource" rowspan="2"><a href="YAHOO.ext.state.Provider.html#clear">Provider</a></td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc">Clear a value from the state.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon inherited" title="Inherited" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#decodeValue">decodeValue</a>(<code>String value</code>) : Mixed</td>
|
|
<td class="msource" rowspan="2"><a href="YAHOO.ext.state.Provider.html#decodeValue">Provider</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">Decodes a string previously encoded with <a href="#encodeValue">encodeValue</a>.</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon inherited" title="Inherited" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#encodeValue">encodeValue</a>(<code>Mixed value</code>) : String</td>
|
|
<td class="msource" rowspan="2"><a href="YAHOO.ext.state.Provider.html#encodeValue">Provider</a></td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc">Encode a value including type information.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon inherited" title="Inherited" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#get">get</a>(<code>String name</code>, <code>Mixed defaultValue</code>) : Mixed</td>
|
|
<td class="msource" rowspan="2"><a href="YAHOO.ext.state.Provider.html#get">Provider</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">Get the current value for a key.</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon inherited" title="Inherited" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#set">set</a>(<code>String name</code>, <code>Mixed value</code>) : void</td>
|
|
<td class="msource" rowspan="2"><a href="YAHOO.ext.state.Provider.html#set">Provider</a></td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc">Set the value for a key.</td>
|
|
</tr>
|
|
</table>
|
|
<a name="events"></a>
|
|
<h2>Public Events</h2>
|
|
<table cellspacing="0" class="member-table">
|
|
<tr>
|
|
<th class="sig-header" colspan="2">Event</th>
|
|
<th class="msource-header">Defined By</th>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon inherited" title="Inherited" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#event-statechange">statechange</a> : (<code>Provider this</code>, <code>String key</code>, <code>String value</code>)</td>
|
|
<td class="msource" rowspan="2"><a href="YAHOO.ext.state.Provider.html#event-statechange">Provider</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">Fires when a state change occurs.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
<a name="CookieProvider"></a>
|
|
<h2 class="mdetail-head">Constructor Details</h2>
|
|
<div class="detail-wrap">
|
|
<div class="mdetail">
|
|
<h3>CookieProvider</i></h3>
|
|
<code>public function CookieProvider(<code>Object config</code>)</code>
|
|
<div class="mdetail-desc">
|
|
Create a new CookieProvider <div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>config</code> : Object<div class="sub-desc">The configuration object</div></li> </ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<h2 class="mdetail-head">Method Details</h2>
|
|
<div class="detail-wrap">
|
|
<a name="clear"></a>
|
|
<div class="mdetail">
|
|
<h3>clear</i></h3>
|
|
<code>public function clear()</code>
|
|
<div class="mdetail-desc">
|
|
Clear a value from the state.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li>None.</li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by <a href="YAHOO.ext.state.Provider.html#clear">Provider</a>.</div>
|
|
</div>
|
|
<a name="decodeValue"></a>
|
|
<div class="mdetail alt">
|
|
<h3>decodeValue</i></h3>
|
|
<code>public function decodeValue(<code>String value</code>)</code>
|
|
<div class="mdetail-desc">
|
|
Decodes a string previously encoded with <a href="#encodeValue">encodeValue</a>.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>value</code> : String<div class="sub-desc"></div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>Mixed</code><div class="sub-desc">The value</div></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by <a href="YAHOO.ext.state.Provider.html#decodeValue">Provider</a>.</div>
|
|
</div>
|
|
<a name="encodeValue"></a>
|
|
<div class="mdetail">
|
|
<h3>encodeValue</i></h3>
|
|
<code>public function encodeValue(<code>Mixed value</code>)</code>
|
|
<div class="mdetail-desc">
|
|
Encode a value including type information.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>value</code> : Mixed<div class="sub-desc"></div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>String</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by <a href="YAHOO.ext.state.Provider.html#encodeValue">Provider</a>.</div>
|
|
</div>
|
|
<a name="get"></a>
|
|
<div class="mdetail alt">
|
|
<h3>get</i></h3>
|
|
<code>public function get(<code>String name</code>, <code>Mixed defaultValue</code>)</code>
|
|
<div class="mdetail-desc">
|
|
Get the current value for a key.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>name</code> : String<div class="sub-desc"></div></li><li><code>defaultValue</code> : Mixed<div class="sub-desc"></div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>Mixed</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by <a href="YAHOO.ext.state.Provider.html#get">Provider</a>.</div>
|
|
</div>
|
|
<a name="set"></a>
|
|
<div class="mdetail">
|
|
<h3>set</i></h3>
|
|
<code>public function set(<code>String name</code>, <code>Mixed value</code>)</code>
|
|
<div class="mdetail-desc">
|
|
Set the value for a key.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>name</code> : String<div class="sub-desc"></div></li><li><code>value</code> : Mixed<div class="sub-desc"></div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by <a href="YAHOO.ext.state.Provider.html#set">Provider</a>.</div>
|
|
</div>
|
|
</div>
|
|
|
|
<h2 class="mdetail-head">Event Details</h2>
|
|
<div class="detail-wrap">
|
|
<a name="event-statechange"></a>
|
|
<div class="mdetail">
|
|
<h3>statechange</i></h3>
|
|
<code>public event statechange</code>
|
|
<div class="mdetail-desc">
|
|
Fires when a state change occurs.
|
|
<div class="mdetail-params">
|
|
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
|
|
<ul><li><code>this</code> : Provider<div class="sub-desc"></div></li><li><code>key</code> : String<div class="sub-desc">The state key which was changed</div></li><li><code>value</code> : String<div class="sub-desc">The encoded value for the state</div></li> </ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This event is defined by <a href="YAHOO.ext.state.Provider.html#event-statechange">Provider</a>.</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
Copyright © 2006 Jack Slocum. All rights reserved.
|
|
</body>
|
|
</html>
|
|
|