From 16fa2623327192ca44263ad77c19e45c03d5df11 Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Wed, 9 Jan 2019 01:16:16 +0100 Subject: Expose new-style edit-stuff in old-style panel The integration is a hack, but a first step. I will eventually remove all the code in nms-info-box, but I needed a simple test. This also demonstrates how to add a new switch.... simply hit edit, then change the name. It aint pretty, and shouldn't work like it does today, but it's a decent example. Also, had to fix the backend again now that I actually tested the write-api :D --- web/js/nms-ui-boxes.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'web/js/nms-ui-boxes.js') diff --git a/web/js/nms-ui-boxes.js b/web/js/nms-ui-boxes.js index 9a3330c..dda77c9 100644 --- a/web/js/nms-ui-boxes.js +++ b/web/js/nms-ui-boxes.js @@ -176,6 +176,12 @@ class nmsString extends nmsBox { return this.html.textContent; } } + +class nmsButton extends nmsBox { + constructor(text,type = "btn-default") { + super("button",{html:{textContent:text,className:"btn "+type,type:"button"}}) + } +} /* * A general-purpose table. It can be created in one go, or * as-you-go. -- cgit v1.2.3