Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
init: function() {
this.setHelpUrl(Blockly.Msg.TEXT_APPEND_HELPURL);
this.setColour(HUE);
this.appendValueInput('TEXT')
.appendField(Blockly.Msg.TEXT_APPEND_TO)
.appendField(new Blockly.FieldVariable(
Blockly.Msg.TEXT_APPEND_VARIABLE), 'VAR')
.appendField(Blockly.Msg.TEXT_APPEND_APPENDTEXT);
this.setPreviousStatement(true);
this.setNextStatement(true);
// Assign 'this' to a variable for use in the tooltip closure below.
var thisBlock = this;
this.setTooltip(function() {
return Blockly.Msg.TEXT_APPEND_TOOLTIP.replace('%1',
thisBlock.getFieldValue('VAR'));
});
},
/**
init: function() {
// this.setHelpUrl(Blockly.Msg.VARIABLES_GET_HELPURL);
this.setHelpUrl(Blockly.Msg.VARIABLES_GET_HELPURL);
this.setColour(HUE);
this.appendDummyInput()
.appendField("?")
.appendField(new Blockly.FieldVariable(), "VAR");
this.setOutput(true, "Var");
this.setTooltip('');
// this.appendDummyInput()
// .appendField(Blockly.Msg.VARIABLES_GET_TITLE)
// .appendField(new Blockly.FieldVariable(
// Blockly.Msg.VARIABLES_GET_ITEM), 'VAR')
// .appendField(Blockly.Msg.VARIABLES_GET_TAIL);
// this.setTooltip(Blockly.Msg.VARIABLES_GET_TOOLTIP);
// this.contextMenuMsg_ = Blockly.Msg.VARIABLES_GET_CREATE_SET;
// this.contextMenuType_ = 'variables_set';
}
});
init: function() {
_initVerb(this);
this.appendValueInput("OBJECT")
.setCheck(typeExt("Object"))
.appendField("━")
.appendField(new Blockly.FieldVariable(), "VAR")
.appendField("━▶");
this.setInputsInline(true);
this.setPreviousStatement(true, "PropertyList");
this.setNextStatement(true, "PropertyList");
this.setTooltip(Msg.VERB_OBJECT_TOOLTIP);
}
});