rem: if( ThisCalendarObject.getAttribute( "http: { CalendarManager.addCalendar( ThisCalendarObject ); }  refreshEventTree( getAndSetEventTable() );  refreshToDoTree( false );  CalendarManager.CalendarWindow.currentView.refreshEvents();  
add: CalendarManager.removeCalendar( ThisCalendarObject );  if( ThisCalendarObject.getAttribute( "http: { CalendarManager.addCalendar( ThisCalendarObject ); }  refreshEventTree( getAndSetEventTable() );  refreshToDoTree( false );  CalendarManager.CalendarWindow.currentView.refreshEvents();  
context: calendarManager.prototype.retrieveAndSaveRemoteCalendar = function calMan_retrieveAndSaveRemoteCalendar( ThisCalendarObject, onResponseExtra ){   //the image doesn't always exist. If it doesn't exist, it causes problems, so check for it here   document.getElementById( ThisCalendarObject.getSubject() ).childNodes[1].childNodes[0].setAttribute( "synching", "true" );   var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);      var Path;   if( ThisCalendarObject.getAttribute( "http://home.netscape.com/NC-rdf#username" ) != "" ||       ThisCalendarObject.getAttribute( "http://home.netscape.com/NC-rdf#password" ) != "" )   {      var RemotePath = ThisCalendarObject.getAttribute( "http://home.netscape.com/NC-rdf#remotePath" );      var Protocol;      if( RemotePath.indexOf( "http://" ) != -1 )      {         Protocol = "http://";         RemotePath = RemotePath.substr( 7 );      }      if( RemotePath.indexOf( "https://" ) != -1 )      {         Protocol = "https://";         RemotePath = RemotePath.substr( 8 );      }      if( RemotePath.indexOf( "ftp://" ) != -1 )      {         Protocol = "ftp://";         RemotePath = RemotePath.substr( 6 );      }            Path = Protocol+ThisCalendarObject.getAttribute( "http://home.netscape.com/NC-rdf#username" )+":"+ThisCalendarObject.getAttribute( "http://home.netscape.com/NC-rdf#password" )+"@"+RemotePath;   }   else      Path = ThisCalendarObject.getAttribute( "http://home.netscape.com/NC-rdf#remotePath" );   var Channel = ioService.newChannel( Path, null, null );   var CalendarManager = this;      var onResponse = function( CalendarData )   {      //save the stream to a file.      saveDataToFile( ThisCalendarObject.getAttribute( "http://home.netscape.com/NC-rdf#path" ), CalendarData, "UTF-8" );            if( onResponseExtra )         onResponseExtra();      //else      //{         CalendarManager.removeCalendar( ThisCalendarObject );               if( ThisCalendarObject.getAttribute( "http://home.netscape.com/NC-rdf#active" ) == "true" )         {            CalendarManager.addCalendar( ThisCalendarObject );         }                  refreshEventTree( getAndSetEventTable() );                  refreshToDoTree( false );                  CalendarManager.CalendarWindow.currentView.refreshEvents();      //}      document.getElementById( ThisCalendarObject.getSubject() ).childNodes[1].childNodes[0].removeAttribute( "synching" );   }   var CalendarData = this.getRemoteCalendarText( Channel, onResponse, null );}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/d31b4f3cf149677fb636f1f69391b8e89fee5202/calendarManager.js/buggy/calendar/resources/content/calendarManager.js