Skip to content

Commit

Permalink
Revert "Use extensions to share color and shape between some blocks (#…
Browse files Browse the repository at this point in the history
…938)" (#947)

This reverts commit c7afcda.
  • Loading branch information
rachel-fenichel authored Jun 14, 2017
1 parent c7afcda commit 09dc7c1
Show file tree
Hide file tree
Showing 7 changed files with 200 additions and 140 deletions.
66 changes: 54 additions & 12 deletions blocks_vertical/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ goog.provide('Blockly.Blocks.control');

goog.require('Blockly.Blocks');
goog.require('Blockly.Colours');
goog.require('Blockly.ScratchBlocks.VerticalExtensions');


Blockly.Blocks['control_forever'] = {
Expand Down Expand Up @@ -59,7 +58,9 @@ Blockly.Blocks['control_forever'] = {
"inputsInline": true,
"previousStatement": null,
"category": Blockly.Categories.control,
"extensions": ["colours_control"]
"colour": Blockly.Colours.control.primary,
"colourSecondary": Blockly.Colours.control.secondary,
"colourTertiary": Blockly.Colours.control.tertiary
});
}
};
Expand Down Expand Up @@ -99,8 +100,13 @@ Blockly.Blocks['control_repeat'] = {
"flip_rtl": true
}
],
"inputsInline": true,
"previousStatement": null,
"nextStatement": null,
"category": Blockly.Categories.control,
"extensions": ["colours_control", "shape_statement"]
"colour": Blockly.Colours.control.primary,
"colourSecondary": Blockly.Colours.control.secondary,
"colourTertiary": Blockly.Colours.control.tertiary
});
}
};
Expand Down Expand Up @@ -128,8 +134,13 @@ Blockly.Blocks['control_if'] = {
"name": "SUBSTACK"
}
],
"inputsInline": true,
"previousStatement": null,
"nextStatement": null,
"category": Blockly.Categories.control,
"extensions": ["colours_control", "shape_statement"]
"colour": Blockly.Colours.control.primary,
"colourSecondary": Blockly.Colours.control.secondary,
"colourTertiary": Blockly.Colours.control.tertiary
});
}
};
Expand Down Expand Up @@ -165,8 +176,13 @@ Blockly.Blocks['control_if_else'] = {
"name": "SUBSTACK2"
}
],
"inputsInline": true,
"previousStatement": null,
"nextStatement": null,
"category": Blockly.Categories.control,
"extensions": ["colours_control", "shape_statement"]
"colour": Blockly.Colours.control.primary,
"colourSecondary": Blockly.Colours.control.secondary,
"colourTertiary": Blockly.Colours.control.tertiary
});
}
};
Expand Down Expand Up @@ -232,8 +248,13 @@ Blockly.Blocks['control_wait'] = {
"name": "DURATION"
}
],
"inputsInline": true,
"previousStatement": null,
"nextStatement": null,
"category": Blockly.Categories.control,
"extensions": ["colours_control", "shape_statement"]
"colour": Blockly.Colours.control.primary,
"colourSecondary": Blockly.Colours.control.secondary,
"colourTertiary": Blockly.Colours.control.tertiary
});
}
};
Expand All @@ -253,8 +274,13 @@ Blockly.Blocks['control_wait_until'] = {
"check": "Boolean"
}
],
"inputsInline": true,
"previousStatement": null,
"nextStatement": null,
"category": Blockly.Categories.control,
"extensions": ["colours_control", "shape_statement"]
"colour": Blockly.Colours.control.primary,
"colourSecondary": Blockly.Colours.control.secondary,
"colourTertiary": Blockly.Colours.control.tertiary
});
}
};
Expand Down Expand Up @@ -292,8 +318,13 @@ Blockly.Blocks['control_repeat_until'] = {
"flip_rtl": true
}
],
"inputsInline": true,
"previousStatement": null,
"nextStatement": null,
"category": Blockly.Categories.control,
"extensions": ["colours_control", "shape_statement"]
"colour": Blockly.Colours.control.primary,
"colourSecondary": Blockly.Colours.control.secondary,
"colourTertiary": Blockly.Colours.control.tertiary
});
}
};
Expand All @@ -312,7 +343,9 @@ Blockly.Blocks['control_start_as_clone'] = {
"inputsInline": true,
"nextStatement": null,
"category": Blockly.Categories.control,
"extensions": ["colours_control"]
"colour": Blockly.Colours.control.primary,
"colourSecondary": Blockly.Colours.control.secondary,
"colourTertiary": Blockly.Colours.control.tertiary
});
}
};
Expand All @@ -338,7 +371,9 @@ Blockly.Blocks['control_create_clone_of_menu'] = {
"inputsInline": true,
"output": "String",
"outputShape": Blockly.OUTPUT_SHAPE_ROUND,
"extensions": ["colours_control"]
"colour": Blockly.Colours.control.secondary,
"colourSecondary": Blockly.Colours.control.secondary,
"colourTertiary": Blockly.Colours.control.tertiary
});
}
};
Expand All @@ -358,8 +393,13 @@ Blockly.Blocks['control_create_clone_of'] = {
"name": "CLONE_OPTION"
}
],
"inputsInline": true,
"previousStatement": null,
"nextStatement": null,
"category": Blockly.Categories.control,
"extensions": ["colours_control", "shape_statement"]
"colour": Blockly.Colours.control.primary,
"colourSecondary": Blockly.Colours.control.secondary,
"colourTertiary": Blockly.Colours.control.tertiary
});
}
};
Expand All @@ -377,7 +417,9 @@ Blockly.Blocks['control_delete_this_clone'] = {
"inputsInline": true,
"previousStatement": null,
"category": Blockly.Categories.control,
"extensions": ["colours_control"]
"colour": Blockly.Colours.control.primary,
"colourSecondary": Blockly.Colours.control.secondary,
"colourTertiary": Blockly.Colours.control.tertiary
});
}
};
70 changes: 56 additions & 14 deletions blocks_vertical/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ goog.provide('Blockly.Constants.Data');
goog.require('Blockly.Blocks');
goog.require('Blockly.Colours');
goog.require('Blockly.constants');
goog.require('Blockly.ScratchBlocks.VerticalExtensions');


