mirror of
https://github.com/google/blockly.git
synced 2026-01-08 09:30:06 +01:00
Allow multiple interpolation messages. Fix variable context menus.
This commit is contained in:
@@ -211,8 +211,8 @@ Blockly.Blocks['lists_repeat'] = {
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message": Blockly.Msg.LISTS_REPEAT_TITLE,
|
||||
"args": [
|
||||
"message0": Blockly.Msg.LISTS_REPEAT_TITLE,
|
||||
"args0": [
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "ITEM"
|
||||
@@ -238,8 +238,8 @@ Blockly.Blocks['lists_length'] = {
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message": Blockly.Msg.LISTS_LENGTH_TITLE,
|
||||
"args": [
|
||||
"message0": Blockly.Msg.LISTS_LENGTH_TITLE,
|
||||
"args0": [
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "VALUE",
|
||||
@@ -261,8 +261,8 @@ Blockly.Blocks['lists_isEmpty'] = {
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message": Blockly.Msg.LISTS_ISEMPTY_TITLE,
|
||||
"args": [
|
||||
"message0": Blockly.Msg.LISTS_ISEMPTY_TITLE,
|
||||
"args0": [
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "VALUE",
|
||||
|
||||
@@ -371,8 +371,8 @@ Blockly.Blocks['logic_negate'] = {
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message": Blockly.Msg.LOGIC_NEGATE_TITLE,
|
||||
"args": [
|
||||
"message0": Blockly.Msg.LOGIC_NEGATE_TITLE,
|
||||
"args0": [
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "BOOL",
|
||||
|
||||
@@ -41,8 +41,8 @@ Blockly.Blocks['controls_repeat'] = {
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message": Blockly.Msg.CONTROLS_REPEAT_TITLE,
|
||||
"args": [
|
||||
"message0": Blockly.Msg.CONTROLS_REPEAT_TITLE,
|
||||
"args0": [
|
||||
{
|
||||
"type": "field_input",
|
||||
"name": "TIMES",
|
||||
@@ -69,8 +69,8 @@ Blockly.Blocks['controls_repeat_ext'] = {
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message": Blockly.Msg.CONTROLS_REPEAT_TITLE,
|
||||
"args": [
|
||||
"message0": Blockly.Msg.CONTROLS_REPEAT_TITLE,
|
||||
"args0": [
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "TIMES",
|
||||
@@ -126,8 +126,8 @@ Blockly.Blocks['controls_for'] = {
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message": Blockly.Msg.CONTROLS_FOR_TITLE,
|
||||
"args": [
|
||||
"message0": Blockly.Msg.CONTROLS_FOR_TITLE,
|
||||
"args0": [
|
||||
{
|
||||
"type": "field_variable",
|
||||
"name": "VAR",
|
||||
@@ -214,8 +214,8 @@ Blockly.Blocks['controls_forEach'] = {
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message": Blockly.Msg.CONTROLS_FOREACH_TITLE,
|
||||
"args": [
|
||||
"message0": Blockly.Msg.CONTROLS_FOREACH_TITLE,
|
||||
"args0": [
|
||||
{
|
||||
"type": "field_variable",
|
||||
"name": "VAR",
|
||||
|
||||
@@ -258,8 +258,8 @@ Blockly.Blocks['math_change'] = {
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message": Blockly.Msg.MATH_CHANGE_TITLE,
|
||||
"args": [
|
||||
"message0": Blockly.Msg.MATH_CHANGE_TITLE,
|
||||
"args0": [
|
||||
{
|
||||
"type": "field_variable",
|
||||
"name": "VAR",
|
||||
@@ -268,8 +268,7 @@ Blockly.Blocks['math_change'] = {
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "DELTA",
|
||||
"check": "Number",
|
||||
"align": "RIGHT"
|
||||
"check": "Number"
|
||||
}
|
||||
],
|
||||
"previousStatement": null,
|
||||
@@ -381,8 +380,8 @@ Blockly.Blocks['math_modulo'] = {
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message": Blockly.Msg.MATH_MODULO_TITLE,
|
||||
"args": [
|
||||
"message0": Blockly.Msg.MATH_MODULO_TITLE,
|
||||
"args0": [
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "DIVIDEND",
|
||||
@@ -410,8 +409,8 @@ Blockly.Blocks['math_constrain'] = {
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message": Blockly.Msg.MATH_CONSTRAIN_TITLE,
|
||||
"args": [
|
||||
"message0": Blockly.Msg.MATH_CONSTRAIN_TITLE,
|
||||
"args0": [
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "VALUE",
|
||||
@@ -444,8 +443,8 @@ Blockly.Blocks['math_random_int'] = {
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message": Blockly.Msg.MATH_RANDOM_INT_TITLE,
|
||||
"args": [
|
||||
"message0": Blockly.Msg.MATH_RANDOM_INT_TITLE,
|
||||
"args0": [
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "FROM",
|
||||
|
||||
@@ -274,8 +274,8 @@ Blockly.Blocks['text_length'] = {
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message": Blockly.Msg.TEXT_LENGTH_TITLE,
|
||||
"args": [
|
||||
"message0": Blockly.Msg.TEXT_LENGTH_TITLE,
|
||||
"args0": [
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "VALUE",
|
||||
@@ -297,8 +297,8 @@ Blockly.Blocks['text_isEmpty'] = {
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message": Blockly.Msg.TEXT_ISEMPTY_TITLE,
|
||||
"args": [
|
||||
"message0": Blockly.Msg.TEXT_ISEMPTY_TITLE,
|
||||
"args0": [
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "VALUE",
|
||||
@@ -577,8 +577,8 @@ Blockly.Blocks['text_print'] = {
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message": Blockly.Msg.TEXT_PRINT_TITLE,
|
||||
"args": [
|
||||
"message0": Blockly.Msg.TEXT_PRINT_TITLE,
|
||||
"args0": [
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "TEXT"
|
||||
|
||||
@@ -47,6 +47,7 @@ Blockly.Blocks['variables_get'] = {
|
||||
Blockly.Msg.VARIABLES_DEFAULT_NAME), 'VAR');
|
||||
this.setOutput(true);
|
||||
this.setTooltip(Blockly.Msg.VARIABLES_GET_TOOLTIP);
|
||||
this.contextMenuMsg_ = Blockly.Msg.VARIABLES_GET_CREATE_SET;
|
||||
},
|
||||
/**
|
||||
* Return all variables referenced by this block.
|
||||
@@ -68,7 +69,6 @@ Blockly.Blocks['variables_get'] = {
|
||||
this.setFieldValue(newName, 'VAR');
|
||||
}
|
||||
},
|
||||
contextMenuMsg_: Blockly.Msg.VARIABLES_GET_CREATE_SET,
|
||||
contextMenuType_: 'variables_set',
|
||||
/**
|
||||
* Add menu option to create getter/setter block for this setter/getter.
|
||||
@@ -95,8 +95,8 @@ Blockly.Blocks['variables_set'] = {
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message": Blockly.Msg.VARIABLES_SET,
|
||||
"args": [
|
||||
"message0": Blockly.Msg.VARIABLES_SET,
|
||||
"args0": [
|
||||
{
|
||||
"type": "field_variable",
|
||||
"name": "VAR",
|
||||
@@ -113,6 +113,7 @@ Blockly.Blocks['variables_set'] = {
|
||||
"tooltip": Blockly.Msg.VARIABLES_SET_TOOLTIP,
|
||||
"helpUrl": Blockly.Msg.VARIABLES_SET_HELPURL
|
||||
});
|
||||
this.contextMenuMsg_ = Blockly.Msg.VARIABLES_SET_CREATE_GET;
|
||||
},
|
||||
/**
|
||||
* Return all variables referenced by this block.
|
||||
@@ -134,7 +135,6 @@ Blockly.Blocks['variables_set'] = {
|
||||
this.setFieldValue(newName, 'VAR');
|
||||
}
|
||||
},
|
||||
contextMenuMsg_: Blockly.Msg.VARIABLES_SET_CREATE_GET,
|
||||
contextMenuType_: 'variables_get',
|
||||
customContextMenu: Blockly.Blocks['variables_get'].customContextMenu
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user