X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=webcit-ng%2Fstatic%2Fjs%2Fview_calendar.js;fp=webcit-ng%2Fstatic%2Fjs%2Fview_calendar.js;h=f5c53fc19b4142b2341712b4e60a1b1c75beb027;hp=786090aa6aec57a99cde57ffb4bc5a33d2485711;hb=fd9570c14521f696cccaaf8b8e7e0fa75cfddc2a;hpb=74104e1f70c837bfeec6e957ce7f84a4f969a0ed diff --git a/webcit-ng/static/js/view_calendar.js b/webcit-ng/static/js/view_calendar.js index 786090aa6..f5c53fc19 100644 --- a/webcit-ng/static/js/view_calendar.js +++ b/webcit-ng/static/js/view_calendar.js @@ -8,20 +8,35 @@ // RENDERER FOR THIS VIEW function view_render_calendar() { - fetch( - "/ctdl/r/" + escapeHTMLURI(current_room) + "/calendar::" - ) + + let options = { + method: "REPORT", + headers: { + "Content-Type" : "application/xml; charset=utf-8" + }, + body: ` + + + + + + + + + ` + }; + + fetch("/ctdl/r/" + escapeHTMLURI(current_room), options) .then(response => { if (response.ok) { - return(response.json()); + return(response.text()); } else { throw new Error(`${response.status} ${response.statusText}`); } }) - .then(j => { - document.getElementById("ctdl-main").innerHTML = JSON.stringify(j); - }) + //.then(str => new window.DOMParser().parseFromString(str, "text/xml")) + .then(str => document.getElementById("ctdl-main").innerHTML = escapeHTML(str)) .catch(error => { console.log(error); document.getElementById("ctdl-main").innerHTML = `
${error}
`;