aboutsummaryrefslogtreecommitdiff
path: root/radicale_infcloud/web/interface.js
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-08-12 14:53:46 +0000
committerB. Stack <bgstack15@gmail.com>2022-08-12 14:53:46 +0000
commitfdd641301eb1e030c56e86575a7b0f607e03d53c (patch)
tree70dcca6002aff90633df7b13e2a0b5789096ba1e /radicale_infcloud/web/interface.js
parentadd my preferred contact display settings (diff)
parentAdd upload functionality (diff)
downloadradicaleinfcloud-fdd641301eb1e030c56e86575a7b0f607e03d53c.tar.gz
radicaleinfcloud-fdd641301eb1e030c56e86575a7b0f607e03d53c.tar.bz2
radicaleinfcloud-fdd641301eb1e030c56e86575a7b0f607e03d53c.zip
Merge branch 'add-upload' into 'stackrpms'
Add upload functionality See merge request bgstack15/RadicaleInfCloud!1
Diffstat (limited to 'radicale_infcloud/web/interface.js')
-rw-r--r--radicale_infcloud/web/interface.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/radicale_infcloud/web/interface.js b/radicale_infcloud/web/interface.js
index e5afb8d..7f7304b 100644
--- a/radicale_infcloud/web/interface.js
+++ b/radicale_infcloud/web/interface.js
@@ -1289,6 +1289,33 @@ function addAndEdit(isFormHidden, deleteMode)
dataToVcalendar('EDIT',origUID, inputUID, $('#etag').val(), '', isFormHidden, deleteMode);
}
+/* START stackrpms 2022-08-10
+ * uploadFile is a clone of addAndEdit
+ */
+function uploadFile(fileContents)
+{
+ var inputUID='';
+ if($('#uid').val()!='')
+ var coll = globalResourceCalDAVList.getEventCollectionByUID($('#uid').val().substring(0, $('#uid').val().lastIndexOf('/')+1));
+ else
+ var coll = globalResourceCalDAVList.getEventCollectionByUID($('#event_calendar').val());
+ var res = getAccount(coll.accountUID);
+ var tmp=res.href.match(vCalendar.pre['hrefRex']);
+ var origUID=tmp[1]+res.userAuth.userName+'@'+tmp[2];
+ if($('#etag').val()!='')
+ inputUID=$('#uid').val();
+ else if($('#event_calendar').val()!='choose')
+ inputUID = $('#event_calendar').val()+'';
+ else
+ return false;
+ // Always generate new UID for imported event
+ var newUID=globalEventList.getNewUID();
+ fileContents = fileContents.replace(/^UID:.*$/gm,String("UID:"+newUID));
+ putVcalendarToCollection(coll.accountUID, inputUID, "", fileContents, "", 'vevent', false, false, "");
+ return true;
+}
+/* STOP stackrpms */
+
function interResourceEdit(op, delUID,isFormHidden)
{
var inputUID='';
bgstack15