mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
Rename JSON's 'id' to 'type'. Issue #245.
This commit is contained in:
@@ -99,8 +99,8 @@ function updateLanguage() {
|
||||
*/
|
||||
function formatJson_(blockType, rootBlock) {
|
||||
var JS = {};
|
||||
// ID is not used by Blockly, but may be used by a loader.
|
||||
JS.id = blockType;
|
||||
// Type is not used by Blockly, but may be used by a loader.
|
||||
JS.type = blockType;
|
||||
// Generate inputs.
|
||||
var message = [];
|
||||
var args = [];
|
||||
|
||||
@@ -193,12 +193,13 @@ if (typeof google == 'object') {
|
||||
Blockly.Blocks['graph_get_x'] = {
|
||||
// x variable getter.
|
||||
init: function() {
|
||||
this.setHelpUrl(Blockly.Msg.VARIABLES_GET_HELPURL);
|
||||
this.setColour(330);
|
||||
this.appendDummyInput()
|
||||
.appendField('x');
|
||||
this.setOutput(true, 'Number');
|
||||
this.setTooltip(Blockly.Msg.VARIABLES_GET_TOOLTIP);
|
||||
this.jsonInit({
|
||||
"message0": "x",
|
||||
"output": "Number",
|
||||
"colour": Blockly.Blocks.variables.HUE,
|
||||
"tooltip": Blockly.Msg.VARIABLES_GET_TOOLTIP,
|
||||
"helpUrl": Blockly.Msg.VARIABLES_GET_HELPURL
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -210,12 +211,19 @@ Blockly.JavaScript['graph_get_x'] = function(block) {
|
||||
Blockly.Blocks['graph_set_y'] = {
|
||||
// y variable setter.
|
||||
init: function() {
|
||||
this.setHelpUrl(Blockly.Msg.VARIABLES_SET_HELPURL);
|
||||
this.setColour(330);
|
||||
this.appendValueInput('VALUE')
|
||||
.appendField('y =')
|
||||
.setCheck('Number');
|
||||
this.setTooltip(Blockly.Msg.VARIABLES_SET_TOOLTIP);
|
||||
this.jsonInit({
|
||||
"message0": "y = %1",
|
||||
"args0": [
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "VALUE",
|
||||
"check": "Number"
|
||||
}
|
||||
],
|
||||
"colour": Blockly.Blocks.variables.HUE,
|
||||
"tooltip": Blockly.Msg.VARIABLES_SET_TOOLTIP,
|
||||
"helpUrl": Blockly.Msg.VARIABLES_SET_HELPURL
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user