aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-08-12 09:15:32 -0400
committerB. Stack <bgstack15@gmail.com>2022-08-12 09:15:32 -0400
commit13d9e82d5533f53f8158dc3ca7f0426518982df8 (patch)
tree67a3894a0065f71d289f4de770febfb763e25da5
parenthide upload button when editing existing event (diff)
downloadradicaleinfcloud-13d9e82d5533f53f8158dc3ca7f0426518982df8.tar.gz
radicaleinfcloud-13d9e82d5533f53f8158dc3ca7f0426518982df8.tar.bz2
radicaleinfcloud-13d9e82d5533f53f8158dc3ca7f0426518982df8.zip
fully fix the import-event function!
-rw-r--r--radicale_infcloud/web/data_process.js9
-rw-r--r--radicale_infcloud/web/forms.js12
2 files changed, 7 insertions, 14 deletions
diff --git a/radicale_infcloud/web/data_process.js b/radicale_infcloud/web/data_process.js
index fb03b2c..d562927 100644
--- a/radicale_infcloud/web/data_process.js
+++ b/radicale_infcloud/web/data_process.js
@@ -2549,6 +2549,9 @@ 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)
@@ -8546,7 +8549,8 @@ function stringToVevent(inputCollection, vstring, uid, etag, isNew)
{
repeatCount++;
var tmpObj=new items(etag, start, end, title, all, uid, rid, evid, note, inputCollection.displayValue, alertTime, alertNote, realUntilDate, frequency, interval, realUntil, repeatStart, repeatEnd, byMonthDay,repeatCount, realRepeatCount, vcalendar, location, alertTimeOut,tzName, realStart, realEnd, byDay, rec_id,wkst,classType, avail,hrefUrl, compareString,priority,status,ruleString);
- globalEventList.displayEventsArray[rid].splice(globalEventList.displayEventsArray[rid].length, 0, tmpObj);
+ // stackrpms,2 Disable this next line because it makes an uneditable, duplicate visible entry on the current calendar.
+ //globalEventList.displayEventsArray[rid].splice(globalEventList.displayEventsArray[rid].length, 0, tmpObj);
}
}
@@ -8573,7 +8577,8 @@ function stringToVevent(inputCollection, vstring, uid, etag, isNew)
if(needReload)
showEventForm(null, null, tmpObj, globalJsEvent, 'show', '');
}
- globalEventList.displayEventsArray[rid].splice(globalEventList.displayEventsArray[rid].length, 0, tmpObj);
+ // stackrpms,2 Disable this next line because it makes an uneditable, duplicate visible entry on the current calendar.
+ //globalEventList.displayEventsArray[rid].splice(globalEventList.displayEventsArray[rid].length, 0, tmpObj);
}
}
}
diff --git a/radicale_infcloud/web/forms.js b/radicale_infcloud/web/forms.js
index e8155e9..441f0d6 100644
--- a/radicale_infcloud/web/forms.js
+++ b/radicale_infcloud/web/forms.js
@@ -57,18 +57,6 @@ function dropHandler(event) {
if(window.console){console.log(reader.result)};
//dataToVcalendar('EDIT'
var calEvent = uploadFile(reader.result);
- // This lets it appear right away, but it is still not clickable.
- console.log(`Using ${newEvent.id} as uid`);
- $('#uid').val(calEvent.id);
- $('#etag').val(calEvent.etag);
- refetchCalendarEvents();
- {
- var beforeScroll = $('#main').width()-$('#calendar').width();
- $('#calendar').fullCalendar('unselect');
- $('#calendar').fullCalendar('removeEvents', 'fooUID');
- var afterScroll = $('#main').width()-$('#calendar').width();
- rerenderCalendar();
- }
};
reader.onerror = function(){if(window.console){console.log(reader.error)}};
}
bgstack15