mirror of
https://github.com/google/blockly.git
synced 2026-01-09 01:50:11 +01:00
Merge remote-tracking branch 'upstream/develop' into feature/variable_management_merge_develop
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user