From f653a01328be3b8be6af35c0c96867623765ca5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 5 Sep 2023 11:41:46 +0200 Subject: Move JS documentation into the JS-code. Texinfo was a bad match for how TypeScript is structured. This also allows generation of jsdoc pages, which can be nice. Another large win is that this opens up for the texinfo pages to replace the Guile heading with different subheadings, including - external library - internal library - C library - ... --- static/ts/server_connect.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'static/ts/server_connect.ts') diff --git a/static/ts/server_connect.ts b/static/ts/server_connect.ts index 29f5bab2..ad4bc9eb 100644 --- a/static/ts/server_connect.ts +++ b/static/ts/server_connect.ts @@ -1,3 +1,9 @@ +/** + * Procedures for interfacing with the backend server. + * + * @module + */ + export { create_event, remove_event } import { jcal_to_xcal } from './jcal' @@ -6,6 +12,15 @@ import { uid } from './types' import { vcal_objects } from './globals' import { PopupElement } from './components/popup-element' +/** + * Requests that the server permanently remove the event with the given + * unique id from its persistant storage. + * + * If the server responds with a success also delete it from our local + * store (`vcal_objects`). + * + * // TODO link to our backend flow here +*/ async function remove_event(uid: uid) { let element = vcal_objects.get(uid); if (!element) { @@ -55,6 +70,13 @@ async function remove_event(uid: uid) { // ]; // } +/** + * Packs up the given event and sends it to the server to either be + * created, or simply be updated in the persistant database. + + * Also does some minor updates registered components, to show that the + * event is actually created. +*/ async function create_event(event: VEvent) { // let xml = event.getElementsByTagName("icalendar")[0].outerHTML -- cgit v1.2.3