rem: addEventsToCalendar( calendarEventArray ); } 
add: addEventsToCalendar( calendarEventArray ); return true; } 
context: function loadEventsFromFile(){   const nsIFilePicker = Components.interfaces.nsIFilePicker;      var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);        fp.init(window, "Open", nsIFilePicker.modeOpen);	   // fp.defaultString = "*.ics";   fp.defaultExtension = "ics"      fp.appendFilter( "Calendar Files", "*.ics" );      fp.show();   if (fp.file && fp.file.path.length > 0)    {      var aDataStream = readDataFromFile( fp.file.path );      var calendarEventArray = parseIcalData( aDataStream );      // Show a dialog with option to import events with or without dialogs      var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService();       promptService = promptService.QueryInterface(Components.interfaces.nsIPromptService);       var result = {value:0};             var buttonPressed =            promptService.confirmEx(window,            "Import", "About to import " + calendarEventArray.length + " event(s). Do you want to open all events to import before importing?",            (promptService.BUTTON_TITLE_YES * promptService.BUTTON_POS_0) +            (promptService.BUTTON_TITLE_NO * promptService.BUTTON_POS_1) +            (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_2),             null,null,null,null, result);       if(buttonPressed == 0) // YES      {       addEventsToCalendar( calendarEventArray );   }      else if(buttonPressed == 1) // NO      {         addEventsToCalendar( calendarEventArray, true );      }       else if(buttonPressed == 2) // CANCEL      {          return false;       }    }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/77a8635c150ffa68ee4502b24e7e5f4a44e05894/importExport.js/clean/calendar/resources/content/importExport.js