rem: prepareCalendarToDoUnifinder();  scheduleMidnightUpdate(refreshUIBits); 
add:  for (var i = 0; i < window.arguments.length; i++) { try { var cl = window.arguments[i].QueryInterface(Components.interfaces.nsICommandLine); } catch (ex) { dump("unknown argument passed to main window\n"); continue; } handleCommandLine(cl); } 
context: function calendarInit() {   // set up the CalendarWindow instance      gCalendarWindow = new CalendarWindow();   // Set up the checkbox variables.  Do not use the typical change*() functions   // because those will actually toggle the current value.   if (document.getElementById("toggle_workdays_only").getAttribute("checked")       == 'true') {       var deck = document.getElementById("view-deck")       for each (view in deck.childNodes) {           view.workdaysOnly = true;       }       deck.selectedPanel.goToDay(deck.selectedPanel.selectedDay);   }   // tasksInView is false by default   if (document.getElementById("toggle_tasks_in_view").getAttribute("checked")       == 'true') {       var deck = document.getElementById("view-deck")       for each (view in deck.childNodes) {           view.tasksInView = true;       }       deck.selectedPanel.goToDay(deck.selectedPanel.selectedDay);   }   // showCompleted is false by default   if (document.getElementById("hide-completed-checkbox").checked == false) {       var deck = document.getElementById("view-deck")       for each (view in deck.childNodes) {           view.showCompleted = true;       }       deck.selectedPanel.goToDay(deck.selectedPanel.selectedDay);   }   updateOrientation();   // set up the unifinder   prepareCalendarUnifinder();   prepareCalendarToDoUnifinder();      scheduleMidnightUpdate(refreshUIBits);   loadCalendarManager();   // fire up the alarm service   var alarmSvc = Components.classes["@mozilla.org/calendar/alarm-service;1"]                  .getService(Components.interfaces.calIAlarmService);   alarmSvc.timezone = calendarDefaultTimezone();   alarmSvc.startup();   // a bit of a hack since the menulist doesn't remember the selected value   var value = document.getElementById( 'event-filter-menulist' ).value;   document.getElementById( 'event-filter-menulist' ).selectedItem =        document.getElementById( 'event-filter-'+value );   var toolbox = document.getElementById("calendar-toolbox");   toolbox.customizeDone = CalendarToolboxCustomizeDone;   getViewDeck().addEventListener("dayselect", observeViewDaySelect, false);   getViewDeck().addEventListener("itemselect", onSelectionChanged, true);   // Setup undo/redo menu for additional main windows   updateUndoRedoMenu();   // Handle commandline args   for (var i=0; i < window.arguments.length; i++) {       try {           var cl = window.arguments[i].QueryInterface(Components.interfaces.nsICommandLine);       } catch(ex) {           dump("unknown argument passed to main window\n");           continue;       }       handleCommandLine(cl);   }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/9421/adf8def97c78eca43decf76e12f684786f6bea7d/calendar.js/buggy/calendar/resources/content/calendar.js