resolve warnings
This commit is contained in:
parent
0183679041
commit
dad91d0a93
@ -1,6 +1,5 @@
|
|||||||
import * as Blockly from 'blockly/core';
|
import * as Blockly from 'blockly/core';
|
||||||
import { getColour } from '../helpers/colour';
|
import { getColour } from '../helpers/colour';
|
||||||
import * as Types from '../helpers/types'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MQTT Blocks
|
* MQTT Blocks
|
||||||
@ -36,7 +35,7 @@ Blockly.Blocks["sensebox_mqtt_setup"] = {
|
|||||||
},
|
},
|
||||||
onchange: function (e) {
|
onchange: function (e) {
|
||||||
let service = this.getFieldValue('service');
|
let service = this.getFieldValue('service');
|
||||||
switch (this.getFieldValue('service')) {
|
switch (service) {
|
||||||
case 'adafruitio':
|
case 'adafruitio':
|
||||||
this.getField('server').setValue("io.adafruit.com");
|
this.getField('server').setValue("io.adafruit.com");
|
||||||
this.getField('port').setValue("1883");
|
this.getField('port').setValue("1883");
|
||||||
|
@ -22,12 +22,10 @@ Blockly.Blocks['sensebox_initialize_http_server'] = {
|
|||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
},
|
},
|
||||||
onchange: function (e) {
|
onchange: function (e) {
|
||||||
var legal = false;
|
|
||||||
// Is the block nested in a loop?
|
// Is the block nested in a loop?
|
||||||
var block = this;
|
var block = this;
|
||||||
do {
|
do {
|
||||||
if (this.LOOP_TYPES.indexOf(block.type) != -1) {
|
if (this.LOOP_TYPES.indexOf(block.type) !== -1) {
|
||||||
legal = true;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
block = block.getSurroundParent();
|
block = block.getSurroundParent();
|
||||||
@ -177,7 +175,6 @@ Blockly.Blocks['sensebox_general_html_tag'] = {
|
|||||||
this.setPreviousStatement(false);
|
this.setPreviousStatement(false);
|
||||||
this.setNextStatement(false);
|
this.setNextStatement(false);
|
||||||
this.setMutator(new Blockly.Mutator(['additional_child']));
|
this.setMutator(new Blockly.Mutator(['additional_child']));
|
||||||
var thisBlock = this;
|
|
||||||
this.additionalChildCount_ = 0;
|
this.additionalChildCount_ = 0;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -232,7 +229,6 @@ Blockly.Blocks['sensebox_general_html_tag'] = {
|
|||||||
// Count number of inputs.
|
// Count number of inputs.
|
||||||
this.additionalChildCount_ = 0;
|
this.additionalChildCount_ = 0;
|
||||||
var statementConnections = [null];
|
var statementConnections = [null];
|
||||||
var elseStatementConnection = null;
|
|
||||||
while (clauseBlock) {
|
while (clauseBlock) {
|
||||||
switch (clauseBlock.type) {
|
switch (clauseBlock.type) {
|
||||||
case 'additional_child':
|
case 'additional_child':
|
||||||
@ -240,7 +236,7 @@ Blockly.Blocks['sensebox_general_html_tag'] = {
|
|||||||
statementConnections.push(clauseBlock.statementConnection_);
|
statementConnections.push(clauseBlock.statementConnection_);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw 'Unknown block type.';
|
throw new Error("Unknown block type.");
|
||||||
}
|
}
|
||||||
clauseBlock = clauseBlock.nextConnection &&
|
clauseBlock = clauseBlock.nextConnection &&
|
||||||
clauseBlock.nextConnection.targetBlock();
|
clauseBlock.nextConnection.targetBlock();
|
||||||
@ -268,7 +264,7 @@ Blockly.Blocks['sensebox_general_html_tag'] = {
|
|||||||
i++;
|
i++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw 'Unknown block type.';
|
throw new Error('Unknown block type.');
|
||||||
}
|
}
|
||||||
clauseBlock = clauseBlock.nextConnection &&
|
clauseBlock = clauseBlock.nextConnection &&
|
||||||
clauseBlock.nextConnection.targetBlock();
|
clauseBlock.nextConnection.targetBlock();
|
||||||
@ -287,7 +283,7 @@ Blockly.Blocks['sensebox_general_html_tag'] = {
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
// Rebuild block.
|
// Rebuild block.
|
||||||
for (var i = 1; i <= this.additionalChildCount_; i++) {
|
for (i = 1; i <= this.additionalChildCount_; i++) {
|
||||||
this.appendValueInput('DO' + i, Blockly.Arduino.ORDER_NONE);
|
this.appendValueInput('DO' + i, Blockly.Arduino.ORDER_NONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user