rem: eventList = gCalendarWindow.EventSelection.selectedEvents; break; case 'custom': start = jsDateToDateTime(document.getElementById("start-date-picker").value); end   = jsDateToDateTime(document.getElementById("end-date-picker").value); break ; default : dump("Error : no case in printDialog.js::printCalendar()"); } if (!eventList) {  end = end.clone(); end.day = end.day + 1; end.normalize(); ccalendar.getItems(filter, 0, start, end, listener); } else { settings.eventList = eventList; settings.start = null; settings.end = null; }  var tempTitle = document.getElementById("title-field").value; settings.title = (tempTitle || calGetString("calendar", "Untitled")); settings.layoutCId = document.getElementById("layout-field").value; return settings; } 
add: eventList = theView.getSelectedItems({}); 
context: function getDialogSettings(){    var settings = new Object();    var ccalendar = window.opener.getCompositeCalendar();    var listener = {        mEventArray: new Array(),        onOperationComplete: function (aCalendar, aStatus, aOperationType, aId, aDateTime) {            settings.eventList = listener.mEventArray;            settings.start = start;            settings.end = end;        },        onGetResult: function (aCalendar, aStatus, aItemType, aDetail, aCount, aItems) {            for (var i = 0; i < aCount; i++) {                listener.mEventArray.push(aItems[i]);            }        }    };    var filter = ccalendar.ITEM_FILTER_TYPE_EVENT |                  ccalendar.ITEM_FILTER_CLASS_OCCURRENCES;    var start;    var end;    var eventList;    switch (document.getElementById("view-field").selectedItem.value) {        case 'currentview':        case '': //just in case            var theView = window.opener.currentView();            start = theView.startDay;            end   = theView.endDay;            break;        case 'selected':            eventList = gCalendarWindow.EventSelection.selectedEvents;            break;        case 'custom':            start = jsDateToDateTime(document.getElementById("start-date-picker").value);            end   = jsDateToDateTime(document.getElementById("end-date-picker").value);            break ;        default :            dump("Error : no case in printDialog.js::printCalendar()");    }    if (!eventList) {        // end isn't exclusive, so we need to add one day        end = end.clone();        end.day = end.day + 1;        end.normalize();        ccalendar.getItems(filter, 0, start, end, listener);    } else {        settings.eventList = eventList;        settings.start = null;        settings.end = null;    }    var tempTitle = document.getElementById("title-field").value;    settings.title = (tempTitle || calGetString("calendar", "Untitled"));    settings.layoutCId = document.getElementById("layout-field").value;    return settings;}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/daf762c7fca63c377d255ff7e70b1b7a4b4cb141/printDialog.js/clean/calendar/resources/content/printDialog.js