rem: editNewToDo(calendarToDo, calendar); 
add: createTodoWithDialog(calendar, null, null, calendarToDo); 
context: function newToDo ( startDate, dueDate ) {    var calendarToDo = createToDo();       // created todo has no start or due date unless user wants one    if (startDate)         calendarToDo.entryDate = jsDateToDateTime(startDate);    if (dueDate)        calendarToDo.dueDate = jsDateToDateTime(startDate);   var prefService = Components.classes["@mozilla.org/preferences-service;1"]                               .getService(Components.interfaces.nsIPrefService);   var alarmsBranch = prefService.getBranch("calendar.alarms.");   if (alarmsBranch.getIntPref("onfortodos") == 1) {       // alarmTime doesn't matter, it just can't be null       calendarToDo.alarmTime = createDateTime();       // You can't have an alarm if the entryDate doesn't exist.       if (!calendarToDo.entryDate)           calendarToDo.entryDate = jsDateToDateTime(                                    gCalendarWindow.currentView.getNewEventDate());       calendarToDo.setProperty("alarmUnits", alarmsBranch.getCharPref("todoalarmunit"));       calendarToDo.setProperty("alarmLength", alarmsBranch.getIntPref("todoalarmlen"));       calendarToDo.setProperty("alarmRelation", "START");   }    var calendar = getSelectedCalendarOrNull();        editNewToDo(calendarToDo, calendar);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/edb75cb3aa7fe2a0098e7d7a97a91ce5dd7f6556/calendar.js/buggy/calendar/resources/content/calendar.js