diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-12-05 15:35:01 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-12-05 15:35:01 +0100 |
commit | 46a8ed79f6afdca1d3e1ccebfb90eb3c1b5feb68 (patch) | |
tree | 78b1313ca9cd41d65d5c189da244fb9cc3aaa5be /task.js | |
parent | ace5f9ead8c72f74616f96f7fd396b77391247d9 (diff) |
Major brushup of javascript protocol handler.
Diffstat (limited to 'task.js')
-rw-r--r-- | task.js | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -1,6 +1,16 @@ /* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set et sw=2 ts=2: */ +function createId(boardid, taskid) +{ + return "b" + boardid + "_t" + taskid; +} + +function idFromStr(str) +{ + return str.substring(str.search('t') + 1, str.length); +} + var tasks = new Array(); function findTask(id, observeid) @@ -79,8 +89,11 @@ Task.prototype.create = function() task.setAttribute("draggable", true); task.setAttribute("ondragstart", "drag(this, event)"); task.setAttribute("title", this.id); - + + // This is a hack to make it possible to identify the taskid and + // oberveid from the node id alone. task.id = createId(this.observeid, this.id); + /* var observe_button = document.createElement("div"); observe_button.name = "observe_button"; @@ -100,6 +113,7 @@ Task.prototype.create = function() unobserve_button.appendChild(txt_minus); task.appendChild(unobserve_button); */ + this.element.appendChild(this.div_id); var id_txt = document.createTextNode(this.id); this.div_id.appendChild(id_txt); |