You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by mt...@apache.org on 2006/08/11 19:56:56 UTC
svn commit: r430877 -
/incubator/xap/trunk/WebContent/examples/dojo/xapStatus.js
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> appName:"
- + session.appName
- + ", <br> and source "
- + session.src
- + "<br> under element: "
- + "<code>"+path +"</code>"
- ;
- return statusWindow ;
-}
-
-
+ return ""
+ // + statusWindow.innerHTML.innerHTML
+ +"<br>Found xap tag with <br> xapId:"
+ + session.xapId
+ + ", <br> source "
+ + "<b>"+session.xapSrc+"</b>"
+ + ", <br> using toolkit: "
+ + "<b>"+session.xapToolkit+"</b>"
+ + ", <br> loading its document handler definition file from: "
+ + "<b>"+session.xapContext+"</b>"
+ + "<br> attached within element: "
+ + "<code>"
+ + "<b>"+path + "</b>"
+ + "</code>" ;
+};
-