Revert "fix: liveview interpreter using new templates"

This commit is contained in:
Jon Kelley authored and GitHub committed 2022-12-16 14:20:05 -08:00
1 parent 7ec55aa563
commit 5ac9b595ea
32 files changed
+1734 -627

No files matched your search

-36
View File
@@ -1,36 +0,0 @@
function main() {
let root = window.document.getElementById("main");
if (root != null) {
// create a new ipc
window.ipc = new IPC(root);
window.ipc.postMessage(serializeIpcMessage("initialize"));
}
}
class IPC {
constructor(root) {
// connect to the websocket
window.interpreter = new Interpreter(root);
this.ws = new WebSocket(WS_ADDR);
this.ws.onopen = () => {
console.log("Connected to the websocket");
};
this.ws.onerror = (err) => {
console.error("Error: ", err);
};
this.ws.onmessage = (event) => {
console.log("Received message: ", event.data);
let edits = JSON.parse(event.data);
window.interpreter.handleEdits(edits);
};
}
postMessage(msg) {
this.ws.send(msg);
}
}