rem:  calendarWindow.currentView.refreshEvents( ); 
context: function CalendarWindow( calendarDataSource ){   this.eventSource = calendarDataSource;      this.EventSelection = new CalendarEventSelection( this );   this.dateFormater = new DateFormater();      this.monthView = new MonthView( this );   this.weekView = new WeekView( this );   this.dayView = new DayView( this );      // we keep track of the selected date and the selected   // event, start with selecting today.      this.selectedEvent = null;   this.selectedDate = new Date();      // set up the current view - we assume that this.currentView is NEVER null   // after this      this.currentView = null;      this.switchToMonthView();      // now that all is set up we can start to observe the data source      // make the observer, the calendarEventDataSource calls into the   // observer when things change in the data source.      var calendarWindow = this;      this.calendarEventDataSourceObserver =   {            onLoad   : function()      {         // called when the data source has finished loading                  calendarWindow.currentView.refreshEvents( );      },      onStartBatch   : function()      {      },      onEndBatch   : function()      {         calendarWindow.currentView.refreshEvents( );      },            onAddItem : function( calendarEvent )      {         if( !gICalLib.batchMode )         {             if( calendarEvent )             {                calendarWindow.setSelectedEvent( calendarEvent );                                calendarWindow.currentView.refreshEvents( );             }         }      },         onModifyItem : function( calendarEvent, originalEvent )      {        if( !gICalLib.batchMode )        {             if( calendarEvent )             {                calendarWindow.setSelectedEvent( calendarEvent );                             }             calendarWindow.currentView.refreshEvents( );        }      },         onDeleteItem : function( calendarEvent, nextEvent )      {        calendarWindow.clearSelectedEvent( calendarEvent );                if( !gICalLib.batchMode )        {            if ( nextEvent )             {                calendarWindow.setSelectedEvent( nextEvent );            }            else            {                var eventStartDate = new Date( calendarEvent.start.getTime() );                calendarWindow.setSelectedDate( eventStartDate );                                if( calendarWindow.currentView == calendarWindow.monthView )                {                   calendarWindow.currentView.hiliteSelectedDate( );                }            }            calendarWindow.currentView.refreshEvents( );        }      },      onAlarm : function( calendarEvent )      {            }   };      // add the observer to the event source      gICalLib.addObserver( this.calendarEventDataSourceObserver );}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/92effc626bc214a7e810f31617fe9f8c71072239/calendar.js/buggy/calendar/resources/content/calendar.js