[ 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-utils.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-utils.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-utils.js</h2> </center> <h4>Summary</h4> <p> No overview generated for 'zptime-utils.js'<BR/><BR/> </p> <hr> <!-- ========== METHOD SUMMARY =========== --> <!-- ========== END METHOD SUMMARY =========== --> <pre class="sourceview"><span class="comment">// $Id: zptime-utils.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">/** * Parses given DOM element to save references into objects properties. * All the elements to be saved as a reference had to have a word starting * with 'area' in there class name. So for example an element with class name * areaTitle will be parsed into this.title property and those className will * be removed. * <span class="attrib">@param</span> el [HTML element] - element to parse; * <span class="attrib">@return</span> - true if success, otherwise false; */</span> Zapatec.TimeSelect.<span class="reserved">prototype</span>.parseDom = <span class="reserved">function</span>(el) { var classes = <span class="literal">""</span>; <span class="comment">//the el needs to be a DOM HTML element</span> <span class="reserved">if</span> (!Zapatec.isHtmlElement(el)) { <span class="reserved">return</span> false; } <span class="comment">//seeks the elements with the className starting with word 'area',</span> <span class="comment">//extracts the rest part of this class name, creates the reference </span> <span class="comment">//(a property of the object) with such name, removes this class.</span> <span class="comment">//I didn't knew which way to mark the elements which needed to have reference</span> <span class="comment">//in our object, and decided (by advise) to use className starting with 'area'.</span> <span class="comment">//Example: 'areaContent', 'areaTitle', etc. will create this.content, this.title, etc.</span> <span class="reserved">if</span> (el.className) { classes = el.className.match(/area(\w+)/); <span class="comment">//this way we mark all the elements which belong to the widget with a reference to it.</span> el.win = true; <span class="reserved">if</span> (classes) { el.id = <span class="literal">"zpTime"</span> + <span class="reserved">this</span>.id + classes[1]; classes[1] = classes[1].charAt(0).toLowerCase() + classes[1].substring(1); <span class="reserved">if</span> (!Zapatec.isArray(<span class="reserved">this</span>[classes[1]])) { <span class="reserved">this</span>.createProperty(<span class="reserved">this</span>, classes[1], el); } <span class="reserved">else</span> { <span class="reserved">this</span>[classes[1]].push(el); } Zapatec.Utils.removeClass(el, classes[0]); } } <span class="comment">//to go through all the childs we use recursive calls of this function for every child.</span> var child = el.firstChild; <span class="reserved">while</span>(child) { <span class="reserved">this</span>.parseDom(child); child = child.nextSibling; } <span class="reserved">return</span> true; }; <span class="comment">/** * Shows the specified button of the window. * <span class="attrib">@param</span> button {string} string pointing to button name. */</span> Zapatec.TimeSelect.<span class="reserved">prototype</span>.showButton = <span class="reserved">function</span>(button) { <span class="reserved">this</span>.restorer.restoreProp(button + <span class="literal">".getContainer().parentNode.style.display"</span>); }; <span class="comment">/** * Hides the specified button of the window. * <span class="attrib">@param</span> button {string} string pointing to button name. */</span> Zapatec.TimeSelect.<span class="reserved">prototype</span>.hideButton = <span class="reserved">function</span>(button) { <span class="reserved">this</span>.restorer.saveProp(button + <span class="literal">".getContainer().parentNode.style.display"</span>); <span class="reserved">this</span>[button].getContainer().parentNode.style.display = <span class="literal">"none"</span>; }; <span class="comment">/** * Shows the given control. * <span class="attrib">@param</span> control {string} string representing control. */</span> Zapatec.TimeSelect.<span class="reserved">prototype</span>.showControl = <span class="reserved">function</span>(control) { <span class="reserved">this</span>.showButton(control + <span class="literal">"Select"</span>); <span class="reserved">this</span>.showButton(control + <span class="literal">"Up"</span>); <span class="reserved">this</span>.showButton(control + <span class="literal">"Down"</span>); }; <span class="comment">/** * Hides the given control. * <span class="attrib">@param</span> control {string} string representing control. */</span> Zapatec.TimeSelect.<span class="reserved">prototype</span>.hideControl = <span class="reserved">function</span>(control) { <span class="reserved">this</span>.hideButton(control + <span class="literal">"Select"</span>); <span class="reserved">this</span>.hideButton(control + <span class="literal">"Up"</span>); <span class="reserved">this</span>.hideButton(control + <span class="literal">"Down"</span>); }; <span class="comment">/** * Reconfigurating the object due to the config options. */</span> Zapatec.TimeSelect.<span class="reserved">prototype</span>.reconfig = <span class="reserved">function</span>() { <span class="reserved">if</span> (!<span class="reserved">this</span>.fireOnState(<span class="literal">"loaded"</span>, <span class="reserved">function</span>() {<span class="reserved">this</span>.reconfig();})) { <span class="reserved">return</span>; } var config = <span class="reserved">this</span>.getConfiguration(); <span class="comment">//filling separators</span> var separators = Zapatec.Array(<span class="reserved">this</span>.separators); separators.each(<span class="reserved">function</span>(index, separator) { separator.innerHTML = config.separator; }); <span class="comment">//hiding buttons if needed, otherwise showing them</span> <span class="comment">//hours controls</span> <span class="reserved">if</span> (config.showHours) { <span class="reserved">this</span>.showControl(<span class="literal">"hours"</span>); } <span class="reserved">else</span> { <span class="reserved">this</span>.hideControl(<span class="literal">"hours"</span>); } <span class="comment">//minutes controls</span> <span class="reserved">if</span> (config.showMinutes) { <span class="reserved">this</span>.showControl(<span class="literal">"minutes"</span>); } <span class="reserved">else</span> { <span class="reserved">this</span>.hideControl(<span class="literal">"minutes"</span>); } <span class="comment">//seconds controls</span> <span class="reserved">if</span> (config.showSeconds) { <span class="reserved">this</span>.showControl(<span class="literal">"seconds"</span>); } <span class="reserved">else</span> { <span class="reserved">this</span>.hideControl(<span class="literal">"seconds"</span>); } <span class="comment">//ampm select</span> <span class="reserved">if</span> (config.timeFormat == <span class="literal">"12"</span>) { <span class="reserved">this</span>.showButton(<span class="literal">"ampmSelect"</span>); <span class="reserved">this</span>.restorer.restoreProp(<span class="literal">"emptySeparator.style.display"</span>); } <span class="reserved">else</span> { <span class="reserved">this</span>.hideButton(<span class="literal">"ampmSelect"</span>); <span class="reserved">this</span>.restorer.saveProp(<span class="literal">"emptySeparator.style.display"</span>); <span class="reserved">this</span>.emptySeparator.style.display = <span class="literal">"none"</span>; } <span class="comment">//toggling separators</span> <span class="reserved">if</span> ((config.showHours && config.showMinutes) || (config.showHours && config.showSeconds)) { <span class="reserved">this</span>.restorer.restoreProp(<span class="literal">"separators[0].style.display"</span>); } <span class="reserved">else</span> { <span class="reserved">this</span>.restorer.saveProp(<span class="literal">"separators[0].style.display"</span>); <span class="reserved">this</span>.separators[0].style.display = <span class="literal">"none"</span>; } <span class="reserved">if</span> (config.showMinutes && config.showSeconds) { <span class="reserved">this</span>.restorer.restoreProp(<span class="literal">"separators[1].style.display"</span>); } <span class="reserved">else</span> { <span class="reserved">this</span>.restorer.saveProp(<span class="literal">"separators[1].style.display"</span>); <span class="reserved">this</span>.separators[1].style.display = <span class="literal">"none"</span>; } };</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>