incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtu...@apache.org
Subject svn commit: r430874 - /incubator/xap/trunk/WebContent/examples/xapStatus.js
Date Fri, 11 Aug 2006 19:41:29 GMT
Author: mturyn
Date: Fri Aug 11 12:41:28 2006
New Revision: 430874

URL: http://svn.apache.org/viewvc?rev=430874&view=rev
Log:
Support method for multiple examples:  has method to produce a string locating a xaplet within
the HTML DOM.

Added:
    incubator/xap/trunk/WebContent/examples/xapStatus.js   (with props)

Added: incubator/xap/trunk/WebContent/examples/xapStatus.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/xapStatus.js?rev=430874&view=auto
==============================================================================
--- incubator/xap/trunk/WebContent/examples/xapStatus.js (added)
+++ incubator/xap/trunk/WebContent/examples/xapStatus.js Fri Aug 11 12:41:28 2006
@@ -0,0 +1,44 @@
+document.showXapStatus = function(name){
+	var session = window[ name ] ;
+
+	var node = session.domContainer ;
+	var front = "" ;
+	var path = "";
+	while( node.parentNode ){
+		var siblings = node.parentNode.childNodes ;
+		if (path.length>0){
+			path = "<strong>/</strong>" + path  ;
+		}
+		var idx = -1 ;
+		var nodeLikeThisOneName= node.nodeName ;
+		var nodeLikeThisOneNameIndex = -1 ;
+		// Which node is this (e.g., which TR child of a TBODY?)
+		while( ++idx < siblings.length ){
+			if( nodeLikeThisOneName == siblings[idx].nodeName ){
+			// This is {<last count>+1} node like this under
+			// the parent (e.g., the 3rd <td> under a <tr>)
+				++nodeLikeThisOneNameIndex ;
+			}
+			if( siblings[idx] == node ){
+				path = "<strong>" +node.nodeName +"</strong>" +"<font color='#4444FF'>["+nodeLikeThisOneNameIndex+"]</font>"
 + path ;
+				break ;
+			}
+		}	
+		node = node.parentNode ;				
+	}
+	var statusWindow = document.getElementById("xapStat") ;
+	statusWindow.innerHTML +=""
+						 //statusWindow.innerHTML.innerHTML 
+						+"<br>Found xap tag with <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xapId:" 
+						+ session.xapId
+						+ ", <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and source " 
+						+ session.src 
+						+ "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; under element: "
+						+ "<code>"+path +"</code>"
+							;
+	return statusWindow ;
+}	
+
+
+
+		

Propchange: incubator/xap/trunk/WebContent/examples/xapStatus.js
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message