diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-05 01:25:00 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-05 01:25:00 +0200 |
commit | 7949fcdc683d07689bad5da5d20bfa3eeb5a6a46 (patch) | |
tree | c1bc39dc0e508ee498cf7119f888f513db4bab8f /static/components/changelog.ts | |
parent | Add build step for jsdoc. (diff) | |
download | calp-7949fcdc683d07689bad5da5d20bfa3eeb5a6a46.tar.gz calp-7949fcdc683d07689bad5da5d20bfa3eeb5a6a46.tar.xz |
Move frontend code to subdirectories, to simplify command line flags.
Diffstat (limited to 'static/components/changelog.ts')
-rw-r--r-- | static/components/changelog.ts | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/static/components/changelog.ts b/static/components/changelog.ts deleted file mode 100644 index d08f7cb3..00000000 --- a/static/components/changelog.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { makeElement } from '../lib' -import { ComponentVEvent } from './vevent' -import { VEvent } from '../vevent' - -export { VEventChangelog } - -class VEventChangelog extends ComponentVEvent { - - readonly ul: HTMLElement - - constructor(uid?: string) { - super(uid); - - this.ul = makeElement('ul'); - } - - connectedCallback() { - this.replaceChildren(this.ul); - } - - redraw(data: VEvent) { - /* TODO only redraw what is needed */ - let children = [] - for (let [_, el] of data.changelog) { - let msg = ''; - switch (el.type) { - case 'property': - msg += `change ${el.name}: ` - msg += `from "${el.from}" to "${el.to}"` - break; - case 'calendar': - if (el.from === null && el.to === null) { - msg += '???' - } else if (el.from === null) { - msg += `set calendar to "${atob(el.to!)}"` - } else if (el.to === null) { - msg += `Remove calendar "${atob(el.from)}"` - } else { - msg += `Change calendar from "${atob(el.from)}" to "${atob(el.to)}"` - } - break; - } - - children.push(makeElement('li', { textContent: msg })); - } - - this.ul.replaceChildren(...children) - } -} |