1
1
<template >
2
+ <!-- Use computed CSS rules -->
2
3
<div :style =" cssProps" >
3
4
<v-app id =" inspire" >
5
+ <!-- the mobile draw animation doesn't play well with how Blockly is draw -->
4
6
<sidebar mobileDrawAnim =0 ></sidebar >
5
7
<v-toolbar color =" indigo" dark fixed app >
6
- <template v-if =" activity .drawerEnabled " >
7
- <v-toolbar-side-icon @click.stop =" toggleSidebar()" ></v-toolbar-side-icon >
8
- </template >
9
- <template v-if =" activity .showName " >
10
- <v-toolbar-title >
8
+ <v-toolbar-side-icon @click.stop =" toggleSidebar()" v-if =" activity.drawerEnabled" ></v-toolbar-side-icon >
9
+ <v-toolbar-title v-if =" activity.showName" >
11
10
{{ activity.name }}
12
11
</v-toolbar-title >
13
- </template >
14
12
<v-spacer ></v-spacer >
15
13
<v-toolbar-items >
14
+ <!-- If the API is available, show the desired buttons -->
16
15
<template v-if =" status == 200 " >
17
16
<template v-for =" button , i in activity .buttons " >
18
17
<v-btn @click =" _self[button.action]()" style =" height : 70% " :color =" button.colorBtn" :class =" button.colorText" >
22
21
  ;  ;
23
22
</template >
24
23
</template >
25
- <!--
26
- <v-btn @click="dialog = true" icon v-if="status == 200">
27
- <v-icon>check_circle</v-icon>
28
- </v-btn>
29
- -->
24
+ <!-- If the API is not responding, show an error icon -->
30
25
<v-btn @click =" dialog = true" icon v-if =" status != 200" >
31
26
<v-icon >error</v-icon >
32
27
</v-btn >
33
28
</v-toolbar-items >
34
29
</v-toolbar >
30
+ <!-- Page content -->
35
31
<v-content >
32
+ <!-- Blockly -->
36
33
<div style =" height : 480px ; width : 600px ;" >
37
34
<div ref =" blocklyTotal" style =" height : 100% ; width : 100% ;" class =" blocklyTotal" >
38
35
<div ref =" blocklyArea" style =" height : 100% ; width : 100% ;" class =" blocklyArea" >
42
39
</div >
43
40
</div >
44
41
</v-content >
45
- <!-- Runtime modal -->
42
+ <!-- Hidden file input. Its file dialog it's event-click triggered by the "pickFile" method -->
43
+ <input type =" file" style =" display : none " ref =" file" @change =" importProgram" >
44
+ <!-- When the selection is completed, the result is then handled by importProgram -->
45
+ <!-- Dialogs -->
46
+ <!-- Runtime -->
46
47
<v-dialog v-model =" runtimeDialog" width =" 500" >
47
48
<v-card >
48
49
<v-card-title class =" headline grey lighten-2" primary-title >
65
66
</v-card-actions >
66
67
</v-card >
67
68
</v-dialog >
68
- <!-- Hidden file input. Its file dialog it's event-click triggered by the "pickFile" method -->
69
- <input type =" file" style =" display : none " ref =" file" @change =" importProgram" >
70
- <!-- When the selection is completed, the result is then handled by importProgram -->
71
- <!-- Dialogs -->
69
+ <!-- Load Program -->
72
70
<v-dialog v-model =" carica" max-width =" 290" >
73
71
<v-card >
74
72
<v-card-title class =" headline" >
92
90
</v-card-actions >
93
91
</v-card >
94
92
</v-dialog >
95
- <!-- -->
93
+ <!-- Save Program -->
96
94
<v-dialog v-model =" salva" max-width =" 430" >
97
95
<v-card >
98
96
<v-card-title class =" headline" >
112
110
</v-card-actions >
113
111
</v-card >
114
112
</v-dialog >
115
- <!-- -->
113
+ <!-- Name error -->
116
114
<v-dialog v-model =" unvalidName" max-width =" 290" >
117
115
<v-card >
118
- <v-card-title class =" headline" >ERRORE </v-card-title >
116
+ <v-card-title class =" headline" >Error </v-card-title >
119
117
<v-card-text >
120
- Il nome del programma non deve essere vuoto
118
+ Il nome del programma non può essere vuoto.
121
119
</v-card-text >
122
120
<v-card-actions >
123
121
<v-btn color =" green darken-1" flat =" flat" @click =" unvalidName = false, salva = true" >
126
124
</v-card-actions >
127
125
</v-card >
128
126
</v-dialog >
129
- <!-- -->
127
+ <!-- Overwrite error -->
130
128
<v-dialog v-model =" CannotOverwrite" max-width =" 290" >
131
129
<v-card >
132
- <v-card-title class =" headline" >ERRORE </v-card-title >
130
+ <v-card-title class =" headline" >Error </v-card-title >
133
131
<v-card-text >
134
132
Impossibile sovrascrivere un programma di default, cambiare il nome.
135
133
</v-card-text >
140
138
</v-card-actions >
141
139
</v-card >
142
140
</v-dialog >
143
- <!-- -->
141
+ <!-- Ask for overwrite -->
144
142
<v-dialog v-model =" overwriteDialog" max-width =" 500" >
145
143
<v-card >
146
144
<v-card-title class =" headline" >
159
157
</v-card-actions >
160
158
</v-card >
161
159
</v-dialog >
162
- <!-- -->
160
+ <!-- Delete Program -->
163
161
<v-dialog v-model =" del" max-width =" 500" >
164
162
<v-card >
165
163
<v-card-title class =" headline" >
178
176
</v-card-actions >
179
177
</v-card >
180
178
</v-dialog >
181
- <!-- -->
179
+ <!-- Show Code -->
182
180
<v-dialog v-model =" dialogCode" >
183
181
<v-card >
184
182
<v-card-title class =" headline" >Codice</v-card-title >
194
192
</v-card-actions >
195
193
</v-card >
196
194
</v-dialog >
197
- <!-- -->
195
+ <!-- Status -->
198
196
<v-dialog v-model =" dialog" max-width =" 290" >
199
197
<v-card >
200
198
<v-card-title class =" headline" >Stato del Coderbot</v-card-title >
209
207
</v-card-actions >
210
208
</v-card >
211
209
</v-dialog >
212
- <!-- -->
210
+ <!-- Generic dialog -->
213
211
<v-dialog v-model =" generalDialog" max-width =" 290" >
214
212
<v-card >
215
213
<v-card-title class =" headline" >{{ generalDialogTitle }}</v-card-title >
@@ -366,7 +364,7 @@ export default {
366
364
console .log (" Computed CSS props:" , this .cssProps )
367
365
},
368
366
369
- initBlockly (settings ){
367
+ initBlockly (settings ) {
370
368
// Extend the default blocks set
371
369
this .blocksExtensions (settings);
372
370
@@ -385,7 +383,7 @@ export default {
385
383
// Options
386
384
{
387
385
toolbox: serializedToolbox,
388
- path : ' static/js/blockly/' ,
386
+ path: ' static/js/blockly/' ,
389
387
// TODO: Use values from fetched configuration!
390
388
scrollbars: true ,
391
389
// MaxBlocks : -1, // -1 as infinite not working FIXME
0 commit comments