context:   onDragStart: function (aEvent, aXferData, aDragAction){    //Clear any dragged over events left from last drag selection.    var liveList = document.getElementsByAttribute( "draggedover", "true" );    // Delete in reverse order.  Moz1.8+ getElementsByAttribute list is    // 'live', so when attribute is deleted the indexes of later elements    // change, but Moz1.7- is not.  Reversed order works with both.    for (var i = liveList.length - 1; i >= 0; i--) {      liveList.item(i).removeAttribute( "draggedover" );    }    // select clicked object, Mozilla doesn't do this.    calendarViewClick( aEvent );    // aEvent.currentTarget;    if( aEvent.target.localName == "splitter" || aEvent.target.localName == "menu")      throw Components.results.NS_OK; // not a draggable item    var eventIsDragged ;    var currentTargetFirstClassName = aEvent.currentTarget.className.split(" ")[0];    switch (currentTargetFirstClassName) {      case "day-view-event-class" :        eventIsDragged = true ;        this.startDragDayIndex = 0 ;        break;      case "week-view-event-class" :        eventIsDragged = true ;        this.startDragDayIndex = aEvent.currentTarget.getAttribute( "dayindex" );        break;      default :        eventIsDragged = false ;    }    if(eventIsDragged == true) {      // We are going to drag an event      var dragEvents = gCalendarWindow.EventSelection.selectedEvents;      aXferData.data= new TransferData();      aXferData.data.addDataForFlavour("text/calendar", eventArrayToICalString( dragEvents ) );      aXferData.data.addDataForFlavour("text/unicode", eventArrayToICalString( dragEvents, true ) );      //if (aEvent.ctrlKey)      //  action.action = nsIDragService.DRAGDROP_ACTION_COPY ;      aEvent.preventBubble();    } else {      // Dragging on the calendar canvas to select an event period      // var newDate = gHeaderDateItemArray[dayIndex].getAttribute( "date" );      // var gStartDate = new Date( gCalendarWindow.getSelectedDate() );      // The date the drap action initiated on.      var gStartDate;      this.startDateIndex = aEvent.target.getAttribute( "day" );      // In the week view, the drag can start on a date different from the currently      // selected one. However, in the day view, the event target does not have a 'day'      // attribute.      if( gCalendarWindow.currentView == gCalendarWindow.weekView ) {        //Week view.        gStartDate = new Date ( gHeaderDateItemArray[this.startDateIndex].getAttribute( "date" ));      } else {        //Day view.        gStartDate = new Date ( gCalendarWindow.getSelectedDate() );      }      gStartDate.setHours( aEvent.target.getAttribute( "hour" ) );      gStartDate.setMinutes( 0 );      gStartDate.setSeconds( 0 );      aXferData.data=new TransferData();      aXferData.data.addDataForFlavour("text/calendar-interval", gStartDate.getTime() );      // aDragAction.action = nsIDragService.DRAGDROP_ACTION_MOVE;      aEvent.preventBubble();    }  },
meta: 5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5459/4965c3640b905bb308876d5db5244c2a32e74b64/dragDrop.js/buggy/calendar/resources/content/dragDrop.js