rem:   var tree = document.getElementById( ToDoUnifinderTreeName ); var start = new Object(); var end = new Object(); var numRanges = tree.view.selection.getRangeCount();   var t; var v; var toDoItem; if( numRanges == 1 ) { for (t=numRanges-1; t>=0; t--){ tree.view.selection.getRangeAt(t,start,end); for (v=end.value; v>=start.value; v--){ toDoItem = tree.taskView.getCalendarTaskAtRow( v ); refreshRemoteCalendarAndRunFunction( toDoItem.id, toDoItem.parent.server, "deleteTodo" ); } } } else { gICalLib.batchMode = true;  for (t=numRanges; t>=0; t--){ tree.view.selection.getRangeAt(t,start,end); for (v=end.value; v>=start.value; v--){ toDoItem = tree.taskView.getCalendarTaskAtRow( v ); var todoId = toDoItem.id gICalLib.deleteTodo( todoId ); } } gICalLib.batchMode = false; }  tree.view.selection.clearSelection(); 
add: var SelectedItems = new Array(); var tree = document.getElementById( ToDoUnifinderTreeName ); var start = new Object(); var end = new Object(); var numRanges = tree.view.selection.getRangeCount(); var t; var v; if( numRanges == 1 ) { for (t=numRanges-1; t>= 0; t--) { tree.view.selection.getRangeAt(t, start, end); for (v=end.value; v>=start.value; v--){ var toDoItem = tree.taskView.getCalendarTaskAtRow( v ); SelectedItems.push(toDoItem); } } } else { for (t=numRanges; t >= 0; t--) { tree.view.selection.getRangeAt(t,start,end); for (v=end.value; v >= start.value; v--){ var toDoItem=tree.taskView.getCalendarTaskAtRow( v ); SelectedItems.push(toDoItem); } } } deleteItems( SelectedItems, DoNotConfirm ); tree.view.selection.clearSelection(); 
context: function deleteToDoCommand( DoNotConfirm ){   // TODO Implement Confirm    var tree = document.getElementById( ToDoUnifinderTreeName );    var start = new Object();    var end = new Object();    var numRanges = tree.view.selection.getRangeCount();    // delete in reverse order so indexes of remaining selected tasks stay same    var t;    var v;    var toDoItem;    if( numRanges == 1 ) {        for (t=numRanges-1; t>=0; t--){            tree.view.selection.getRangeAt(t,start,end);            for (v=end.value; v>=start.value; v--){                toDoItem = tree.taskView.getCalendarTaskAtRow( v );                refreshRemoteCalendarAndRunFunction( toDoItem.id, toDoItem.parent.server, "deleteTodo" );            }        }    } else {        gICalLib.batchMode = true;        for (t=numRanges; t>=0; t--){            tree.view.selection.getRangeAt(t,start,end);            for (v=end.value; v>=start.value; v--){                toDoItem = tree.taskView.getCalendarTaskAtRow( v );                var todoId = toDoItem.id                gICalLib.deleteTodo( todoId );               }        }        gICalLib.batchMode = false;    }    // all selected tasks deleted, now clear selection    tree.view.selection.clearSelection();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/d1547f1bc4b4ca00d034a2f99d0fda7436932254/calendar.js/clean/calendar/resources/content/calendar.js