rem:  var icalWrapper = new SupportsString; var textWrapper = new SupportsString; var htmlWrapper = new SupportsString; 
add: if ( trans && clipboard) {  trans.addDataFlavor("text/calendar"); trans.addDataFlavor("text/unicode"); 
context: function copyToClipboard( calendarEventArray ){     if( !calendarEventArray)   {      calendarEventArray = new Array( 0 );      calendarEventArray = gCalendarWindow.EventSelection.selectedEvents;   }   if(calendarEventArray.length == 0)      alert("No events selected");   var calendarEvent;     var sTextiCalendar = eventArrayToICalString( calendarEventArray );   var sTextiCalendarExport =  eventArrayToICalString( calendarEventArray, true );   var sTextHTML = eventArrayToHTML( calendarEventArray );    // 1. get the clipboard service   var clipboard = getClipboard();   // 2. create the transferable  var trans = new Transferable;   if ( trans && clipboard) {      // 3. register the data flavors      trans.addDataFlavor("text/calendar");      trans.addDataFlavor("text/unicode");      trans.addDataFlavor("text/html");      // 4. create the data objects    var icalWrapper = new SupportsString;    var textWrapper = new SupportsString;    var htmlWrapper = new SupportsString;      if ( icalWrapper && textWrapper && htmlWrapper ) {         // get the data         icalWrapper.data = sTextiCalendar;        // plainTextRepresentation;         textWrapper.data = sTextiCalendarExport;  // plainTextRepresentation;         htmlWrapper.data = sTextHTML;             // htmlRepresentation;         // 5. add data objects to transferable         // Both Outlook 2000 client and Lotus Organizer use text/unicode when pasting iCalendar data         trans.setTransferData ( "text/calendar", icalWrapper, icalWrapper.data.length*2 ); // double byte data         trans.setTransferData ( "text/unicode", textWrapper, textWrapper.data.length*2 );         trans.setTransferData ( "text/html", htmlWrapper, htmlWrapper.data.length*2 );         clipboard.setData( trans, null, Components.interfaces.nsIClipboard.kGlobalClipboard );         return true;               }   }   return true;}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/36244b556ea688a6fb15f55940dfb4f0364417f9/clipboard.js/buggy/calendar/resources/content/clipboard.js