io.js 1.2 KB

123456789101112131415161718192021
  1. Blockly.Blocks['text_input'] = {
  2. init: function() {
  3. this.appendDummyInput()
  4. .appendField("input")
  5. .appendField(this.newQuote_(true))
  6. .appendField(new Blockly.FieldTextInput("with prompt"), "MESSAGE")
  7. .appendField(this.newQuote_(false));
  8. this.setOutput(true, "String");
  9. this.setColour(230);
  10. this.setTooltip('');
  11. this.setHelpUrl('');
  12. },
  13. newQuote_: function(open) {
  14. if (open == this.RTL) {
  15. var file = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==';
  16. } else {
  17. var file = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC';
  18. }
  19. return new Blockly.FieldImage(file, 12, 12, '"');
  20. }
  21. };