class.js 685 B

123456789101112131415161718192021
  1. Blockly.Blocks['class_creation'] = {
  2. init: function() {
  3. this.appendDummyInput()
  4. .appendField("Create class")
  5. .appendField(new Blockly.FieldVariable("new class"), "CLASS");
  6. this.appendDummyInput()
  7. .appendField("Inherits from")
  8. .appendField(new Blockly.FieldVariable("j"), "NAME")
  9. .appendField(",")
  10. .appendField(new Blockly.FieldVariable("k"), "NAME");
  11. this.appendStatementInput("BODY")
  12. .setCheck(null);
  13. this.setPreviousStatement(true, null);
  14. this.setNextStatement(true, null);
  15. this.setColour(230);
  16. this.setTooltip('');
  17. this.setHelpUrl('http://www.example.com/');
  18. }
  19. }