Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
e3bf012
Use checkboxes instead of dropdowns for generator tests
rachel-fenichel Oct 29, 2018
200afba
Update version number
rachel-fenichel Oct 30, 2018
ecc555b
Fix bad xml element when generating next node (#2098)
RoboErikG Oct 31, 2018
29e8367
Remove bad classes
rachel-fenichel Oct 31, 2018
2756596
Localisation updates from https://translatewiki.net.
translatewiki Nov 1, 2018
d582c37
Localisation updates from https://translatewiki.net.
translatewiki Nov 5, 2018
280fa51
Don’t move immovable blocks in workspace cleanup. (#2104)
NeilFraser Nov 5, 2018
c49f9c4
Merge pull request #2094 from google/rachel-fenichel-patch-1
rachel-fenichel Nov 5, 2018
b9d6de1
Merge pull request #2101 from rachel-fenichel/feature/generator_tests…
rachel-fenichel Nov 5, 2018
9e9e566
add test skeleton
rachel-fenichel Oct 29, 2018
a248c01
Run generator tests and save a file with the generated js!
rachel-fenichel Nov 1, 2018
f3bb0d8
fix #2090 (#2109)
duzc2 Nov 7, 2018
9423970
Localisation updates from https://translatewiki.net.
translatewiki Nov 8, 2018
6202919
Make generator tests compare results against golden files; add golden…
rachel-fenichel Nov 9, 2018
abd22e8
Remove vestigial button
rachel-fenichel Nov 9, 2018
6e300cc
Add firefox to travis; quit early if files are not found in generator…
rachel-fenichel Nov 10, 2018
b0dfbb1
Localisation updates from https://translatewiki.net.
translatewiki Nov 12, 2018
b33d832
Check whether generator tests work under chrome + osx
rachel-fenichel Nov 12, 2018
d3ba3eb
Disable osx build
rachel-fenichel Nov 14, 2018
898810d
Use firefox for generator tests
rachel-fenichel Nov 14, 2018
d677023
Merge pull request #2111 from rachel-fenichel/feature/run_gen_tests_i…
rachel-fenichel Nov 14, 2018
97caca6
Removing comment around <meta>
AnmAtAnm Nov 14, 2018
7d77590
Add insertion markers.
rachel-fenichel Jul 23, 2018
df888eb
Remove setOpacity and getOpacity
rachel-fenichel Jul 27, 2018
dfc1f00
Mark the dragged connection manager deprecated
rachel-fenichel Jul 27, 2018
565569f
Fix horizontal insertion markers for blockly
rachel-fenichel Aug 6, 2018
4c133e9
Highlight and unhilight the closest connection
rachel-fenichel Aug 6, 2018
9aa54ac
Make replaceable child blocks opaque
rachel-fenichel Aug 6, 2018
e794b68
Make insertion markers match the size of the source block
rachel-fenichel Aug 7, 2018
17823db
Fix problem with connecting a statement into a stack, but not a c-sha…
rachel-fenichel Aug 14, 2018
57bffc0
Removing comment around <meta> in demos/mobile (PR #2120)
AnmAtAnm Nov 14, 2018
31a723b
Add handlers for console.alert and console.confirm.
AnmAtAnm Oct 16, 2018
4ce4544
Temp save of work
AnmAtAnm Nov 13, 2018
182ba96
Doc comments and style corrections.
AnmAtAnm Nov 14, 2018
5d8b4cd
Localisation updates from https://translatewiki.net.
translatewiki Nov 15, 2018
ca15234
Add support for handling window.prompt(..) etc in iOS mobile demo (PR…
AnmAtAnm Nov 15, 2018
cf05006
Make build.py compatible with Python 2 and 3
gomercin Nov 16, 2018
246580b
Merge pull request #2123 from gomercin/python3_upgrade
rachel-fenichel Nov 17, 2018
a4c3d1b
Update chromedriver version
rachel-fenichel Nov 17, 2018
bf825d0
Fix issues related to Python 3 compatibility
Nov 17, 2018
3235c6c
Fix issues related to Python 3 compatibility
gomercin Nov 17, 2018
8a58c71
Merge branch 'python3_further_upgrade' of https://github.com/gomercin…
Nov 18, 2018
233b156
Localisation updates from https://translatewiki.net.
translatewiki Nov 19, 2018
53d8ac8
Prefer inserting to wrapping for c-shape blocks
rachel-fenichel Nov 19, 2018
f2208a6
Merge pull request #2125 from gomercin/python3_further_upgrade
rachel-fenichel Nov 19, 2018
991b704
Minor cleanup
rachel-fenichel Nov 19, 2018
d70e89d
Cleanup
rachel-fenichel Nov 19, 2018
a8b0b90
Add warning for default case in canConnectToPrevious_
rachel-fenichel Nov 19, 2018
ef23820
Add private annotation
rachel-fenichel Nov 19, 2018
779e70f
Update selenium version
rachel-fenichel Nov 19, 2018
13740f4
Add tests for canConnectToPrevious
rachel-fenichel Nov 19, 2018
2449296
Merge pull request #2126 from rachel-fenichel/update_selenium
rachel-fenichel Nov 19, 2018
ff901a7
Comment cleanup; remove logs
rachel-fenichel Nov 20, 2018
c7b5028
Merge pull request #1987 from rachel-fenichel/feature/insertion_markers
rachel-fenichel Nov 20, 2018
26a4774
Adds option to generate code for a single block
Nov 21, 2018
6366d7b
Tests blockToCode function for all generators
Nov 21, 2018
b0601d3
Localisation updates from https://translatewiki.net.
translatewiki Nov 22, 2018
c03ea23
Localisation updates from https://translatewiki.net.
translatewiki Nov 26, 2018
e9773be
Adds tests for a nested loop and disabled block
Nov 27, 2018
f06bee4
Fixes pull request comments
Nov 27, 2018
2ad4333
Look up variable by name if not found by ID
rachel-fenichel Nov 27, 2018
d64b6fe
Changes function name
Nov 27, 2018
76538e6
Merge pull request #2133 from alschmiedt/single_code_block
alschmiedt Nov 27, 2018
9ed9dd2
Add tests
rachel-fenichel Nov 27, 2018
6169a64
Merge pull request #2139 from rachel-fenichel/bugfix/2107
rachel-fenichel Nov 27, 2018
1c4ba38
Added Max Instances Property to Workspace Options (#2130)
BeksOmega Nov 28, 2018
74b1584
Localisation updates from https://translatewiki.net.
translatewiki Nov 29, 2018
9a1d668
Pulls from MakeCode fork the ability to rename and delete variables i…
Nov 29, 2018
670e432
Merge pull request #2144 from alschmiedt/delete_variable_menuItem
alschmiedt Nov 30, 2018
b8d7ed1
Chromedriver 2.43 -> 2.44
rachel-fenichel Nov 30, 2018
7ec5599
Merge pull request #2124 from google/update_chromedriver_develop
rachel-fenichel Nov 30, 2018
5938c6d
Fix #2131
rachel-fenichel Nov 30, 2018
b606bc5
Don't distinguish between first statement connection and others
rachel-fenichel Nov 30, 2018
1553096
Check if both sides of a potential connection match, not just one
rachel-fenichel Nov 30, 2018
3cbb137
Merge pull request #2147 from rachel-fenichel/bugfix/2131
rachel-fenichel Nov 30, 2018
1b2ec72
Added randomness to bumping per Issue #2011
BeksOmega Dec 2, 2018
6b96528
Localisation updates from https://translatewiki.net.
translatewiki Dec 3, 2018
1070436
Merge pull request #2148 from BeksOmega/fixes/Bumping
rachel-fenichel Dec 3, 2018
f5ea0f6
Tweak insertion marker snap radii
rachel-fenichel Dec 3, 2018
c08eadf
Merge pull request #2149 from rachel-fenichel/bugfix/snap_radius
rachel-fenichel Dec 3, 2018
16f2175
#1848 Fixed throw console warning when deleting workspace comments
m-yeganeh Dec 4, 2018
a20af7e
#1848 Fixed eslint errors
m-yeganeh Dec 5, 2018
d016932
Merge pull request #2151 from mehdi-yeganeh/develop
rachel-fenichel Dec 5, 2018
8f81bba
Fixed Filter Capacity not Considering Child Blocks. (#2155)
BeksOmega Dec 6, 2018
56d5f16
#172, Fixed [Edge, IE] Zoom control mouseover is not clipped
m-yeganeh Dec 8, 2018
fc47878
#172, Fixed [Edge, IE] Zoom control mouseover is not clipped
m-yeganeh Dec 8, 2018
83cc98f
Localisation updates from https://translatewiki.net.
translatewiki Dec 10, 2018
c9411df
Merge pull request #2159 from mehdi-yeganeh/develop
rachel-fenichel Dec 10, 2018
8422f93
Handle promise rejection for sound.play() in preload (#2162)
epicfaace Dec 10, 2018
e49d07d
Propagate the event group when enforcing bounds on blocks (#2163)
RoboErikG Dec 12, 2018
2ba0456
Localisation updates from https://translatewiki.net.
translatewiki Dec 13, 2018
094418f
Reconnects child blocks when an undo is done on an else block
alschmiedt Dec 13, 2018
3bf9337
Fixed comment
alschmiedt Dec 13, 2018
0c66429
Merge pull request #2167 from alschmiedt/mutation_actions
alschmiedt Dec 13, 2018
aae15f0
Groups events fired during field input change
alschmiedt Dec 13, 2018
4bd21c5
Added todo
alschmiedt Dec 13, 2018
91cc05a
Merge pull request #2168 from alschmiedt/procedure_events
alschmiedt Dec 13, 2018
e182f43
Disable insertion markers for the December 2018 release
rachel-fenichel Dec 14, 2018
4ee1420
Merge pull request #2170 from rachel-fenichel/disable_insertion_markers
rachel-fenichel Dec 14, 2018
b7446e1
Update dependencies
rachel-fenichel Dec 14, 2018
1f076d7
Merge pull request #2171 from rachel-fenichel/update_dependencies
rachel-fenichel Dec 14, 2018
b58f3b1
Rebuild uncompressed and language files
rachel-fenichel Dec 14, 2018
1ed0585
Merge pull request #2173 from rachel-fenichel/rebuild_12_14_18
rachel-fenichel Dec 14, 2018
a272e52
Bump version to 1.20181214
rachel-fenichel Dec 14, 2018
2e71584
Merge branch 'master' into rc/Dec_18
rachel-fenichel Dec 14, 2018
17ab169
Fix bad version number
rachel-fenichel Dec 15, 2018
da94697
Rebuild
rachel-fenichel Dec 17, 2018
738d06a
Avoid crashing when a procedure input has an empty string
RoboErikG Dec 18, 2018
68ecd80
Merge pull request #2186 from RoboErikG/roboerikg-emptyVar-cp
rachel-fenichel Dec 19, 2018
c042a94
Rebuild blocks_compressed
rachel-fenichel Dec 19, 2018
817399a
Bump version number on master
rachel-fenichel Dec 19, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ npm-debug.log
tests/compile/main_compressed.js
tests/compile/*compiler*.jar
local_build/*compiler*.jar
local_build/local_blockly_compressed.js
local_build/local_blockly_compressed.js
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ matrix:
apt:
packages:
- google-chrome-stable
- os: osx
node_js: stable
osx_image: xcode8.3
# TODO (#2114): reenable osx build.
# - os: osx
# node_js: stable
# osx_image: xcode8.3
# addons:
# firefox: latest

before_script:
# Symlink closure library used by test/jsunit
Expand Down
197 changes: 104 additions & 93 deletions blockly_accessible_compressed.js

Large diffs are not rendered by default.

24 changes: 13 additions & 11 deletions blockly_accessible_uncompressed.js

Large diffs are not rendered by default.

197 changes: 104 additions & 93 deletions blockly_compressed.js

Large diffs are not rendered by default.

24 changes: 13 additions & 11 deletions blockly_uncompressed.js

Large diffs are not rendered by default.

49 changes: 43 additions & 6 deletions blocks/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = {
domToMutation: function(xmlElement) {
this.elseifCount_ = parseInt(xmlElement.getAttribute('elseif'), 10) || 0;
this.elseCount_ = parseInt(xmlElement.getAttribute('else'), 10) || 0;
this.updateShape_();
this.rebuildShape_();
},
/**
* Populate the mutator's dialog with this block's components.
Expand Down Expand Up @@ -388,11 +388,8 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = {
}
this.updateShape_();
// Reconnect any child blocks.
for (var i = 1; i <= this.elseifCount_; i++) {
Blockly.Mutator.reconnect(valueConnections[i], this, 'IF' + i);
Blockly.Mutator.reconnect(statementConnections[i], this, 'DO' + i);
}
Blockly.Mutator.reconnect(elseStatementConnection, this, 'ELSE');
this.reconnectChildBlocks_(valueConnections, statementConnections,
elseStatementConnection);
},
/**
* Store pointers to any connected child blocks.
Expand Down Expand Up @@ -425,6 +422,29 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = {
clauseBlock.nextConnection.targetBlock();
}
},
/**
* Reconstructs the block with all child blocks attached.
*/
rebuildShape_: function() {
var valueConnections = [null];
var statementConnections = [null];
var elseStatementConnection = null;

if (this.getInput('ELSE')) {
elseStatementConnection = this.getInput('ELSE').connection.targetConnection;
}
var i = 1;
while (this.getInput('IF' + i)) {
var inputIf = this.getInput('IF' + i);
var inputDo = this.getInput('DO' + i);
valueConnections.push(inputIf.connection.targetConnection);
statementConnections.push(inputDo.connection.targetConnection);
i++;
}
this.updateShape_();
this.reconnectChildBlocks_(valueConnections, statementConnections,
elseStatementConnection);
},
/**
* Modify this block to have the correct number of inputs.
* @this Blockly.Block
Expand Down Expand Up @@ -453,6 +473,23 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = {
this.appendStatementInput('ELSE')
.appendField(Blockly.Msg['CONTROLS_IF_MSG_ELSE']);
}
},
/**
* Reconnects child blocks.
* @param {!Array<?Blockly.RenderedConnection>} valueConnections List of value
* connectsions for if input.
* @param {!Array<?Blockly.RenderedConnection>} statementConnections List of
* statement connections for do input.
* @param {?Blockly.RenderedConnection} elseStatementConnection Statement
* connection for else input.
*/
reconnectChildBlocks_: function(valueConnections, statementConnections,
elseStatementConnection) {
for (var i = 1; i <= this.elseifCount_; i++) {
Blockly.Mutator.reconnect(valueConnections[i], this, 'IF' + i);
Blockly.Mutator.reconnect(statementConnections[i], this, 'DO' + i);
}
Blockly.Mutator.reconnect(elseStatementConnection, this, 'ELSE');
}
};

Expand Down
13 changes: 11 additions & 2 deletions blocks/procedures.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ Blockly.Blocks['procedures_defnoreturn'] = {
this.arguments_.push(varName);
var variable = Blockly.Variables.getOrCreateVariablePackage(
this.workspace, varId, varName, '');
this.argumentVarModels_.push(variable);
if (variable != null) {
this.argumentVarModels_.push(variable);
} else {
console.log('Failed to create a variable with name ' + varName + ', ignoring.');
}
}
}
this.updateParams_();
Expand Down Expand Up @@ -216,7 +220,12 @@ Blockly.Blocks['procedures_defnoreturn'] = {
var varName = paramBlock.getFieldValue('NAME');
this.arguments_.push(varName);
var variable = this.workspace.getVariable(varName, '');
this.argumentVarModels_.push(variable);
if (variable != null) {
this.argumentVarModels_.push(variable);
} else {
console.log('Failed to get variable named ' + varName + ', ignoring.');
}

this.paramIds_.push(paramBlock.id);
paramBlock = paramBlock.nextConnection &&
paramBlock.nextConnection.targetBlock();
Expand Down
87 changes: 66 additions & 21 deletions blocks/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,31 +100,76 @@ Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN = {
* @this Blockly.Block
*/
customContextMenu: function(options) {
if (this.isInFlyout){
return;
}
// Getter blocks have the option to create a setter block, and vice versa.
if (this.type == 'variables_get') {
var opposite_type = 'variables_set';
var contextMenuMsg = Blockly.Msg['VARIABLES_GET_CREATE_SET'];
if (!this.isInFlyout){
// Getter blocks have the option to create a setter block, and vice versa.
if (this.type == 'variables_get') {
var opposite_type = 'variables_set';
var contextMenuMsg = Blockly.Msg['VARIABLES_GET_CREATE_SET'];
} else {
var opposite_type = 'variables_get';
var contextMenuMsg = Blockly.Msg['VARIABLES_SET_CREATE_GET'];
}

var option = {enabled: this.workspace.remainingCapacity() > 0};
var name = this.getField('VAR').getText();
option.text = contextMenuMsg.replace('%1', name);
var xmlField = document.createElement('field');
xmlField.setAttribute('name', 'VAR');
xmlField.appendChild(document.createTextNode(name));
var xmlBlock = document.createElement('block');
xmlBlock.setAttribute('type', opposite_type);
xmlBlock.appendChild(xmlField);
option.callback = Blockly.ContextMenu.callbackFactory(this, xmlBlock);
options.push(option);
// Getter blocks have the option to rename or delete that variable.
} else {
var opposite_type = 'variables_get';
var contextMenuMsg = Blockly.Msg['VARIABLES_SET_CREATE_GET'];
if (this.type == 'variables_get' || this.type == 'variables_get_reporter'){
var renameOption = {
text: Blockly.Msg.RENAME_VARIABLE,
enabled: true,
callback: Blockly.Constants.Variables.RENAME_OPTION_CALLBACK_FACTORY(this)
};
var name = this.getField('VAR').getText();
var deleteOption = {
text: Blockly.Msg.DELETE_VARIABLE.replace('%1', name),
enabled: true,
callback: Blockly.Constants.Variables.DELETE_OPTION_CALLBACK_FACTORY(this)
};
options.unshift(renameOption);
options.unshift(deleteOption);
}
}

var option = {enabled: this.workspace.remainingCapacity() > 0};
var name = this.getField('VAR').getText();
option.text = contextMenuMsg.replace('%1', name);
var xmlField = document.createElement('field');
xmlField.setAttribute('name', 'VAR');
xmlField.appendChild(document.createTextNode(name));
var xmlBlock = document.createElement('block');
xmlBlock.setAttribute('type', opposite_type);
xmlBlock.appendChild(xmlField);
option.callback = Blockly.ContextMenu.callbackFactory(this, xmlBlock);
options.push(option);
}
};

/**
* Callback for rename variable dropdown menu option associated with a
* variable getter block.
* @param {!Blockly.Block} block The block with the variable to rename.
* @return {!function()} A function that renames the variable.
*/
Blockly.Constants.Variables.RENAME_OPTION_CALLBACK_FACTORY = function(block) {
return function() {
var workspace = block.workspace;
var variable = block.getField('VAR').getVariable();
Blockly.Variables.renameVariable(workspace, variable);
};
};

/**
* Callback for delete variable dropdown menu option associated with a
* variable getter block.
* @param {!Blockly.Block} block The block with the variable to delete.
* @return {!function()} A function that deletes the variable.
*/
Blockly.Constants.Variables.DELETE_OPTION_CALLBACK_FACTORY = function(block) {
return function() {
var workspace = block.workspace;
var variable = block.getField('VAR').getVariable();
workspace.deleteVariableById(variable.getId());
workspace.refreshToolboxSelection();
};
};

Blockly.Extensions.registerMixin('contextMenu_variableSetterGetter',
Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN);
97 changes: 71 additions & 26 deletions blocks/variables_dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,34 +97,50 @@ Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MI
*/
customContextMenu: function(options) {
// Getter blocks have the option to create a setter block, and vice versa.
if (this.isInFlyout) {
return;
}
var opposite_type;
var contextMenuMsg;
var id = this.getFieldValue('VAR');
var variableModel = this.workspace.getVariableById(id);
var varType = variableModel.type;
if (this.type == 'variables_get_dynamic') {
opposite_type = 'variables_set_dynamic';
contextMenuMsg = Blockly.Msg['VARIABLES_GET_CREATE_SET'];
if (!this.isInFlyout) {
var opposite_type;
var contextMenuMsg;
var id = this.getFieldValue('VAR');
var variableModel = this.workspace.getVariableById(id);
var varType = variableModel.type;
if (this.type == 'variables_get_dynamic') {
opposite_type = 'variables_set_dynamic';
contextMenuMsg = Blockly.Msg['VARIABLES_GET_CREATE_SET'];
} else {
opposite_type = 'variables_get_dynamic';
contextMenuMsg = Blockly.Msg['VARIABLES_SET_CREATE_GET'];
}

var option = {enabled: this.workspace.remainingCapacity() > 0};
var name = this.getField('VAR').getText();
option.text = contextMenuMsg.replace('%1', name);
var xmlField = document.createElement('field');
xmlField.setAttribute('name', 'VAR');
xmlField.setAttribute('variabletype', varType);
xmlField.appendChild(document.createTextNode(name));
var xmlBlock = document.createElement('block');
xmlBlock.setAttribute('type', opposite_type);
xmlBlock.appendChild(xmlField);
option.callback = Blockly.ContextMenu.callbackFactory(this, xmlBlock);
options.push(option);
} else {
opposite_type = 'variables_get_dynamic';
contextMenuMsg = Blockly.Msg['VARIABLES_SET_CREATE_GET'];
if (this.type == 'variables_get_dynamic' ||
this.type == 'variables_get_reporter_dynamic') {
var renameOption = {
text: Blockly.Msg.RENAME_VARIABLE,
enabled: true,
callback: Blockly.Constants.Variables.RENAME_OPTION_CALLBACK_FACTORY(this)
};
var name = this.getField('VAR').getText();
var deleteOption = {
text: Blockly.Msg.DELETE_VARIABLE.replace('%1', name),
enabled: true,
callback: Blockly.Constants.Variables.DELETE_OPTION_CALLBACK_FACTORY(this)
};
options.unshift(renameOption);
options.unshift(deleteOption);
}
}

var option = {enabled: this.workspace.remainingCapacity() > 0};
var name = this.getField('VAR').getText();
option.text = contextMenuMsg.replace('%1', name);
var xmlField = document.createElement('field');
xmlField.setAttribute('name', 'VAR');
xmlField.setAttribute('variabletype', varType);
xmlField.appendChild(document.createTextNode(name));
var xmlBlock = document.createElement('block');
xmlBlock.setAttribute('type', opposite_type);
xmlBlock.appendChild(xmlField);
option.callback = Blockly.ContextMenu.callbackFactory(this, xmlBlock);
options.push(option);
},
onchange: function() {
var id = this.getFieldValue('VAR');
Expand All @@ -137,5 +153,34 @@ Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MI
}
};

/**
* Callback for rename variable dropdown menu option associated with a
* variable getter block.
* @param {!Blockly.Block} block The block with the variable to rename.
* @return {!function()} A function that renames the variable.
*/
Blockly.Constants.VariablesDynamic.RENAME_OPTION_CALLBACK_FACTORY = function(block) {
return function() {
var workspace = block.workspace;
var variable = block.getField('VAR').getVariable();
Blockly.Variables.renameVariable(workspace, variable);
};
};

/**
* Callback for delete variable dropdown menu option associated with a
* variable getter block.
* @param {!Blockly.Block} block The block with the variable to delete.
* @return {!function()} A function that deletes the variable.
*/
Blockly.Constants.VariablesDynamic.DELETE_OPTION_CALLBACK_FACTORY = function(block) {
return function() {
var workspace = block.workspace;
var variable = block.getField('VAR').getVariable();
workspace.deleteVariableById(variable.getId());
workspace.refreshToolboxSelection();
};
};

Blockly.Extensions.registerMixin('contextMenu_variableDynamicSetterGetter',
Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN);
Loading