[Zope3-checkins] CVS: ZopeProducts/RotterdamSprint - xmltree.js:1.3

Paul Everitt paul@zope.com
Wed, 4 Dec 2002 11:25:35 -0500


Update of /cvs-repository/ZopeProducts/RotterdamSprint
In directory cvs.zope.org:/tmp/cvs-serv6604

Modified Files:
	xmltree.js 
Log Message:
Updated to work with Windows


=== ZopeProducts/RotterdamSprint/xmltree.js 1.2 => 1.3 ===
--- ZopeProducts/RotterdamSprint/xmltree.js:1.2	Wed Dec  4 09:36:24 2002
+++ ZopeProducts/RotterdamSprint/xmltree.js	Wed Dec  4 11:25:35 2002
@@ -1,13 +1,14 @@
 
 
-const ELEMENT_NODE = 1;
-const TEXT_NODE = 3;
-const COLLECTION = 'COLLECTION';
-const FOLDERDATA_URL = 'children.xml';
+var ELEMENT_NODE = 1;
+var TEXT_NODE = 3;
+var COLLECTION = 'COLLECTION';
+var FOLDERDATA_URL = 'children.xml';
 var baseurl;
 
 function prettydump(s) {
   // Put the string "s" in a box on the screen as an log message
+
   var logger = document.getElementById('logger');
   var msg = document.createElement('code');
   var br1 = document.createElement('br');
@@ -20,15 +21,14 @@
 }
 
 function togglenode (n) {
-
-  if (typeof(n.style) == 'undefined') {
-    alert('no style on node');
- }
-
-  if (n.style.display == 'none')
-    n.style.display = 'block';
-  else 
-    n.style.display = 'none';
+	 if (typeof(n.style) == 'undefined') {
+	    alert('no style on node');
+	    }
+
+ 	    if (n.style.display == 'none')
+	       n.style.display = 'block';
+	    else 
+    	    	 n.style.display = 'none';
 }
 
 function togglecursor (e) {
@@ -54,7 +54,6 @@
     var elem=e.srcElement;
   }
   if (elem.tagName.toUpperCase() != COLLECTION) return;
-//  alert(elem.tagName);
   if(elem.id == 'navtree')
   {return}
 //  if(elem.nodeType != TEXT_NODE)
@@ -67,7 +66,6 @@
      var name = elem.getAttribute('name');
      var thisbaseurl = baseurl + name + '/';
      var data = loadtreexml(thisbaseurl);
-
      createAndAddNodes(data,elem);
      elem.setAttribute('isEmpty',0);
 
@@ -138,27 +136,23 @@
 
 function loadtreexml (baseurl) {
   var xmlHttp = XmlHttp.create(); 
-  //alert('url'+baseurl + FOLDERDATA_URL);
 
   xmlHttp.open('GET',baseurl + FOLDERDATA_URL,false); 
   xmlHttp.send(null);
-  prettydump(xmlHttp.responseText);
+  prettydump('Response XML ' + xmlHttp.responseText);
   var data = xmlHttp.responseXML.documentElement;
   return data;
 }  
 
 function loadtree (thisbaseurl) {
   baseurl = thisbaseurl;  // Global baseurl
+
   var data = loadtreexml(thisbaseurl);
   var navtree = document.getElementById('navtreecontents');
   var newelem = document.createElement('div');
   newelem.setAttribute('name','');
   navtree.appendChild(newelem);
     createAndAddNodes(data,newelem);
-
-
-//  alert(document.getElementsByTagName('collection').length);
-
 }
 
 
@@ -179,7 +173,6 @@
     }
 
     var currname = curritem.getAttribute('name');
-//    alert(currtext);
     var newtextnode = document.createTextNode(currname);
     var newelem = document.createElement(curritem.tagName);
     newelem.setAttribute('name',basename+currname);
@@ -190,7 +183,7 @@
        
        }
     newelem.appendChild(newtextnode);
-//   alert (targetNode.nodeType+targetNode.tagName);
    targetNode.appendChild(newelem);
   }
-}
\ No newline at end of file
+}
+