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]) {    var uri = window.arguments[0];    bookmarksTree.setAttribute("ref", uri);    var title = "";    if (uri.substring(0,5) == "find:") {      title = gBookmarksShell.getLocaleString("search_results_title");      // Update the windowtype so that future searches are directed       // there and the window is not re-used for bookmarks.       windowNode.setAttribute("windowtype", "bookmarks:searchresults");    }    else {      const krNameArc = gBookmarksShell.RDF.GetResource(NC_NS + "Name");      const krRoot = gBookmarksShell.RDF.GetResource(window.arguments[0]);      var rName = gBookmarksShell.db.GetTarget(krRoot, krNameArc, true);      title = rName.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;    }    const titleString = gBookmarksShell.getLocaleString("window_title");    windowNode.setAttribute("title", titleString.replace(/%folder_name%/gi, title));  }  else {    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);    windowNode.setAttribute("title", rootfoldername);  }  // Update to the last sort.  RefreshSort();  var kids = document.getElementById("treechildren-bookmarks");  if (kids.firstChild)    bookmarksTree.selectItem(kids.firstChild);  bookmarksTree.focus();}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/25a2413d8a54ac7f02a9e50617ba805bde257a66/bookmarks.js/buggy/xpfe/components/bookmarks/resources/bookmarks.js