function RemovePersonalToolbar()
{
var personalToolbarFolder = document.getElementById("NC:PersonalToolbarFolder");
dump("personalToolbarFolder = " + personalToolbarFolder + "\n");
if (personalToolbarFolder == null)
return;
var bookmarksRoot = document.getElementById("NC:BookmarksRoot");
dump("bookmarksRoot = " + bookmarksRoot + "\n");
if (bookmarksRoot == null)
return;
bookmarksRoot.removeChild(personalToolbarFolder);
}
function AddPersonalToolbar()
{
var bookmarksRoot = document.getElementById("NC:BookmarksRoot");
dump("bookmarksRoot = " + bookmarksRoot + "\n");
if (bookmarksRoot == null)
return;
var personalToolbarFolder = document.getElementById("NC:PersonalToolbarFolder");
dump("personalToolbarFolder = " + personalToolbarFolder + "\n");
if (personalToolbarFolder != null) // already there
return;
personalToolbarFolder = document.createElement("xul:treeitem");
personalToolbarFolder.setAttribute("id", "NC:PersonalToolbarFolder");
bookmarksRoot.appendChild(personalToolbarFolder);
}
function MutateBody()
{
// This test changes the "id" attribute on the treebody
var tree = document.getElementById("tree");
dump("tree = " + tree + "\n");
var currentRef = tree.getAttribute("ref");
dump("currentRef = " + currentRef + "\n");
if (currentRef == "NC:BookmarksRoot") {
tree.setAttribute("ref", "NC:PersonalToolbarFolder");
}
else {
tree.setAttribute("ref", "NC:BookmarksRoot");
}
}
Remove Personal Toolbar
Add Personal Toolbar
Swap Body (Bookmarks Root/Personal Toolbar Folder)
Name
URL