incubator-xap-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=430877&view=rev
Log:
Improved so that it will take a list of session names, or default to the window's entire list.

Modified:
    incubator/xap/trunk/WebContent/examples/dojo/xapStatus.js

Modified: incubator/xap/trunk/WebContent/examples/dojo/xapStatus.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/xapStatus.js?rev=430877&r1=430876&r2=430877&view=diff
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/xapStatus.js (original)
+++ incubator/xap/trunk/WebContent/examples/dojo/xapStatus.js Fri Aug 11 12:56:56 2006
@@ -1,44 +1,60 @@
-document.showXapStatus = function(name){
-	var session = window[ name ] ;
 
-	var node = session.domContainer ;
-	var front = "" ;
+document.showXapStatus = function (names) {
+	var sessionNames = names;
+	if( !names ){
+		sessionNames = window.xapSessionIds ;
+	} else 	if (typeof names == "string") {
+		sessionNames = [names];
+	}
+	var str = ""; 
+	for (var k = 0; k < sessionNames.length; ++k) {
+		str += document.locString(sessionNames[k]);
+	}
+	var statusWindow = document.getElementById("xapStat");
+	statusWindow.innerHTML = str;
+	return statusWindow;
+};
+
+document.locString = 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  ;
+	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 ;
+		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 ){
+		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 ;
+				++nodeLikeThisOneNameIndex;
 			}
-			if( siblings[idx] == node ){
-				path = "<strong>" +node.nodeName +"</strong>" +"<font color='#4444FF'>["+nodeLikeThisOneNameIndex+"]</font>"
 + path ;
-				break ;
+			if (siblings[idx] == node) {
+				path = "<strong>" + node.nodeName + "</strong>" + "<font color='#4444FF'>["
+ nodeLikeThisOneNameIndex + "]</font>" + path;
+				break;
 			}
-		}	
-		node = node.parentNode ;				
+		}
+		node = node.parentNode;
 	}
-	var statusWindow = document.getElementById("xapStat") ;
-	statusWindow.innerHTML +=""
-						 //statusWindow.innerHTML.innerHTML 
-						+"<br>Found xap tag with <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
appName:" 
-						+ session.appName
-						+ ", <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and source " 
-						+ session.src 
-						+ "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; under element: "
-						+ "<code>"+path +"</code>"
-							;
-	return statusWindow ;
-}	
-
-
+	return ""
+			 // + statusWindow.innerHTML.innerHTML 
+				+"<br>Found xap tag with <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xapId:" 
+				+ session.xapId
+				+ ", <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; source " 
+				+ "<b>"+session.xapSrc+"</b>"
+				+ ", <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using toolkit: " 
+				+ "<b>"+session.xapToolkit+"</b>"		
+				+ ", <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loading its document
handler definition file from: " 
+				+ "<b>"+session.xapContext+"</b>"								
+				+ "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; attached within element:
" 
+				+ "<code>" 
+				+ "<b>"+path + "</b>" 
+				+ "</code>" ;
+};
 
-		



Mime
View raw message