[Zope-CVS] CVS: Packages/Moztop/moztop/content/Menu - ToolBar.js:1.7
Stephan Richter
srichter@cbu.edu
Wed, 15 Jan 2003 08:17:06 -0500
Update of /cvs-repository/Packages/Moztop/moztop/content/Menu
In directory cvs.zope.org:/tmp/cvs-serv2352/moztop/content/Menu
Modified Files:
ToolBar.js
Log Message:
Now the Content Object subtabs are created instead of cloned...
=== Packages/Moztop/moztop/content/Menu/ToolBar.js 1.6 => 1.7 ===
--- Packages/Moztop/moztop/content/Menu/ToolBar.js:1.6 Wed Jan 15 07:40:51 2003
+++ Packages/Moztop/moztop/content/Menu/ToolBar.js Wed Jan 15 08:17:04 2003
@@ -74,45 +74,49 @@
var parent = rdf.Value.replace('urn:explorer:data', '');
while (parent.indexOf(":") > -1)
parent = parent.replace(":", "/");
- var newtab = tabs.firstChild.cloneNode(true);
- var newtabpanel = tabpanels.childNodes[0].cloneNode(true);
- newtab.label = parent;
+
+ var newtab = document.createElement("tab");
+ newtab.setAttribute('label', parent);
+ newtab.setAttribute('selected', true);
if (tabs.firstChild.selected == true)
tabs.firstChild.selected = false;
- newtab.selected = true;
tabs.appendChild(newtab);
+
+ var newtabpanel = document.createElement("tabpanel");
tabpanels.appendChild(newtabpanel);
+
_removeWelcome();
- createViewTabs('Folder', newtabpanel);
+ createViewTabs('Folder', parent, 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 newbutton = document.createElement("button");
- newbutton.setAttribute("label","Show Datasource");
- newbutton.setAttribute("onclick","displayDS();");
- var toolbar = document.getElementById("moztop-toolbar");
- toolbar.appendChild(newbutton);
-
- var newtab = tabs.firstChild.cloneNode(true);
- newtab.label = "Contents";
+function createViewTabs(type, name, tabpanel) {
+ var tabbox = document.createElement("tabbox");
+ tabbox.setAttribute('id', name+'-tabbox');
+ tabbox.setAttribute('orient', 'vertical');
+ tabbox.setAttribute('flex', '1');
+ tabpanel.appendChild(tabbox);
+
+ var tabs = document.createElement("tabs");
+ tabs.setAttribute('orient', 'horizontal');
+ tabbox.appendChild(tabs);
+
+ var tabpanels = document.createElement("tabpanels");
+ tabpanels.setAttribute('flex', '100%');
+ tabbox.appendChild(tabpanels);
+
+ var newtab = document.createElement("tab");
+ newtab.setAttribute("label", "Contents");
+ newtab.setAttribute("selected", true);
tabs.appendChild(newtab);
- // var newtabpanel = tabpanels.childNodes[0].cloneNode(true);
- // tabpanels.appendChild(newtabpanel);
+ var newtabpanel = document.createElement("tabpanel");
+ tabpanel.appendChild(newtabpanel);
- tabs.removeChild(tabs.firstChild);
- tabpanels.removeChild(tabpanels.firstChild);
-
- var newtab = tabs.firstChild.cloneNode(true);
- newtab.label = "Meta Data";
+ var newtab = document.createElement("tab");
+ newtab.setAttribute("label", "Meta Data");
tabs.appendChild(newtab);
- var newtab = tabs.firstChild.cloneNode(true);
- newtab.label = "Security";
+ var newtab = document.createElement("tab");
+ newtab.setAttribute("label", "Security");
tabs.appendChild(newtab);
-
}