aboutsummaryrefslogtreecommitdiff
path: root/static/elements.ts
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-11-10 01:40:22 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2021-11-10 01:40:22 +0100
commit410404cfdd54c083b6609fd52334e02d320145d7 (patch)
treeac934bde696f099590496d23bdd636f691f4c637 /static/elements.ts
parentBasic event modification works again. (diff)
downloadcalp-410404cfdd54c083b6609fd52334e02d320145d7.tar.gz
calp-410404cfdd54c083b6609fd52334e02d320145d7.tar.xz
Re-modularize javascript.
This moves almost everything out of globals.ts, into sepparate files. Things are still slightly to tightly coupled. But that is worked on.
Diffstat (limited to 'static/elements.ts')
-rw-r--r--static/elements.ts30
1 files changed, 30 insertions, 0 deletions
diff --git a/static/elements.ts b/static/elements.ts
new file mode 100644
index 00000000..06e0e31f
--- /dev/null
+++ b/static/elements.ts
@@ -0,0 +1,30 @@
+import { ComponentDescription } from './components/vevent-description'
+import { ComponentEdit } from './components/vevent-edit'
+import { VEventDL } from './components/vevent-dl'
+import { ComponentBlock } from './components/vevent-block'
+import { DateTimeInput } from './components/date-time-input'
+import { PopupElement } from './components/popup-element'
+import { TabElement } from './components/tab-element'
+
+export { initialize_components }
+
+function initialize_components() {
+
+
+ /* These MUST be created AFTER vcal_objcets and event_calendar_mapping are
+ inistialized, since their constructors assume that that piece of global
+ state is available */
+ customElements.define('vevent-description', ComponentDescription);
+ customElements.define('vevent-edit', ComponentEdit);
+ customElements.define('vevent-dl', VEventDL);
+ customElements.define('vevent-block', ComponentBlock);
+
+ /* date-time-input should be instansiatable any time, but we do it here
+ becouse why not */
+
+ customElements.define('date-time-input', DateTimeInput /*, { extends: 'input' } */)
+
+ /* These maybe also require that the global maps are initialized */
+ customElements.define('popup-element', PopupElement)
+ customElements.define('tab-element', TabElement)
+}