rem:  window.close(); 
context: function Save(){  persist_dialog_dimensions();  var all_panels = document.getElementById('other-panels');  var current_panels = document.getElementById('current-panels');  // See if list membership has changed  var root = document.getElementById('current-panels-root');  var panels = root.childNodes;  var list_unchanged = (panels.length == original_panels.length);  for (var i = 0; i < panels.length && list_unchanged; i++) {    if (original_panels[i] != panels.item(i).getAttribute('id')) {      list_unchanged = false;    }  }  if (list_unchanged) {    window.close();    return;  }  // Iterate through the 'current-panels' tree to collect the panels  // that the user has chosen. We need to do this _before_ we remove  // the panels from the datasource, because the act of removing them  // from the datasource will change the tree!  panels = new Array();  root = document.getElementById('current-panels-root');  for (var node = root.firstChild; node != null; node = node.nextSibling) {    panels[panels.length] = node.getAttribute('id');  }  // Cut off the connection between the dialog and the datasource.  // The dialog is closed at the end of this function.  // Without this, the dialog tries to update as it is being destroyed.  current_panels.setAttribute('ref', 'rdf:null');  // Create a "container" wrapper around the current panels to  // manipulate the RDF:Seq more easily.  var panel_list = sidebarObj.datasource.GetTarget(RDF.GetResource(sidebarObj.resource), RDF.GetResource(NC+"panel-list"), true);  if (panel_list) {    panel_list.QueryInterface(Components.interfaces.nsIRDFResource);  } else {    // Datasource is busted. Start over.    debug("Sidebar datasource is busted\n");  }  var container = Components.classes["@mozilla.org/rdf/container;1"].createInstance();  container = container.QueryInterface(Components.interfaces.nsIRDFContainer);  container.Init(sidebarObj.datasource, panel_list);  // Remove all the current panels from the datasource.  var have_panel_attributes = new Array();  current_panels = container.GetElements();  while (current_panels.hasMoreElements()) {    panel = current_panels.getNext();    id = panel.QueryInterface(Components.interfaces.nsIRDFResource).Value;    if (has_element(panels, id)) {      // This panel will remain in the sidebar.      // Remove the resource, but keep all the other attributes.      // Removing it will allow it to be added in the correct order.      // Saving the attributes will preserve things such as the exclude state.      have_panel_attributes[id] = true;      container.RemoveElement(panel, false);    } else {      // Kiss it goodbye.      delete_resource_deeply(container, panel);    }  }  // Add the new list of panels  for (var ii = 0; ii < panels.length; ++ii) {    var id = panels[ii];    var resource = RDF.GetResource(id);    if (have_panel_attributes[id]) {      container.AppendElement(resource);    } else {      copy_resource_deeply(all_panels.database, resource, container);    }  }  refresh_all_sidebars();  // Write the modified panels out.  sidebarObj.datasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource).Flush();  window.close();}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/e0d74dbab0591d49321454ee7cde5f57910c4047/customize.js/clean/suite/common/sidebar/customize.js