aboutsummaryrefslogtreecommitdiff
path: root/radicale_infcloud/web
diff options
context:
space:
mode:
Diffstat (limited to 'radicale_infcloud/web')
-rw-r--r--radicale_infcloud/web/forms.js14
-rw-r--r--radicale_infcloud/web/interface.js21
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)
{
bgstack15