context: function MonthView( calendarWindow ){   // call the super constructor      this.superConstructor( calendarWindow );      this.numberOfEventsToShow = false;   var monthViewEventSelectionObserver =    {      onSelectionChanged : function( EventSelectionArray )      {                  dump( "\nIn Month view, on selection changed");         if( EventSelectionArray.length > 0 )         {            //if there are selected events.                        //for some reason, this function causes the tree to go into a select / unselect loop            //putting it in a settimeout fixes this.            setTimeout( "gCalendarWindow.monthView.clearSelectedDate();", 1 );            gCalendarWindow.monthView.clearSelectedBoxes();                        //dump( "\nIn Month view, eventSelectionArray.length is "+EventSelectionArray.length );            var i = 0;                        for( i = 0; i < EventSelectionArray.length; i++ )            {               //dump( "\nin Month view, going to try and get the event boxes with name 'month-view-event-box-"+EventSelectionArray[i].id+"'" );               var EventBoxes = document.getElementsByAttribute( "name", "month-view-event-box-"+EventSelectionArray[i].id );               //dump( "\nIn Month view, found "+EventBoxes.length+" matches for the selected event." );               for ( j = 0; j < EventBoxes.length; j++ )                {                  EventBoxes[j].setAttribute( "eventselected", "true" );               }            }            //dump( "\nAll Done in Selection for Month View" );         }         else         {            //select the proper day            gCalendarWindow.monthView.hiliteSelectedDate();         }      }   }         calendarWindow.EventSelection.addObserver( monthViewEventSelectionObserver );      this.showingLastDay = false;     // set up month day box's and day number text items, see notes above      this.dayNumberItemArray = new Array();   this.dayBoxItemArray = new Array();   this.weekNumberItemArray = new Array();   this.kungFooDeathGripOnEventBoxes = new Array();   this.firstDateOfView = new Date();   this.lastDateOfView = new Date();   var dayItemIndex = 0;      for( var weekIndex = 1; weekIndex <= 6; ++weekIndex )   {     var weekNumberItem = document.getElementById( "month-week-" + weekIndex + "-left" );     this.weekNumberItemArray[ weekIndex ] = weekNumberItem;      for( var dayIndex = 1; dayIndex <= 7; ++dayIndex )      {         // add the day text item to an array[0..41]                  var dayNumberItem = document.getElementById( "month-week-" + weekIndex + "-day-" + dayIndex );         this.dayNumberItemArray[ dayItemIndex ] = dayNumberItem;                  // add the day box to an array[0..41]                  var dayBoxItem = document.getElementById( "month-week-" + weekIndex + "-day-" + dayIndex + "-box" );         this.dayBoxItemArray[ dayItemIndex ] = dayBoxItem;                  // set on click of day boxes                  dayBoxItem.setAttribute( "onclick", "gCalendarWindow.monthView.clickDay( event )" );         dayBoxItem.setAttribute( "oncontextmenu", "gCalendarWindow.monthView.contextClickDay( event )" );         //set the drop         dayBoxItem.setAttribute( "ondragdrop", "nsDragAndDrop.drop(event,monthViewEventDragAndDropObserver)" );         dayBoxItem.setAttribute( "ondragover", "nsDragAndDrop.dragOver(event,monthViewEventDragAndDropObserver)" );                  //set the double click of day boxes         dayBoxItem.setAttribute( "ondblclick", "gCalendarWindow.monthView.doubleClickDay( event )" );         // array index                  ++dayItemIndex;      }   }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/e6f91f1650b73e77526d064b4667bd2de11a3c76/monthView.js/buggy/calendar/resources/content/monthView.js