Grammar change in the license declaration.
[citadel.git] / webcit-ng / static / js / view_calendar.js
1 // This module handles the view for "calendar" rooms.
2 //
3 // Copyright (c) 2016-2023 by the citadel.org team
4 //
5 // This program is open source software.  Use, duplication, or
6 // disclosure is subject to the GNU General Public License v3.
7
8
9 // RENDERER FOR THIS VIEW
10 function view_render_calendar() {
11         fetch(
12                 "/ctdl/r/" + escapeHTMLURI(current_room) + "/calendar::"
13         )
14         .then(response => {
15                 if (response.ok) {
16                         return(response.json());
17                 }
18                 else {
19                         throw new Error(`${response.status} ${response.statusText}`);
20                 }
21         })
22         .then(j => {
23                 document.getElementById("ctdl-main").innerHTML = JSON.stringify(j);
24         })
25         .catch(error => {
26                 console.log(error);
27                 document.getElementById("ctdl-main").innerHTML = `<div class="ctdl-fatal-error">${error}</div>`;
28         });
29 }