File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -541,6 +541,8 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
541541 '</block>' +
542542 '<block type="json_values" id="json_values">' +
543543 '</block>' +
544+ '<block type="json_entries" id="json_entries">' +
545+ '</block>' +
544546 '<block type="json_value_of_key" id="json_value_of_key">' +
545547 '<value name="KEY">' +
546548 '<shadow type="text">' +
Original file line number Diff line number Diff line change @@ -125,6 +125,27 @@ Blockly.Blocks['json_values'] = {
125125 }
126126} ;
127127
128+ Blockly . Blocks [ 'json_entries' ] = {
129+ /**
130+ * Fetches the entries of the object
131+ * @this Blockly.Block
132+ */
133+ init : function ( ) {
134+ this . jsonInit ( {
135+ "message0" : Blockly . Msg . JSON_ENTRIES ,
136+ "args0" : [
137+ {
138+ "type" : "input_value" ,
139+ "name" : "OBJ" ,
140+ "check" : "Object"
141+ } ,
142+ ] ,
143+ "category" : Blockly . Categories . json ,
144+ "extensions" : [ "colours_json" , "output_array" ]
145+ } ) ;
146+ }
147+ } ;
148+
128149Blockly . Blocks [ 'json_value_of_key' ] = {
129150 /**
130151 * Fetches the value of the target key
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ Blockly.Msg.JSON_TO_OBJECT = '%1 to object';
8282Blockly . Msg . JSON_TO_STRING = '%1 to string' ;
8383Blockly . Msg . JSON_KEYS = 'keys of %1' ;
8484Blockly . Msg . JSON_VALUES = 'values of %1' ;
85+ Blockly . Msg . JSON_ENTRIES = 'entries of %1' ;
8586Blockly . Msg . JSON_VALUE_OF_KEY = 'value of %1 in %2' ;
8687Blockly . Msg . JSON_SET_KEY = 'set %1 in %2 to %3' ;
8788Blockly . Msg . JSON_DELETE_KEY = 'delete %1 in %2' ;
You can’t perform that action at this time.
0 commit comments