1234567891011121314151617181920212223242526272829303132333435363738394041 |
- (function(){var u=/MSIE/.test(navigator.userAgent)&&!window.opera,s=null,f=function(){j.repaintEverything()},g=true,l={},k=[],h={},m={},d=true,e=[],p=1200,w=function(a,b,c){var i=function(q,t){if(q===t)return true;else if(typeof q=="object"&&typeof t=="object"){var v=true;for(var x in q)if(!i(q[x],t[x])){v=false;break}for(x in t)if(!i(t[x],q[x])){v=false;break}return v}};c=+c||0;for(var n=a.length;c<n;c++)if(i(a[c],b))return c;return-1},E=function(a,b,c){var i=a[b];if(i==null){i=[];a[b]=i}i.push(c)},
- I=function(a,b){var c=z(a,"id"),i=l[c];if(i){M(c,b);for(var n=k[c],q=e[c],t=0;t<i.length;t++){var v=i[t],x=i[t].anchor.compute([n.left,n.top],q);v.paint(x);v=v.connections;for(x=0;x<v.length;x++)v[x].paint(c,b)}}},G=function(a,b){var c=null;if(typeof a=="object"&&a.length){c=[];for(var i=0;i<a.length;i++){var n=A(a[i]),q=z(n,"id");c.push(b(n,q))}}else{n=A(a);q=z(n,"id");c=b(n,q)}return c},z=function(a,b){var c=j.CurrentLibrary.getElementObject(a);return j.CurrentLibrary.getAttribute(c,b)},F=function(a,
- b,c){a=j.CurrentLibrary.getElementObject(a);j.CurrentLibrary.setAttribute(a,b,c)},A=function(a){return j.CurrentLibrary.getElementObject(a)},V=function(a){a=j.CurrentLibrary.getElementObject(a);return j.CurrentLibrary.getSize(a)},T=function(a,b,c,i){if((c==null?d:c)&&j.CurrentLibrary.isDragSupported(a)){var n=i||j.Defaults.DragOptions;n=j.extend({},n);var q=j.CurrentLibrary.dragEvents.drag;(function(t,v,x){n[q]=J(n[q],x);v=m[v];n.disabled=v==null?false:!v;j.CurrentLibrary.initDraggable(t,n)})(a,b,
- function(){var t=j.CurrentLibrary.getUIPosition(arguments);I(a,t);t=j.CurrentLibrary.getElementObject(a);j.CurrentLibrary.addClass(t,"jsPlumb_dragged")})}},W=function(a){var b=document.createElement("canvas");document.body.appendChild(b);b.style.position="absolute";if(a)b.className=a;a=b;var c=z(a,"id");if(!c){c="_jsPlumb_"+new String((new Date).getTime());F(a,"id",c)}if(u){j.sizeCanvas(b,0,0,p,p);b=G_vmlCanvasManager.initElement(b)}return b},U=function(a,b){var c=l[a];if(c&&c.length)for(var i=0;i<
- c.length;i++)for(var n=0;n<c[i].connections.length;n++)if(b(c[i].connections[n]))return},N=function(a){if(a!=null)try{document.body.removeChild(a)}catch(b){}},X=function(a,b,c){a=a[b];if(a!=null){c=w(a,c);if(c>=0){delete a[c];a.splice(c,1);return true}}return false},Y=function(a,b){var c=z(a,"id");U(c,function(i){i.canvas.style.display=b})},Z=function(a){U(a,function(b){b.canvas.style.display="none"==b.canvas.style.display?"block":"none"})},M=function(a,b,c){if(c||b==null){A(a);e[a]=V(a);b=j.CurrentLibrary.getElementObject(a);
- b=j.CurrentLibrary.getOffset(b);k[a]=b}else k[a]=b},J=function(a,b){a=a||function(){};b=b||function(){};return function(){try{b.apply(this,arguments)}catch(c){}try{a.apply(this,arguments)}catch(i){}}},ba=function(a){var b=this;this.x=a.x||0;this.y=a.y||0;var c=a.orientation||[0,0];this.offsets=a.offsets||[0,0];this.compute=function(i,n){return[i[0]+b.x*n[0]+b.offsets[0],i[1]+b.y*n[1]+b.offsets[1]]};this.getOrientation=function(){return c}},ca=function(a){var b=a.reference,c=V(a.referenceCanvas),i=
- 0,n=0,q=null;this.compute=function(t){n=i=0;return[t[0]+c[0]/2,t[1]+c[1]/2]};this.getOrientation=function(){if(q)return q;else{var t=b.getOrientation();return[Math.abs(t[0])*i*-1,Math.abs(t[1])*n*-1]}};this.over=function(t){q=t.getOrientation()};this.out=function(){q=null}},aa=function(a){var b=this;this.source=A(a.source);this.target=A(a.target);this.sourceId=z(this.source,"id");this.targetId=z(this.target,"id");this.endpointsOnTop=a.endpointsOnTop!=null?a.endpointsOnTop:true;this.endpoints=[];this.endpointStyles=
- [];var c=function(q,t,v){if(q)b.endpoints[t]=q;else{if(!v.endpoints)v.endpoints=[null,null];q=v.endpoints[t]||v.endpoint||j.Defaults.Endpoints[t]||j.Defaults.Endpoint||new j.Endpoints.Dot;if(!v.endpointStyles)v.endpointStyles=[null,null];b.endpoints[t]=new S({style:v.endpointStyles[t]||v.endpointStyle||j.Defaults.EndpointStyles[t]||j.Defaults.EndpointStyle,endpoint:q,connections:[b],anchor:v.anchors?v.anchors[t]:j.Defaults.Anchors[t]||j.Anchors.BottomCenter,source:b.source})}};c(a.sourceEndpoint,
- 0,a);c(a.targetEndpoint,1,a);this.connector=this.endpoints[0].connector||this.endpoints[1].connector||a.connector||j.Defaults.Connector||new j.Connectors.Bezier;this.paintStyle=this.endpoints[0].connectorStyle||this.endpoints[1].connectorStyle||a.paintStyle||j.Defaults.PaintStyle;M(this.sourceId);M(this.targetId);c=k[this.sourceId];var i=e[this.sourceId];c=this.endpoints[0].anchor.compute([c.left,c.top],i);this.endpoints[0].paint(c);c=k[this.targetId];i=e[this.targetId];c=this.endpoints[1].anchor.compute([c.left,
- c.top],i);this.endpoints[1].paint(c);var n=W(j.connectorClass);this.canvas=n;this.paint=function(q,t,v){s&&s.debug("Painting Connection; element in motion is "+q+"; ui is ["+t+"]; recalc is ["+v+"]");var x=q!=this.sourceId,H=x?this.sourceId:this.targetId,y=x?0:1,r=x?1:0;if(this.canvas.getContext){M(q,t,v);v&&M(H);t=k[q];v=k[H];q=e[q];var P=e[H];H=n.getContext("2d");var K=this.endpoints[r].anchor.compute([t.left,t.top],q,[v.left,v.top],P);this.endpoints[r].anchor.getOrientation();t=this.endpoints[y].anchor.compute([v.left,
- v.top],P,[t.left,t.top],q);this.endpoints[y].anchor.getOrientation();y=this.connector.compute(K,t,this.endpoints[r].anchor,this.endpoints[y].anchor,this.paintStyle.lineWidth);j.sizeCanvas(n,y[0],y[1],y[2],y[3]);j.extend(H,this.paintStyle);if(this.paintStyle.gradient&&!u){x=x?H.createLinearGradient(y[4],y[5],y[6],y[7]):H.createLinearGradient(y[6],y[7],y[4],y[5]);for(r=0;r<this.paintStyle.gradient.stops.length;r++)x.addColorStop(this.paintStyle.gradient.stops[r][0],this.paintStyle.gradient.stops[r][1]);
- H.strokeStyle=x}this.connector.paint(y,H)}};this.repaint=function(){this.paint(this.sourceId,null,true)};T(b.source,b.sourceId,a.draggable,a.dragOptions);T(b.target,b.targetId,a.draggable,a.dragOptions);this.source.resize&&this.source.resize(function(){j.repaint(b.sourceId)})},S=function(a){a=a||{};j.extend({},a);var b=this;b.anchor=a.anchor||j.Anchors.TopCenter;var c=a.endpoint||new j.Endpoints.Dot,i=a.style||j.Defaults.EndpointStyle;this.connectorStyle=a.connectorStyle;this.connector=a.connector;
- var n=a.source,q=z(n,"id"),t=a.maxConnections||1;this.canvas=a.canvas||W(j.endpointClass);this.connections=a.connections||[];var v=a.reattach||false,x=null,H=null;this.addConnection=function(o){b.connections.push(o)};this.removeConnection=function(o){o=w(b.connections,o);o>=0&&b.connections.splice(o,1)};this.makeInPlaceCopy=function(){return new S({anchor:b.anchor,source:n,style:i,endpoint:c})};this.isConnectedTo=function(o){var D=false;if(o)for(var B=0;B<b.connections.length;B++)if(b.connections[B].endpoints[1]==
- o){D=true;break}return D};this.isFloating=function(){return x!=null};this.isFull=function(){return t<1?false:b.connections.length>=t};this.paint=function(o,D,B){s&&s.debug("Painting Endpoint with elementId ["+q+"]; anchorPoint is ["+o+"]");if(o==null){o=k[q];var O=e[q];if(o==null||O==null){M(q);o=k[q];O=e[q]}o=b.anchor.compute([o.left,o.top],O)}c.paint(o,b.anchor.getOrientation(),B||b.canvas,i,D||i)};if(a.isSource&&j.CurrentLibrary.isDragSupported(n)){var y=null,r=null,P=false,K=null,C=a.dragOptions||
- {},L=j.extend({},j.CurrentLibrary.defaultDragOptions);C=j.extend(L,C);L=j.CurrentLibrary.dragEvents.start;var Q=j.CurrentLibrary.dragEvents.stop,R=j.CurrentLibrary.dragEvents.drag;C[L]=J(C[L],function(){H=b.makeInPlaceCopy();H.paint();y=document.createElement("div");document.body.appendChild(y);var o=""+new String((new Date).getTime());F(A(y),"id",o);M(o);F(A(b.canvas),"dragId",o);F(A(b.canvas),"elId",q);var D=new ca({reference:b.anchor,referenceCanvas:b.canvas});x=new S({style:{fillStyle:"rgba(0,0,0,0)"},
- endpoint:c,anchor:D,source:y});r=b.connections.length==0||b.connections.length<t?null:b.connections[0];if(r==null){r=new aa({sourceEndpoint:b,targetEndpoint:x,source:A(n),target:A(y),anchors:[b.anchor,D],paintStyle:a.connectorStyle,connector:a.connector});b.addConnection(r)}else{P=true;D=r.sourceId==q?0:1;r.floatingAnchorIndex=D;b.removeConnection(r);if(D==0){K=[r.source,r.sourceId];r.source=A(y);r.sourceId=o}else{K=[r.target,r.targetId];r.target=A(y);r.targetId=o}r.suspendedEndpoint=r.endpoints[D];
- r.endpoints[D]=x}h[o]=r;x.addConnection(r);E(l,o,x)});C[R]=J(C[R],function(){var o=j.CurrentLibrary.getUIPosition(arguments);I(A(y),o)});C[Q]=J(C[Q],function(){X(l,null,x);var o=[x.canvas,y,H.canvas];for(var D in o)N(o[D]);o=r.floatingAnchorIndex==null?1:r.floatingAnchorIndex;if(r.endpoints[o]==x)if(P&&r.suspendedEndpoint)if(v){r.floatingAnchorIndex=null;if(o==0){r.source=K[0];r.sourceId=K[1]}else{r.target=K[0];r.targetId=K[1]}r.endpoints[o]=r.suspendedEndpoint;r.suspendedEndpoint.addConnection(r);
- j.repaint(K[1])}else{r.endpoints[0].removeConnection(r);r.endpoints[1].removeConnection(r);N(r.canvas)}else{N(r.canvas);b.removeConnection(r)}r=null;delete x;delete H;b.paint()});L=A(b.canvas);j.CurrentLibrary.initDraggable(L,C)}if(a.isTarget&&j.CurrentLibrary.isDropSupported(n)){C=a.dropOptions||j.Defaults.DropOptions;C=j.extend({},C);L=j.CurrentLibrary.dragEvents.drop;Q=j.CurrentLibrary.dragEvents.over;R=j.CurrentLibrary.dragEvents.out;C[L]=J(C[L],function(){var o=j.CurrentLibrary.getDragObject(arguments),
- D=z(A(o),"dragId");o=z(A(o),"elId");var B=h[D],O=B.floatingAnchorIndex==null?1:B.floatingAnchorIndex;if(O==0){B.source=n;B.sourceId=q}else{B.target=n;B.targetId=q}B.endpoints[O].removeConnection(B);B.suspendedEndpoint&&B.suspendedEndpoint.removeConnection(B);B.endpoints[O]=b;b.addConnection(B);T(n,q,a.draggable,{});j.repaint(o);delete h[D]});C[Q]=J(C[Q],function(){var o=j.CurrentLibrary.getDragObject(arguments);o=z(A(o),"dragId");o=h[o];o.endpoints[o.floatingAnchorIndex==null?1:o.floatingAnchorIndex].anchor.over(b.anchor)});
- C[R]=J(C[R],function(){var o=j.CurrentLibrary.getDragObject(arguments);o=z(A(o),"dragId");o=h[o];o.endpoints[o.floatingAnchorIndex==null?1:o.floatingAnchorIndex].anchor.out()});j.CurrentLibrary.initDroppable(A(b.canvas),C)}return b},j=window.jsPlumb={Defaults:{Anchors:[null,null],Connector:null,DragOptions:{},DropOptions:{},Endpoint:null,Endpoints:[null,null],EndpointStyle:{fillStyle:null},EndpointStyles:[null,null],MaxConnections:null,PaintStyle:{lineWidth:10,strokeStyle:"red"},Scope:"_jsPlumb_DefaultScope"},
- connectorClass:"_jsPlumb_connector",endpointClass:"_jsPlumb_endpoint",Anchors:{},Connectors:{},Endpoints:{},addEndpoint:function(a,b){b=j.extend({},b);var c=A(a),i=z(a,"id");b.source=c;M(i);c=new S(b);E(l,i,c);var n=k[i];i=c.anchor.compute([n.left,n.top],e[i]);c.paint(i);return c},addEndpoints:function(a,b){for(var c=[],i=0;i<b.length;i++)c.push(j.addEndpoint(a,b[i]));return c},animate:function(a,b,c){var i=A(a),n=z(a,"id");c=c||{};a=j.CurrentLibrary.dragEvents.step;c[a]=J(c[a],function(){j.repaint(n)});
- j.CurrentLibrary.animate(i,b,c)},connect:function(a){if(!(a.sourceEndpoint&&a.sourceEndpoint.isFull()))if(!(a.targetEndpoint&&a.targetEndpoint.isFull())){var b=new aa(a);a.sourceEndpoint||E(l,b.sourceId,b.endpoints[0]);a.targetEndpoint||E(l,b.targetId,b.endpoints[1]);b.endpoints[0].addConnection(b);b.endpoints[1].addConnection(b);I(b.source);return b}},detach:function(a,b){U(a,function(c){if(c.sourceId==a&&c.targetId==b||c.targetId==a&&c.sourceId==b){N(c.canvas);c.endpoints[0].removeConnection(c);
- c.endpoints[1].removeConnection(c);return true}})},detachAll:function(a){a=z(a,"id");if((a=l[a])&&a.length)for(var b=0;b<a.length;b++){var c=a[b].connections.length;if(c>0)for(var i=0;i<c;i++){var n=a[b].connections[0];N(n.canvas);n.endpoints[0].removeConnection(n);n.endpoints[1].removeConnection(n)}}},detachEverything:function(){for(var a in l){var b=l[a];if(b&&b.length)for(var c=0;c<b.length;c++){var i=b[c].connections.length;if(i>0)for(var n=0;n<i;n++){var q=b[c].connections[0];N(q.canvas);q.endpoints[0].removeConnection(q);
- q.endpoints[1].removeConnection(q)}}}},extend:function(a,b){return j.CurrentLibrary.extend(a,b)},hide:function(a){Y(a,"none")},makeAnchor:function(a,b){var c={};if(arguments.length==1)j.extend(c,a);else{c={x:a,y:b};if(arguments.length>=4)c.orientation=[arguments[2],arguments[3]];if(arguments.length==6)c.offsets=[arguments[4],arguments[5]]}return new ba(c)},repaint:function(a){var b=function(i){i=A(i);I(i)};if(typeof a=="object")for(var c=0;c<a.length;c++)b(a[c]);else b(a)},repaintEverything:function(){for(var a in l)I(A(a))},
- removeAllEndpoints:function(a){a=z(a,"id");j.detachAll(a);var b=l[a];for(var c in b)N(b[c].canvas);l[a]=[]},removeEndpoint:function(a,b){var c=z(a,"id");l[c]&&X(l,c,b)&&N(b.canvas)},setAutomaticRepaint:function(a){g=a},setDefaultNewCanvasSize:function(a){p=a},setDraggable:function(a,b){return G(a,function(c,i){m[i]=b;j.CurrentLibrary.isDragSupported(c)&&j.CurrentLibrary.setDraggable(c,b)})},setDraggableByDefault:function(a){d=a},setDebugLog:function(a){s=a},setRepaintFunction:function(a){f=a},show:function(a){Y(a,
- "block")},sizeCanvas:function(a,b,c,i,n){if(a){a.style.height=n+"px";a.height=n;a.style.width=i+"px";a.width=i;a.style.left=b+"px";a.style.top=c+"px"}},getTestHarness:function(){return{endpointCount:function(a){return(a=l[a])?a.length:0},findIndex:w}},toggle:Z,toggleVisible:Z,toggleDraggable:function(a){return G(a,function(b,c){var i=m[c]==null?d:m[c];i=!i;m[c]=i;j.CurrentLibrary.setDraggable(b,i);return i})},unload:function(){delete l;delete k;delete e;delete h;delete m},wrap:J}})();
- (function(){var u=new Class({Extends:Fx.Morph,onStep:null,initialize:function(d,e){this.parent(d,e);if(e.onStep)this.onStep=e.onStep},step:function(){this.parent();if(this.onStep)try{this.onStep()}catch(d){}}}),s={},f={},g={},l={},k=function(d,e,p){if(e){var w=e.get("id");if(w)(w=f[w])&&w[p]&&w[p](d,e)}},h=function(d,e){if(d){var p=d.get("id");if(p)if(p=f[p])if(p.hoverClass)e?d.addClass(p.hoverClass):d.removeClass(p.hoverClass)}},m=function(d,e,p){var w=d[e];if(!w){w=[];d[e]=w}w.push(p)};jsPlumb.CurrentLibrary=
- {dragEvents:{start:"onStart",stop:"onComplete",drag:"onDrag",step:"onStep",over:"onEnter",out:"onLeave",drop:"onDrop"},extend:function(d,e){return $extend(d,e)},getElementObject:function(d){return $(d)},getOffset:function(d){d=d.getPosition();return{left:d.x,top:d.y}},getSize:function(d){d=d.getSize();return[d.x,d.y]},getAttribute:function(d,e){return d.get(e)},setAttribute:function(d,e,p){d.set(e,p)},addClass:function(d,e){d.addClass(e)},initDraggable:function(d,e){var p=l[d.get("id")];if(!p){var w=
- 0,E=null,I=jsPlumb.Defaults.DragOptions.zIndex||2E3;e.onStart=jsPlumb.wrap(e.onStart,function(){w=this.element.getStyle("z-index");this.element.setStyle("z-index",I);if(jsPlumb.Defaults.DragOptions.cursor){E=this.element.getStyle("cursor");this.element.setStyle("cursor",jsPlumb.Defaults.DragOptions.cursor)}});e.onComplete=jsPlumb.wrap(e.onComplete,function(){this.element.setStyle("z-index",w);E&&this.element.setStyle("cursor",E)});var G=e.scope||jsPlumb.Defaults.Scope;p=function(z){return z.get("id")!=
- d.get("id")};p=s[G]?s[G].filter(p):[];e.droppables=p;e.onLeave=jsPlumb.wrap(e.onLeave,function(z,F){if(F){h(F,false);k(z,F,"onLeave")}});e.onEnter=jsPlumb.wrap(e.onEnter,function(z,F){if(F){h(F,true);k(z,F,"onEnter")}});e.onDrop=function(z,F){if(F){h(F,false);k(z,F,"onDrop")}};p=new Drag.Move(d,e);m(g,G,p);m(l,d.get("id"),p);e.disabled&&p.detach()}return p},isDragSupported:function(){return typeof Drag!="undefined"},setDraggable:function(d,e){var p=l[d.get("id")];p&&p.each(function(w){e?w.attach():
- w.detach()})},initDroppable:function(d,e){var p=e.scope||jsPlumb.Defaults.Scope;m(s,p,d);f[d.get("id")]=e;var w=function(E){return E.element!=d};p=g[p]?g[p].filter(w):[];for(w=0;w<p.length;w++)p[w].droppables.push(d)},isDropSupported:function(){if(typeof Drag!=undefined)return typeof Drag.Move!=undefined;return false},animate:function(d,e,p){(new u(d,p)).start(e)},getUIPosition:function(d){d=d[0];return{left:d.offsetLeft,top:d.offsetTop}},getDragObject:function(d){return d[0]}}})();
- (function(){jsPlumb.Anchors.TopCenter=jsPlumb.makeAnchor(0.5,0,0,-1);jsPlumb.Anchors.BottomCenter=jsPlumb.makeAnchor(0.5,1,0,1);jsPlumb.Anchors.LeftMiddle=jsPlumb.makeAnchor(0,0.5,-1,0);jsPlumb.Anchors.RightMiddle=jsPlumb.makeAnchor(1,0.5,1,0);jsPlumb.Anchors.Center=jsPlumb.makeAnchor(0.5,0.5,0,0);jsPlumb.Anchors.TopRight=jsPlumb.makeAnchor(1,0,0,-1);jsPlumb.Anchors.BottomRight=jsPlumb.makeAnchor(1,1,0,1);jsPlumb.Anchors.TopLeft=jsPlumb.makeAnchor(0,0,0,-1);jsPlumb.Anchors.BottomLeft=jsPlumb.makeAnchor(0,
- 1,0,1);jsPlumb.Connectors.Straight=function(){this.compute=function(u,s,f,g,l){f=Math.abs(u[0]-s[0]);g=Math.abs(u[1]-s[1]);var k=0.45*f,h=0.45*g;f*=1.9;g*=1.9;var m=Math.min(u[0],s[0])-k,d=Math.min(u[1],s[1])-h;if(f<2*l){f=2*l;m=u[0]+(s[0]-u[0])/2-l;k=(f-Math.abs(u[0]-s[0]))/2}if(g<2*l){g=2*l;d=u[1]+(s[1]-u[1])/2-l;h=(g-Math.abs(u[1]-s[1]))/2}return[m,d,f,g,u[0]<s[0]?f-k:k,u[1]<s[1]?g-h:h,u[0]<s[0]?k:f-k,u[1]<s[1]?h:g-h]};this.paint=function(u,s){s.beginPath();s.moveTo(u[4],u[5]);s.lineTo(u[6],u[7]);
- s.stroke()}};jsPlumb.Connectors.Bezier=function(u){var s=this;this.majorAnchor=u||150;this.minorAnchor=10;this._findControlPoint=function(f,g,l,k,h){k=k.getOrientation();h=h.getOrientation();var m=[],d=s.majorAnchor,e=s.minorAnchor;if(k[0]!=h[0]||k[1]==h[1]){h[0]==0?m.push(l[0]<g[0]?f[0]+e:f[0]-e):m.push(f[0]+d*h[0]);h[1]==0?m.push(l[1]<g[1]?f[1]+e:f[1]-e):m.push(f[1]+d*k[1])}else{k[0]==0?m.push(g[0]<l[0]?f[0]+e:f[0]-e):m.push(f[0]-d*k[0]);k[1]==0?m.push(g[1]<l[1]?f[1]+e:f[1]-e):m.push(f[1]+d*h[1])}return m};
- this.compute=function(f,g,l,k,h){h=h||0;var m=Math.abs(f[0]-g[0])+h,d=Math.abs(f[1]-g[1])+h,e=Math.min(f[0],g[0])-h/2,p=Math.min(f[1],g[1])-h/2,w=f[0]<g[0]?m-h/2:h/2,E=f[1]<g[1]?d-h/2:h/2,I=f[0]<g[0]?h/2:m-h/2;h=f[1]<g[1]?h/2:d-h/2;var G=s._findControlPoint([w,E],f,g,l,k);f=s._findControlPoint([I,h],g,f,k,l);g=Math.min(Math.min(w,I),Math.min(G[0],f[0]));l=Math.max(Math.max(w,I),Math.max(G[0],f[0]));if(l>m)m=l;if(g<0){e+=g;g=Math.abs(g);m+=g;G[0]+=g;w+=g;I+=g;f[0]+=g}g=Math.min(Math.min(E,h),Math.min(G[1],
- f[1]));l=Math.max(Math.max(E,h),Math.max(G[1],f[1]));if(l>d)d=l;if(g<0){p+=g;g=Math.abs(g);d+=g;G[1]+=g;E+=g;h+=g;f[1]+=g}return[e,p,m,d,w,E,I,h,G[0],G[1],f[0],f[1]]};this.paint=function(f,g){g.beginPath();g.moveTo(f[4],f[5]);g.bezierCurveTo(f[8],f[9],f[10],f[11],f[6],f[7]);g.stroke()}};jsPlumb.Endpoints.Dot=function(u){u=u||{radius:10};var s=this;this.radius=u.radius;var f=0.5*this.radius,g=this.radius/3,l=function(k){try{return parseInt(k)}catch(h){if(k.substring(k.length-1)=="%")return parseInt(k.substring(0,
- k-1))}};this.paint=function(k,h,m,d,e){var p=d.radius||s.radius;jsPlumb.sizeCanvas(m,k[0]-p,k[1]-p,p*2,p*2);k=m.getContext("2d");m=jsPlumb.extend({},d);if(m.fillStyle==null)m.fillStyle=e.strokeStyle;jsPlumb.extend(k,m);e=/MSIE/.test(navigator.userAgent)&&!window.opera;if(d.gradient&&!e){e=d.gradient;m=f;var w=g;if(e.offset)m=l(e.offset);if(e.innerRadius)w=l(e.innerRadius);e=[m,w];h=k.createRadialGradient(p,p,p,p+(h[0]==1?e[0]*-1:e[0]),p+(h[1]==1?e[0]*-1:e[0]),e[1]);for(e=0;e<d.gradient.stops.length;e++)h.addColorStop(d.gradient.stops[e][0],
- d.gradient.stops[e][1]);k.fillStyle=h}k.beginPath();k.arc(p,p,p,0,Math.PI*2,true);k.closePath();k.fill()}};jsPlumb.Endpoints.Rectangle=function(u){u=u||{width:20,height:20};var s=this;this.width=u.width;this.height=u.height;this.paint=function(f,g,l,k,h){var m=k.width||s.width,d=k.height||s.height;jsPlumb.sizeCanvas(l,f[0]-m/2,f[1]-d/2,m,d);f=l.getContext("2d");l=jsPlumb.extend({},k);if(l.fillStyle==null)l.fillStyle=h.strokeStyle;jsPlumb.extend(f,l);h=/MSIE/.test(navigator.userAgent)&&!window.opera;
- if(k.gradient&&!h){g=f.createLinearGradient(g[0]==1?m:g[0]==0?m/2:0,g[1]==1?d:g[1]==0?d/2:0,g[0]==-1?m:g[0]==0?d/2:0,g[1]==-1?d:g[1]==0?d/2:0);for(h=0;h<k.gradient.stops.length;h++)g.addColorStop(k.gradient.stops[h][0],k.gradient.stops[h][1]);f.fillStyle=g}f.beginPath();f.rect(0,0,m,d);f.closePath();f.fill()}};jsPlumb.Endpoints.Triangle=function(u){u=u||{width:15,height:15};var s=this;this.width=u.width;this.height=u.height;this.paint=function(f,g,l,k){var h=k.width||s.width,m=k.height||s.height;
- jsPlumb.sizeCanvas(l,f[0]-h/2,f[1]-m/2,h,m);f=l.getContext("2d");var d=l=0,e=0;if(g[0]==1){l=h;d=m;e=180}if(g[1]==-1){l=h;e=90}if(g[1]==1){d=m;e=-90}f.fillStyle=k.fillStyle;f.translate(l,d);f.rotate(e*Math.PI/180);f.beginPath();f.moveTo(0,0);f.lineTo(h/2,m/2);f.lineTo(0,m);f.closePath();f.fill()}};jsPlumb.Endpoints.Image=function(u){var s=this;this.img=new Image;this.img.onload=function(){s.ready=true};this.img.src=u.url;var f=function(g,l,k,h){l=s.img.width||h.width;h=s.img.height||h.height;jsPlumb.sizeCanvas(k,
- g[0]-l/2,g[1]-h/2,l,h);k.getContext("2d").drawImage(s.img,0,0)};this.paint=function(g,l,k,h,m){s.ready?f(g,l,k,h,m):window.setTimeout(function(){s.paint(g,l,k,h,m)},200)}}})();
|