-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
241 lines (211 loc) · 11.2 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>NSD-Maker</title>
<link rel="stylesheet" href="res/styles.css">
<script src='js/panzoom/panzoom.min.js'></script>
<script src='js/html2canvas.min.js'></script>
</head>
<body>
<div class="menu">
<button onclick="upload();">Open <b>[^O]</b></button>
<button onclick="save();">Save <b>[^S]</b></button>
<button onclick="printContent();">Print <b>[^P]</b></button>
<button onclick="removeElement();">Delete <b>[DEL]</b></button>
<button onclick="centerCanvas();">Center canvas <b>[^A]</b></button>
<button onclick="undo();">Undo <b>[^Z]</b></button>
<button onclick="redo();">Redo <b>[^Y]</b></button>
<button id="png" onclick="getImage();">Export PNG <b>[^E]</b></button>
<button onclick="clearCanvas();">Clear <b>[^DEL]</b></button>
<a href="https://github.com/charyan/nsdmaker" target="_blank"><img src="res/img/github-mark-white.png"></a>
</div>
<div id="canvas">
<div id="rblock" class="dblock program">
<textarea rows="1" placeholder="Program" ondrop="return false;" oninput="textareaResize(event);"></textarea>
<div class="droparea drop-before-end" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
</div>
</div>
<div id="sidebar">
<h2>Process</h2>
<div class="dblock process" draggable="true" ondragstart="drag(event)">
<div class="droparea drop-before-begin" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
<textarea rows="1" placeholder="Process" ondrop="return false;" oninput="textareaResize(event);"
ondragstart="return false;" onfocusin="disableDraggableParent(event);"
onfocusout="enableDraggableParent(event);"></textarea>
</div>
<h2>Decision</h2>
<div class="dblock decision decision-two" draggable="true" ondragstart="drag(event)">
<div class="droparea drop-before-begin" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
<textarea rows="1" placeholder="Condition" ondrop="return false;" oninput="textareaResize(event);"
ondragstart="return false;" onfocusin="disableDraggableParent(event);"
onfocusout="enableDraggableParent(event);"></textarea>
<div class="triangles">
<svg>
<line x1="-5%" y1="0" x2="105%" y2="100%" style="stroke:rgb(127,127,127);stroke-width:5" />
</svg>
<svg>
<line x1="-5%" y1="100%" x2="105%" y2="0" style="stroke:rgb(127,127,127);stroke-width:5" />
</svg>
</div>
<div class="decision-branches">
<div class="decision-branch">
<textarea class="decision-two-ta" rows="1" placeholder="True" ondrop="return false;"
oninput="textareaResize(event);" ondragstart="return false;" onfocusin="disableDraggableParent(event);"
onfocusout="enableDraggableParent(event);"></textarea>
<div class="droparea drop-before-end decision-two-da" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
</div>
<div class="decision-branch">
<textarea class="decision-two-ta" rows="1" placeholder="False" ondrop="return false;"
oninput="textareaResize(event);" ondragstart="return false;" onfocusin="disableDraggableParent(event);"
onfocusout="enableDraggableParent(event);"></textarea>
<div class="droparea drop-before-end decision-two-da" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
</div>
</div>
</div>
<h2>CASE Statement</h2>
<div class="dblock decision" draggable="true" ondragstart="drag(event)" ondrop="decisionDrop(event);">
<div class="droparea drop-before-begin" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
<textarea rows="1" placeholder="Condition" ondrop="return false;" oninput="textareaResize(event);"
ondragstart="return false;" onfocusin="disableDraggableParent(event);"
onfocusout="enableDraggableParent(event);"></textarea>
<div class="triangles">
<svg>
<line x1="-5%" y1="0" x2="105%" y2="100%" style="stroke:rgb(127,127,127);stroke-width:5" />
</svg>
<svg>
<line x1="-5%" y1="100%" x2="105%" y2="0" style="stroke:rgb(127,127,127);stroke-width:5" />
</svg>
</div>
<div class="decision-branches">
<div class="decision-branch">
<textarea rows="1" placeholder="True" ondrop="return false;" oninput="textareaResize(event);"
ondragstart="return false;" onfocusin="disableDraggableParent(event);"
onfocusout="enableDraggableParent(event);"></textarea>
<div class="droparea drop-before-end" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
</div>
<div class="decision-branch">
<textarea rows="1" placeholder="False" ondrop="return false;" oninput="textareaResize(event);"
ondragstart="return false;" onfocusin="disableDraggableParent(event);"
onfocusout="enableDraggableParent(event);"></textarea>
<div class="droparea drop-before-end" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
</div>
<div class="decision-branch">
<textarea rows="1" placeholder="Default" ondrop="return false;" oninput="textareaResize(event);"
ondragstart="return false;" onfocusin="disableDraggableParent(event);"
onfocusout="enableDraggableParent(event);"></textarea>
<div class="droparea drop-before-end" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
</div>
</div>
</div>
<div class="dblock decision-item" draggable="true" ondragstart="drag(event)">
<textarea rows="1" placeholder="Branch" ondrop="return false;" oninput="textareaResize(event);"
ondragstart="return false;" onfocusin="disableDraggableParent(event);"
onfocusout="enableDraggableParent(event);"></textarea>
</div>
<h2>Iteration</h2>
<div class="dblock iteration" draggable="true" ondragstart="drag(event)">
<div class="droparea drop-before-begin" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
<textarea class="left-ta rewh-ta" rows="1" placeholder="Condition" ondrop="return false;"
oninput="textareaResize(event);" ondragstart="return false;" onfocusin="disableDraggableParent(event);"
onfocusout="enableDraggableParent(event);"></textarea>
<div class="droparea drop-before-end drop-iteration" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
</div>
<h2>Repeat-While</h2>
<div class="dblock repeatwhile" draggable="true" ondragstart="drag(event)">
<div class="droparea drop-before-begin" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
<div class="droparea drop-before-end drop-repeatwhile" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
<textarea class="left-ta" rows="1" placeholder="Condition" ondrop="return false;" oninput="textareaResize(event);"
ondragstart="return false;" onfocusin="disableDraggableParent(event);"
onfocusout="enableDraggableParent(event);"></textarea>
</div>
<h2>Begin-End</h2>
<div class="dblock begin-end" draggable="true" ondragstart="drag(event)">
<div class="droparea drop-before-begin" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
<textarea class="left-ta" rows="1" placeholder="Condition" ondrop="return false;" oninput="textareaResize(event);"
ondragstart="return false;" onfocusin="disableDraggableParent(event);"
onfocusout="enableDraggableParent(event);"></textarea>
<div class="droparea drop-before-end drop-begin-end" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
<textarea class="left-ta" rows="1" placeholder="Condition" ondrop="return false;" oninput="textareaResize(event);"
ondragstart="return false;" onfocusin="disableDraggableParent(event);"
onfocusout="enableDraggableParent(event);"></textarea>
</div>
<h2>Parallel Processing</h2>
<div class="dblock decision parallel" draggable="true" ondragstart="drag(event)" ondrop="parallelDrop(event);">
<div class="droparea drop-before-begin" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
<div class="parallel-top">
<svg>
<line x1="0" y1="103%" x2="20%" y2="-3%" style="stroke:rgb(127,127,127);stroke-width:5" />
</svg>
<svg>
<line x1="80%" y1="-3%" x2="100%" y2="103%" style="stroke:rgb(127,127,127);stroke-width:5" />
</svg>
</div>
<div class="decision-branches">
<div class="decision-branch">
<div class="droparea drop-before-end par-da" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
</div>
<div class="decision-branch">
<div class="droparea drop-before-end par-da" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
</div>
<div class="decision-branch">
<div class="droparea drop-before-end par-da" ondrop="drop(event)" ondragover="allowDrop(event)"
ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
</div>
</div>
</div>
<div class="parallel-bottom">
<svg>
<line x1="0" y1="-3%" x2="20%" y2="103%" style="stroke:rgb(127,127,127);stroke-width:5" />
</svg>
<svg>
<line x1="80%" y1="103%" x2="100%" y2="-3%" style="stroke:rgb(127,127,127);stroke-width:5" />
</svg>
</div>
</div>
<div class="dblock parallel-item" draggable="true" ondragstart="drag(event)">
<textarea rows="1" placeholder="Parallel Block" ondrop="return false;" oninput="textareaResize(event);"
ondragstart="return false;" onfocusin="disableDraggableParent(event);"
onfocusout="enableDraggableParent(event);"></textarea>
</div>
</div>
</body>
<script src="js/main.js"></script>
</html>