system.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /**
  2. * @license
  3. * Visual Blocks Editor
  4. *
  5. * Copyright 2012 Google Inc.
  6. * https://developers.google.com/blockly/
  7. *
  8. * Licensed under the Apache License, Version 2.0 (the "License");
  9. * you may not use this file except in compliance with the License.
  10. * You may obtain a copy of the License at
  11. *
  12. * http://www.apache.org/licenses/LICENSE-2.0
  13. *
  14. * Unless required by applicable law or agreed to in writing, software
  15. * distributed under the License is distributed on an "AS IS" BASIS,
  16. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. * See the License for the specific language governing permissions and
  18. * limitations under the License.
  19. */
  20. /**
  21. * @fileoverview Colour blocks for Blockly.
  22. * @author fraser@google.com (Neil Fraser)
  23. */
  24. 'use strict';
  25. goog.provide('Blockly.Blocks.System');
  26. goog.require('Blockly.Blocks');
  27. /**
  28. * Common HSV hue for all blocks in this category.
  29. */
  30. Blockly.Blocks.System.HUE = "#6cb7b3";
  31. Blockly.Blocks['System_import'] = {
  32. /**
  33. * Block for log setup.
  34. * @this Blockly.Block
  35. */
  36. init: function() {
  37. this.setColour(Blockly.Blocks.System.HUE);
  38. this.appendDummyInput()
  39. .appendField(Blockly.Msg.SYSTEM_IMPORT);
  40. // this.setInputsInline(false);
  41. // this.setOutput(true);
  42. this.setPreviousStatement(true);
  43. this.setNextStatement(true);
  44. },
  45. };
  46. Blockly.Blocks['System_exit'] = {
  47. /**
  48. * Block for log setup.
  49. * @this Blockly.Block
  50. */
  51. init: function() {
  52. this.setColour(Blockly.Blocks.System.HUE);
  53. this.appendDummyInput()
  54. .appendField(Blockly.Msg.SYSTEM_EXIT)
  55. .appendField(new Blockly.FieldTextInput("1"),"TEXT_INPUT")
  56. // this.setInputsInline(false);
  57. // this.setOutput(true);
  58. this.setPreviousStatement(true);
  59. this.setNextStatement(true);
  60. },
  61. };
  62. Blockly.Blocks['System_dot'] = {
  63. /**
  64. * Block for log setup.
  65. * @this Blockly.Block
  66. */
  67. init: function() {
  68. this.setColour(Blockly.Blocks.System.HUE);
  69. this.appendValueInput("INPUT1")
  70. .appendField("")
  71. this.appendValueInput("INPUT2")
  72. .appendField(".")
  73. this.setInputsInline(true);
  74. this.setOutput(true);
  75. // this.setPreviousStatement(true);
  76. // this.setNextStatement(true);
  77. },
  78. }