Skip to content

Commit 299383a

Browse files
rearragememetn
1 parent 54428e8 commit 299383a

File tree

3 files changed

+41
-41
lines changed

3 files changed

+41
-41
lines changed

blocks_vertical/data.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -455,14 +455,14 @@ Blockly.Blocks['data_listcontainsitem'] = {
455455
}
456456
};
457457

458-
Blockly.Blocks['data_showlist'] = {
458+
Blockly.Blocks['data_listasarray'] = {
459459
/**
460-
* Block to show a list.
460+
* Block for turning list into array.
461461
* @this Blockly.Block
462462
*/
463463
init: function() {
464464
this.jsonInit({
465-
"message0": Blockly.Msg.DATA_SHOWLIST,
465+
"message0": Blockly.Msg.DATA_LISTASARRAY,
466466
"args0": [
467467
{
468468
"type": "field_variable",
@@ -471,40 +471,45 @@ Blockly.Blocks['data_showlist'] = {
471471
}
472472
],
473473
"category": Blockly.Categories.dataLists,
474-
"extensions": ["colours_data_lists", "shape_statement"]
474+
"extensions": ["colours_data_lists", "output_array"]
475475
});
476476
}
477477
};
478478

479-
Blockly.Blocks['data_hidelist'] = {
479+
Blockly.Blocks['data_setlistarray'] = {
480480
/**
481-
* Block to hide a list.
481+
* Block to set a list to array.
482482
* @this Blockly.Block
483483
*/
484484
init: function() {
485485
this.jsonInit({
486-
"message0": Blockly.Msg.DATA_HIDELIST,
486+
"message0": Blockly.Msg.DATA_SETLISTARRAY,
487487
"args0": [
488488
{
489489
"type": "field_variable",
490490
"name": "LIST",
491491
"variableTypes": [Blockly.LIST_VARIABLE_TYPE]
492-
}
492+
},
493+
{
494+
"type": "input_value",
495+
"name": "ARRAY",
496+
"check": "Array"
497+
},
493498
],
494499
"category": Blockly.Categories.dataLists,
495500
"extensions": ["colours_data_lists", "shape_statement"]
496501
});
497502
}
498503
};
499504

500-
Blockly.Blocks['data_listasarray'] = {
505+
Blockly.Blocks['data_showlist'] = {
501506
/**
502-
* Block for turning list into array.
507+
* Block to show a list.
503508
* @this Blockly.Block
504509
*/
505510
init: function() {
506511
this.jsonInit({
507-
"message0": Blockly.Msg.DATA_LISTASARRAY,
512+
"message0": Blockly.Msg.DATA_SHOWLIST,
508513
"args0": [
509514
{
510515
"type": "field_variable",
@@ -513,30 +518,25 @@ Blockly.Blocks['data_listasarray'] = {
513518
}
514519
],
515520
"category": Blockly.Categories.dataLists,
516-
"extensions": ["colours_data_lists", "output_array"]
521+
"extensions": ["colours_data_lists", "shape_statement"]
517522
});
518523
}
519524
};
520525

521-
Blockly.Blocks['data_setlistarray'] = {
526+
Blockly.Blocks['data_hidelist'] = {
522527
/**
523-
* Block to set a list to array.
528+
* Block to hide a list.
524529
* @this Blockly.Block
525530
*/
526531
init: function() {
527532
this.jsonInit({
528-
"message0": Blockly.Msg.DATA_SETLISTARRAY,
533+
"message0": Blockly.Msg.DATA_HIDELIST,
529534
"args0": [
530535
{
531536
"type": "field_variable",
532537
"name": "LIST",
533538
"variableTypes": [Blockly.LIST_VARIABLE_TYPE]
534-
},
535-
{
536-
"type": "input_value",
537-
"name": "ARRAY",
538-
"check": "Array"
539-
},
539+
}
540540
],
541541
"category": Blockly.Categories.dataLists,
542542
"extensions": ["colours_data_lists", "shape_statement"]

core/data_category.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ Blockly.DataCategory = function(workspace) {
8383
Blockly.DataCategory.addItemOfList(xmlList, firstVariable);
8484
Blockly.DataCategory.addItemNumberOfList(xmlList, firstVariable);
8585
Blockly.DataCategory.addLengthOfList(xmlList, firstVariable);
86-
Blockly.DataCategory.addListAsArray(xmlList, firstVariable);
8786
Blockly.DataCategory.addListContainsItem(xmlList, firstVariable);
8887
Blockly.DataCategory.addSep(xmlList);
88+
Blockly.DataCategory.addListAsArray(xmlList, firstVariable);
89+
Blockly.DataCategory.addSetListArray(xmlList, firstVariable);
8990
Blockly.DataCategory.addShowList(xmlList, firstVariable);
9091
Blockly.DataCategory.addHideList(xmlList, firstVariable);
91-
Blockly.DataCategory.addSetListArray(xmlList, firstVariable);
9292
}
9393

9494
// Now add table variables to the flyout
@@ -385,51 +385,51 @@ Blockly.DataCategory.addListContainsItem = function(xmlList, variable) {
385385
};
386386

387387
/**
388-
* Construct and add a data_showlist block to xmlList.
388+
* Construct and add a data_lengthoflist block to xmlList.
389389
* @param {!Array.<!Element>} xmlList Array of XML block elements.
390390
* @param {?Blockly.VariableModel} variable Variable to select in the field.
391391
*/
392-
Blockly.DataCategory.addShowList = function(xmlList, variable) {
393-
// <block type="data_showlist">
392+
Blockly.DataCategory.addListAsArray = function(xmlList, variable) {
393+
// <block type="data_listasarray">
394394
// <field name="LIST" variabletype="list" id="">variablename</field>
395395
// </block>
396-
Blockly.DataCategory.addBlock(xmlList, variable, 'data_showlist', 'LIST');
396+
Blockly.DataCategory.addBlock(xmlList, variable, 'data_listasarray', 'LIST');
397397
};
398398

399399
/**
400-
* Construct and add a data_hidelist block to xmlList.
400+
* Construct and add a data_lengthoflist block to xmlList.
401401
* @param {!Array.<!Element>} xmlList Array of XML block elements.
402402
* @param {?Blockly.VariableModel} variable Variable to select in the field.
403403
*/
404-
Blockly.DataCategory.addHideList = function(xmlList, variable) {
405-
// <block type="data_hidelist">
404+
Blockly.DataCategory.addSetListArray = function(xmlList, variable) {
405+
// <block type="data_setlistarray">
406406
// <field name="LIST" variabletype="list" id="">variablename</field>
407407
// </block>
408-
Blockly.DataCategory.addBlock(xmlList, variable, 'data_hidelist', 'LIST');
408+
Blockly.DataCategory.addBlock(xmlList, variable, 'data_setlistarray', 'LIST');
409409
};
410410

411411
/**
412-
* Construct and add a data_lengthoflist block to xmlList.
412+
* Construct and add a data_showlist block to xmlList.
413413
* @param {!Array.<!Element>} xmlList Array of XML block elements.
414414
* @param {?Blockly.VariableModel} variable Variable to select in the field.
415415
*/
416-
Blockly.DataCategory.addListAsArray = function(xmlList, variable) {
417-
// <block type="data_listasarray">
416+
Blockly.DataCategory.addShowList = function(xmlList, variable) {
417+
// <block type="data_showlist">
418418
// <field name="LIST" variabletype="list" id="">variablename</field>
419419
// </block>
420-
Blockly.DataCategory.addBlock(xmlList, variable, 'data_listasarray', 'LIST');
420+
Blockly.DataCategory.addBlock(xmlList, variable, 'data_showlist', 'LIST');
421421
};
422422

423423
/**
424-
* Construct and add a data_lengthoflist block to xmlList.
424+
* Construct and add a data_hidelist block to xmlList.
425425
* @param {!Array.<!Element>} xmlList Array of XML block elements.
426426
* @param {?Blockly.VariableModel} variable Variable to select in the field.
427427
*/
428-
Blockly.DataCategory.addSetListArray = function(xmlList, variable) {
429-
// <block type="data_setlistarray">
428+
Blockly.DataCategory.addHideList = function(xmlList, variable) {
429+
// <block type="data_hidelist">
430430
// <field name="LIST" variabletype="list" id="">variablename</field>
431431
// </block>
432-
Blockly.DataCategory.addBlock(xmlList, variable, 'data_setlistarray', 'LIST');
432+
Blockly.DataCategory.addBlock(xmlList, variable, 'data_hidelist', 'LIST');
433433
};
434434

435435
/**

msg/messages.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ Blockly.Msg.DATA_ITEMOFLIST = 'item %1 of %2';
7272
Blockly.Msg.DATA_ITEMNUMOFLIST = 'item # of %1 in %2';
7373
Blockly.Msg.DATA_LENGTHOFLIST = 'length of %1';
7474
Blockly.Msg.DATA_LISTCONTAINSITEM = '%1 contains %2?';
75-
Blockly.Msg.DATA_SHOWLIST = 'show list %1';
76-
Blockly.Msg.DATA_HIDELIST = 'hide list %1';
7775
Blockly.Msg.DATA_LISTASARRAY = '%1 as array';
7876
Blockly.Msg.DATA_SETLISTARRAY = 'set list %1 to %2';
77+
Blockly.Msg.DATA_SHOWLIST = 'show list %1';
78+
Blockly.Msg.DATA_HIDELIST = 'hide list %1';
7979
Blockly.Msg.DATA_INDEX_ALL = 'all';
8080
Blockly.Msg.DATA_INDEX_LAST = 'last';
8181
Blockly.Msg.DATA_INDEX_RANDOM = 'random';

0 commit comments

Comments
 (0)