1
0
mirror of https://github.com/s00500/ESPUI.git synced 2025-07-04 06:10:18 +00:00

Chunk updates

This commit is contained in:
Ian Gray
2022-01-01 22:04:32 +00:00
parent 1d78608786
commit 78317ce5f2
5 changed files with 63 additions and 39 deletions

13
data/js/controls.js vendored
View File

@ -2,6 +2,8 @@ const UI_INITIAL_GUI = 200;
const UI_RELOAD = 201;
const UPDATE_OFFSET = 100;
const UI_EXTEND_GUI = 210;
const UI_TITEL = 0;
const UI_PAD = 1;
@ -230,6 +232,7 @@ function start() {
var data = JSON.parse(evt.data);
var e = document.body;
var center = "";
switch (data.type) {
case UI_INITIAL_GUI:
// Clear current elements
@ -247,6 +250,16 @@ function start() {
handleEvent(fauxEvent);
});
break;
case UI_EXTEND_GUI:
data.controls.forEach(element => {
var fauxEvent = {
data: JSON.stringify(element),
};
handleEvent(fauxEvent);
});
break;
case UI_RELOAD:
window.location.reload();
break;