mirror of
https://github.com/google/blockly.git
synced 2026-01-07 09:00:11 +01:00
Correct block color reference in demos/graph (#1794)
This commit is contained in:
committed by
GitHub
parent
662d79443f
commit
49be85b89d
@@ -192,42 +192,34 @@ if (typeof google == 'object') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Define the custom blocks and their JS generators.
|
// Define the custom blocks and their JS generators.
|
||||||
Blockly.Blocks['graph_get_x'] = {
|
Blockly.defineBlocksWithJsonArray([{
|
||||||
// x variable getter.
|
"type": "graph_get_x",
|
||||||
init: function() {
|
"message0": "x",
|
||||||
this.jsonInit({
|
"output": "Number",
|
||||||
"message0": "x",
|
"colour": Blockly.Msg.VARIABLES_HUE,
|
||||||
"output": "Number",
|
"tooltip": Blockly.Msg.VARIABLES_GET_TOOLTIP,
|
||||||
"colour": Blockly.Blocks.variables.HUE,
|
"helpUrl": Blockly.Msg.VARIABLES_GET_HELPURL
|
||||||
"tooltip": Blockly.Msg.VARIABLES_GET_TOOLTIP,
|
}]);
|
||||||
"helpUrl": Blockly.Msg.VARIABLES_GET_HELPURL
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.JavaScript['graph_get_x'] = function(block) {
|
Blockly.JavaScript['graph_get_x'] = function(block) {
|
||||||
// x variable getter.
|
// x variable getter.
|
||||||
return ['x', Blockly.JavaScript.ORDER_ATOMIC];
|
return ['x', Blockly.JavaScript.ORDER_ATOMIC];
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Blocks['graph_set_y'] = {
|
Blockly.defineBlocksWithJsonArray([{
|
||||||
// y variable setter.
|
"type": "graph_set_y",
|
||||||
init: function() {
|
"message0": "y = %1",
|
||||||
this.jsonInit({
|
"args0": [
|
||||||
"message0": "y = %1",
|
{
|
||||||
"args0": [
|
"type": "input_value",
|
||||||
{
|
"name": "VALUE",
|
||||||
"type": "input_value",
|
"check": "Number"
|
||||||
"name": "VALUE",
|
}
|
||||||
"check": "Number"
|
],
|
||||||
}
|
"colour": Blockly.Msg.VARIABLES_HUE,
|
||||||
],
|
"tooltip": Blockly.Msg.VARIABLES_SET_TOOLTIP,
|
||||||
"colour": Blockly.Blocks.variables.HUE,
|
"helpUrl": Blockly.Msg.VARIABLES_SET_HELPURL
|
||||||
"tooltip": Blockly.Msg.VARIABLES_SET_TOOLTIP,
|
}]);
|
||||||
"helpUrl": Blockly.Msg.VARIABLES_SET_HELPURL
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.JavaScript['graph_set_y'] = function(block) {
|
Blockly.JavaScript['graph_set_y'] = function(block) {
|
||||||
// y variable setter.
|
// y variable setter.
|
||||||
|
|||||||
Reference in New Issue
Block a user