From 7949fcdc683d07689bad5da5d20bfa3eeb5a6a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 5 Sep 2023 01:25:00 +0200 Subject: Move frontend code to subdirectories, to simplify command line flags. --- static/components/vevent-dl.ts | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 static/components/vevent-dl.ts (limited to 'static/components/vevent-dl.ts') diff --git a/static/components/vevent-dl.ts b/static/components/vevent-dl.ts deleted file mode 100644 index a792c07f..00000000 --- a/static/components/vevent-dl.ts +++ /dev/null @@ -1,35 +0,0 @@ -export { VEventDL } - -import { ComponentVEvent } from './vevent' -import { VEvent } from '../vevent' -import { makeElement } from '../lib' - -import { RecurrenceRule } from '../vevent' - -/* */ -class VEventDL extends ComponentVEvent { - redraw(obj: VEvent) { - let dl = buildDescriptionList( - Array.from(obj.boundProperties) - .map(key => [key, obj.getProperty(key)])) - this.replaceChildren(dl); - } -} - -function buildDescriptionList(data: [string, any][]): HTMLElement { - let dl = document.createElement('dl'); - for (let [key, val] of data) { - dl.appendChild(makeElement('dt', { textContent: key })) - let fmtVal: string = val; - if (val instanceof Date) { - fmtVal = val.format( - val.dateonly - ? '~Y-~m-~d' - : '~Y-~m-~dT~H:~M:~S'); - } else if (val instanceof RecurrenceRule) { - fmtVal = JSON.stringify(val.to_jcal()) - } - dl.appendChild(makeElement('dd', { textContent: fmtVal })) - } - return dl; -} -- cgit v1.2.3