forked from ocadotechnology/cfl-bots-for-kids
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrial1.js
46 lines (39 loc) · 1.17 KB
/
Trial1.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
/* TODO: Change toolbox XML ID if necessary. Can export toolbox XML from Workspace Factory. */
var toolbox = document.getElementById("trial_toolbox");
var options = {
toolbox : toolbox,
collapse : true,
comments : true,
disable : true,
maxBlocks : Infinity,
trashcan : true,
horizontalLayout : false,
toolboxPosition : 'start',
css : true,
media : 'https://blockly-demo.appspot.com/static/media/',
rtl : false,
scrollbars : true,
sounds : true,
oneBasedIndex : true,
grid : {
spacing : 20,
length : 1,
colour : '#888',
snap : false
},
zoom : {
controls : true,
wheel : true,
startScale : 1,
maxScale : 3,
minScale : 0.3,
scaleSpeed : 1.2
}
};
/* Inject your workspace */
var workspace = Blockly.inject(/* TODO: Add ID of div to inject Blockly into */, options);
/* Load Workspace Blocks from XML to workspace. Remove all code below if no blocks to load */
/* TODO: Change workspace blocks XML ID if necessary. Can export workspace blocks XML from Workspace Factory. */
var workspaceBlocks = document.getElementById("workspaceBlocks");
/* Load blocks to workspace. */
Blockly.Xml.domToWorkspace(workspaceBlocks, workspace);