diff options
author | B. Stack <bgstack15@gmail.com> | 2022-08-11 10:19:17 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-08-11 10:19:17 -0400 |
commit | 193d811cb3c9fd317b10e910b06d4e4533021cee (patch) | |
tree | cc5600b2f324053b8a1a541a755f17aa8685e31a /radicale_infcloud/web | |
parent | WIP: add upload functionality, part 1 (diff) | |
download | radicaleinfcloud-193d811cb3c9fd317b10e910b06d4e4533021cee.tar.gz radicaleinfcloud-193d811cb3c9fd317b10e910b06d4e4533021cee.tar.bz2 radicaleinfcloud-193d811cb3c9fd317b10e910b06d4e4533021cee.zip |
WIP: uploaded event is visible but not clickable
The new event now populates in the visual calendar, but the user
cannot edit/view the details. The etag is not returned, which I think
is the last piece.
Diffstat (limited to 'radicale_infcloud/web')
-rw-r--r-- | radicale_infcloud/web/forms.js | 14 | ||||
-rw-r--r-- | radicale_infcloud/web/interface.js | 21 |
2 files changed, 27 insertions, 8 deletions
diff --git a/radicale_infcloud/web/forms.js b/radicale_infcloud/web/forms.js index 4e5a1a9..4fd8d6b 100644 --- a/radicale_infcloud/web/forms.js +++ b/radicale_infcloud/web/forms.js @@ -56,7 +56,19 @@ function dropHandler(event) { reader.onload = function(){ if(window.console){console.log(reader.result)}; //dataToVcalendar('EDIT' - uploadFile(reader.result) + 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(beforeScroll!=afterScroll); + } }; reader.onerror = function(){if(window.console){console.log(reader.error)}}; } diff --git a/radicale_infcloud/web/interface.js b/radicale_infcloud/web/interface.js index 745d58d..da298a6 100644 --- a/radicale_infcloud/web/interface.js +++ b/radicale_infcloud/web/interface.js @@ -1312,21 +1312,28 @@ function uploadFile(fileContents) var newUID=globalEventList.getNewUID(); //process_elem=process_elem.replace('##:::##uid##:::##', newUID); fileContents = fileContents.replace(/^UID:.*$/gm,String("UID:"+newUID)); - // WORKHERE: Could also try adding inputUID+newUID. Not sure if it helps or hurts. + // FINDTHIS: Could also try adding inputUID+newUID. Not sure if it helps or hurts. newEvent = stringToVevent(coll, fileContents, inputUID, $('#etag').val(), true); console.log(newEvent); - console.log("All day:"); - console.log(newEvent.allDay); - console.log(newEvent.allDay); // This was an attempt to populate the form. I found it easier to just send the object to the caldav server right away. // ref: interface.js:2601 //showEventForm(null, newEvent.allDay, newEvent, null, 'show', ''); // Just call the caldav operation directly. //putVcalendarToCollection(accountUID, inputUID, inputEtag, inputS, delUID, 'vevent', isFormHidden, deleteMode, fixedArr); // putVcalendarToCollection("http://domainjoin@d2-03a/radicale/domainjoin", "http://domainjoin@d2-03a/radicale/domainjoin/4f58b6a8-014f-03b9-ae12-071eb28798de/", "", fileContents, "", 'vevent', undefined, undefined, - return putVcalendarToCollection(coll.accountUID, inputUID, "", fileContents, "", 'vevent', false, false, ""); - // WORKHERE: somehow add this to the globalEventList thing, like adding a brand-new event by hand? -} + // WORKHERE: The new object does appear in the current view, but is not clickable! The user has to re-login to view/edit details. + // Perhaps somehow add this to the globalEventList thing, like adding a brand-new event by hand? + // Maybe follow the stack trace on the "save" button click. + //refetchCalendarEvents(); + //rerenderCalendar(true); + //dataToVcalendar('EDIT',origUID, inputUID, $('#etag').val(), '', isFormHidden, deleteMode); + putVcalendarToCollection(coll.accountUID, inputUID, "", fileContents, "", 'vevent', false, false, ""); + // If this newUID were instead the etag (which is internal to putVcalendarToCollection), the new event would be + // immediately clickable! + newEvent.id = inputUID + newUID + ".ics"; + return newEvent; +} +/* STOP stackrpms */ function interResourceEdit(op, delUID,isFormHidden) { |