123456789101112131415161718192021222324252627282930313233343536373839 |
- (function(){function e(){o&&f()}var h=/MSIE/.test(navigator.userAgent)&&!window.opera,d=null,f=function(){j.repaintEverything()},o=true,m=null;$(window).bind("resize",function(){m&&clearTimeout(m);m=setTimeout(e,100)});var g={},l=[],s={},r={},y=true,z=[],H=1200,I=function(a,b,c){var i=function(q,t){if(q===t)return true;else if(typeof q=="object"&&typeof t=="object"){var u=true;for(var v in q)if(!i(q[v],t[v])){u=false;break}for(v in t)if(!i(t[v],q[v])){u=false;break}return u}};c=+c||0;for(var p=a.length;c<
- p;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)},O=function(a,b){var c=C(a,"id"),i=g[c];if(i){J(c,b);for(var p=l[c],q=z[c],t=0;t<i.length;t++){var u=i[t],v=i[t].anchor.compute([p.left,p.top],q);u.paint(v);u=u.connections;for(v=0;v<u.length;v++)u[v].paint(c,b)}}},T=function(a,b){var c=null;if(typeof a=="object"&&a.length){c=[];for(var i=0;i<a.length;i++){var p=w(a[i]),q=C(p,"id");c.push(b(p,q))}}else{p=w(a);q=C(p,"id");c=b(p,q)}return c},C=function(a,
- b){var c=j.CurrentLibrary.getElementObject(a);return j.CurrentLibrary.getAttribute(c,b)},Q=function(a,b,c){a=j.CurrentLibrary.getElementObject(a);j.CurrentLibrary.setAttribute(a,b,c)},w=function(a){return j.CurrentLibrary.getElementObject(a)},ba=function(a,b){return j.CurrentLibrary.initDroppable(a,b)},R=function(a,b,c,i){if((c==null?y:c)&&j.CurrentLibrary.isDragSupported(a)){var p=i||j.Defaults.DragOptions;p=j.extend({},p);var q=j.CurrentLibrary.dragEvents.drag;(function(t,u,v){p[q]=K(p[q],v);u=
- r[u];p.disabled=u==null?false:!u;j.CurrentLibrary.initDraggable(t,p)})(a,b,function(){var t=j.CurrentLibrary.getUIPosition(arguments);O(a,t);t=j.CurrentLibrary.getElementObject(a);j.CurrentLibrary.addClass(t,"jsPlumb_dragged")})}},U=function(a){var b=document.createElement("canvas");document.body.appendChild(b);b.style.position="absolute";if(a)b.className=a;a=b;var c=C(a,"id");if(!c){c="_jsPlumb_"+new String((new Date).getTime());Q(a,"id",c)}if(h){j.sizeCanvas(b,0,0,H,H);b=G_vmlCanvasManager.initElement(b)}return b},
- P=function(a,b){var c=g[a];if(c&&c.length)for(var i=0;i<c.length;i++)for(var p=0;p<c[i].connections.length;p++)if(b(c[i].connections[p]))return},ca=function(a){for(var b in g)P(b,a)},L=function(a){if(a!=null)try{document.body.removeChild(a)}catch(b){}},V=function(a,b,c){a=a[b];if(a!=null){c=I(a,c);if(c>=0){delete a[c];a.splice(c,1);return true}}return false},W=function(a,b){var c=C(a,"id");P(c,function(i){i.canvas.style.display=b})},X=function(a){P(a,function(b){b.canvas.style.display="none"==b.canvas.style.display?
- "block":"none"})},J=function(a,b,c){if(c||b==null){w(a);b=j.CurrentLibrary.getElementObject(a);b=j.CurrentLibrary.getSize(b);z[a]=b;b=j.CurrentLibrary.getElementObject(a);b=j.CurrentLibrary.getOffset(b);l[a]=b}else l[a]=b},K=function(a,b){a=a||function(){};return function(){b.apply(this,arguments);a.apply(this,arguments)}},da=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,p){return[i[0]+b.x*p[0]+b.offsets[0],i[1]+
- b.y*p[1]+b.offsets[1]]};this.getOrientation=function(){return c}},ea=function(a){var b=a.reference,c=0,i=0,p=null;this.compute=function(q){i=c=0;return[q[0],q[1]]};this.getOrientation=function(){if(p)return p;else{var q=b.getOrientation();return[Math.abs(q[0])*c*-1,Math.abs(q[1])*i*-1]}};this.over=function(q){p=q.getOrientation()};this.out=function(){p=null}},Y=function(a){var b=this;this.source=w(a.source);this.target=w(a.target);this.sourceId=C(this.source,"id");this.targetId=C(this.target,"id");
- this.endpointsOnTop=a.endpointsOnTop!=null?a.endpointsOnTop:true;this.endpoints=[];this.endpointStyles=[];var c=function(q,t,u){if(q)b.endpoints[t]=q;else{if(!u.endpoints)u.endpoints=[null,null];q=u.endpoints[t]||u.endpoint||j.Defaults.Endpoints[t]||j.Defaults.Endpoint||new j.Endpoints.Dot;if(!u.endpointStyles)u.endpointStyles=[null,null];b.endpoints[t]=new S({style:u.endpointStyles[t]||u.endpointStyle||j.Defaults.EndpointStyles[t]||j.Defaults.EndpointStyle,endpoint:q,connections:[b],anchor:u.anchors?
- u.anchors[t]:j.Defaults.Anchors[t]||j.Anchors.BottomCenter})}};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].connectionStyle||this.endpoints[1].connectionStyle||a.paintStyle||j.Defaults.PaintStyle;J(this.sourceId);J(this.targetId);c=l[this.sourceId];var i=z[this.sourceId];c=this.endpoints[0].anchor.compute([c.left,c.top],i);this.endpoints[0].paint(c);
- c=l[this.targetId];i=z[this.targetId];c=this.endpoints[1].anchor.compute([c.left,c.top],i);this.endpoints[1].paint(c);var p=U(j.connectorClass);this.canvas=p;this.paint=function(q,t,u){d&&d.debug("Painting Connection; element in motion is "+q+"; ui is ["+t+"]; recalc is ["+u+"]");var v=q!=this.sourceId,A=v?this.sourceId:this.targetId,k=v?0:1,F=v?1:0;if(this.canvas.getContext){J(q,t,u);u&&J(A);t=l[q];u=l[A];q=z[q];var G=z[A];A=p.getContext("2d");var x=this.endpoints[F].anchor.compute([t.left,t.top],
- q,[u.left,u.top],G);this.endpoints[F].anchor.getOrientation();t=this.endpoints[k].anchor.compute([u.left,u.top],G,[t.left,t.top],q);this.endpoints[k].anchor.getOrientation();k=this.connector.compute(x,t,this.endpoints[F].anchor,this.endpoints[k].anchor,this.paintStyle.lineWidth);j.sizeCanvas(p,k[0],k[1],k[2],k[3]);j.extend(A,this.paintStyle);if(this.paintStyle.gradient&&!h){v=v?A.createLinearGradient(k[4],k[5],k[6],k[7]):A.createLinearGradient(k[6],k[7],k[4],k[5]);for(F=0;F<this.paintStyle.gradient.stops.length;F++)v.addColorStop(this.paintStyle.gradient.stops[F][0],
- this.paintStyle.gradient.stops[F][1]);A.strokeStyle=v}this.connector.paint(k,A)}};this.repaint=function(){this.paint(this.sourceId,null,true)};R(b.source,b.sourceId,a.draggable,a.dragOptions);R(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.connectionStyle=a.connectionStyle;
- this.connector=a.connector;var p=a.source,q=C(p,"id"),t=a.maxConnections||1;this.canvas=a.canvas||U(j.endpointClass);this.connections=a.connections||[];var u=a.reattach||false,v=null;this.addConnection=function(n){b.connections.push(n)};this.removeConnection=function(n){n=I(b.connections,n);n>=0&&b.connections.splice(n,1)};this.isConnectedTo=function(n){var D=false;if(n)for(var B=0;B<b.connections.length;B++)if(b.connections[B].endpoints[1]==n){D=true;break}return D};this.isFloating=function(){return v!=
- null};this.isFull=function(){return t<1?false:b.connections.length>=t};this.paint=function(n,D,B){d&&d.debug("Painting Endpoint with elementId ["+q+"]; anchorPoint is ["+n+"]");if(n==null){n=l[q];var M=z[q];if(n==null||M==null){J(q);n=l[q];M=z[q]}n=b.anchor.compute([n.left,n.top],M)}c.paint(n,b.anchor.getOrientation(),B||b.canvas,i,D||i)};if(a.isSource&&j.CurrentLibrary.isDragSupported(p)){var A=null,k=null,F=false,G=null,x=a.dragOptions||{},N=j.extend({},j.CurrentLibrary.defaultDragOptions);x=j.extend(N,
- x);N=j.CurrentLibrary.dragEvents.start;var Z=j.CurrentLibrary.dragEvents.stop,aa=j.CurrentLibrary.dragEvents.drag;x[N]=K(x[N],function(){A=document.createElement("div");document.body.appendChild(A);var n=""+new String((new Date).getTime());Q(w(A),"id",n);J(n);Q(w(b.canvas),"dragId",n);Q(w(b.canvas),"elId",q);var D=new ea({reference:b.anchor});v=new S({style:i,endpoint:c,anchor:D,source:A});k=b.connections.length==0||b.connections.length<t?null:b.connections[0];if(k==null){k=new Y({sourceEndpoint:b,
- targetEndpoint:v,source:w(p),target:w(A),anchors:[b.anchor,D],paintStyle:a.connectionStyle,connector:a.connector});b.addConnection(k)}else{F=true;D=k.sourceId==q?0:1;k.floatingAnchorIndex=D;b.removeConnection(k);if(D==0){G=[k.source,k.sourceId];k.source=w(A);k.sourceId=n}else{G=[k.target,k.targetId];k.target=w(A);k.targetId=n}k.suspendedEndpoint=k.endpoints[D];k.endpoints[D]=v}s[n]=k;v.addConnection(k);E(g,n,v)});x[aa]=K(x[aa],function(){var n=j.CurrentLibrary.getUIPosition(arguments);O(w(A),n)});
- x[Z]=K(x[Z],function(){V(g,null,v);var n=[v.canvas,A];for(var D in n)L(n[D]);n=k.floatingAnchorIndex==null?1:k.floatingAnchorIndex;if(k.endpoints[n]==v)if(F&&k.suspendedEndpoint)if(u){k.floatingAnchorIndex=null;if(n==0){k.source=G[0];k.sourceId=G[1]}else{k.target=G[0];k.targetId=G[1]}k.endpoints[n]=k.suspendedEndpoint;k.suspendedEndpoint.addConnection(k);j.repaint(G[1])}else{k.endpoints[0].removeConnection(k);k.endpoints[1].removeConnection(k);L(k.canvas)}else{L(k.canvas);b.removeConnection(k)}k=
- null;delete v});N=w(b.canvas);j.CurrentLibrary.initDraggable(N,x)}if(a.isTarget&&j.CurrentLibrary.isDropSupported(p)){x=a.dropOptions||j.Defaults.DropOptions;x=j.extend({},x);x.drop=K(x.drop,function(){var n=j.CurrentLibrary.getDragObject(arguments),D=C(w(n),"dragId");n=C(w(n),"elId");var B=s[D],M=B.floatingAnchorIndex==null?1:B.floatingAnchorIndex;if(M==0){B.source=p;B.sourceId=q}else{B.target=p;B.targetId=q}B.endpoints[M].removeConnection(B);B.suspendedEndpoint&&B.suspendedEndpoint.removeConnection(B);
- B.endpoints[M]=b;b.addConnection(B);R(p,q,a.draggable,{});j.repaint(n);delete s[D]});x.over=K(x.over,function(){var n=j.CurrentLibrary.getDragObject(arguments);n=C(w(n),"dragId");n=s[n];n.endpoints[n.floatingAnchorIndex==null?1:n.floatingAnchorIndex].anchor.over(b.anchor)});x.out=K(x.out,function(){var n=j.CurrentLibrary.getDragObject(arguments);n=C(w(n),"dragId");n=s[n];n.endpoints[n.floatingAnchorIndex==null?1:n.floatingAnchorIndex].anchor.out()});ba(w(b.canvas),x)}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"}},connectorClass:"_jsPlumb_connector",endpointClass:"_jsPlumb_endpoint",Anchors:{},Connectors:{},Endpoints:{},addEndpoint:function(a,b){b=j.extend({},b);var c=w(a),i=C(a,"id");b.source=c;J(i);c=new S(b);E(g,i,c);var p=l[i];i=c.anchor.compute([p.left,p.top],z[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=w(a),p=C(a,"id");c=c||{};c.step=K(c.step,function(){j.repaint(p)});j.CurrentLibrary.animate(i,b,c)},connect:function(a){if(!(a.sourceEndpoint&&a.sourceEndpoint.isFull()))if(!(a.targetEndpoint&&a.targetEndpoint.isFull())){var b=new Y(a);a.sourceEndpoint||E(g,b.sourceId,b.endpoints[0]);a.targetEndpoint||E(g,b.targetId,b.endpoints[1]);b.endpoints[0].addConnection(b);b.endpoints[1].addConnection(b);
- O(b.source);return b}},detach:function(a,b){P(a,function(c){if(c.sourceId==a&&c.targetId==b||c.targetId==a&&c.sourceId==b){L(c.canvas);c.endpoints[0].removeConnection(c);c.endpoints[1].removeConnection(c);return true}})},detachAll:function(a){a=C(a,"id");P(a,function(b){L(b.canvas);b.endpoints[0].removeConnection(b);b.endpoints[1].removeConnection(b)})},detachEverything:function(){ca(function(a){L(a.canvas);a.endpoints[0].removeConnection(a);a.endpoints[1].removeConnection(a)})},extend:function(a,
- b){return j.CurrentLibrary.extend(a,b)},hide:function(a){W(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 da(c)},repaint:function(a){var b=function(i){i=w(i);O(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 g)O(w(a))},removeAllEndpoints:function(a){a=
- C(a,"id");j.detachAll(a);var b=g[a];for(var c in b)L(b[c].canvas);g[a]=[]},removeEndpoint:function(a,b){var c=C(a,"id");g[c]&&V(g,c,b)&&L(b.canvas)},setAutomaticRepaint:function(a){o=a},setDefaultNewCanvasSize:function(a){H=a},setDraggable:function(a,b){return T(a,function(c,i){r[i]=b;j.CurrentLibrary.isDragSupported(c)&&j.CurrentLibrary.setDraggable(c,b)})},setDraggableByDefault:function(a){y=a},setDebugLog:function(a){d=a},setRepaintFunction:function(a){f=a},show:function(a){W(a,"block")},sizeCanvas:function(a,
- b,c,i,p){if(a){a.style.height=p+"px";a.height=p;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=g[a])?a.length:0}}},toggle:X,toggleVisible:X,toggleDraggable:function(a){return T(a,function(b,c){var i=r[c]==null?y:r[c];i=!i;r[c]=i;j.CurrentLibrary.setDraggable(b,i);return i})},unload:function(){delete g;delete l;delete z;delete s;delete r}}})();
- (function(e){e.fn.plumb=function(h){h=e.extend({},h);return this.each(function(){var d=e.extend({source:e(this)},h);jsPlumb.connect(d)})};e.fn.detach=function(h){return this.each(function(){var d=e(this).attr("id");if(typeof h=="string")h=[h];for(var f=0;f<h.length;f++)jsPlumb.detach(d,h[f])})};e.fn.detachAll=function(){return this.each(function(){var h=e(this).attr("id");jsPlumb.detachAll(h)})};e.fn.addEndpoint=function(h){var d=[];this.each(function(){d.push(jsPlumb.addEndpoint(e(this).attr("id"),
- h))});return d[0]};e.fn.addEndpoints=function(h){var d=[];this.each(function(){for(var f=jsPlumb.addEndpoints(e(this).attr("id"),h),o=0;o<f.length;o++)d.push(f[o])});return d};e.fn.removeEndpoint=function(h){this.each(function(){jsPlumb.removeEndpoint(e(this).attr("id"),h)})}})(jQuery);
- (function(){jsPlumb.CurrentLibrary={dragEvents:{start:"start",stop:"stop",drag:"drag"},defaultDragOptions:{opacity:0.5,revert:true,helper:"clone"},extend:function(e,h){return $.extend(e,h)},getElementObject:function(e){return typeof e=="string"?$("#"+e):$(e)},getOffset:function(e){return e.offset()},getSize:function(e){return[e.outerWidth(),e.outerHeight()]},getAttribute:function(e,h){return e.attr(h)},setAttribute:function(e,h,d){e.attr(h,d)},addClass:function(e,h){e.addClass(h)},initDraggable:function(e,
- h){e.length>1&&alert("poo");e.draggable(h)},isDragSupported:function(e){return e.draggable},setDraggable:function(e,h){e.draggable("option","disabled",!h)},initDroppable:function(e,h){e.droppable(h)},isDropSupported:function(e){return e.droppable},animate:function(e,h,d){e.animate(h,d)},getUIPosition:function(e){e=e[1];return e.absolutePosition||e.offset},getDragObject:function(e){return e[1].draggable}}})();
- (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(e,h,d,f,o){d=Math.abs(e[0]-h[0]);f=Math.abs(e[1]-h[1]);var m=0.45*d,g=0.45*f;d*=1.9;f*=1.9;var l=Math.min(e[0],h[0])-m,s=Math.min(e[1],h[1])-g;if(d<2*o){d=2*o;l=e[0]+(h[0]-e[0])/2-o;m=(d-Math.abs(e[0]-h[0]))/2}if(f<2*o){f=2*o;s=e[1]+(h[1]-e[1])/2-o;g=(f-Math.abs(e[1]-h[1]))/2}return[l,s,d,f,e[0]<h[0]?d-m:m,e[1]<h[1]?f-g:g,e[0]<h[0]?m:d-m,e[1]<h[1]?g:f-g]};this.paint=function(e,h){h.beginPath();h.moveTo(e[4],e[5]);h.lineTo(e[6],e[7]);
- h.stroke()}};jsPlumb.Connectors.Bezier=function(e){var h=this;this.majorAnchor=e||150;this.minorAnchor=10;this._findControlPoint=function(d,f,o,m,g){m=m.getOrientation();g=g.getOrientation();var l=[],s=h.majorAnchor,r=h.minorAnchor;if(m[0]!=g[0]||m[1]==g[1]){g[0]==0?l.push(o[0]<f[0]?d[0]+r:d[0]-r):l.push(d[0]+s*g[0]);g[1]==0?l.push(o[1]<f[1]?d[1]+r:d[1]-r):l.push(d[1]+s*m[1])}else{m[0]==0?l.push(f[0]<o[0]?d[0]+r:d[0]-r):l.push(d[0]-s*m[0]);m[1]==0?l.push(f[1]<o[1]?d[1]+r:d[1]-r):l.push(d[1]+s*g[1])}return l};
- this.compute=function(d,f,o,m,g){g=g||0;var l=Math.abs(d[0]-f[0])+g,s=Math.abs(d[1]-f[1])+g,r=Math.min(d[0],f[0])-g/2,y=Math.min(d[1],f[1])-g/2,z=d[0]<f[0]?l-g/2:g/2,H=d[1]<f[1]?s-g/2:g/2,I=d[0]<f[0]?g/2:l-g/2;g=d[1]<f[1]?g/2:s-g/2;var E=h._findControlPoint([z,H],d,f,o,m);d=h._findControlPoint([I,g],f,d,m,o);f=Math.min(Math.min(z,I),Math.min(E[0],d[0]));o=Math.max(Math.max(z,I),Math.max(E[0],d[0]));if(o>l)l=o;if(f<0){r+=f;f=Math.abs(f);l+=f;E[0]+=f;z+=f;I+=f;d[0]+=f}f=Math.min(Math.min(H,g),Math.min(E[1],
- d[1]));o=Math.max(Math.max(H,g),Math.max(E[1],d[1]));if(o>s)s=o;if(f<0){y+=f;f=Math.abs(f);s+=f;E[1]+=f;H+=f;g+=f;d[1]+=f}return[r,y,l,s,z,H,I,g,E[0],E[1],d[0],d[1]]};this.paint=function(d,f){f.beginPath();f.moveTo(d[4],d[5]);f.bezierCurveTo(d[8],d[9],d[10],d[11],d[6],d[7]);f.stroke()}};jsPlumb.Endpoints.Dot=function(e){e=e||{radius:10};var h=this;this.radius=e.radius;var d=0.5*this.radius,f=this.radius/3,o=function(m){try{return parseInt(m)}catch(g){if(m.substring(m.length-1)=="%")return parseInt(m.substring(0,
- m-1))}};this.paint=function(m,g,l,s,r){var y=s.radius||h.radius;jsPlumb.sizeCanvas(l,m[0]-y,m[1]-y,y*2,y*2);m=l.getContext("2d");l=jsPlumb.extend({},s);if(l.fillStyle==null)l.fillStyle=r.strokeStyle;jsPlumb.extend(m,l);r=/MSIE/.test(navigator.userAgent)&&!window.opera;if(s.gradient&&!r){r=s.gradient;l=d;var z=f;if(r.offset)l=o(r.offset);if(r.innerRadius)z=o(r.innerRadius);r=[l,z];g=m.createRadialGradient(y,y,y,y+(g[0]==1?r[0]*-1:r[0]),y+(g[1]==1?r[0]*-1:r[0]),r[1]);for(r=0;r<s.gradient.stops.length;r++)g.addColorStop(s.gradient.stops[r][0],
- s.gradient.stops[r][1]);m.fillStyle=g}m.beginPath();m.arc(y,y,y,0,Math.PI*2,true);m.closePath();m.fill()}};jsPlumb.Endpoints.Rectangle=function(e){e=e||{width:20,height:20};var h=this;this.width=e.width;this.height=e.height;this.paint=function(d,f,o,m,g){var l=m.width||h.width,s=m.height||h.height;jsPlumb.sizeCanvas(o,d[0]-l/2,d[1]-s/2,l,s);d=o.getContext("2d");o=jsPlumb.extend({},m);if(o.fillStyle==null)o.fillStyle=g.strokeStyle;jsPlumb.extend(d,o);g=/MSIE/.test(navigator.userAgent)&&!window.opera;
- if(m.gradient&&!g){f=d.createLinearGradient(f[0]==1?l:f[0]==0?l/2:0,f[1]==1?s:f[1]==0?s/2:0,f[0]==-1?l:f[0]==0?s/2:0,f[1]==-1?s:f[1]==0?s/2:0);for(g=0;g<m.gradient.stops.length;g++)f.addColorStop(m.gradient.stops[g][0],m.gradient.stops[g][1]);d.fillStyle=f}d.beginPath();d.rect(0,0,l,s);d.closePath();d.fill()}};jsPlumb.Endpoints.Triangle=function(e){e=e||{width:15,height:15};var h=this;this.width=e.width;this.height=e.height;this.paint=function(d,f,o,m){var g=m.width||h.width,l=m.height||h.height;
- jsPlumb.sizeCanvas(o,d[0]-g/2,d[1]-l/2,g,l);d=o.getContext("2d");var s=o=0,r=0;if(f[0]==1){o=g;s=l;r=180}if(f[1]==-1){o=g;r=90}if(f[1]==1){s=l;r=-90}d.fillStyle=m.fillStyle;d.translate(o,s);d.rotate(r*Math.PI/180);d.beginPath();d.moveTo(0,0);d.lineTo(g/2,l/2);d.lineTo(0,l);d.closePath();d.fill()}};jsPlumb.Endpoints.Image=function(e){var h=this;this.img=new Image;this.img.onload=function(){h.ready=true};this.img.src=e.url;var d=function(f,o,m,g){o=h.img.width||g.width;g=h.img.height||g.height;jsPlumb.sizeCanvas(m,
- f[0]-o/2,f[1]-g/2,o,g);m.getContext("2d").drawImage(h.img,0,0)};this.paint=function(f,o,m,g,l){h.ready?d(f,o,m,g,l):window.setTimeout(function(){h.paint(f,o,m,g,l)},200)}}})();
|