summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO1
-rw-r--r--munia.html1
-rw-r--r--proto.js58
3 files changed, 22 insertions, 38 deletions
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..200a30e
--- /dev/null
+++ b/TODO
@@ -0,0 +1 @@
+Server segfaults on 'remove 0'
diff --git a/munia.html b/munia.html
index ec01af8..cddf8da 100644
--- a/munia.html
+++ b/munia.html
@@ -50,7 +50,6 @@ body {
</head>
<body id="body">
<div id="wstask_status">TaskProto not initialized</div>
-<div id="wsobserve_status">ObserveProto not initialized</div>
TaskProto: <input type="text" id="input_task_data" value="observe 0" onfocus="clear()"/>
<input type="button" value="submit" onclick="task_submit()"/><br/>
TaskMessages: <span id="wstask_lastmsg"></span><br/>
diff --git a/proto.js b/proto.js
index c229473..4cbbfc7 100644
--- a/proto.js
+++ b/proto.js
@@ -161,15 +161,13 @@ try {
var observeid = msg[0];
var cmd = msg[1];
+ var id = msg[2];
- if(cmd == "del") {
- var id = msg[2];
+ if(cmd == "remove") {
var task = document.getElementById("task_" + id);
- //todo: remove from parent not board
- board.removeChild(task);
+ task.parentNode.removeChild(task);
}
else if(cmd == "move") {
- var id = msg[2];
var parent_id = msg[3];
var task = document.getElementById("task_" + id);
if(parent_id != -1) {
@@ -179,19 +177,11 @@ try {
else {
board.appendChild(task);
}
- // task.parentNode.removeChild(task);
- // board.removeChild(task);
- // parent_task.appendChild(task);
- // task.style.left = left + "px";
- // task.style.top = top + "px";
}
else if(cmd == "create") {
- var id = msg[2];
var parent_id = msg[3];
- // var title = msg[3];
- // var description = msg[4];
-
var task = document.createElement("div");
+
task.name = "task";
task.setAttribute("class", "task");
task.setAttribute("ondrop", "drop(this, event)");
@@ -203,24 +193,23 @@ try {
task.id = "task_" + id;
- // var taskText = document.createTextNode(title + ": " + description + " :" + task.id);
var taskText = document.createTextNode('[' + task.id + ']');
taskText.id = "txt";
task.appendChild(taskText);
- // task.style.position = "absolute";
- // task.style.left = left + "px";
- // task.style.top = top + "px";
- // task.setAttribute("onMouseDown", "dragged = '" + id + "';");
-
- // var dlButton = document.createElement("input");
- // dlButton.type = "button";
- // dlButton.value = "Remove";
- // dlButton.onclick = "deleteTask(document.getElementById(" + task.id + ").id";
- // dlButton.setAttribute("onclick", "deleteTask(" + id +")");
- // task.appendChild(dlButton);
-
- // board.appendChild(task);
+ //task.style.position = "absolute";
+ //task.style.left = left + "px";
+ //task.style.top = top + "px";
+ //task.setAttribute("onMouseDown", "dragged = '" + id + "';");
+
+ //var dlButton = document.createElement("input");
+ //dlButton.type = "button";
+ //dlButton.value = "Remove";
+ //dlButton.onclick = "deleteTask(document.getElementById(" + task.id + ").id";
+ //dlButton.setAttribute("onclick", "deleteTask(" + id +")");
+ //task.appendChild(dlButton);
+
+ //board.appendChild(task);
var parent_task = document.getElementById("task_" + parent_id);
@@ -232,20 +221,15 @@ try {
}
}
else if(cmd == "update") {
-
- var id = msg[2];
var title = msg[3];
- var description = 'N/A';//msg[3];
-
var task = document.getElementById("task_" + id);
-
- var taskText = document.createTextNode(title + ": " + description + " :" + task.id);
+ var taskText = document.createTextNode(title);
task.appendChild(taskText);
}
f++;
- // document.getElementById("box").style.top = i[3] + "px";
- // document.getElementById("box").style.left = i[2] + "px";
- // document.getElementById("box").style.display = "block";
+ //document.getElementById("box").style.top = i[3] + "px";
+ //document.getElementById("box").style.left = i[2] + "px";
+ //document.getElementById("box").style.display = "block";
}
}