rem: if (o.displayDirectory) 
add: if (o.displayDirectory) { 
context: function onLoad() {  dirHistory = new Array();  directoryTree = document.getElementById("directoryTree");  textInput = document.getElementById("textInput");  okButton = document.getElementById("ok");  if (window.arguments) {    var o = window.arguments[0];    retvals = o.retvals; /* set this to a global var so we can set return values */    const title = o.title;    filePickerMode = o.mode;    if (o.displayDirectory)      const directory = o.displayDirectory.path;    const initialText = o.defaultString;    const filterTitles = o.filters.titles;    const filterTypes = o.filters.types;    const numFilters = filterTitles.length;    window.title = title;    if (initialText) {      textInput.value = initialText;    }  }  if ((filePickerMode == nsIFilePicker.modeOpen) ||      (filePickerMode == nsIFilePicker.modeSave)) {    currentFilter = filterTypes[0];    applyFilter();    /* build filter popup */    var filterPopup = document.createElement("menupopup");    for (var i = 0; i < numFilters; i++) {      var menuItem = document.createElement("menuitem");      menuItem.setAttribute("value", filterTitles[i] + " (" + filterTypes[i] + ")");      menuItem.setAttribute("filters", filterTypes[i]);      filterPopup.appendChild(menuItem);    }    var filterMenuList = document.getElementById("filterMenuList");    filterMenuList.appendChild(filterPopup);    var filterBox = document.getElementById("filterBox");    filterBox.removeAttribute("hidden");  } else if (filePickerMode == nsIFilePicker.modeGetFolder) {     // This applies a special filter to only show directories     applyDirectoryFilter();  }  try {    var buttonLabel;    switch (filePickerMode) {      case nsIFilePicker.modeOpen:        buttonLabel = bundle.GetStringFromName("openButtonLabel");        break;      case nsIFilePicker.modeSave:        buttonLabel = bundle.GetStringFromName("saveButtonLabel");        break;      case nsIFilePicker.modeGetFolder:        buttonLabel = bundle.GetStringFromName("selectFolderButtonLabel");        break;    }    if (buttonLabel) {      okButton.setAttribute("value", buttonLabel);    }  } catch (exception) {    // keep it set to "OK"  }  // setup the dialogOverlay.xul button handlers  doSetOKCancel(onOK, onCancel);  // get the home dir  var dirServiceProvider = Components.classes[nsIDirectoryServiceProvider_CONTRACTID].getService().QueryInterface(nsIDirectoryServiceProvider);  var persistent = new Object();  homeDir = dirServiceProvider.getFile("Home", persistent);  if (directory)    sfile.initWithPath(directory);  if (!directory || !(sfile.exists() && sfile.isDirectory())) {    // Start in the user's home directory    sfile.initWithPath(homeDir.path);  }  retvals.buttonStatus = nsIFilePicker.returnCancel;  gotoDirectory(sfile);  doEnabling();  textInput.focus();}
meta: 5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5459/b2362555bacaf42a85a6ab536d4c4c321970d31e/filepicker.js/buggy/xpfe/components/filepicker/res/content/filepicker.js