[Zope-CVS] CVS: Packages/Moztop/moztop/content/workspace - folderbindings.xbl:1.2
Stephan Richter
srichter@cbu.edu
Sat, 22 Mar 2003 20:34:29 -0500
Update of /cvs-repository/Packages/Moztop/moztop/content/workspace
In directory cvs.zope.org:/tmp/cvs-serv18063/moztop/content/workspace
Modified Files:
folderbindings.xbl
Log Message:
Okay, this is a good checkpoint.
- I hooked up the XBL for the Folder again.
- Improved the Folder Viewer constructors.
- Implemented Folder Preview.
- Only the Folder's actual content is shown now in content.
=== Packages/Moztop/moztop/content/workspace/folderbindings.xbl 1.1 => 1.2 ===
--- Packages/Moztop/moztop/content/workspace/folderbindings.xbl:1.1 Thu Mar 20 09:33:38 2003
+++ Packages/Moztop/moztop/content/workspace/folderbindings.xbl Sat Mar 22 20:33:59 2003
@@ -10,12 +10,12 @@
<xul:tabs>
<xul:tab label="Contents"/>
- <xul:tab oncommand="alert('clicked preview');" label="Preview"/>
+ <xul:tab label="Preview"/>
</xul:tabs>
- <xul:tabpanels>
- <xul:foldercontentspanel ref="urn:moztop:sites" flex="1"/>
- <xul:foldercontentspanel/>
+ <xul:tabpanels flex="1">
+ <xul:foldercontentspanel flex="1"/>
+ <xul:folderpreviewpanel flex="1"/>
</xul:tabpanels>
</xul:tabbox>
@@ -25,17 +25,6 @@
<field name="urn"/>
<field name="resourcetitle"/>
<constructor>
-
- /* Grab the tabbox and add a tab */
- var folderviewer = document.getAnonymousNodes(this)[0].parentNode;
- var parent = folderviewer.parentNode.parentNode;
- var tabs = parent.getElementsByTagName("tabs")[0];
- var rt = this.getAttribute("resourcetitle");
-
- var thistab = document.createElement("tab");
- thistab.setAttribute("label",rt);
- thistab.setAttribute("id", rt + "-tab");
- tabs.appendChild(thistab);
</constructor>
</implementation>
</binding>
@@ -49,8 +38,6 @@
style="width: 20em; height: 10em"
id="foldercontentstree" ref="urn:moztop:sites"
datasources="rdf:null"
-
- ondblclick="sitesmanager.openSelectedResource();"
containment="http://home.netscape.com/NC-rdf#subitems">
<xul:treecols>
@@ -71,7 +58,7 @@
<xul:bindings>
<xul:binding subject="?subitem"
- predicate="http://www.zope.org/rdf#resourcetype"
+ predicate="http://www.oscom.org/rdf#resourcetype"
object="?resourcetype" />
<xul:binding subject="?subitem"
predicate="http://www.purl.org/dc/1.1#title"
@@ -80,7 +67,7 @@
predicate="http://www.purl.org/dc/1.1#title"
object="?resourcetypetitle"/>
<xul:binding subject="?resourcetype"
- predicate="http://www.zope.org/rdf#styleid"
+ predicate="http://www.oscom.org/rdf#styleid"
object="?styleid"/>
</xul:bindings>
@@ -103,11 +90,36 @@
<implementation>
<constructor>
- var tree = document.getAnonymousNodes(this)[0].childNodes[0];
- dump("\n tree name is " + tree.tagName);
- tree.database.AddDataSource(sitesmanager.ds.getRawDataSource());
- tree.database.AddDataSource(sitesmanager.commontypesds.getRawDataSource());
- tree.builder.rebuild();
+ // The constructor assumes that 'urn' is defined in this scope
+ var tree = document.getAnonymousNodes(this)[0].childNodes[0];
+ var navtree = document.getElementById(sitesmanager.treeId);
+ sources = navtree.database.GetDataSources();
+ sources.getNext();
+ while (sources.hasMoreElements()) {
+ tree.database.AddDataSource(sources.getNext());
+ }
+ tree.ref = urn;
+ tree.builder.rebuild();
+ </constructor>
+ </implementation>
+
+ </binding>
+
+
+ <binding id="folderpreviewpanelbinding" extends="xul:tabpanel">
+ <content orient="vertical">
+ <xul:iframe id="preview-frame" src="" flex="1"/>
+ <xul:box orient="horizontal">
+ <xul:button onclick="loadPreview();" label="Reload Content" />
+ <xul:spring flex="100%" />
+ </xul:box>
+ </content>
+
+ <implementation>
+ <constructor>
+ // The constructor assumes that 'urn' is defined in this scope
+ var iframe = document.getElementById('preview-frame');
+ iframe.setAttribute("src", urn);
</constructor>
</implementation>