[Zope-CVS] CVS: Packages/Moztop/moztop/content/Menu - ToolBar.js:1.4
Stephan Richter
srichter@cbu.edu
Tue, 14 Jan 2003 23:04:47 -0500
Update of /cvs-repository/Packages/Moztop/moztop/content/Menu
In directory cvs.zope.org:/tmp/cvs-serv25946/moztop/content/Menu
Modified Files:
ToolBar.js
Log Message:
You can now "open" content objects. A new tab is created for them.
=== Packages/Moztop/moztop/content/Menu/ToolBar.js 1.3 => 1.4 ===
--- Packages/Moztop/moztop/content/Menu/ToolBar.js:1.3 Tue Jan 14 21:26:39 2003
+++ Packages/Moztop/moztop/content/Menu/ToolBar.js Tue Jan 14 23:04:44 2003
@@ -53,3 +53,23 @@
// alert(parent);
sendAddRequest(parent, type, name);
}
+
+/* Open selected content object. */
+function openContentObject() {
+ var tree = document.getElementById("navigationtree");
+ var tabs = document.getElementById("active-contents-tabs");
+ var tabpanels = document.getElementById("active-contents-tabpanels");
+ index = tree.view.selection.currentIndex;
+ rdf = tree.view.getItemAtIndex(index).resource;
+ var parent = rdf.Value.replace('urn:explorer:data', '');
+ while (parent.indexOf(":") > -1)
+ parent = parent.replace(":", "/");
+ var newtab = tabs.childNodes[0].cloneNode(true);
+ var newtabpanel = tabpanels.childNodes[0].cloneNode(true);
+ newtab.label = parent;
+ if (tabs.childNodes[0].selected == true)
+ tabs.childNodes[0].selected = false;
+ newtab.selected = true;
+ tabs.appendChild(newtab);
+ tabpanels.appendChild(newtabpanel);
+}