[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
xampp182
/
htdocs
/
simpeg
/
zapatec
/
zptime
/
zptime
/
jsdocs
/
[
Home
]
File: overview-summary-zptime-states.js.html
<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"> <html> <head> <title> Zapatec Time Overview </title> <link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style"> <script> function asd() { parent.document.title="zptime-states.js Overview"; } </script> </head> <body bgcolor="white" onload="asd();"> <!-- ========== START OF NAVBAR ========== --> <a name="navbar_top"><!-- --></a> <table border="0" width="100%" cellpadding="1" cellspacing="0"> <tr> <td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1"> <a name="navbar_top_firstrow"><!-- --></a> <table border="0" cellpadding="0" cellspacing="3"> <tr align="center" valign="top"> <td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a> </td> <td bgcolor="#FFFFFF" class="NavBarCell1Rev"> <font class="NavBarFont1Rev"><b>File</b></font> </td> <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font> </td> <td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a> </td> <td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a> </td> <td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a> </td> </tr> </table> </td> <td bgcolor="#EEEEFF" align="right" valign="top"> <em> <b>Zapatec Time</b></em> </td> </tr> <tr> <td bgcolor="white" class="NavBarCell2"><font size="-2"> PREV NEXT</font></td> <td bgcolor="white" class="NavBarCell2"><font size="-2"> <a href="index.html" target="_top"><b>FRAMES</b></a> <a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a> <script> <!-- if(window==top) { document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--> </script> <noscript> <a href="allclasses-noframe.html" target=""><b>All Classes</b></a> </noscript> </font></td> </tr> </table> <!-- =========== END OF NAVBAR =========== --> <hr> <center> <h2>zptime-states.js</h2> </center> <h4>Summary</h4> <p> No overview generated for 'zptime-states.js'<BR/><BR/> </p> <hr> <!-- ========== METHOD SUMMARY =========== --> <!-- ========== END METHOD SUMMARY =========== --> <pre class="sourceview"><span class="comment">// $Id: zptime-states.js 6651 2007-03-19 10:15:22Z slip $</span> <span class="comment">/** * * Copyright (c) 2004-2006 by Zapatec, Inc. * http://www.zapatec.com * 1700 MLK Way, Berkeley, California, * 94709, U.S.A. * All rights reserved. */</span> <span class="comment">/** * Checks if needed state was reached and tryes to fire function exactly when it needs. * <span class="attrib">@param</span> state [string] - required state; * <span class="attrib">@param</span> func [function] - function needed to be fired * <span class="attrib">@param</span> first [boolean] - should it go first * <span class="attrib">@return</span> true if the state was already reached */</span> Zapatec.TimeSelect.<span class="reserved">prototype</span>.fireOnState = <span class="reserved">function</span>(state, func) { var self = <span class="reserved">this</span>; <span class="comment">//special way for BODY load</span> <span class="reserved">if</span> (state == <span class="literal">"body_loaded"</span>) { <span class="comment">//Object was destroyed!</span> <span class="reserved">if</span> (!<span class="reserved">this</span>.stateReached(<span class="literal">"created"</span>)) { <span class="reserved">return</span> false; } <span class="comment">//not loaded? - let's try again in 50 msecs</span> <span class="reserved">if</span> (!Zapatec.windowLoaded) { setTimeout(<span class="reserved">function</span>() {func.call(self);}, 50); <span class="reserved">return</span> false; } <span class="reserved">return</span> true; } <span class="comment">//was state reached?</span> <span class="reserved">if</span> (!<span class="reserved">this</span>.stateReached(state)) { <span class="comment">//Object was destroyed!</span> <span class="reserved">if</span> (!<span class="reserved">this</span>.stateReached(<span class="literal">"created"</span>)) { <span class="reserved">return</span> false; } <span class="comment">//or lets just add listener to the state</span> <span class="reserved">this</span>.addEventListener(state, func); <span class="comment">//returning false, as function can not be executed</span> <span class="comment">//and was scheduled</span> <span class="reserved">return</span> false; } <span class="reserved">else</span> { <span class="comment">//state was reached we can execute function</span> <span class="reserved">return</span> true; } }; <span class="comment">/** * Changes the state of the widget, firing all the events planned * <span class="attrib">@param</span> state [string] - state to set. * <span class="attrib">@return</span> true if succeeds, otherwise false */</span> Zapatec.TimeSelect.<span class="reserved">prototype</span>.changeState = <span class="reserved">function</span>(state) { <span class="reserved">this</span>.widgetState = state; <span class="reserved">this</span>.fireEvent(state); <span class="reserved">return</span> true; }; <span class="comment">/** * This method tells you wether the state you need was reached or maybe already passed. * Right now we have following states: * 'destroyed' - the object was destroyed; * 'created' - the instance of the object was created; * 'inited' - the object was inited (this include initing all variables, calling parent * init and starting loading structure); * 'loaded' - the structure is loaded and parsed; * 'ready' - object has all the parts ready for work; * 'hidden' - object is visually hidden; * 'shown' - object is visible; * <span class="attrib">@param</span> state [string] - the name of the state you need to check; * <span class="attrib">@return</span> - true if the state was reached or already passed, otherwise false */</span> Zapatec.TimeSelect.<span class="reserved">prototype</span>.stateReached = <span class="reserved">function</span>(state) { <span class="comment">//getting current state priority.</span> <span class="comment">//if there is no such in our priority array we give it the highest priority, </span> <span class="comment">//which means count of states avaliable in the array.</span> var currentState = <span class="reserved">this</span>.priorities[<span class="reserved">this</span>.widgetState] || (<span class="reserved">this</span>.priorities[<span class="reserved">this</span>.widgetState] !== 0 ? <span class="reserved">this</span>.priorities.count : 0); <span class="comment">//getting passed state priority.</span> <span class="comment">//if there is no such in our priority array we give it the highest priority, </span> <span class="comment">//which means count of states avaliable in the array.</span> state = <span class="reserved">this</span>.priorities[state] || (<span class="reserved">this</span>.priorities[state] !== 0 ? <span class="reserved">this</span>.priorities.count : 0); <span class="comment">//and now compareing them</span> <span class="reserved">if</span> (state > currentState) {<span class="reserved">return</span> false;} <span class="reserved">return</span> true; }; </pre> <hr> <!-- ========== START OF NAVBAR ========== --> <a name="navbar_top"><!-- --></a> <table border="0" width="100%" cellpadding="1" cellspacing="0"> <tr> <td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1"> <a name="navbar_top_firstrow"><!-- --></a> <table border="0" cellpadding="0" cellspacing="3"> <tr align="center" valign="top"> <td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a> </td> <td bgcolor="#FFFFFF" class="NavBarCell1Rev"> <font class="NavBarFont1Rev"><b>File</b></font> </td> <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font> </td> <td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a> </td> <td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a> </td> <td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a> </td> </tr> </table> </td> <td bgcolor="#EEEEFF" align="right" valign="top"><em> <b>Zapatec Time</b></em> </td> </tr> <tr> <td bgcolor="white" class="NavBarCell2"><font size="-2"> PREV NEXT</font></td> <td bgcolor="white" class="NavBarCell2"><font size="-2"> <a href="index.html" target="_top"><b>FRAMES</b></a> <a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a> <script> <!-- if(window==top) { document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--> </script> <noscript> <a href="allclasses-noframe.html" target=""><b>All Classes</b></a> </noscript> </font></td> </tr> </table> <!-- =========== END OF NAVBAR =========== --> <hr> <font size="-1"> </font> <div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Thu Aug 16 12:19:05 2007</div> </body> </html>