-
Notifications
You must be signed in to change notification settings - Fork 1
/
jana.js
76 lines (66 loc) · 2.19 KB
/
jana.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
var common = {
isSource:true,
isTarget:true,
connector:"Straight",
endpoint:"Dot",
paintStyle:{ fillStyle:"lightblue", outlineWidth:1 },
hoverPaintStyle:{ fillStyle:"lightblue" },
connectorStyle:{ strokeStyle:"blue", lineWidth:2 },
connectorHoverStyle:{ lineWidth:3 }
};
jsPlumb.ready(function() {
//Enable dragging all item class elements
jsPlumb.draggable($(".item"), {});
// jsPlumb.connect({
// source:"db",
// target:"api-manager",
// endpoint: ["Dot", {
// radius:10,
// cssClass:"endPoint"
// }],
// connector: ["Straight"],
// anchor:[ "Perimeter", { shape:"Circle" } ],
// paintStyle:{ strokeStyle:"gray", lineWidth:5 },
// // endpointStyle:{ fillStyle:"lightgray", outlineColor:"gray" },
// overlays:[
// ["Arrow" , { width:20, length:20, location:0.97 }]
// ]
// });
jsPlumb.addEndpoint($(".item"), {
endpoint:"Dot",
anchor:[ "Perimeter", { shape:"Circle" } ],
// anchors:[
// ["Bottom"],
// ["Top"],
// ["Left"],
// ["Right"]
// ]
}, common);
jsPlumb.makeSource($(".item"), {
endpoint:"Dot",
maxConnections:3
}, common);
jsPlumb.makeTarget($(".item"), {
endpoint:"Dot",
anchor:[ "Perimeter", { shape:"Circle" } ],
maxConnections:3
}, common);
});
//--------------------------- Add Elements
$( document ).ready(function() {
// Handler for .ready() called.
$("#diagramContainer").append("<div id='dbs' class='item'> <img src='img/db.png'> </div>")
alert("fdaf")
var Div = $('<div>', { id: "X12" },
{ class: 'window ui-draggable' })
.css(
{ height: '100px',
width: '100px',
border: 'solid 1px'
}
).appendTo('body');
jsPlumb.addEndpoint($(Div), targetEndpoint);
jsPlumb.addEndpoint($(Div), sourceEndpoint);
jsPlumb.draggable($(Div));
$(Div).addClass('window');
});