rem:      const kRDF = gBookmarksShell.RDF; const krNavCenter = kRDF.GetResource("NC:NavCenter"); const kRDFCUtilsContractID = "@mozilla.org/rdf/container-utils;1"; const kRDFCUtilsIID = Components.interfaces.nsIRDFContainerUtils; const kRDFCUtils = Components.classes[kRDFCUtilsContractID].getService(kRDFCUtilsIID); const kNC_NavCenter = kRDFCUtils.MakeSeq(gBookmarksShell.db, krNavCenter); const krBookmarksRoot = kRDF.GetResource("NC:BookmarksRoot"); const krName = kRDF.GetResource(NC_NS + "Name"); 
context: function Startup(){  // Create the Bookmarks Shell  var bookmarksTree = document.getElementById("bookmarksTree");  gBookmarksShell = new BookmarksWindowTree (bookmarksTree.database);  // Set up the tree controller  bookmarksTree.controllers.appendController(gBookmarksShell.controller);  const windowNode = document.getElementById("bookmark-window");  // If we've been opened with a parameter, root the tree on it.  if ("arguments" in window && window.arguments[0]) {    bookmarksTree.setAttribute("ref", window.arguments[0]);    const krNameArc = gBookmarksShell.RDF.GetResource(NC_NS + "Name");    const krRoot = gBookmarksShell.RDF.GetResource(window.arguments[0]);    var rName = gBookmarksShell.db.GetTarget(krRoot, krNameArc, true);    rName = rName.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;    const titleString = gBookmarksShell.getLocaleString("window_title");    windowNode.setAttribute("title", titleString.replace(/%folder_name%/gi, rName));  }  else {    // There's a better way of doing this, but for the initial revision just    // using the root folder in the bookmarks window will do.    // For the next milestone I'd like to move this either into the bookmarks    // service or some other higher level datasource so that it can be accessed    // from everywhere.    const kRDF = gBookmarksShell.RDF;    const krNavCenter = kRDF.GetResource("NC:NavCenter");    const kRDFCUtilsContractID = "@mozilla.org/rdf/container-utils;1";    const kRDFCUtilsIID = Components.interfaces.nsIRDFContainerUtils;    const kRDFCUtils = Components.classes[kRDFCUtilsContractID].getService(kRDFCUtilsIID);    const kNC_NavCenter = kRDFCUtils.MakeSeq(gBookmarksShell.db, krNavCenter);    const krBookmarksRoot = kRDF.GetResource("NC:BookmarksRoot");    const krName = kRDF.GetResource(NC_NS + "Name");    var rootfoldername = gBookmarksShell.getLocaleString("bookmarks_root");    const kProfileContractID = "@mozilla.org/profile/manager;1";    const kProfileIID = Components.interfaces.nsIProfile;    const kProfile = Components.classes[kProfileContractID].getService(kProfileIID);    rootfoldername = rootfoldername.replace(/%user_name%/, kProfile.currentProfile);    const klBookmarksRootName = kRDF.GetLiteral(rootfoldername);    const kBMDS = kRDF.GetDataSource("rdf:bookmarks");    kBMDS.Assert(krBookmarksRoot, krName, klBookmarksRootName, true);    kNC_NavCenter.AppendElement(krBookmarksRoot);    windowNode.setAttribute("title", rootfoldername);    /* Blue Sky    const krHistoryRoot = kRDF.GetResource("NC:HistoryRoot");    const klHistoryRootName = kRDF.GetLiteral("Browsing History");    const kHistory = kRDF.GetDataSource("rdf:history");    kHistory.Assert(krHistoryRoot, krName, klHistoryRootName, true);    kNC_NavCenter.AppendElement(krHistoryRoot);    */    const krType = kRDF.GetResource(RDF_NS + "type");    const krFolderType = kRDF.GetResource(NC_NS + "Folder");    gBookmarksShell.db.Assert(krNavCenter, krType, krFolderType, true);  }  // Update to the last sort.  RefreshSort();  // Initialize the tree widget.  var children = document.getElementById("treechildren-bookmarks");  if (children.firstChild) {    bookmarksTree.selectItem(children.firstChild);    children.firstChild.setAttribute("open", "true");  }  // XXX templates suck ASS  var node = document.getElementById("NC:BookmarksRoot");  if (node.localName == "menubutton")    node.removeAttribute("open");  bookmarksTree.focus();}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/3c1e4cee57d48dad81a4af4b045f5845fa04b0f0/bookmarks.js/buggy/xpfe/components/bookmarks/resources/bookmarks.js