-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathindex.html
304 lines (301 loc) · 10.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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="target-densitydpi=device-dpi, height=660, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>BlocklyDuino: Block Factory</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="prettify/prettify.css">
<script src="prettify/prettify.js"></script>
<script src="filesaver/Blob.js"></script>
<script src="filesaver/FileSaver.min.js"></script>
<script src="blockly/blockly_compressed.js"></script>
<script src="blockly/blocks_compressed.js"></script>
<script src="blockly/arduino_compressed.js"></script>
<script src="blockly/msg/messages.js"></script>
<script src="factory_blocks.js"></script>
<script src="generator.js"></script>
<script src="factory.js"></script>
<script src="preview.js"></script>
<script src="blocklyduinofactory.js"></script>
</head>
<body>
<table>
<!-- Firt row contains the title and buttons. -->
<tr>
<td height="5%" colspan="2">
<table>
<tr>
<td>
<h1>BlocklyDuino: Block Factory</h1>
</td>
<td style="vertical-align: middle; text-align: right;">
<input type="file" id="loadFileButton" style="display: none;"/>
<button id="loadXmlFactoryButton" title="">
<span>Load Factory XML</span>
</button>
<button id="saveXmlFactoryButton" title="">
<span>Save Factory XML</span>
</button>
<button id="downloadButton" title="" disabled>
<span>Download Block</span>
</button>
<button id="helpButton" title="View documentation in new window.">
<span>Help</span>
</button>
</td>
</tr>
</table>
</td>
</tr>
<!-- Second row has the rest of the content in two columns. -->
<tr>
<td width="50%" height="95%">
<!-- Left column table contains the define and generate workspaces. -->
<table>
<tr>
<td height="4%" class="bottom_align">
<h3>Block Definition:</h3>
</td>
</tr>
<tr>
<td height="46%">
<div id="blocklyFactory"></div>
<div id="blocklyFactoryMask"></div>
</td>
</tr>
<tr>
<td height="4%" class="bottom_align">
<h3>Block Generator:</h3>
</td>
</tr>
<tr>
<td height="46%">
<div id="blocklyGenerator"></div>
<div id="blocklyGeneratorMask"></div>
</td>
</tr>
</table>
</td>
<td width="50%" height="95%">
<!-- Right column table contains the generated code and preview. -->
<table>
<tr>
<td height="4%" class="bottom_align">
<h3>Definition code:
<select id="format">
<option value="JavaScript">JavaScript</option>
<option value="JSON">JSON</option>
<option value="Manual">Manual edit...</option>
</select>
</h3>
</td>
</tr>
<tr>
<td height="34%">
<pre id="languagePre"></pre>
<textarea id="languageTA"></textarea>
</td>
</tr>
<tr>
<td height="4%" class="bottom_align">
<h3>Preview:
<select id="direction">
<option value="ltr">LTR</option>
<option value="rtl">RTL</option>
</select>
</h3>
</td>
</tr>
<tr>
<td height="20%">
<div id="preview"></div>
</td>
</tr>
<tr>
<td height="4%" class="bottom_align">
<h3>Generator code for Arduino:</h3>
</td>
</tr>
<tr>
<td height="34%">
<pre id="generatorPre"></pre>
</td>
</tr>
</table>
</td>
</tr>
</table>
<xml id="toolboxFactory" style="display: none">
<category name="Input">
<block type="input_value"></block>
<block type="input_statement"></block>
<block type="input_dummy"></block>
</category>
<category name="Field">
<block type="field_static"></block>
<block type="field_input"></block>
<block type="field_arduino_pin"></block>
<block type="field_angle"></block>
<block type="field_dropdown"></block>
<block type="field_checkbox"></block>
<block type="field_colour"></block>
<block type="field_variable"></block>
<block type="field_image"></block>
</category>
<category name="Type">
<block type="type_group"></block>
<block type="type_null"></block>
<block type="type_boolean"></block>
<block type="type_number"></block>
<block type="type_string"></block>
<block type="type_list"></block>
<block type="type_other"></block>
</category>
<category name="Colour" id="colourCategory">
<block type="colour_hue"><mutation colour="20"></mutation><field name="HUE">20</field></block>
<block type="colour_hue"><mutation colour="65"></mutation><field name="HUE">65</field></block>
<block type="colour_hue"><mutation colour="120"></mutation><field name="HUE">120</field></block>
<block type="colour_hue"><mutation colour="160"></mutation><field name="HUE">160</field></block>
<block type="colour_hue"><mutation colour="210"></mutation><field name="HUE">210</field></block>
<block type="colour_hue"><mutation colour="230"></mutation><field name="HUE">230</field></block>
<block type="colour_hue"><mutation colour="260"></mutation><field name="HUE">260</field></block>
<block type="colour_hue"><mutation colour="290"></mutation><field name="HUE">290</field></block>
<block type="colour_hue"><mutation colour="330"></mutation><field name="HUE">330</field></block>
</category>
</xml>
<xml id="toolboxGenerator" style="display: none">
<category name="Logic">
<block type="controls_if"></block>
<block type="logic_compare"></block>
<block type="logic_operation"></block>
<block type="logic_negate"></block>
<block type="logic_null"></block>
</category>
<category name="Control">
<block type="base_delay">
<value name="DELAY_TIME">
<block type="math_number">
<field name="NUM">1000</field>
</block>
</value>
</block>
<block type="controls_for">
<value name="FROM">
<block type="math_number">
<field name="NUM">1</field>
</block>
</value>
<value name="TO">
<block type="math_number">
<field name="NUM">10</field>
</block>
</value>
</block>
<block type="controls_whileUntil"></block>
</category>
<category name="Math">
<block type="math_number"></block>
<block type="math_arithmetic"></block>
<block type="base_map">
<value name="DMAX">
<block type="math_number">
<field name="NUM">180</field>
</block>
</value>
</block>
</category>
<category name="Text">
<block type="text"></block>
</category>
<category name="Variables" custom="VARIABLE"></category>
<category name="Functions" custom="PROCEDURE"></category>
<sep></sep>
<category name="Input/Output">
<block type="inout_highlow"></block>
<block type="inout_digital_write"></block>
<block type="inout_digital_read"></block>
<block type="inout_analog_write">
<value name="NUM">
<block type="math_number">
<field name="NUM">0</field>
</block>
</value>
</block>
<block type="inout_analog_read"></block>
<block type="serial_print">
<value name="CONTENT">
<block type="text">
<field name="TEXT"></field>
</block>
</value>
</block>
<block type="inout_tone">
<value name="NUM">
<block type="math_number">
<field name="NUM">440</field>
</block>
</value>
</block>
<block type="inout_notone"></block>
<block type="inout_buildin_led"></block>
</category>
<category name="Servo">
<block type="servo_move">
<value name="DEGREE">
<block type="math_number">
<field name="NUM">0</field>
</block>
</value>
<value name="DELAY_TIME">
<block type="math_number">
<field name="NUM">1000</field>
</block>
</value>
</block>
<block type="servo_read_degrees"></block>
</category>
<category name="Grove Analog">
<block type="grove_rotary_angle"></block>
<block type="grove_temporature_sensor"></block>
<block type="grove_sound_sensor"></block>
<block type="grove_thumb_joystick"></block>
</category>
<category name="Grove">
<block type="grove_led"></block>
<block type="grove_button"></block>
<block type="grove_relay"></block>
<block type="grove_tilt_switch"></block>
<block type="grove_piezo_buzzer"></block>
<block type="grove_pir_motion_sensor"></block>
<block type="grove_line_finder"></block>
<block type="grove_rgb_led"></block>
<block type="grove_ultrasonic_ranger"></block>
</category>
<category name="Grove LCD">
<block type="grove_serial_lcd_print">
<value name="TEXT">
<block type="text">
<field name="TEXT"></field>
</block>
</value>
<value name="TEXT2">
<block type="text">
<field name="TEXT"></field>
</block>
</value>
<value name="DELAY_TIME">
<block type="math_number">
<field name="NUM">1000</field>
</block>
</value>
</block>
<block type="grove_serial_lcd_power"></block>
<block type="grove_serial_lcd_effect"></block>
</category>
<category name="Grove Motor">
<block type="grove_motor_shield"></block>
</category>
</xml>
</body>
</html>