[Zope3-checkins] CVS: ZopeProducts/RotterdamSprint - template.pt:1.21 xmltree.js:1.7 zope3.css:1.12

Godefroid Chapelle gotcha@swing.be
Tue, 10 Dec 2002 12:43:44 -0500


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

Modified Files:
	template.pt xmltree.js zope3.css 
Log Message:

updated cursor state changes
code cleanup


=== ZopeProducts/RotterdamSprint/template.pt 1.20 => 1.21 ===
--- ZopeProducts/RotterdamSprint/template.pt:1.20	Fri Dec  6 09:34:47 2002
+++ ZopeProducts/RotterdamSprint/template.pt	Tue Dec 10 12:43:43 2002
@@ -83,7 +83,9 @@
           id="navtreecontents" 
           class="body" 
           onclick="treeclicked(event);" 
-          onmousemove="togglecursor(event);">
+          onmouseover="mouseOverTree(event);"
+          onmouseout="mouseOutTree(event);"
+          >
         </div>
 
       </div>


=== ZopeProducts/RotterdamSprint/xmltree.js 1.6 => 1.7 === (405/505 lines abridged)
--- ZopeProducts/RotterdamSprint/xmltree.js:1.6	Thu Dec  5 17:22:58 2002
+++ ZopeProducts/RotterdamSprint/xmltree.js	Tue Dec 10 12:43:43 2002
@@ -1,13 +1,12 @@
-
-
 var ELEMENT_NODE = 1;
 var TEXT_NODE = 3;
 var COLLECTION = 'COLLECTION';
 var TITLE = 'TITLE';
+var EXPAND = 'EXPAND';
 var XML_CHILDREN_VIEW = 'children.xml';
 var SINGLE_BRANCH_TREE_VIEW = 'singleBranchTree.xml';
-var CONTENT_VIEW = '';
-//var CONTENT_VIEW = '@@contents.html';
+//var CONTENT_VIEW = '';
+var CONTENT_VIEW = '@@contents.html';
 var baseurl;
 
 
@@ -19,245 +18,279 @@
 
 
 function prettydump(s, locallog) {
-  // Put the string "s" in a box on the screen as an log message
-  if (locallog <= loglevel){
-	  var logger = document.getElementById('logger');
-  	var msg = document.createElement('code');
-		var br1 = document.createElement('br');
-  	var br2 = document.createElement('br');
-  	var msg_text = document.createTextNode(s);
-  	msg.appendChild(msg_text);
-  	logger.insertBefore(br1,logger.firstChild);
-  	logger.insertBefore(br2,logger.firstChild);
-  	logger.insertBefore(msg,logger.firstChild);
-		}
-}
+        // Put the string "s" in a box on the screen as an log message
+        if (locallog <= loglevel) {
+                var logger = document.getElementById('logger');
+  	        var msg = document.createElement('code');
+	        var br1 = document.createElement('br');
+  	        var br2 = document.createElement('br');
+  	        var msg_text = document.createTextNode(s);
+  	        msg.appendChild(msg_text);
+          	logger.insertBefore(br1, logger.firstChild);
+  	        logger.insertBefore(br2, logger.firstChild);
+          	logger.insertBefore(msg, logger.firstChild);
+	        }
+        }
+

[-=- -=- -=- 405 lines omitted -=- -=- -=-]

+
+                if (curritem.nodeType != ELEMENT_NODE) {
+                        continue;
+                        }
+
+                if (!isCollection(curritem)) {
+                        continue;
+                        }
+                result.push(curritem);
+                }
+        return result;
+        }
+
+function createCollection(curritem, basename, deep) {
+        var currname = curritem.getAttribute('name');
+        var newelem = document.createElement(curritem.tagName);
+        // add plus/minus icon
+        var expandelem = document.createElement('expand');
+        newelem.appendChild(expandelem);
+        // add title
+        var titleelem = document.createElement('title');
+        var newtextnode = document.createTextNode(currname);
+        titleelem.appendChild(newtextnode);
+        expandelem.appendChild(titleelem);
+        newelem.setAttribute('name',basename + currname);
+
+        if (deep) {
+                var children = getChildCollectionNodes(curritem);
+                var numchildren = children.length;
+                for (var i=0; i< numchildren; i++) {
+                        var newchild = createCollection(children[i], basename + currname + '/', deep);
+                        prettydump("add " + newelem.tagName, LG_DEBUG);
+                        newelem.appendChild(newchild);
+                        }
+                if (numchildren) {
+	                newelem.setAttribute('isCollapsed', 0);
+	                newelem.setAttribute('isEmpty', 0);
+                        }
+                else {
+	                newelem.setAttribute('isCollapsed', 1);
+	                newelem.setAttribute('isEmpty', 1);
+                        }
+                }
+        else {
+                newelem.setAttribute('isCollapsed', 1);
+                newelem.setAttribute('isEmpty', 1);
+                }
+        return newelem;
+        }
+


=== ZopeProducts/RotterdamSprint/zope3.css 1.11 => 1.12 ===
--- ZopeProducts/RotterdamSprint/zope3.css:1.11	Fri Dec  6 09:34:47 2002
+++ ZopeProducts/RotterdamSprint/zope3.css	Tue Dec 10 12:43:43 2002
@@ -227,17 +227,21 @@
 
 title {
 	   display: inline;
+	   cursor: pointer;
 		 }
 
-
-collection {
-	   display: block;
-	   margin-left: 5px;
+expand {
   	   background-image: url("pl.gif");
   	   background-repeat: no-repeat;
   	   padding-left: 15px;
-/*	   border: red solid 1pt;
-/*	   cursor: pointer; */
+	   display: inline;
+	   cursor: pointer;
+                }
+                 
+collection {
+	   display: block;
+	   margin-left: 15px;
+/*	   border: red solid 1pt; */
 }
 
 
@@ -306,7 +310,7 @@
     text-transform: lowercase;
     margin: 0px;
     font-weight: normal;
-    font-size: 1em;
+
     padding: 0.1em 1em 0.3em 0.5em;
     height: 1em;
 }