mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
Added field_label_serializable. (#2399)
This commit is contained in:
@@ -406,6 +406,12 @@ FactoryUtils.getFieldsJs_ = function(block) {
|
||||
// Result: 'hello'
|
||||
fields.push(JSON.stringify(block.getFieldValue('TEXT')));
|
||||
break;
|
||||
case 'field_label_serializable':
|
||||
// Result: new Blockly.FieldLabelSerializable('Hello'), 'GREET'
|
||||
fields.push('new Blockly.FieldLabelSerializable(' +
|
||||
JSON.stringify(block.getFieldValue('TEXT')) + '), ' +
|
||||
JSON.stringify(block.getFieldValue('FIELDNAME')));
|
||||
break;
|
||||
case 'field_input':
|
||||
// Result: new Blockly.FieldTextInput('Hello'), 'GREET'
|
||||
fields.push('new Blockly.FieldTextInput(' +
|
||||
@@ -511,6 +517,13 @@ FactoryUtils.getFieldsJson_ = function(block) {
|
||||
// Result: 'hello'
|
||||
fields.push(block.getFieldValue('TEXT'));
|
||||
break;
|
||||
case 'field_label_serializable':
|
||||
fields.push({
|
||||
type: block.type,
|
||||
name: block.getFieldValue('FIELDNAME'),
|
||||
text: block.getFieldValue('TEXT')
|
||||
});
|
||||
break;
|
||||
case 'field_input':
|
||||
fields.push({
|
||||
type: block.type,
|
||||
|
||||
Reference in New Issue
Block a user