[Zope-CVS] CVS: Packages/Moztop/moztop/content - moztop.js:1.9

Stephan Richter srichter@cbu.edu
Thu, 16 Jan 2003 01:21:29 -0500


Update of /cvs-repository/Packages/Moztop/moztop/content
In directory cvs.zope.org:/tmp/cvs-serv29427/moztop/content

Modified Files:
	moztop.js 
Log Message:
- Content Tab is working for Folders.

- Updated CHANGES.txt to reflect my work.


=== Packages/Moztop/moztop/content/moztop.js 1.8 => 1.9 ===
--- Packages/Moztop/moztop/content/moztop.js:1.8	Wed Jan 15 23:11:20 2003
+++ Packages/Moztop/moztop/content/moztop.js	Thu Jan 16 01:20:57 2003
@@ -48,7 +48,7 @@
 
 /* Initialize the Explorer datasource */
 function initExplorer() {
-    var ds = RDF.GetDataSource(contentsURL);
+    var ds = RDF.GetDataSource(RDF_BASE + '@@contents.rdf');
     var tree = document.getElementById('navigationtree');
     tree.database.AddDataSource(ds);
     tree.setAttribute("ref", "urn:explorer:data");
@@ -57,12 +57,17 @@
 /* Reload Explorer datasource */
 function reloadContentData() {
     var tree = document.getElementById('navigationtree');
-    // XXX There are some issues using this variant:
-    var ds = RDF.GetDataSource(contentsURL);
-    // var ds = tree.database.GetDataSources().getNext()
+    var sources = tree.database.GetDataSources();
+    sources.getNext(); // Hack, we should find this out in a better way.
+    var ds = sources.getNext();
     ds = ds.QueryInterface(
 	      Components.interfaces.nsIRDFRemoteDataSource);
     ds.Refresh(false);
+    /* We need this alert, so the RDF has time to load, otherwise the tree
+       will be empty. We have find a better way of doing this.
+
+       This happens because the DS is loaded asynchronically.
+    */ 
     alert('Done reloading Content Tree.');
     tree.builder.rebuild();
 }