[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
xampp182
/
htdocs
/
simpeg
/
zapatec
/
zpautocomplete
/
utils
/
jsdocs
/
[
Home
]
File: overview-summary-dump.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 Utils Overview </title> <link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style"> <script> function asd() { parent.document.title="dump.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 Utils</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>dump.js</h2> </center> <h4>Summary</h4> <p> No overview generated for 'dump.js'<BR/><BR/> </p> <hr> <!-- ========== METHOD SUMMARY =========== --> <!-- ========== END METHOD SUMMARY =========== --> <pre class="sourceview"><span class="comment">// $Id: dump.js 4563 2006-09-25 19:05:25Z dror $</span> <span class="comment">/* * <pre> * Copyright (c) 2004-2006 by Zapatec, Inc. * http://www.zapatec.com * 1700 MLK Way, Berkeley, California, * 94709, U.S.A. * All rights reserved. * </pre> */</span> <span class="comment">/* * Dumpe the dom, for an item, often the body. * * Use with something like * <a href='#' onclick='new dump(document.getElementsByTagName("body")[0], true);' >Dump DOM </a> * $Id: dump.js 4563 2006-09-25 19:05:25Z dror $ * * Heavily borrowed from htmlarea. */</span> dump = <span class="reserved">function</span> (domElement, bWindow) { <span class="comment">// Use destination window to print the tree or create a new</span> <span class="comment">// window, then print the tree into that window</span> var strDump=dump.getHTML(domElement, false, 0) <span class="reserved">if</span> (!bWindow) <span class="reserved">return</span> strDump var outputWindow; outputWindow=window.open(<span class="literal">""</span>,<span class="literal">"dumpdom"</span>); outputWindow.focus(); outputWindow.document.open(<span class="literal">"text/html"</span>, <span class="literal">"replace"</span>); outputWindow.document.write(<span class="literal">"<HTML><HEAD><TITLE>DOM</TITLE></HEAD><BODY>\n"</span>); outputWindow.document.write(<span class="literal">"<textarea rows=20 cols=60>"</span>) outputWindow.document.write(strDump) outputWindow.document.write(<span class="literal">"</textarea>"</span>) outputWindow.document.write(<span class="literal">"</BODY></HTML>\n"</span>); outputWindow.document.close(); } dump.agt = navigator.userAgent.toLowerCase(); dump.is_ie = ((dump.agt.indexOf(<span class="literal">"msie"</span>) != -1) && (dump.agt.indexOf(<span class="literal">"opera"</span>) == -1)); dump.RE_tagName = /(<\/|<)\s*([^ \t\n>]+)/ig; dump.getHTML = <span class="reserved">function</span>(root, outputRoot, intDeep) { var i2; var html = <span class="literal">""</span>; <span class="reserved">for</span> (i2=0; i2 <= intDeep; i2++) html+=<span class="literal">" "</span> switch (root.nodeType) { case 1: <span class="comment">// Node.ELEMENT_NODE</span> case 11: <span class="comment">// Node.DOCUMENT_FRAGMENT_NODE</span> var closed; var i; var root_tag = (root.nodeType == 1) ? root.tagName.toLowerCase() : <span class="literal">''</span>; <span class="reserved">if</span> (dump.is_ie && root_tag == <span class="literal">"head"</span>) { <span class="reserved">if</span> (outputRoot) html += <span class="literal">"\n<head>\n"</span>; <span class="comment">// lowercasize</span> var save_multiline = RegExp.multiline; RegExp.multiline = true; var txt = root.innerHTML.replace(dump.RE_tagName, <span class="reserved">function</span>(str, p1, p2) { <span class="reserved">return</span> p1 + p2.toLowerCase(); }); RegExp.multiline = save_multiline; html += <span class="literal">'\n'</span> + txt; <span class="reserved">if</span> (outputRoot) html += <span class="literal">"\n</head>\n"</span>; break; } <span class="reserved">else</span> <span class="reserved">if</span> (outputRoot) { closed = (!(root.hasChildNodes() || dump.needsClosingTag(root))); html += <span class="literal">"<"</span> + root.tagName.toLowerCase(); var attrs = root.attributes; <span class="reserved">for</span> (i = 0; i < attrs.length; ++i) { var a = attrs.item(i); <span class="reserved">if</span> (!a.specified) { continue; } var name = a.nodeName.toLowerCase(); <span class="reserved">if</span> (/_moz|contenteditable|_msh/.test(name)) { <span class="comment">// avoid certain attributes</span> continue; } var value; <span class="reserved">if</span> (name != <span class="literal">"style"</span>) { <span class="comment">// IE5.5 reports 25 when cellSpacing is</span> <span class="comment">// 1; other values might be doomed too.</span> <span class="comment">// For this reason we extract the</span> <span class="comment">// values directly from the root node.</span> <span class="comment">//</span> <span class="comment">// Using Gecko the values of href and src are converted to absolute links</span> <span class="comment">// unless we get them using nodeValue()</span> <span class="reserved">if</span> (typeof root[a.nodeName] != <span class="literal">"undefined"</span> && name != <span class="literal">"href"</span> && name != <span class="literal">"src"</span>) { value = root[a.nodeName]; } <span class="reserved">else</span> { value = a.nodeValue; <span class="comment">// IE seems not willing to return the original values - it converts to absolute</span> <span class="comment">// links using a.nodeValue, a.value, a.stringValue, root.getAttribute("href")</span> <span class="comment">// So we have to strip the baseurl manually -/</span> <span class="reserved">if</span> (value && (dump.is_ie && (name == <span class="literal">"href"</span> || name == <span class="literal">"src"</span>))) { value = <span class="reserved">this</span>.stripBaseURL(value); } } } <span class="reserved">else</span> { <span class="comment">// IE fails to put style in attributes list</span> <span class="comment">// FIXME: cssText reported by IE is UPPERCASE</span> value = root.style.cssText; } <span class="reserved">if</span> (/(_moz|^$)/.test(value)) { <span class="comment">// Mozilla reports some special tags</span> <span class="comment">// here; we don't need them.</span> continue; } html += <span class="literal">" "</span> + name + <span class="literal">'="'</span> + value + <span class="literal">'"'</span>; } html += closed ? <span class="literal">" />\n"</span> : <span class="literal">">\n"</span>; } <span class="reserved">for</span> (i = root.firstChild; i; i = i.nextSibling) { html += <span class="reserved">this</span>.getHTML(i, true, intDeep+1) } <span class="reserved">if</span> (outputRoot && !closed) { <span class="reserved">for</span> (i2=0; i2 <= intDeep; i2++) html+=<span class="literal">" "</span> html += <span class="literal">"</"</span> + root.tagName.toLowerCase() + <span class="literal">">\n"</span>; } break; case 3: <span class="comment">// Node.TEXT_NODE</span> <span class="comment">// If a text node is alone in an element and all spaces, replace it with an non breaking one</span> <span class="comment">// This partially undoes the damage done by moz, which translates '&nbsp;'s into spaces in the data element</span> <span class="reserved">if</span> ( !root.previousSibling && !root.nextSibling && root.data.match(/^\s*$/i) ) html += <span class="literal">'&nbsp;'</span>; <span class="reserved">else</span> { html += <span class="reserved">this</span>.htmlEncode(root.data) + <span class="literal">'\n'</span>; } break; case 8: <span class="comment">// Node.COMMENT_NODE</span> html += <span class="literal">"<!--"</span> + root.data + <span class="literal">"-->"</span>; break; <span class="comment">// skip comments, for now.</span> } <span class="reserved">return</span> html; }; dump.stripBaseURL = <span class="reserved">function</span>(string) { var baseurl = string; <span class="comment">// strip to last directory in case baseurl points to a file</span> baseurl = baseurl.replace(/[^\/]+$/, <span class="literal">''</span>); var basere = new RegExp(baseurl); string = string.replace(basere, <span class="literal">""</span>); <span class="comment">// strip host-part of URL which is added by MSIE to links relative to server root</span> baseurl = baseurl.replace(/^(https?:\/\/[^\/]+)(.*)$/, <span class="literal">'$1'</span>); basere = new RegExp(baseurl); <span class="reserved">return</span> string.replace(basere, <span class="literal">""</span>); }; <span class="comment">// performs HTML encoding of some given string</span> dump.htmlEncode = <span class="reserved">function</span>(str) { <span class="comment">// we don't need regexp for that, but.. so be it for now.</span> str = str.replace(/&/ig, <span class="literal">"&amp;"</span>); str = str.replace(/</ig, <span class="literal">"&lt;"</span>); str = str.replace(/>/ig, <span class="literal">"&gt;"</span>); str = str.replace(/\x22/ig, <span class="literal">"&quot;"</span>); <span class="comment">// \x22 means '"' -- we use hex reprezentation so that we don't disturb</span> <span class="comment">// JS compressors (well, at least mine fails.. ;)</span> <span class="reserved">return</span> str; }; dump.needsClosingTag = <span class="reserved">function</span>(el) { var closingTags = <span class="literal">" head script style div span tr td tbody table em strong font a title "</span>; <span class="reserved">return</span> (closingTags.indexOf(<span class="literal">" "</span> + el.tagName.toLowerCase() + <span class="literal">" "</span>) != -1); }; </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 Utils</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:18:39 2007</div> </body> </html>