summaryrefslogtreecommitdiff
path: root/scripts/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/main.js')
-rw-r--r--scripts/main.js36
1 files changed, 34 insertions, 2 deletions
diff --git a/scripts/main.js b/scripts/main.js
index ce0dfe4..ac6dbe9 100644
--- a/scripts/main.js
+++ b/scripts/main.js
@@ -1,3 +1,35 @@
-import * as w from './gui-common/widgets.js';
+class Client {
-let a = w.Widget();
+
+
+ /**
+ * @param {HTMLElement} content The base element where page content is placed
+ */
+ constructor (content)
+ {
+ /** @type {WidgetToggle} */
+ this.toggle = new WidgetCheckbox();
+ content.appendChild(this.toggle.element);
+ this.slider = new WidgetSlider();
+ content.appendChild(this.slider.element);
+ this.temp = new WidgetColorTemp();
+ content.appendChild(this.temp.element);
+ this.light = new WidgetColorLight();
+ content.appendChild(this.light.element);
+ // content.appendChild(Widget("button").el);
+ // content.appendChild(Widget("checkbox").el);
+ // content.appendChild(Widget("slider").el);
+ // content.appendChild(Widget("color-wheel").el);
+ // content.appendChild(Widget("color-temp").el);
+ // content.appendChild(Widget("color-light").el);
+ // content.appendChild(Widget("thermostat").el);
+ // content.appendChild(Widget("sel-button").el);
+ this.content = content;
+ }
+}
+
+let contents = document.getElementsByTagName("content");
+if (contents.length > 0)
+ OSmClient = new Client(contents[0]);
+else
+ console.error("Unable to find content tag, OSm stopping client.");