From: Art Cancro Date: Tue, 16 Apr 2024 23:25:41 +0000 (-0700) Subject: Calendar view: initial call of REPORT method. X-Git-Tag: v1000~30 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=fd9570c14521f696cccaaf8b8e7e0fa75cfddc2a Calendar view: initial call of REPORT method. Right now it's just a placeholder that outputs the raw XML to the screen. Use the allprop tag --- 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}
`;