context: function onOKCommand(){   // get values from the form and put them into the event      gEvent.title       = getFieldValue( "title-field" );   gEvent.description = getFieldValue( "description-field" );   gEvent.location    = getFieldValue( "location-field" );      gEvent.allDay      = getFieldValue( "all-day-event-checkbox", "checked" );   var startDate = getDateTimeFieldValue( "start-date-text" );   gEvent.start.year = startDate.getYear()+1900;   gEvent.start.month = startDate.getMonth();   gEvent.start.day = startDate.getDate();      var startTime = getDateTimeFieldValue( "start-time-text" );   gEvent.start.hour = startTime.getHours();   gEvent.start.minute = startTime.getMinutes();      var endDate = getDateTimeFieldValue( "end-date-text" );   //do this because the end date is always the same as the start date.   gEvent.end.year = endDate.getYear()+1900;   gEvent.end.month = endDate.getMonth();   gEvent.end.day = endDate.getDate();   var endTime = getDateTimeFieldValue( "end-time-text" );   gEvent.end.hour = endTime.getHours();   gEvent.end.minute = endTime.getMinutes();      gEvent.privateEvent = getFieldValue( "private-checkbox", "checked" );      if( getFieldValue( "invite-checkbox", "checked" ) )   {      gEvent.inviteEmailAddress = getFieldValue( "invite-email-field", "value" );   }   else   {      gEvent.inviteEmailAddress = "";   }   gEvent.alarm       = getFieldValue( "alarm-checkbox", "checked" );   gEvent.alarmLength = getFieldValue( "alarm-length-field" );   gEvent.alarmUnits  = getFieldValue( "alarm-length-units", "value" );     debug( "!!!-->in ca-event-dialog.js, alarmUnits is "+gEvent.alarmUnits );   if ( getFieldValue( "alarm-email-checkbox", "checked" ) )    {      gEvent.alarmEmailAddress = getFieldValue( "alarm-email-field", "value" );      debug( "!!!-->in ca-event-dialog.js, alarmEmailAddress is "+gEvent.alarmEmailAddress );   }   else   {      gEvent.alarmEmailAddress = "";   }   gEvent.recur         = getFieldValue( "repeat-checkbox", "checked" );   gEvent.recurUnits    = getFieldValue( "repeat-length-units", "value" );     gEvent.recurForever  = getFieldValue( "repeat-forever-radio", "selected" );   gEvent.recurInterval  = getFieldValue( "repeat-length-field" );      if( gEvent.recurInterval == 0 )      gEvent.recur = false;   var recurEndDate = getDateTimeFieldValue( "repeat-end-date-text" );      gEvent.recurEnd.setTime( recurEndDate );   gEvent.recurEnd.hour = gEvent.start.hour;   gEvent.recurEnd.minute = gEvent.start.minute;   if( gEvent.recur == true )   {      //check that the repeat end time is later than the end time      if( recurEndDate.getTime() < gEvent.end.getTime() && gEvent.recurForever == false )      {         alert( neRecurErrorAlertMessage );         return( false );      }      if( gEvent.recurUnits == "weeks" )      {         /*         ** advanced weekly repeating, choosing the days to repeat         */         gEvent.recurWeekdays = getAdvancedWeekRepeat();      }      else if( gEvent.recurUnits == "months" )      {         /*         ** advanced month repeating, either every day or every date         */         if( getFieldValue( "advanced-repeat-dayofweek", "selected" ) == true )         {            gEvent.recurWeekNumber = getWeekNumberOfMonth();         }         else            gEvent.recurWeekNumber = 0;            }   }         // :TODO: REALLY only do this if the alarm or start settings change.?   //if the end time is later than the start time... alert the user using text from the dtd.   if ( gEvent.end.getTime() < gEvent.start.getTime() && !gEvent.allDay )    {      alert( neStartTimeErrorAlertMessage );      return( false );   }   else   {      // call caller's on OK function      gOnOkFunction( gEvent );            // tell standard dialog stuff to close the dialog      return true;   }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/9f41bd5b5fa1946c76b6932d5e6bc9624c05e658/calendarEventDialog.js/clean/calendar/resources/content/calendarEventDialog.js