Blockly.Blocks['data_variablemenu'] = {
Expand Down Expand Up @@ -70,10 +69,13 @@ Blockly.Blocks['data_variable'] = {
}
],
"category": Blockly.Categories.data,
"colour": Blockly.Colours.data.primary,
"colourSecondary": Blockly.Colours.data.secondary,
"colourTertiary": Blockly.Colours.data.tertiary,
"output": "String",
"outputShape": Blockly.OUTPUT_SHAPE_ROUND,
"checkboxInFlyout": true,
"extensions": ["contextMenu_getVariableBlock", "colours_data"]
"extensions": ["contextMenu_getVariableBlock"]
});
}
};
Expand All @@ -96,8 +98,12 @@ Blockly.Blocks['data_setvariableto'] = {
"name": "VALUE"
}
],
"previousStatement": null,
"nextStatement": null,
"category": Blockly.Categories.data,
"extensions": ["colours_data", "shape_statement"]
"colour": Blockly.Colours.data.primary,
"colourSecondary": Blockly.Colours.data.secondary,
"colourTertiary": Blockly.Colours.data.tertiary
});
}
};
Expand All @@ -120,8 +126,12 @@ Blockly.Blocks['data_changevariableby'] = {
"name": "VALUE"
}
],
"previousStatement": null,
"nextStatement": null,
"category": Blockly.Categories.data,
"extensions": ["colours_data", "shape_statement"]
"colour": Blockly.Colours.data.primary,
"colourSecondary": Blockly.Colours.data.secondary,
"colourTertiary": Blockly.Colours.data.tertiary
});
}
};
Expand Down Expand Up @@ -191,7 +201,9 @@ Blockly.Blocks['data_listcontents'] = {
}
],
"category": Blockly.Categories.data,
"extensions": ["colours_data"],
"colour": Blockly.Colours.data.primary,
"colourSecondary": Blockly.Colours.data.secondary,
"colourTertiary": Blockly.Colours.data.tertiary,
"output": "String",
"outputShape": Blockly.OUTPUT_SHAPE_ROUND,
"checkboxInFlyout": true
Expand Down Expand Up @@ -277,8 +289,12 @@ Blockly.Blocks['data_addtolist'] = {
"name": "LIST"
}
],
"previousStatement": null,
"nextStatement": null,
"category": Blockly.Categories.data,
"extensions": ["colours_data", "shape_statement"]
"colour": Blockly.Colours.data.primary,
"colourSecondary": Blockly.Colours.data.secondary,
"colourTertiary": Blockly.Colours.data.tertiary
});
}
};
Expand All @@ -301,8 +317,12 @@ Blockly.Blocks['data_deleteoflist'] = {
"name": "LIST"
}
],
"previousStatement": null,
"nextStatement": null,
"category": Blockly.Categories.data,
"extensions": ["colours_data", "shape_statement"]
"colour": Blockly.Colours.data.primary,
"colourSecondary": Blockly.Colours.data.secondary,
"colourTertiary": Blockly.Colours.data.tertiary
});
}
};
Expand All @@ -329,8 +349,12 @@ Blockly.Blocks['data_insertatlist'] = {
"name": "LIST"
}
],
"previousStatement": null,
"nextStatement": null,
"category": Blockly.Categories.data,
"extensions": ["colours_data", "shape_statement"]
"colour": Blockly.Colours.data.primary,
"colourSecondary": Blockly.Colours.data.secondary,
"colourTertiary": Blockly.Colours.data.tertiary
});
}
};
Expand All @@ -357,8 +381,12 @@ Blockly.Blocks['data_replaceitemoflist'] = {
"name": "ITEM"
}
],
"previousStatement": null,
"nextStatement": null,
"category": Blockly.Categories.data,
"extensions": ["colours_data", "shape_statement"]
"colour": Blockly.Colours.data.primary,
"colourSecondary": Blockly.Colours.data.secondary,
"colourTertiary": Blockly.Colours.data.tertiary
});
}
};
Expand All @@ -383,7 +411,9 @@ Blockly.Blocks['data_itemoflist'] = {
],
"output": null,
"category": Blockly.Categories.data,
"extensions": ["colours_data"],
"colour": Blockly.Colours.data.primary,
"colourSecondary": Blockly.Colours.data.secondary,
"colourTertiary": Blockly.Colours.data.tertiary,
"outputShape": Blockly.OUTPUT_SHAPE_ROUND
});
}
Expand All @@ -405,7 +435,9 @@ Blockly.Blocks['data_lengthoflist'] = {
],
"output": "Number",
"category": Blockly.Categories.data,
"extensions": ["colours_data"],
"colour": Blockly.Colours.data.primary,
"colourSecondary": Blockly.Colours.data.secondary,
"colourTertiary": Blockly.Colours.data.tertiary,
"outputShape": Blockly.OUTPUT_SHAPE_ROUND
});
}
Expand All @@ -432,7 +464,9 @@ Blockly.Blocks['data_listcontainsitem'] = {
"output": "Boolean",
"outputShape": Blockly.OUTPUT_SHAPE_HEXAGONAL,
"category": Blockly.Categories.data,
"extensions": ["colours_data"]
"colour": Blockly.Colours.data.primary,
"colourSecondary": Blockly.Colours.data.secondary,
"colourTertiary": Blockly.Colours.data.tertiary
});
}
};
Expand All @@ -451,8 +485,12 @@ Blockly.Blocks['data_showlist'] = {
"name": "LIST"
}
],
"previousStatement": null,
"nextStatement": null,
"category": Blockly.Categories.data,
"extensions": ["colours_data", "shape_statement"]
"colour": Blockly.Colours.data.primary,
"colourSecondary": Blockly.Colours.data.secondary,
"colourTertiary": Blockly.Colours.data.tertiary
});
}
};
Expand All @@ -471,8 +509,12 @@ Blockly.Blocks['data_hidelist'] = {
"name": "LIST"
}
],
"previousStatement": null,
"nextStatement": null,
"category": Blockly.Categories.data,
"extensions": ["colours_data", "shape_statement"]
"colour": Blockly.Colours.data.primary,
"colourSecondary": Blockly.Colours.data.secondary,
"colourTertiary": Blockly.Colours.data.tertiary
});
}
};
Expand Down
Loading

0 comments on commit 09dc7c1

Please # to comment.