From c0d9b3a037bc7574f9d8a81a273e74223a85f6f9 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Fri, 12 Aug 2022 10:11:29 -0400 Subject: move line-endings fix to forms.js By moving the line-endings fix to this one source location of fileContents, we avoid having to modify multiple places where the input is parsed. --- radicale_infcloud/web/data_process.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'radicale_infcloud/web/data_process.js') diff --git a/radicale_infcloud/web/data_process.js b/radicale_infcloud/web/data_process.js index 0e0df93..7f866ed 100644 --- a/radicale_infcloud/web/data_process.js +++ b/radicale_infcloud/web/data_process.js @@ -761,9 +761,7 @@ function getvCalendarstart(inputEvent) { var vcalendar_element='', itsOK=false; - // stackrpms,3 Handle not-to-spec upload of .ics file - // By adjusting line endings, this function can process the fileContents and make it visible on the current view. - var vEvent=inputEvent.vcalendar.replace(/\r*\n+/gm,'\r\n'); + var vEvent=inputEvent.vcalendar; if(vEvent.match(vCalendar.pre['vcalendar'])) { vcalendar_element=vEvent.match(vCalendar.pre['beginVTODO']); @@ -2551,9 +2549,6 @@ function fullVcalendarToData(inputEvent) if(!vcalendar) return false; - // stackrpms,3 Handle not-to-spec upload of .ics file - // By adjusting the line endings, we can now immediately edit newly-imported events. - vcalendar = vcalendar.replace(/\r*\n+/gm,'\r\n'); var vcalendar_full=vcalendar.split('\r\n'); if((parsed=('\r\n'+vcalendar_full[0]+'\r\n').match(vCalendar.pre['contentline_parse']))==null) @@ -3539,9 +3534,6 @@ function getDateFromDay(objComponent, t, disableRecursion,uid) vcalendar=vcalendar.replace(vcalendar_element[0],''); */ var recurrence_id_array=new Array(); - // stackrpms,3 Handle not-to-spec upload of .ics file - // By adjusting line endings, this function can process the fileContents and make it visible on the current view. - vcalendarOrig = vcalendarOrig.replace(/\r*\n+/gm,'\r\n'); while(vcalendarOrig.match(vCalendar.pre['vevent'])!=null) { if(vcalendarOrig.substring(vcalendarOrig.indexOf('BEGIN:VEVENT')-2, vcalendarOrig.indexOf('BEGIN:VEVENT'))=='\r\n') @@ -7888,7 +7880,6 @@ function stringToVevent(inputCollection, vstring, uid, etag, isNew) var recurrence_id_array=new Array(); /* matching for BEGIN:VEVENT */ - vcalendarOrig = vcalendarOrig.replace(/\r*\n+/gm,'\r\n'); while(vcalendarOrig.match(vCalendar.pre['vevent'])!=null) { if(vcalendarOrig.substring(vcalendarOrig.indexOf('BEGIN:VEVENT')-2, vcalendarOrig.indexOf('BEGIN:VEVENT'))=='\r\n') -- cgit