-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
87 lines (84 loc) · 2.19 KB
/
index.html
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
<html>
<head>
<style>
body {
background: #808080;
margin: 0px;
padding: 5px;
overflow: scroll;
overflow-x: scroll;
min-width: 650px;
width: 650px;
min-height: 480px;
height: 480px;
}
#canvas {
color: white;
margin: 0px;
position: relative;
background: url('cross.png');
background-color: #005;
width: 500px;
height: 480px;
border-bottom: 1px solid #646464;
border-right: 1px solid #646464;
}
#canvas.delete-mode {
cursor: crosshair;
}
#panel {
float: left;
clear: none;
padding: 6px;
padding-top: 4px;
padding-bottom: 0px;
margin-right: 5px;
border-radius:8px;
background: #333333;
width: auto;
height: 476px;
}
#panel button {
background-color: #3D3D3D;
margin: 0px;
border-radius:8px;
border: 0px;
width: 60px;
height: 60px;
}
#panel button:hover {
background-color: #494949;
}
</style>
</head>
<body>
<div id="panel">
<button type="button" onclick="new_node()" title="Add node"><img src="add.png"/></button>
<button type="button" onclick="remove_node()" title="Remove node"><img src="remove.png"/></button>
</div>
<canvas id="canvas" width="500" height="480"></canvas>
<script type="application/javascript" src="jquery-2.0.3.min.js"></script>
<script type="application/javascript" src="MOP.js"></script>
<script type="application/javascript" src="nodeView.js"></script>
<script type="application/javascript">
$(function() {
scene = NodeView.Scene.new($('#canvas')[0])
scene.context.fillStyle = "white"
scene.context.strokeStyle = "white"
scene.draw()
new_node = function() {
scene.addNode(
NodeView.Node.new({x:0, y:0, w:100, h:50, inputs:3, outputs:1}),
true
)
}
remove_node = function() {
scene.removeNode(null, true)
}
})
</script>
</body>
</html>
<!--
vim: ts=2 sw=2 et sts=0
-->