Merge branch 'feat/blockly-gallery' of https://github.com/sensebox/React-Ardublockly into feat/blockly-gallery
This commit is contained in:
commit
f1ea8ca2e8
@ -779,5 +779,4 @@ Blockly.Msg.senseBox_ws2818_rgb_led = "senseBox WS2812 - RGB LED";
|
|||||||
Blockly.Msg.senseBox_ws2818_rgb_led_position = "Position";
|
Blockly.Msg.senseBox_ws2818_rgb_led_position = "Position";
|
||||||
Blockly.Msg.senseBox_ws2818_rgb_led_brightness = "Helligkeit";
|
Blockly.Msg.senseBox_ws2818_rgb_led_brightness = "Helligkeit";
|
||||||
|
|
||||||
|
export const De = Blockly.Msg;
|
||||||
export const De = Blockly.Msg;
|
|
||||||
|
@ -764,4 +764,4 @@ Blockly.Msg.senseBox_ws2818_rgb_led_brightness = "Helligkeit";
|
|||||||
Blockly.Msg.senseBox_ws2818_rgb_led_position = "Position";
|
Blockly.Msg.senseBox_ws2818_rgb_led_position = "Position";
|
||||||
|
|
||||||
|
|
||||||
export const En = Blockly.Msg;
|
export const En = Blockly.Msg;
|
||||||
|
@ -233,7 +233,7 @@ class Toolbox extends React.Component {
|
|||||||
<Block type="sensebox_send_to_osem" />
|
<Block type="sensebox_send_to_osem" />
|
||||||
</Category>
|
</Category>
|
||||||
<Category id="catSenseBoxOutput_LoRa" name=" LoRa" colour={getColour().sensebox}>
|
<Category id="catSenseBoxOutput_LoRa" name=" LoRa" colour={getColour().sensebox}>
|
||||||
<Category id="catSenseBoxOutput_LoRa_activation" name=" Activation" colour={getColour().sensebox}>
|
<Category id="catSenseBoxOutput_LoRa_activation" name=" Aktiviereung" colour={getColour().sensebox}>
|
||||||
<Block type="sensebox_lora_initialize_otaa" />
|
<Block type="sensebox_lora_initialize_otaa" />
|
||||||
<Block type="sensebox_lora_initialize_abp" />
|
<Block type="sensebox_lora_initialize_abp" />
|
||||||
</Category>
|
</Category>
|
||||||
@ -252,7 +252,7 @@ class Toolbox extends React.Component {
|
|||||||
<Block type="sensebox_lora_cayenne_gps" />
|
<Block type="sensebox_lora_cayenne_gps" />
|
||||||
</Category>
|
</Category>
|
||||||
</Category>
|
</Category>
|
||||||
<Category name="Logic" colour={getColour().logic}>
|
<Category name="Logik" colour={getColour().logic}>
|
||||||
<Block type="controls_if" />
|
<Block type="controls_if" />
|
||||||
<Block type="controls_ifelse" />
|
<Block type="controls_ifelse" />
|
||||||
<Block type="logic_compare" />
|
<Block type="logic_compare" />
|
||||||
@ -261,7 +261,7 @@ class Toolbox extends React.Component {
|
|||||||
<Block type="logic_boolean" />
|
<Block type="logic_boolean" />
|
||||||
<Block type="switch_case" />
|
<Block type="switch_case" />
|
||||||
</Category>
|
</Category>
|
||||||
<Category id="loops" name="Loops" colour={getColour().loops}>
|
<Category id="loops" name="Schleifen" colour={getColour().loops}>
|
||||||
<Block type="controls_repeat_ext">
|
<Block type="controls_repeat_ext">
|
||||||
<Value name="TIMES">
|
<Value name="TIMES">
|
||||||
<Block type="math_number">
|
<Block type="math_number">
|
||||||
@ -300,7 +300,7 @@ class Toolbox extends React.Component {
|
|||||||
<Block type="text_length" />
|
<Block type="text_length" />
|
||||||
<Block type="text_isEmpty" />
|
<Block type="text_isEmpty" />
|
||||||
</Category>
|
</Category>
|
||||||
<Category id="time" name="Time" colour={getColour().time}>
|
<Category id="time" name="Zeit" colour={getColour().time}>
|
||||||
<Block type="time_delay">
|
<Block type="time_delay">
|
||||||
<Value name="DELAY_TIME_MILI">
|
<Value name="DELAY_TIME_MILI">
|
||||||
<Block type="math_number">
|
<Block type="math_number">
|
||||||
@ -320,7 +320,7 @@ class Toolbox extends React.Component {
|
|||||||
<Block type="infinite_loop"></Block>
|
<Block type="infinite_loop"></Block>
|
||||||
<Block type="sensebox_interval_timer"></Block>
|
<Block type="sensebox_interval_timer"></Block>
|
||||||
</Category>
|
</Category>
|
||||||
<Category id="catMath" name="Math" colour={getColour().math}>
|
<Category id="catMath" name="Mathematik" colour={getColour().math}>
|
||||||
<Block type="math_number"></Block>
|
<Block type="math_number"></Block>
|
||||||
<Block type="math_arithmetic"></Block>
|
<Block type="math_arithmetic"></Block>
|
||||||
<Block type="math_single"></Block>
|
<Block type="math_single"></Block>
|
||||||
@ -380,7 +380,7 @@ class Toolbox extends React.Component {
|
|||||||
<Block type="lists_length" />
|
<Block type="lists_length" />
|
||||||
</Category>
|
</Category>
|
||||||
<sep></sep>
|
<sep></sep>
|
||||||
<Category name="Input/Output" colour={getColour().io}>
|
<Category name="Eingang/Ausgang" colour={getColour().io}>
|
||||||
<Block type="io_digitalwrite"></Block>
|
<Block type="io_digitalwrite"></Block>
|
||||||
<Block type="io_digitalread"></Block>
|
<Block type="io_digitalread"></Block>
|
||||||
<Block type="io_builtin_led"></Block>
|
<Block type="io_builtin_led"></Block>
|
||||||
|
@ -57,6 +57,16 @@ const compareParentBlock = (originalBlock, userBlock, index) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(userBlock.attributes['disabled']){
|
||||||
|
// user-block is not connected
|
||||||
|
return {text: `Der Block mit dem Typen '${userBlock.attributes['type'].value}' hat keine Verbindung zu einem anderen Block.`, type: 'error'};
|
||||||
|
}
|
||||||
|
else if(originalBlock.parentNode.parentNode && originalBlock.parentNode.parentNode.attributes && originalBlock.parentNode.parentNode.attributes['type']){
|
||||||
|
var type = compareBlockType(originalBlock.parentNode.parentNode, userBlock.parentNode.parentNode, index);
|
||||||
|
if(type){
|
||||||
|
return {text: `Der Block an Position ${index+1} ist falsch eingeordnet. Tipp: Block an Position ${index+1} einem vorherigen Block unterordnen.`, type: 'error'};
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const compareXml = (originalXml, userXml) => {
|
const compareXml = (originalXml, userXml) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user