Merge remote-tracking branch 'upstream/develop' into feature/variable_management_merge_develop

This commit is contained in:
Rachel Fenichel
2016-08-08 16:58:51 -07:00
78 changed files with 3293 additions and 2205 deletions

View File

@@ -389,12 +389,9 @@ Blockly.Blocks['lists_getIndex'] = {
tooltip = Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM;
break;
}
if (where == 'FROM_START') {
if (where == 'FROM_START' || where == 'FROM_END') {
tooltip += ' ' + Blockly.Msg.LISTS_INDEX_FROM_START_TOOLTIP
.replace('%1', Blockly.Blocks.ONE_BASED_INDEXING ? '#1' : '#0');
} else if (where == 'FROM_END') {
tooltip += ' ' + Blockly.Msg.LISTS_INDEX_FROM_END_TOOLTIP
.replace('%1', '#1'); // The end is always 1-indexed.
}
return tooltip;
});
@@ -552,12 +549,9 @@ Blockly.Blocks['lists_setIndex'] = {
tooltip = Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM;
break;
}
if (where == 'FROM_START') {
if (where == 'FROM_START' || where == 'FROM_END') {
tooltip += ' ' + Blockly.Msg.LISTS_INDEX_FROM_START_TOOLTIP
.replace('%1', Blockly.Blocks.ONE_BASED_INDEXING ? '#1' : '#0');
} else if (where == 'FROM_END') {
tooltip += ' ' + Blockly.Msg.LISTS_INDEX_FROM_END_TOOLTIP
.replace('%1', '#1'); // The end is always 1-indexed.
}
return tooltip;
});

View File

@@ -349,7 +349,17 @@ Blockly.Blocks['text_charAt'] = {
this.appendDummyInput('AT');
this.setInputsInline(true);
this.updateAt_(true);
this.setTooltip(Blockly.Msg.TEXT_CHARAT_TOOLTIP);
// Assign 'this' to a variable for use in the tooltip closure below.
var thisBlock = this;
this.setTooltip(function() {
var where = thisBlock.getFieldValue('WHERE');
var tooltip = Blockly.Msg.TEXT_CHARAT_TOOLTIP;
if (where == 'FROM_START' || where == 'FROM_END') {
tooltip += ' ' + Blockly.Msg.LISTS_INDEX_FROM_END_TOOLTIP
.replace('%1', Blockly.Blocks.ONE_BASED_INDEXING ? '#1' : '#0');
}
return tooltip;
});
},
/**
* Create XML to represent whether there is an 'AT' input.