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/10 18:57:54 UTC
svn commit: r430480 -
/incubator/xap/trunk/WebContent/examples/dojo/xapStatus.js
Author: mturyn
Date: Thu Aug 10 11:57:53 2006
New Revision: 430480
URL: http://svn.apache.org/viewvc?rev=430480&view=rev
Log:
Generalised method, replaces variants found in dataPicker.js,colorPicker.js,dojo1.js, which will be removed.
Added:
incubator/xap/trunk/WebContent/examples/dojo/xapStatus.js (with props)
Added: incubator/xap/trunk/WebContent/examples/dojo/xapStatus.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/xapStatus.js?rev=430480&view=auto
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dojo/xapStatus.js (added)
+++ incubator/xap/trunk/WebContent/examples/dojo/xapStatus.js Thu Aug 10 11:57:53 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> appName:"
+ + session.appName
+ + ", <br> and source "
+ + session.src
+ + "<br> under element: "
+ + "<code>"+path +"</code>"
+ ;
+ return statusWindow ;
+}
+
+
+
+
Propchange: incubator/xap/trunk/WebContent/examples/dojo/xapStatus.js
------------------------------------------------------------------------------
svn:eol-style = native