Skip to content

Commit 558ddf4

Browse files
committed
wip #92
1 parent 25df12f commit 558ddf4

File tree

5 files changed

+33
-16
lines changed

5 files changed

+33
-16
lines changed

src/assets/js/blockly/blocks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ Blockly.Python.coderbot_audio_record = function (block) {
13021302
const elapse = Blockly.Python.valueToCode(block, 'ELAPSE',
13031303
Blockly.Python.ORDER_NONE) || '\'\'';
13041304
const code = `get_audio().record_to_file(filename=${filename}, elapse=${elapse})\n`;
1305-
return [code, Blockly.Python.ORDER_ATOMIC];
1305+
return code;
13061306
};
13071307

13081308
Blockly.Blocks.coderbot_audio_play = {

src/assets/toolbox_adv.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,27 @@
10811081
},
10821082
{
10831083
"kind": "block",
1084-
"type": "coderbot_audio_record"
1084+
"type": "coderbot_audio_record",
1085+
"inputs": {
1086+
"FILENAME": {
1087+
"shadow": {
1088+
"kind": "block",
1089+
"type": "text",
1090+
"fields": {
1091+
"TEXT": "sound"
1092+
}
1093+
}
1094+
},
1095+
"ELAPSE": {
1096+
"shadow": {
1097+
"kind": "block",
1098+
"type": "math_number",
1099+
"fields": {
1100+
"NUM": 2
1101+
}
1102+
}
1103+
}
1104+
}
10851105
},
10861106
{
10871107
"kind": "block",

src/common/coderbot.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,10 @@ class CoderBot {
306306
}
307307

308308
saveActivity(an_activity) {
309+
// defaults requird by API
310+
an_activity.description = an_activity.description == null ? '' : an_activity.description;
311+
an_activity.default = an_activity.default == null ? false : an_activity.default;
312+
an_activity.stock = an_activity.stock == null ? false : an_activity.stock;
309313
return this.$axios.post(`${this.CB}/activities`, an_activity);
310314
}
311315

src/components/Activity.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ export default {
413413
methods: {
414414
updateCssProps() {
415415
// (Re)Compute the CSS variables from the activity definition, then update them
416-
console.log('Computing CSS Props');
417416
const {
418417
bodyFont
419418
} = this.activity;
@@ -444,7 +443,6 @@ export default {
444443
'--codeFont': fontFamilyCode,
445444
'--transform': textTransform,
446445
};
447-
console.log('Computed CSS props:', this.cssProps);
448446
},
449447
450448
onWorkspaceChanged() {

src/components/ActivityEditor.vue

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
v-bind:error-messages="v$.activity.description.$error == true ? $t('message.validation_alphanum') : ''"
4343
>
4444
</v-text-field>
45-
<v-select v-model="activity.defaultView" :items="viste"
45+
<v-select v-model="activity.defaultView" :items="views"
4646
v-bind:label="$t('message.activity_predefined_view')" required
4747
@input="v$.activity.defaultView.$touch"
4848
></v-select>
@@ -574,21 +574,16 @@ export default {
574574
ar: false,
575575
// drawer: null,
576576
source: null,
577-
viste: [
577+
views: [
578578
{
579-
text: this.$i18n.t('message.activity_views_program'),
579+
title: this.$i18n.t('message.activity_views_program'),
580580
value: 'blocks'
581-
},
581+
}/*,
582582
{
583-
text: this.$i18n.t('message.activity_views_runtime'),
583+
title: this.$i18n.t('message.activity_views_runtime'),
584584
value: 'exec',
585585
disabled: true
586-
},
587-
{
588-
text: this.$i18n.t('message.activity_views_python'),
589-
value: 'python',
590-
disabled: true
591-
},
586+
},*/
592587
],
593588
confirm_exit_dialog: null,
594589
route_next: null,
@@ -621,7 +616,7 @@ export default {
621616
mounted() {
622617
if (this.$route.params.name) {
623618
this.saved = true;
624-
this.$coderbot.loadActivity(this.$route.params.name, false).then((activity) => {
619+
this.$coderbot.loadActivity(this.$route.params.name, null).then((activity) => {
625620
this.activity = activity.data;
626621
if (this.activity.toolbox == null) {
627622
this.activity.toolbox = {

0 commit comments

Comments
 (0)