From 75d1c3d757f25d365327061f4047c0b82e7c4ad2 Mon Sep 17 00:00:00 2001 From: carlosperate Date: Sun, 21 Feb 2016 20:01:57 +0000 Subject: [PATCH] Minor modifications to set up for a release version. --- ardublockly/ardublockly.js | 8 ++++++-- blockly/generators/arduino.js | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ardublockly/ardublockly.js b/ardublockly/ardublockly.js index 4787e4c5da..1d44b117eb 100644 --- a/ardublockly/ardublockly.js +++ b/ardublockly/ardublockly.js @@ -29,7 +29,7 @@ Ardublockly.init = function() { // Inject Blockly into content_blocks and fetch additional blocks Ardublockly.injectBlockly(document.getElementById('content_blocks'), Ardublockly.TOOLBOX_XML, '../blockly/'); - Ardublockly.importExtraBlocks(); + //Ardublockly.importExtraBlocks(); Ardublockly.designJsInit(); Ardublockly.initialiseIdeButtons(); @@ -667,7 +667,11 @@ Ardublockly.isToolboxVisible = function() { return Ardublockly.TOOLBAR_SHOWING_; }; -/** Lazy loads the additional blocks from the ./block directory. */ +/** + * Lazy loads the additional block JS files from the ./block directory. + * Initialises any additional Ardublockly extensions. + * TODO: Loads the examples into the examples modal + */ Ardublockly.importExtraBlocks = function() { /** * Parses the JSON data to find the block and languages js files. diff --git a/blockly/generators/arduino.js b/blockly/generators/arduino.js index 02f19a48ab..5bb1dafc50 100644 --- a/blockly/generators/arduino.js +++ b/blockly/generators/arduino.js @@ -91,7 +91,7 @@ Blockly.Arduino.DEF_FUNC_NAME = Blockly.Arduino.FUNCTION_NAME_PLACEHOLDER_; Blockly.Arduino.init = function(workspace) { // Create a dictionary of definitions to be printed at the top of the sketch Blockly.Arduino.includes_ = Object.create(null); - // Create a dictionary of definitions to be printed after variable definitions + // Create a dictionary of global definitions to be printed after variables Blockly.Arduino.definitions_ = Object.create(null); // Create a dictionary of functions from the code generator Blockly.Arduino.codeFunctions_ = Object.create(null); @@ -259,7 +259,7 @@ Blockly.Arduino.reservePin = function(block, pin, pinType, warningTag) { if (Blockly.Arduino.pins_[pin] != pinType) { block.setWarningText( 'Pin ' + pin + ' is needed for ' + warningTag + ' as pin ' + pinType + - '. Already used as ' + Blockly.Arduino.pins_[pin] + '.', warningTag); + '.\nAlready used as ' + Blockly.Arduino.pins_[pin] + '.', warningTag); } else { block.setWarningText(null, warningTag); } @@ -361,8 +361,8 @@ Blockly.Arduino.getArduinoType_ = function(typeBlockly) { return 'undefined'; case Blockly.Types.CHILD_BLOCK_MISSING.typeName: // If no block connected default to int, change for easier debugging - return 'ChildBlockMissing'; - //return 'int'; + //return 'ChildBlockMissing'; + return 'int'; default: return 'Invalid Blockly Type'; }