Fixing problem with not importing tasks.

This commit is contained in:
mikep%oeone.com 2002-08-26 15:20:27 +00:00
Родитель 15f1fe7b58
Коммит 5b5e4ef57f
2 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -137,7 +137,7 @@ function cutToClipboard( /* calendarEventArray */)
function copyToClipboard( calendarEventArray ) function copyToClipboard( calendarEventArray )
{ {
if( !calendarEventArray) if( !calendarEventArray)
calendarEventArray = gCalendarWindow.EventSelection.selectedEvents; var calendarEventArray = gCalendarWindow.EventSelection.selectedEvents;
if(calendarEventArray.length == 0) if(calendarEventArray.length == 0)
alert("No events selected"); alert("No events selected");
@ -182,7 +182,6 @@ function copyToClipboard( calendarEventArray )
return true; return true;
} }
} }
return false;
} }
@ -219,9 +218,9 @@ function pasteFromClipboard()
trans.getAnyTransferData(flavour, data, length); trans.getAnyTransferData(flavour, data, length);
data = data.value.QueryInterface(Components.interfaces.nsISupportsWString).data; data = data.value.QueryInterface(Components.interfaces.nsISupportsWString).data;
//DEBUG alert("clipboard type: " + flavour.value); //DEBUG alert("clipboard type: " + flavour.value);
var calendarEventArray;
switch (flavour.value) { switch (flavour.value) {
case "text/calendar": case "text/calendar":
var calendarEventArray;
calendarEventArray = parseIcalData( data ); calendarEventArray = parseIcalData( data );
//change the date of all the events to now //change the date of all the events to now
@ -238,7 +237,7 @@ function pasteFromClipboard()
addEventsToCalendar( calendarEventArray ); addEventsToCalendar( calendarEventArray );
break; break;
case "text/unicode": case "text/unicode":
if ( data.indexOf("BEGIN:VCALENDAR") == -1 ) if ( data.indexOf("BEGIN:VEVENT") == -1 )
{ {
// no iCalendar data, paste clipboard text into description of new event // no iCalendar data, paste clipboard text into description of new event
calendarEvent = createEvent(); calendarEvent = createEvent();
@ -248,6 +247,7 @@ function pasteFromClipboard()
} }
else else
{ {
var calendarEventArray;
calendarEventArray = parseIcalData( data ); calendarEventArray = parseIcalData( data );
//change the date of all the events to now //change the date of all the events to now
var startDate = gCalendarWindow.currentView.getNewEventDate(); var startDate = gCalendarWindow.currentView.getNewEventDate();

Просмотреть файл

@ -137,7 +137,7 @@ function cutToClipboard( /* calendarEventArray */)
function copyToClipboard( calendarEventArray ) function copyToClipboard( calendarEventArray )
{ {
if( !calendarEventArray) if( !calendarEventArray)
calendarEventArray = gCalendarWindow.EventSelection.selectedEvents; var calendarEventArray = gCalendarWindow.EventSelection.selectedEvents;
if(calendarEventArray.length == 0) if(calendarEventArray.length == 0)
alert("No events selected"); alert("No events selected");
@ -182,7 +182,6 @@ function copyToClipboard( calendarEventArray )
return true; return true;
} }
} }
return false;
} }
@ -219,9 +218,9 @@ function pasteFromClipboard()
trans.getAnyTransferData(flavour, data, length); trans.getAnyTransferData(flavour, data, length);
data = data.value.QueryInterface(Components.interfaces.nsISupportsWString).data; data = data.value.QueryInterface(Components.interfaces.nsISupportsWString).data;
//DEBUG alert("clipboard type: " + flavour.value); //DEBUG alert("clipboard type: " + flavour.value);
var calendarEventArray;
switch (flavour.value) { switch (flavour.value) {
case "text/calendar": case "text/calendar":
var calendarEventArray;
calendarEventArray = parseIcalData( data ); calendarEventArray = parseIcalData( data );
//change the date of all the events to now //change the date of all the events to now
@ -238,7 +237,7 @@ function pasteFromClipboard()
addEventsToCalendar( calendarEventArray ); addEventsToCalendar( calendarEventArray );
break; break;
case "text/unicode": case "text/unicode":
if ( data.indexOf("BEGIN:VCALENDAR") == -1 ) if ( data.indexOf("BEGIN:VEVENT") == -1 )
{ {
// no iCalendar data, paste clipboard text into description of new event // no iCalendar data, paste clipboard text into description of new event
calendarEvent = createEvent(); calendarEvent = createEvent();
@ -248,6 +247,7 @@ function pasteFromClipboard()
} }
else else
{ {
var calendarEventArray;
calendarEventArray = parseIcalData( data ); calendarEventArray = parseIcalData( data );
//change the date of all the events to now //change the date of all the events to now
var startDate = gCalendarWindow.currentView.getNewEventDate(); var startDate = gCalendarWindow.currentView.getNewEventDate();