diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-06-06 18:32:11 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-06-06 18:32:11 +0200 |
commit | fa5985ed620c3cd4c7b9712b6b80a2e2c1a8ba31 (patch) | |
tree | 39e1eff8ce28467536505d2ca58282492be5b1b5 /handler.js | |
parent | 9e81fcd4bdb089b8f8a05c6fbb586ec2a2a14924 (diff) |
Rename task to node everywhere.
Diffstat (limited to 'handler.js')
-rw-r--r-- | handler.js | 36 |
1 files changed, 18 insertions, 18 deletions
@@ -5,8 +5,8 @@ document.addEventListener("connectEvent", connectEventHandler, false); function connectEventHandler(e) { - document.getElementById("wstask_status").style.backgroundColor = "#40ff40"; - document.getElementById("wstask_status").textContent = "TaskProto websocket connection opened "; + document.getElementById("wsnode_status").style.backgroundColor = "#40ff40"; + document.getElementById("wsnode_status").textContent = "NodeProto websocket connection opened "; //login("foobar", "hundemad"); //subscribe(0); @@ -15,8 +15,8 @@ function connectEventHandler(e) document.addEventListener("disconnectEvent", disconnectEventHandler, false); function disconnectEventHandler(e) { - document.getElementById("wstask_status").style.backgroundColor = "#ff4040"; - document.getElementById("wstask_status").textContent = "TaskProto websocket connection CLOSED "; + document.getElementById("wsnode_status").style.backgroundColor = "#ff4040"; + document.getElementById("wsnode_status").textContent = "NodeProto websocket connection CLOSED "; } document.addEventListener("removeEvent", removeEventHandler, false); @@ -25,8 +25,8 @@ function removeEventHandler(e) var subscribeid = e.detail.subscribeid; var id = e.detail.id; - var task = findTask(id, subscribeid); - if(task.parent) task.parent.removeChild(task); + var node = findNode(id, subscribeid); + if(node.parent) node.parent.removeChild(node); } document.addEventListener("moveEvent", moveEventHandler, false); @@ -36,9 +36,9 @@ function moveEventHandler(e) var id = e.detail.id; var parentid = e.detail.parentid; - var task = findTask(id, subscribeid); - var new_parent = findTask(parentid, subscribeid); - if(task != null && new_parent != null) new_parent.addChild(task); + var node = findNode(id, subscribeid); + var new_parent = findNode(parentid, subscribeid); + if(node != null && new_parent != null) new_parent.addChild(node); } document.addEventListener("createEvent", createEventHandler, false); @@ -48,19 +48,19 @@ function createEventHandler(e) var id = e.detail.id; var parentid = e.detail.parentid; - var task = new Task(id, subscribeid); - task.create(); + var node = new Node(id, subscribeid); + node.create(); if(parentid == -1) { - tasks.push(task); + nodes.push(node); var board = getBoard(subscribeid); - board.appendChild(task.element); + board.appendChild(node.element); return; } - var parent = findTask(parentid, subscribeid); + var parent = findNode(parentid, subscribeid); if(parent != null) { - parent.addChild(task); + parent.addChild(node); } } @@ -73,10 +73,10 @@ function updateEventHandler(e) var name = e.detail.name; var value = e.detail.value; - var task = findTask(id, subscribeid); - if(task == null) return; + var node = findNode(id, subscribeid); + if(node == null) return; - task.setAttribute(name, value); + node.setAttribute(name, value); } /////// |