summaryrefslogtreecommitdiff
path: root/src/ws/node.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/ws/node.js')
-rw-r--r--src/ws/node.js20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/ws/node.js b/src/ws/node.js
index 6abc8b2..3baeb02 100644
--- a/src/ws/node.js
+++ b/src/ws/node.js
@@ -11,6 +11,11 @@ function idFromStr(str)
return str.substring(str.search('t') + 1, str.length);
}
+function subscriptionIdFromStr(str)
+{
+ return str.substring(1, str.search('_'));
+}
+
var nodes = new Array();
function findNode(id, subscribeid)
@@ -39,7 +44,9 @@ function Node(id, subscribeid)
// Elements:
this.element = document.createElement("div");
this.div_id = document.createElement("span");
+ this.div_id.setAttribute("class", "id");
this.div_title = document.createElement("span");
+ this.div_title.setAttribute("class", "title");
}
Node.prototype.dump = function()
@@ -116,7 +123,7 @@ Node.prototype.create = function()
node.name = "node";
node.setAttribute("class", "node");
- node.setAttribute("ondblclick", "editTitle(this, event)");
+ node.setAttribute("ondblclick", "editTitle(event)");
//node.setAttribute("onclick", "showHideChildren(this, event)");
node.setAttribute("ondrop", "drop(event)");
node.setAttribute("ondragenter", "dragenter(event)");
@@ -153,13 +160,9 @@ Node.prototype.create = function()
this.element.appendChild(this.div_id);
var id_txt = document.createTextNode(this.id);
- this.div_id.style.padding = "5px";
- this.div_id.style.opacity = "0.3";
this.div_id.appendChild(id_txt);
-
this.element.appendChild(this.div_title);
-
- this.setAttribute("title", "(missing title)");
+ this.setAttribute("title", "");
};
Node.prototype.setAttribute = function(name, value)
@@ -194,3 +197,8 @@ Node.prototype.setAttribute = function(name, value)
}
}
};
+
+Node.prototype.getTitle = function()
+{
+ return this.attributes["title"];
+};