rem:   var profileInterface = Components.interfaces.nsIProfile; var profileURI = 'component: var profileService  = Components.classes[profileURI].getService(); profileService = profileService.QueryInterface(profileInterface); var sidebar_url = profileService.getCurrentProfileDirFromJS(); sidebar_url.URLString += "panels.rdf"; 
add: try { var fileLocatorInterface = Components.interfaces.nsIFileLocator; var fileLocatorProgID = 'component: var fileLocatorService  = Components.classes[fileLocatorProgID].getService();    fileLocatorService = fileLocatorService.QueryInterface(fileLocatorInterface); 
context: function sidebarOverlayInit(){  // Look in the profile directory to find 'panels.rdf', which is the  // database of the user's currently selected panels.  var profileInterface = Components.interfaces.nsIProfile;  var profileURI = 'component://netscape/profile/manager';  var profileService  = Components.classes[profileURI].getService();  profileService = profileService.QueryInterface(profileInterface);  var sidebar_url = profileService.getCurrentProfileDirFromJS();  sidebar_url.URLString += "panels.rdf";  if (sidebar_url.exists()) {    debug("sidebar url is " + sidebar_url.URLString + "\n");    sidebar.db = sidebar_url.URLString;  }  else {    // XXX What we should _really_ do here is copy the default panels    // into the profile directory and then try again.    sidebar.db = 'chrome://sidebar/content/default-panels.rdf'    debug("using " + sidebar.db + " because " + sidebar_url.URLString + " does not exist\n");  }  sidebar.resource = 'urn:sidebar:current-panel-list';  // Initialize the display  var sidebar_element = document.getElementById('sidebar-box')  var sidebar_menuitem = document.getElementById('menu_sidebar')  if (sidebar_element.getAttribute('hidden') == 'true') {    sidebar_element.setAttribute('style', 'display:none')    sidebar_menuitem.setAttribute('checked', 'false')    return  }  debug("sidebar = " + sidebar + "\n");  debug("sidebar.resource = " + sidebar.resource + "\n");  debug("sidebar.db = " + sidebar.db + "\n");  // Add the user's current panel choices to the template builder,  // which will aggregate it with the other datasources that describe  // the individual panel's title, customize URL, and content URL.  var panels = document.getElementById('sidebar-panels');  panels.database.AddDataSource(RDF.GetDataSource(sidebar.db));  // XXX This is a hack to force re-display  panels.setAttribute('ref', 'urn:sidebar:current-panel-list');  sidebarOpenDefaultPanel(1, 0);}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/f1a3d41f841499dfa9900fbe99706e2b29d34d63/sidebarOverlay.js/buggy/xpfe/components/sidebar/resources/sidebarOverlay.js