logo.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /**
  2. * @license Licensed under the Apache License, Version 2.0 (the "License"):
  3. * http://www.apache.org/licenses/LICENSE-2.0
  4. */
  5. /**
  6. * @fileoverview Blocks use for the Ardublockly logo creation.
  7. * These are not mean to used at all.
  8. *
  9. * Generator:
  10. * var noCode = function(block) { return ''; };
  11. * Blockly.Python['ardublockly_name_bottom'] = noCode;
  12. * Blockly.Python['ardublockly_plus_top_large'] = noCode;
  13. * Blockly.Python['ardublockly_plus_top_small'] = noCode;
  14. * Blockly.Python['ardublockly_plus_bottom_large'] = noCode;
  15. * Blockly.Python['ardublockly_plus_bottom_small'] = noCode;
  16. * Blockly.Python['ardublockly_plus_both_small'] = noCode;
  17. * Blockly.Python['ardublockly_plus_both_large'] = noCode;
  18. * Blockly.Python['ardublockly_minus_large'] = noCode;
  19. * Blockly.Python['ardublockly_minus_small'] = noCode;
  20. *
  21. * Toolbox:
  22. * <sep></sep>
  23. * <category name="Logo">
  24. * <block type="ardublockly_name_top"></block>
  25. * <block type="ardublockly_name_bottom"></block>
  26. * <block type="ardublockly_plus_top_large"></block>
  27. * <block type="ardublockly_plus_top_small"></block>
  28. * <block type="ardublockly_plus_bottom_large"></block>
  29. * <block type="ardublockly_plus_bottom_small"></block>
  30. * <block type="ardublockly_minus_large"></block>
  31. * <block type="ardublockly_minus_small"></block>
  32. * </category>
  33. */
  34. 'use strict';
  35. goog.provide('Blockly.Blocks.logo');
  36. goog.require('Blockly.Blocks');
  37. Blockly.Blocks.logo.HUE = 180;
  38. /* Ardublockly block */
  39. Blockly.Blocks['ardublockly_name_top'] = {
  40. init: function() {
  41. this.appendDummyInput()
  42. .appendField("Ardublockly");
  43. this.setPreviousStatement(true);
  44. this.setColour(Blockly.Blocks.logo.HUE);
  45. }
  46. };
  47. Blockly.Blocks['ardublockly_name_bottom'] = {
  48. init: function() {
  49. this.appendDummyInput()
  50. .appendField("Ardublockly");
  51. this.setNextStatement(true);
  52. this.setColour(Blockly.Blocks.logo.HUE);
  53. this.setTooltip('');
  54. }
  55. };
  56. /* Plus block */
  57. Blockly.Blocks['ardublockly_plus_top_large'] = {
  58. init: function() {
  59. this.appendValueInput("NAME")
  60. .appendField(" +");
  61. this.setNextStatement(true);
  62. this.setColour(Blockly.Blocks.logo.HUE);
  63. }
  64. };
  65. Blockly.Blocks['ardublockly_plus_top_small'] = {
  66. init: function() {
  67. this.appendValueInput("NAME")
  68. .appendField(" +");
  69. this.setNextStatement(true);
  70. this.setColour(Blockly.Blocks.logo.HUE);
  71. }
  72. };
  73. Blockly.Blocks['ardublockly_plus_bottom_large'] = {
  74. init: function() {
  75. this.appendValueInput("NAME")
  76. .appendField(" +");
  77. this.setPreviousStatement(true);
  78. this.setColour(Blockly.Blocks.logo.HUE);
  79. }
  80. };
  81. Blockly.Blocks['ardublockly_plus_bottom_small'] = {
  82. init: function() {
  83. this.appendValueInput("NAME")
  84. .appendField(" +");
  85. this.setPreviousStatement(true);
  86. this.setColour(Blockly.Blocks.logo.HUE);
  87. }
  88. };
  89. Blockly.Blocks['ardublockly_plus_both_small'] = {
  90. init: function() {
  91. this.appendValueInput("NAME")
  92. .appendField(" +");
  93. this.setPreviousStatement(true);
  94. this.setNextStatement(true);
  95. this.setColour(Blockly.Blocks.logo.HUE);
  96. }
  97. };
  98. Blockly.Blocks['ardublockly_plus_both_large'] = {
  99. init: function() {
  100. this.appendValueInput("NAME")
  101. .appendField(" +");
  102. this.setPreviousStatement(true);
  103. this.setNextStatement(true);
  104. this.setColour(Blockly.Blocks.logo.HUE);
  105. }
  106. };
  107. /* Minus block */
  108. Blockly.Blocks['ardublockly_minus_large'] = {
  109. init: function() {
  110. this.appendDummyInput()
  111. .appendField("- ");
  112. this.setInputsInline(false);
  113. this.setOutput(true);
  114. this.setColour(Blockly.Blocks.logo.HUE);
  115. }
  116. };
  117. Blockly.Blocks['ardublockly_minus_small'] = {
  118. init: function() {
  119. this.appendDummyInput()
  120. .appendField("- ");
  121. this.setInputsInline(false);
  122. this.setOutput(true);
  123. this.setColour(Blockly.Blocks.logo.HUE);
  124. }
  125. };