X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=xynt-link.js;fp=xynt-link.js;h=0000000000000000000000000000000000000000;hb=9f0cbf62feaea515635cfc85bddd5292b2170440;hp=12ae9c1457e9e511904915702aacc064386c8ad2;hpb=ff96d86813afe7c2d607bc6ca9d5c18c378c6fed;p=xynt.git diff --git a/xynt-link.js b/xynt-link.js deleted file mode 100644 index 12ae9c1..0000000 --- a/xynt-link.js +++ /dev/null @@ -1,95 +0,0 @@ -function tasks_link(anc, a, b, type) { - var cur; - this.anc = anc; - this.o = document.createElement("div"); - this.o.style.top = "0px"; - this.o.style.left = "0px"; - this.o.style.position = "absolute"; - this.o.style.visibility = "hidden"; - this.beg = document.createElement("div"); - this.end = document.createElement("div"); - this.arr = document.createElement("img"); - this.arr.style.position = "absolute"; - this.o.appendChild(this.arr); - this.anc.appendChild(this.o); - for (var i = 0 ; i < 2 ; i++) { - cur = i == 0 ? this.beg : this.end; - cur.style.width = '5px'; - cur.style.height = '5px'; - cur.style.backgroundColor = 'gray'; - cur.style.visibility = 'inherit'; - cur.style.zIndex = 20; - cur.style.position = 'absolute'; - this.o.appendChild(cur); - // alert("gugu"); - } - - this.a = a; - this.b = b; - this.type = type; - - if (typeof(a.connected) != 'object') - return null; - - if (typeof(b.connected) != 'object') - return null; - - for (var i = 0 ; i < 2 ; i++) { - cur = (i == 0 ? a : b); - cur.connected[cur.connected.length++] = this; - for( ; cur.parentNode != null && cur.parentNode != anc ; cur = cur.parentNode) { - cur.connect(this); - } - } - this.update() -} - -tasks_link.prototype = { - a: null, - b: null, - type: null, - - update: function(method, obj) - { - /* - if (method == 'end') { - if (this.o.style.visibility == 'visible') - this.o.style.visibility = 'hidden'; - else - this.o.style.visibility = 'visible'; - } - */ - - // FIXME you need to user the width of the border instead of +2 - this.beg.style.left = (parseInt(this.a.style.left) + parseInt(this.a.style.width) + 2 + parseInt(this.a.parentNode.style.left))+"px"; - this.beg.style.top = (parseInt(this.a.style.top) + parseInt(((parseInt(this.a.style.height) + 2) / 2)) + parseInt(this.a.parentNode.style.top))+"px"; - this.beg.style.width = (parseInt(this.b.style.left) - (parseInt(this.a.style.left) + 2 + parseInt(this.b.style.width) + 2)+ parseInt(this.b.parentNode.style.left) + 5)+"px"; - this.beg.style.height = "1px"; - - this.end.style.left = (parseInt(this.beg.style.left) + parseInt(this.beg.style.width))+"px"; - this.arr.style.left = (parseInt(this.end.style.left) - 3)+"px"; - /* this.end.style.left = (parseInt(this.b.style.left) + parseInt(this.b.parentNode.style.left))+"px"; - this.end.style.top = (parseInt(this.b.style.top) + parseInt(this.b.parentNode.style.top))+"px"; */ - endpty = parseInt(this.b.style.top) + parseInt(this.b.parentNode.style.top)+10; - this.end.style.width = "1px"; - - if (parseInt(this.beg.style.top) < endpty) { - this.end.style.top = this.beg.style.top; - this.end.style.height = (parseInt(this.b.style.top) + parseInt(this.b.parentNode.style.top) - ((parseInt(this.a.style.top) + parseInt(this.a.parentNode.style.top))) ) - 11 +"px"; - this.arr.style.top = (parseInt(this.end.style.top) + parseInt(this.end.style.height) - 5)+"px"; - this.arr.src = "img/arrow_do.png"; - } - else { - this.end.style.top = (parseInt(this.b.style.top) + parseInt(this.b.parentNode.style.top) + 23)+"px"; - this.end.style.height = (parseInt(this.a.style.top) + parseInt(this.a.parentNode.style.top) - ((parseInt(this.b.style.top) + parseInt(this.b.parentNode.style.top))) ) - 11 +"px"; - - this.arr.style.top = this.end.style.top; - this.arr.src = "img/arrow_up.png"; - } - - - this.o.style.visibility = "visible"; - - console.log("met: " + method + " obj: " + (obj == this.a ? "Obj A" : (obj == this.b ? "Obj B" : "Other")) ); - } -}