Skip to content

Commit

Permalink
Merge pull request #123 from tmickel/upstream-march-15
Browse files Browse the repository at this point in the history
Upstream merge March 15 & remove Lua generators
  • Loading branch information
rachel-fenichel committed Mar 16, 2016
2 parents 210fd0d + 1d0db41 commit cae688e
Show file tree
Hide file tree
Showing 40 changed files with 500 additions and 2,034 deletions.
83 changes: 47 additions & 36 deletions blockly_compressed_horizontal.js

Large diffs are not rendered by default.

81 changes: 46 additions & 35 deletions blockly_compressed_vertical.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion blockly_uncompressed_horizontal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blockly_uncompressed_vertical.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 1 addition & 12 deletions blocks/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,7 @@ Blockly.Blocks['lists_create_with'] = {
this.updateShape_();
// Reconnect any child blocks.
for (var i = 0; i < this.itemCount_; i++) {
var connectionChild = connections[i];
if (connectionChild) {
var parent = connectionChild.targetBlock();
var connectionParent = this.getInput('ADD' + i).connection;
if (connectionParent.targetConnection != connectionChild &&
(!parent || parent == this)) {
if (connectionParent.targetConnection) {
connectionParent.disconnect();
}
connectionParent.connect(connectionChild);
}
}
Blockly.Mutator.reconnect(connections[i], this, 'ADD' + i);
}
},
/**
Expand Down
12 changes: 3 additions & 9 deletions blocks/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,10 @@ Blockly.Blocks['controls_if'] = {
this.updateShape_();
// Reconnect any child blocks.
for (var i = 1; i <= this.elseifCount_; i++) {
if (valueConnections[i]) {
this.getInput('IF' + i).connection.connect(valueConnections[i]);
}
if (statementConnections[i]) {
this.getInput('DO' + i).connection.connect(statementConnections[i]);
}
}
if (elseStatementConnection) {
this.getInput('ELSE').connection.connect(elseStatementConnection);
Blockly.Mutator.reconnect(valueConnections[i], this, 'IF' + i);
Blockly.Mutator.reconnect(statementConnections[i], this, 'DO' + i);
}
Blockly.Mutator.reconnect(elseStatementConnection, this, 'ELSE');
},
/**
* Store pointers to any connected child blocks.
Expand Down
33 changes: 16 additions & 17 deletions blocks/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ Blockly.Blocks['text_join'] = {
this.updateShape_();
// Reconnect any child blocks.
for (var i = 0; i < this.itemCount_; i++) {
if (connections[i]) {
this.getInput('ADD' + i).connection.connect(connections[i]);
}
Blockly.Mutator.reconnect(connections[i], this, 'ADD' + i);
}
},
/**
Expand All @@ -168,28 +166,29 @@ Blockly.Blocks['text_join'] = {
* @this Blockly.Block
*/
updateShape_: function() {
// Delete everything.
if (this.getInput('EMPTY')) {
if (this.itemCount_ && this.getInput('EMPTY')) {
this.removeInput('EMPTY');
} else {
var i = 0;
while (this.getInput('ADD' + i)) {
this.removeInput('ADD' + i);
i++;
}
} else if (!this.itemCount_ && !this.getInput('EMPTY')) {
this.appendDummyInput('EMPTY')
.appendField(this.newQuote_(true))
.appendField(this.newQuote_(false));
}
// Rebuild block.
if (this.itemCount_ == 0) {
this.appendDummyInput('EMPTY');
} else {
for (var i = 0; i < this.itemCount_; i++) {
// Add new inputs.
for (var i = 0; i < this.itemCount_; i++) {
if (!this.getInput('ADD' + i)) {
var input = this.appendValueInput('ADD' + i);
if (i == 0) {
input.appendField(Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH);
}
}
}
}
// Remove deleted inputs.
while (this.getInput('ADD' + i)) {
this.removeInput('ADD' + i);
i++;
}
},
newQuote_: Blockly.Blocks['text'].newQuote_
};

Blockly.Blocks['text_create_join_container'] = {
Expand Down
Loading

0 comments on commit cae688e

Please sign in to comment.