-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest16.html
More file actions
107 lines (93 loc) · 3.07 KB
/
test16.html
File metadata and controls
107 lines (93 loc) · 3.07 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<style>
.container
{
position:relative;
border: 1px solid;
height: 500px;
width: 600px;
}
.node
{
height: 100px;
width: 100px;
border: solid 6px;
text-align: center;
display: inline;
line-height: 100px;
position: absolute;
}
.palette
{
position:absolute;
border: 1px solid;
height: 500px;
width: 200px;
left: 650px;
}
.placeholder {
background: green;
position: absolute;
}
.info
{
position:absolute;
border: 1px solid;
height: 100px;
width: 200px;
top: 550px;
left: 650px;
}
</style>
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/jquery-ui.js"></script>
<script type="text/javascript" src="area-notifier-2.js"></script>
<script type="text/javascript" src="node.js"></script>
<script type="text/javascript" src="process.js"></script>
<script type="text/javascript" src="painter.js"></script>
<script type="text/javascript" src="grid-manager.js"></script>
</head>
<body>
<div id='container'>
<div id='node' class='node'>
Content
</div>
</div>
<script>
function add(){
//var node = $("<div class='node'>");
var node = $("#node");
node.css('top','100px');
node.css('left','100px');
return node;
}
var node = add();
//var area = new Area({element:$("#node"), wide:20, debug:true});
var area = new Area({element:node, wide:20, debug:true});
node.draggable();
/*
node.draggable({'stop': function(event,ui){
area.resetAreas();
}
});
*/
$("#node").on('areaInvaded',function(event,data){
ph = $('<div>');
ph.addClass('placeholder');
// ph.attr('node-id',data.getElement());
ph.css('position','absolute');
ph.css('top',data.getAreaInvaded().getPosition().top);
ph.css('left',data.getAreaInvaded().getPosition().left);
ph.css('width',data.getAreaInvaded().getWidth());
ph.css('height',data.getAreaInvaded().getHeight());
$("#container").append(ph);
});
$("#node").on('areaReleased',function(event,data){
ph.remove();
});
</script>
</body>
</html>