rem:  fp.defaultString = "Mozilla Calendar events"; 
add:  if(calendarEventArray.length == 1 && calendarEventArray[0].title) fp.defaultString = calendarEventArray[0].title; else fp.defaultString = "Mozilla Calendar events";  
context: function saveEventsToFile( calendarEventArray ){   if( !calendarEventArray)      var calendarEventArray = gCalendarWindow.EventSelection.selectedEvents;   if (calendarEventArray.length == 0)   {      alert("No events selected to save");      return;   }   // No show the 'Save As' dialog and ask for a filename to save to   const nsIFilePicker = Components.interfaces.nsIFilePicker;      var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);      // caller can force disable of sand box, even if ON globally      fp.init(window, "Save As", nsIFilePicker.modeSave);	   fp.defaultString = "Mozilla Calendar events";   fp.defaultExtension = "ics";   fp.appendFilter( "Calendar Files", "*.ics" );   fp.appendFilter( "Rich Text Format (RTF)", "*.rtf" );   fp.appendFilters(nsIFilePicker.filterHTML);      fp.show();   // Now find out as what to save, convert the events and save to file.   if (fp.file && fp.file.path.length > 0)    {      var aDataStream;      switch (fp.filterIndex) {      case 0 : // ics         aDataStream = eventArrayToICalString( calendarEventArray, true );         break;      case 1 : // rtf         aDataStream = eventArrayToRTF( calendarEventArray );         break;      case 2 : // html         aDataStream = eventArrayToHTML( calendarEventArray );         break;      }      saveDataToFile(fp.file.path, aDataStream);   }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/77a8635c150ffa68ee4502b24e7e5f4a44e05894/importExport.js/clean/calendar/resources/content/importExport.js