[Zope-CVS] CVS: Packages/Moztop/moztop/content/Menu - ToolBar.js:1.5
Stephan Richter
srichter@cbu.edu
Wed, 15 Jan 2003 00:21:52 -0500
Update of /cvs-repository/Packages/Moztop/moztop/content/Menu
In directory cvs.zope.org:/tmp/cvs-serv5455/moztop/content/Menu
Modified Files:
ToolBar.js
Log Message:
There are some prelimary View Tabs...
Here are two tasks that need to be solved quickly:
1. Is it possible to create XUL Elements from Javascript. If so, how?
2. Can Tabboxes be RDF driven? I was unsuccessful!
=== Packages/Moztop/moztop/content/Menu/ToolBar.js 1.4 => 1.5 ===
--- Packages/Moztop/moztop/content/Menu/ToolBar.js:1.4 Tue Jan 14 23:04:44 2003
+++ Packages/Moztop/moztop/content/Menu/ToolBar.js Wed Jan 15 00:21:20 2003
@@ -54,6 +54,16 @@
sendAddRequest(parent, type, name);
}
+/* Remove the Welcome tab. */
+function _removeWelcome() {
+ var tabs = document.getElementById("active-contents-tabs");
+ var tabpanels = document.getElementById("active-contents-tabpanels");
+ if (tabs.firstChild.label == "Welcome") {
+ tabs.removeChild(tabs.firstChild);
+ tabpanels.removeChild(tabpanels.firstChild);
+ }
+}
+
/* Open selected content object. */
function openContentObject() {
var tree = document.getElementById("navigationtree");
@@ -64,12 +74,38 @@
var parent = rdf.Value.replace('urn:explorer:data', '');
while (parent.indexOf(":") > -1)
parent = parent.replace(":", "/");
- var newtab = tabs.childNodes[0].cloneNode(true);
+ var newtab = tabs.firstChild.cloneNode(true);
var newtabpanel = tabpanels.childNodes[0].cloneNode(true);
newtab.label = parent;
- if (tabs.childNodes[0].selected == true)
- tabs.childNodes[0].selected = false;
+ if (tabs.firstChild.selected == true)
+ tabs.firstChild.selected = false;
newtab.selected = true;
tabs.appendChild(newtab);
tabpanels.appendChild(newtabpanel);
+ _removeWelcome();
+ createViewTabs('Folder', newtabpanel);
+}
+
+/* Create all view tabs for a content object of the specified type */
+function createViewTabs(type, tabpanel) {
+ var tabs = tabpanel.firstChild.childNodes[0];
+ var tabpanels = tabpanel.firstChild.childNodes[1]
+
+ var newtab = tabs.firstChild.cloneNode(true);
+ newtab.label = "Contents";
+ tabs.appendChild(newtab);
+ // var newtabpanel = tabpanels.childNodes[0].cloneNode(true);
+ // tabpanels.appendChild(newtabpanel);
+
+ tabs.removeChild(tabs.firstChild);
+ tabpanels.removeChild(tabpanels.firstChild);
+
+ var newtab = tabs.firstChild.cloneNode(true);
+ newtab.label = "Meta Data";
+ tabs.appendChild(newtab);
+
+ var newtab = tabs.firstChild.cloneNode(true);
+ newtab.label = "Security";
+ tabs.appendChild(newtab);
+
}