Revert "fix: liveview interpreter using new templates"
This commit is contained in:
1 parent
7ec55aa563
commit
5ac9b595ea
32 files changed
+1734
-627
No files matched your search
@@ -1,3 +1,11 @@
|
||||
export function main() {
|
||||
let root = window.document.getElementById("main");
|
||||
if (root != null) {
|
||||
window.interpreter = new Interpreter(root);
|
||||
window.ipc.postMessage(serializeIpcMessage("initialize"));
|
||||
}
|
||||
}
|
||||
|
||||
class ListenerMap {
|
||||
constructor(root) {
|
||||
// bubbling events can listen at the root element
|
||||
@@ -52,7 +60,7 @@ class ListenerMap {
|
||||
}
|
||||
}
|
||||
|
||||
class Interpreter {
|
||||
export class Interpreter {
|
||||
constructor(root) {
|
||||
this.root = root;
|
||||
this.listeners = new ListenerMap(root);
|
||||
@@ -345,10 +353,7 @@ class Interpreter {
|
||||
break;
|
||||
case "NewEventListener":
|
||||
// this handler is only provided on desktop implementations since this
|
||||
// method is not used by the web implementationa
|
||||
|
||||
let bubbles = event_bubbles(edit.name);
|
||||
|
||||
// method is not used by the web implementation
|
||||
let handler = (event) => {
|
||||
let target = event.target;
|
||||
if (target != null) {
|
||||
@@ -430,21 +435,20 @@ class Interpreter {
|
||||
}
|
||||
window.ipc.postMessage(
|
||||
serializeIpcMessage("user_event", {
|
||||
name: edit.name,
|
||||
element: parseInt(realId),
|
||||
data: contents,
|
||||
bubbles: bubbles,
|
||||
event: edit.name,
|
||||
mounted_dom_id: parseInt(realId),
|
||||
contents: contents,
|
||||
})
|
||||
);
|
||||
}
|
||||
};
|
||||
this.NewEventListener(edit.name, edit.id, bubbles, handler);
|
||||
this.NewEventListener(edit.name, edit.id, event_bubbles(edit.name), handler);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function serialize_event(event) {
|
||||
export function serialize_event(event) {
|
||||
switch (event.type) {
|
||||
case "copy":
|
||||
case "cut":
|
||||
|
||||
Reference in new issue
Block a user