mirror of
https://github.com/google/blockly.git
synced 2026-01-05 08:00:09 +01:00
Block annotations (#2997)
* Replace `@this Blockly.Block` with `@this {Blockly.Block}` in all block files.
* Fix 9 compiler warnings (JSC_USED_GLOBAL_THIS)
This commit is contained in:
committed by
Sam El-Husseini
parent
fb74181589
commit
f717add5a5
@@ -129,7 +129,7 @@ Blockly.defineBlocksWithJsonArray([ // BEGIN JSON EXTRACT
|
||||
Blockly.Blocks['lists_create_with'] = {
|
||||
/**
|
||||
* Block for creating a list with any number of elements of any type.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
this.setHelpUrl(Blockly.Msg['LISTS_CREATE_WITH_HELPURL']);
|
||||
@@ -143,7 +143,7 @@ Blockly.Blocks['lists_create_with'] = {
|
||||
/**
|
||||
* Create XML to represent list inputs.
|
||||
* @return {!Element} XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
mutationToDom: function() {
|
||||
var container = Blockly.utils.xml.createElement('mutation');
|
||||
@@ -153,7 +153,7 @@ Blockly.Blocks['lists_create_with'] = {
|
||||
/**
|
||||
* Parse XML to restore the list inputs.
|
||||
* @param {!Element} xmlElement XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
domToMutation: function(xmlElement) {
|
||||
this.itemCount_ = parseInt(xmlElement.getAttribute('items'), 10);
|
||||
@@ -163,7 +163,7 @@ Blockly.Blocks['lists_create_with'] = {
|
||||
* Populate the mutator's dialog with this block's components.
|
||||
* @param {!Blockly.Workspace} workspace Mutator's workspace.
|
||||
* @return {!Blockly.Block} Root block in mutator.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
decompose: function(workspace) {
|
||||
var containerBlock = workspace.newBlock('lists_create_with_container');
|
||||
@@ -180,7 +180,7 @@ Blockly.Blocks['lists_create_with'] = {
|
||||
/**
|
||||
* Reconfigure this block based on the mutator dialog's components.
|
||||
* @param {!Blockly.Block} containerBlock Root block in mutator.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
compose: function(containerBlock) {
|
||||
var itemBlock = containerBlock.getInputTargetBlock('STACK');
|
||||
@@ -208,7 +208,7 @@ Blockly.Blocks['lists_create_with'] = {
|
||||
/**
|
||||
* Store pointers to any connected child blocks.
|
||||
* @param {!Blockly.Block} containerBlock Root block in mutator.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
saveConnections: function(containerBlock) {
|
||||
var itemBlock = containerBlock.getInputTargetBlock('STACK');
|
||||
@@ -224,7 +224,7 @@ Blockly.Blocks['lists_create_with'] = {
|
||||
/**
|
||||
* Modify this block to have the correct number of inputs.
|
||||
* @private
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
updateShape_: function() {
|
||||
if (this.itemCount_ && this.getInput('EMPTY')) {
|
||||
@@ -253,7 +253,7 @@ Blockly.Blocks['lists_create_with'] = {
|
||||
Blockly.Blocks['lists_create_with_container'] = {
|
||||
/**
|
||||
* Mutator block for list container.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
this.setStyle('list_blocks');
|
||||
@@ -268,7 +268,7 @@ Blockly.Blocks['lists_create_with_container'] = {
|
||||
Blockly.Blocks['lists_create_with_item'] = {
|
||||
/**
|
||||
* Mutator block for adding items.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
this.setStyle('list_blocks');
|
||||
@@ -284,7 +284,7 @@ Blockly.Blocks['lists_create_with_item'] = {
|
||||
Blockly.Blocks['lists_indexOf'] = {
|
||||
/**
|
||||
* Block for finding an item in the list.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
var OPERATORS =
|
||||
@@ -313,7 +313,7 @@ Blockly.Blocks['lists_indexOf'] = {
|
||||
Blockly.Blocks['lists_getIndex'] = {
|
||||
/**
|
||||
* Block for getting element at index.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
var MODE =
|
||||
@@ -411,7 +411,7 @@ Blockly.Blocks['lists_getIndex'] = {
|
||||
* Create XML to represent whether the block is a statement or a value.
|
||||
* Also represent whether there is an 'AT' input.
|
||||
* @return {Element} XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
mutationToDom: function() {
|
||||
var container = Blockly.utils.xml.createElement('mutation');
|
||||
@@ -424,7 +424,7 @@ Blockly.Blocks['lists_getIndex'] = {
|
||||
/**
|
||||
* Parse XML to restore the 'AT' input.
|
||||
* @param {!Element} xmlElement XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
domToMutation: function(xmlElement) {
|
||||
// Note: Until January 2013 this block did not have mutations,
|
||||
@@ -439,7 +439,7 @@ Blockly.Blocks['lists_getIndex'] = {
|
||||
* @param {boolean} newStatement True if the block should be a statement.
|
||||
* False if the block should be a value.
|
||||
* @private
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
updateStatement_: function(newStatement) {
|
||||
var oldStatement = !this.outputConnection;
|
||||
@@ -460,7 +460,7 @@ Blockly.Blocks['lists_getIndex'] = {
|
||||
* Create or delete an input for the numeric index.
|
||||
* @param {boolean} isAt True if the input should exist.
|
||||
* @private
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
updateAt_: function(isAt) {
|
||||
// Destroy old 'AT' and 'ORDINAL' inputs.
|
||||
@@ -498,7 +498,7 @@ Blockly.Blocks['lists_getIndex'] = {
|
||||
Blockly.Blocks['lists_setIndex'] = {
|
||||
/**
|
||||
* Block for setting the element at index.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
var MODE =
|
||||
@@ -575,7 +575,7 @@ Blockly.Blocks['lists_setIndex'] = {
|
||||
/**
|
||||
* Create XML to represent whether there is an 'AT' input.
|
||||
* @return {Element} XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
mutationToDom: function() {
|
||||
var container = Blockly.utils.xml.createElement('mutation');
|
||||
@@ -586,7 +586,7 @@ Blockly.Blocks['lists_setIndex'] = {
|
||||
/**
|
||||
* Parse XML to restore the 'AT' input.
|
||||
* @param {!Element} xmlElement XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
domToMutation: function(xmlElement) {
|
||||
// Note: Until January 2013 this block did not have mutations,
|
||||
@@ -598,7 +598,7 @@ Blockly.Blocks['lists_setIndex'] = {
|
||||
* Create or delete an input for the numeric index.
|
||||
* @param {boolean} isAt True if the input should exist.
|
||||
* @private
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
updateAt_: function(isAt) {
|
||||
// Destroy old 'AT' and 'ORDINAL' input.
|
||||
@@ -638,7 +638,7 @@ Blockly.Blocks['lists_setIndex'] = {
|
||||
Blockly.Blocks['lists_getSublist'] = {
|
||||
/**
|
||||
* Block for getting sublist.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
this['WHERE_OPTIONS_1'] =
|
||||
@@ -673,7 +673,7 @@ Blockly.Blocks['lists_getSublist'] = {
|
||||
/**
|
||||
* Create XML to represent whether there are 'AT' inputs.
|
||||
* @return {Element} XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
mutationToDom: function() {
|
||||
var container = Blockly.utils.xml.createElement('mutation');
|
||||
@@ -686,7 +686,7 @@ Blockly.Blocks['lists_getSublist'] = {
|
||||
/**
|
||||
* Parse XML to restore the 'AT' inputs.
|
||||
* @param {!Element} xmlElement XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
domToMutation: function(xmlElement) {
|
||||
var isAt1 = (xmlElement.getAttribute('at1') == 'true');
|
||||
@@ -700,7 +700,7 @@ Blockly.Blocks['lists_getSublist'] = {
|
||||
* @param {number} n Specify first or second input (1 or 2).
|
||||
* @param {boolean} isAt True if the input should exist.
|
||||
* @private
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
updateAt_: function(n, isAt) {
|
||||
// Create or delete an input for the numeric index.
|
||||
@@ -748,7 +748,7 @@ Blockly.Blocks['lists_getSublist'] = {
|
||||
Blockly.Blocks['lists_sort'] = {
|
||||
/**
|
||||
* Block for sorting a list.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
@@ -788,7 +788,7 @@ Blockly.Blocks['lists_sort'] = {
|
||||
Blockly.Blocks['lists_split'] = {
|
||||
/**
|
||||
* Block for splitting text into a list, or joining a list into text.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
// Assign 'this' to a variable for use in the closures below.
|
||||
@@ -825,7 +825,7 @@ Blockly.Blocks['lists_split'] = {
|
||||
* Modify this block to have the correct input and output types.
|
||||
* @param {string} newMode Either 'SPLIT' or 'JOIN'.
|
||||
* @private
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
updateType_: function(newMode) {
|
||||
var mode = this.getFieldValue('MODE');
|
||||
@@ -853,7 +853,7 @@ Blockly.Blocks['lists_split'] = {
|
||||
/**
|
||||
* Create XML to represent the input and output types.
|
||||
* @return {!Element} XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
mutationToDom: function() {
|
||||
var container = Blockly.utils.xml.createElement('mutation');
|
||||
@@ -863,7 +863,7 @@ Blockly.Blocks['lists_split'] = {
|
||||
/**
|
||||
* Parse XML to restore the input and output types.
|
||||
* @param {!Element} xmlElement XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
domToMutation: function(xmlElement) {
|
||||
this.updateType_(xmlElement.getAttribute('mode'));
|
||||
|
||||
@@ -314,7 +314,7 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = {
|
||||
/**
|
||||
* Create XML to represent the number of else-if and else inputs.
|
||||
* @return {Element} XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
mutationToDom: function() {
|
||||
if (!this.elseifCount_ && !this.elseCount_) {
|
||||
@@ -332,7 +332,7 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = {
|
||||
/**
|
||||
* Parse XML to restore the else-if and else inputs.
|
||||
* @param {!Element} xmlElement XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
domToMutation: function(xmlElement) {
|
||||
this.elseifCount_ = parseInt(xmlElement.getAttribute('elseif'), 10) || 0;
|
||||
@@ -343,7 +343,7 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = {
|
||||
* Populate the mutator's dialog with this block's components.
|
||||
* @param {!Blockly.Workspace} workspace Mutator's workspace.
|
||||
* @return {!Blockly.Block} Root block in mutator.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
decompose: function(workspace) {
|
||||
var containerBlock = workspace.newBlock('controls_if_if');
|
||||
@@ -365,7 +365,7 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = {
|
||||
/**
|
||||
* Reconfigure this block based on the mutator dialog's components.
|
||||
* @param {!Blockly.Block} containerBlock Root block in mutator.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
compose: function(containerBlock) {
|
||||
var clauseBlock = containerBlock.nextConnection.targetBlock();
|
||||
@@ -400,7 +400,7 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = {
|
||||
/**
|
||||
* Store pointers to any connected child blocks.
|
||||
* @param {!Blockly.Block} containerBlock Root block in mutator.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
saveConnections: function(containerBlock) {
|
||||
var clauseBlock = containerBlock.nextConnection.targetBlock();
|
||||
@@ -430,6 +430,7 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = {
|
||||
},
|
||||
/**
|
||||
* Reconstructs the block with all child blocks attached.
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
rebuildShape_: function() {
|
||||
var valueConnections = [null];
|
||||
@@ -453,7 +454,7 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = {
|
||||
},
|
||||
/**
|
||||
* Modify this block to have the correct number of inputs.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
* @private
|
||||
*/
|
||||
updateShape_: function() {
|
||||
@@ -488,6 +489,7 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = {
|
||||
* statement connections for do input.
|
||||
* @param {?Blockly.RenderedConnection} elseStatementConnection Statement
|
||||
* connection for else input.
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
reconnectChildBlocks_: function(valueConnections, statementConnections,
|
||||
elseStatementConnection) {
|
||||
@@ -505,7 +507,7 @@ Blockly.Extensions.registerMutator('controls_if_mutator',
|
||||
/**
|
||||
* "controls_if" extension function. Adds mutator, shape updating methods, and
|
||||
* dynamic tooltip to "controls_if" blocks.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
* @package
|
||||
*/
|
||||
Blockly.Constants.Logic.CONTROLS_IF_TOOLTIP_EXTENSION = function() {
|
||||
@@ -540,7 +542,7 @@ Blockly.Constants.Logic.LOGIC_COMPARE_ONCHANGE_MIXIN = {
|
||||
* Called whenever anything on the workspace changes.
|
||||
* Prevent mismatched types from being compared.
|
||||
* @param {!Blockly.Events.Abstract} e Change event.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
onchange: function(e) {
|
||||
if (!this.prevBlocks_) {
|
||||
@@ -582,7 +584,7 @@ Blockly.Constants.Logic.LOGIC_COMPARE_ONCHANGE_MIXIN = {
|
||||
/**
|
||||
* "logic_compare" extension function. Adds type left and right side type
|
||||
* checking to "logic_compare" blocks.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
* @package
|
||||
* @readonly
|
||||
*/
|
||||
@@ -608,7 +610,7 @@ Blockly.Constants.Logic.LOGIC_TERNARY_ONCHANGE_MIXIN = {
|
||||
* Called whenever anything on the workspace changes.
|
||||
* Prevent mismatched types.
|
||||
* @param {!Blockly.Events.Abstract} e Change event.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
onchange: function(e) {
|
||||
var blockA = this.getInputTargetBlock('THEN');
|
||||
|
||||
@@ -255,7 +255,7 @@ Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN = {
|
||||
* Add context menu option to create getter block for the loop's variable.
|
||||
* (customContextMenu support limited to web BlockSvg.)
|
||||
* @param {!Array} options List of menu options to add to.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
customContextMenu: function(options) {
|
||||
if (this.isInFlyout) {
|
||||
@@ -337,7 +337,7 @@ Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN = {
|
||||
* Called whenever anything on the workspace changes.
|
||||
* Add warning if this flow block is not nested inside a loop.
|
||||
* @param {!Blockly.Events.Abstract} _e Change event.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
onchange: function(_e) {
|
||||
if (!this.workspace.isDragging || this.workspace.isDragging()) {
|
||||
|
||||
@@ -457,7 +457,7 @@ Blockly.Constants.Math.IS_DIVISIBLEBY_MUTATOR_MIXIN = {
|
||||
/**
|
||||
* Create XML to represent whether the 'divisorInput' should be present.
|
||||
* @return {Element} XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
mutationToDom: function() {
|
||||
var container = Blockly.utils.xml.createElement('mutation');
|
||||
@@ -468,7 +468,7 @@ Blockly.Constants.Math.IS_DIVISIBLEBY_MUTATOR_MIXIN = {
|
||||
/**
|
||||
* Parse XML to restore the 'divisorInput'.
|
||||
* @param {!Element} xmlElement XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
domToMutation: function(xmlElement) {
|
||||
var divisorInput = (xmlElement.getAttribute('divisor_input') == 'true');
|
||||
@@ -478,7 +478,7 @@ Blockly.Constants.Math.IS_DIVISIBLEBY_MUTATOR_MIXIN = {
|
||||
* Modify this block to have (or not have) an input for 'is divisible by'.
|
||||
* @param {boolean} divisorInput True if this block has a divisor input.
|
||||
* @private
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
updateShape_: function(divisorInput) {
|
||||
// Add or remove a Value Input.
|
||||
@@ -498,7 +498,7 @@ Blockly.Constants.Math.IS_DIVISIBLEBY_MUTATOR_MIXIN = {
|
||||
* 'math_is_divisibleby_mutator' extension to the 'math_property' block that
|
||||
* can update the block shape (add/remove divisor input) based on whether
|
||||
* property is "divisble by".
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
* @package
|
||||
*/
|
||||
Blockly.Constants.Math.IS_DIVISIBLE_MUTATOR_EXTENSION = function() {
|
||||
@@ -530,7 +530,7 @@ Blockly.Constants.Math.LIST_MODES_MUTATOR_MIXIN = {
|
||||
* Modify this block to have the correct output type.
|
||||
* @param {string} newOp Either 'MODE' or some op than returns a number.
|
||||
* @private
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
updateType_: function(newOp) {
|
||||
if (newOp == 'MODE') {
|
||||
@@ -542,7 +542,7 @@ Blockly.Constants.Math.LIST_MODES_MUTATOR_MIXIN = {
|
||||
/**
|
||||
* Create XML to represent the output type.
|
||||
* @return {Element} XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
mutationToDom: function() {
|
||||
var container = Blockly.utils.xml.createElement('mutation');
|
||||
@@ -552,7 +552,7 @@ Blockly.Constants.Math.LIST_MODES_MUTATOR_MIXIN = {
|
||||
/**
|
||||
* Parse XML to restore the output type.
|
||||
* @param {!Element} xmlElement XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
domToMutation: function(xmlElement) {
|
||||
this.updateType_(xmlElement.getAttribute('op'));
|
||||
@@ -562,7 +562,7 @@ Blockly.Constants.Math.LIST_MODES_MUTATOR_MIXIN = {
|
||||
/**
|
||||
* Extension to 'math_on_list' blocks that allows support of
|
||||
* modes operation (outputs a list of numbers).
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
* @package
|
||||
*/
|
||||
Blockly.Constants.Math.LIST_MODES_MUTATOR_EXTENSION = function() {
|
||||
|
||||
@@ -33,7 +33,7 @@ goog.require('Blockly');
|
||||
Blockly.Blocks['procedures_defnoreturn'] = {
|
||||
/**
|
||||
* Block for defining a procedure with no return value.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
var nameField = new Blockly.FieldTextInput('',
|
||||
@@ -61,7 +61,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
|
||||
/**
|
||||
* Add or remove the statement block from this function definition.
|
||||
* @param {boolean} hasStatements True if a statement block is needed.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
setStatements_: function(hasStatements) {
|
||||
if (this.hasStatements_ === hasStatements) {
|
||||
@@ -81,7 +81,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
|
||||
/**
|
||||
* Update the display of parameters for this procedure definition block.
|
||||
* @private
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
updateParams_: function() {
|
||||
|
||||
@@ -105,7 +105,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
|
||||
* @param {boolean=} opt_paramIds If true include the IDs of the parameter
|
||||
* quarks. Used by Blockly.Procedures.mutateCallers for reconnection.
|
||||
* @return {!Element} XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
mutationToDom: function(opt_paramIds) {
|
||||
var container = Blockly.utils.xml.createElement('mutation');
|
||||
@@ -132,7 +132,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
|
||||
/**
|
||||
* Parse XML to restore the argument inputs.
|
||||
* @param {!Element} xmlElement XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
domToMutation: function(xmlElement) {
|
||||
this.arguments_ = [];
|
||||
@@ -161,7 +161,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
|
||||
* Populate the mutator's dialog with this block's components.
|
||||
* @param {!Blockly.Workspace} workspace Mutator's workspace.
|
||||
* @return {!Blockly.Block} Root block in mutator.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
decompose: function(workspace) {
|
||||
/*
|
||||
@@ -213,7 +213,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
|
||||
/**
|
||||
* Reconfigure this block based on the mutator dialog's components.
|
||||
* @param {!Blockly.Block} containerBlock Root block in mutator.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
compose: function(containerBlock) {
|
||||
// Parameter list.
|
||||
@@ -264,7 +264,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
|
||||
* - the name of the defined procedure,
|
||||
* - a list of all its arguments,
|
||||
* - that it DOES NOT have a return value.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
getProcedureDef: function() {
|
||||
return [this.getFieldValue('NAME'), this.arguments_, false];
|
||||
@@ -272,7 +272,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
|
||||
/**
|
||||
* Return all variables referenced by this block.
|
||||
* @return {!Array.<string>} List of variable names.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
getVars: function() {
|
||||
return this.arguments_;
|
||||
@@ -280,7 +280,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
|
||||
/**
|
||||
* Return all variables referenced by this block.
|
||||
* @return {!Array.<!Blockly.VariableModel>} List of variable models.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
getVarModels: function() {
|
||||
return this.argumentVarModels_;
|
||||
@@ -293,7 +293,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
|
||||
* with an updated name. Guaranteed to be the same type as the old
|
||||
* variable.
|
||||
* @override
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
renameVarById: function(oldId, newId) {
|
||||
var oldVariable = this.workspace.getVariableById(oldId);
|
||||
@@ -323,7 +323,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
|
||||
* @param {!Blockly.VariableModel} variable The variable being renamed.
|
||||
* @package
|
||||
* @override
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
updateVarName: function(variable) {
|
||||
var newName = variable.name;
|
||||
@@ -345,6 +345,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
|
||||
* @param {string} oldName The old display name of the argument.
|
||||
* @param {string} newName The new display name of the argument.
|
||||
* @private
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
displayRenamedVar_: function(oldName, newName) {
|
||||
this.updateParams_();
|
||||
@@ -362,7 +363,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
|
||||
/**
|
||||
* Add custom menu options to this block's context menu.
|
||||
* @param {!Array} options List of menu options to add to.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
customContextMenu: function(options) {
|
||||
if (this.isInFlyout) {
|
||||
@@ -409,7 +410,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
|
||||
Blockly.Blocks['procedures_defreturn'] = {
|
||||
/**
|
||||
* Block for defining a procedure with a return value.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
var nameField = new Blockly.FieldTextInput('',
|
||||
@@ -449,7 +450,7 @@ Blockly.Blocks['procedures_defreturn'] = {
|
||||
* - the name of the defined procedure,
|
||||
* - a list of all its arguments,
|
||||
* - that it DOES have a return value.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
getProcedureDef: function() {
|
||||
return [this.getFieldValue('NAME'), this.arguments_, true];
|
||||
@@ -466,7 +467,7 @@ Blockly.Blocks['procedures_defreturn'] = {
|
||||
Blockly.Blocks['procedures_mutatorcontainer'] = {
|
||||
/**
|
||||
* Mutator block for procedure container.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
this.appendDummyInput()
|
||||
@@ -483,7 +484,7 @@ Blockly.Blocks['procedures_mutatorcontainer'] = {
|
||||
* This will create & delete variables and in dialogs workspace to ensure
|
||||
* that when a new block is dragged out it will have a unique parameter name.
|
||||
* @param {!Blockly.Events.Abstract} event Change event.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
onchange: function(event) {
|
||||
if (!this.workspace || this.workspace.isFlyout ||
|
||||
@@ -546,7 +547,7 @@ Blockly.Blocks['procedures_mutatorcontainer'] = {
|
||||
Blockly.Blocks['procedures_mutatorarg'] = {
|
||||
/**
|
||||
* Mutator block for procedure argument.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
var field = new Blockly.FieldTextInput('x', this.validator_);
|
||||
@@ -644,7 +645,7 @@ Blockly.Blocks['procedures_mutatorarg'] = {
|
||||
Blockly.Blocks['procedures_callnoreturn'] = {
|
||||
/**
|
||||
* Block for calling a procedure with no return value.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
this.appendDummyInput('TOPROW')
|
||||
@@ -664,7 +665,7 @@ Blockly.Blocks['procedures_callnoreturn'] = {
|
||||
/**
|
||||
* Returns the name of the procedure this block calls.
|
||||
* @return {string} Procedure name.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
getProcedureCall: function() {
|
||||
// The NAME field is guaranteed to exist, null will never be returned.
|
||||
@@ -675,7 +676,7 @@ Blockly.Blocks['procedures_callnoreturn'] = {
|
||||
* If the name matches this block's procedure, rename it.
|
||||
* @param {string} oldName Previous name of procedure.
|
||||
* @param {string} newName Renamed procedure.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
renameProcedure: function(oldName, newName) {
|
||||
if (Blockly.Names.equals(oldName, this.getProcedureCall())) {
|
||||
@@ -693,7 +694,7 @@ Blockly.Blocks['procedures_callnoreturn'] = {
|
||||
* parameter through the life of a mutator, regardless of param renaming),
|
||||
* e.g. ['piua', 'f8b_', 'oi.o'].
|
||||
* @private
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
setProcedureParameters_: function(paramNames, paramIds) {
|
||||
// Data structures:
|
||||
@@ -784,7 +785,7 @@ Blockly.Blocks['procedures_callnoreturn'] = {
|
||||
/**
|
||||
* Modify this block to have the correct number of arguments.
|
||||
* @private
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
updateShape_: function() {
|
||||
for (var i = 0; i < this.arguments_.length; i++) {
|
||||
@@ -831,7 +832,7 @@ Blockly.Blocks['procedures_callnoreturn'] = {
|
||||
/**
|
||||
* Create XML to represent the (non-editable) name and arguments.
|
||||
* @return {!Element} XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
mutationToDom: function() {
|
||||
var container = Blockly.utils.xml.createElement('mutation');
|
||||
@@ -846,7 +847,7 @@ Blockly.Blocks['procedures_callnoreturn'] = {
|
||||
/**
|
||||
* Parse XML to restore the (non-editable) name and parameters.
|
||||
* @param {!Element} xmlElement XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
domToMutation: function(xmlElement) {
|
||||
var name = xmlElement.getAttribute('name');
|
||||
@@ -864,7 +865,7 @@ Blockly.Blocks['procedures_callnoreturn'] = {
|
||||
/**
|
||||
* Return all variables referenced by this block.
|
||||
* @return {!Array.<!Blockly.VariableModel>} List of variable models.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
getVarModels: function() {
|
||||
return this.argumentVarModels_;
|
||||
@@ -873,7 +874,7 @@ Blockly.Blocks['procedures_callnoreturn'] = {
|
||||
* Procedure calls cannot exist without the corresponding procedure
|
||||
* definition. Enforce this link whenever an event is fired.
|
||||
* @param {!Blockly.Events.Abstract} event Change event.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
onchange: function(event) {
|
||||
if (!this.workspace || this.workspace.isFlyout) {
|
||||
@@ -965,7 +966,7 @@ Blockly.Blocks['procedures_callnoreturn'] = {
|
||||
/**
|
||||
* Add menu option to find the definition block for this call.
|
||||
* @param {!Array} options List of menu options to add to.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
customContextMenu: function(options) {
|
||||
if (!this.workspace.isMovable()) {
|
||||
@@ -993,7 +994,7 @@ Blockly.Blocks['procedures_callnoreturn'] = {
|
||||
Blockly.Blocks['procedures_callreturn'] = {
|
||||
/**
|
||||
* Block for calling a procedure with a return value.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
this.appendDummyInput('TOPROW')
|
||||
@@ -1025,7 +1026,7 @@ Blockly.Blocks['procedures_callreturn'] = {
|
||||
Blockly.Blocks['procedures_ifreturn'] = {
|
||||
/**
|
||||
* Block for conditionally returning a value from a procedure.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
this.appendValueInput('CONDITION')
|
||||
@@ -1044,7 +1045,7 @@ Blockly.Blocks['procedures_ifreturn'] = {
|
||||
/**
|
||||
* Create XML to represent whether this block has a return value.
|
||||
* @return {!Element} XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
mutationToDom: function() {
|
||||
var container = Blockly.utils.xml.createElement('mutation');
|
||||
@@ -1054,7 +1055,7 @@ Blockly.Blocks['procedures_ifreturn'] = {
|
||||
/**
|
||||
* Parse XML to restore whether this block has a return value.
|
||||
* @param {!Element} xmlElement XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
domToMutation: function(xmlElement) {
|
||||
var value = xmlElement.getAttribute('value');
|
||||
@@ -1069,7 +1070,7 @@ Blockly.Blocks['procedures_ifreturn'] = {
|
||||
* Called whenever anything on the workspace changes.
|
||||
* Add warning if this flow block is not nested inside a loop.
|
||||
* @param {!Blockly.Events.Abstract} _e Change event.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
onchange: function(_e) {
|
||||
if (!this.workspace.isDragging || this.workspace.isDragging()) {
|
||||
|
||||
@@ -207,7 +207,7 @@ Blockly.defineBlocksWithJsonArray([ // BEGIN JSON EXTRACT
|
||||
Blockly.Blocks['text_getSubstring'] = {
|
||||
/**
|
||||
* Block for getting substring.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
this['WHERE_OPTIONS_1'] = [
|
||||
@@ -240,7 +240,7 @@ Blockly.Blocks['text_getSubstring'] = {
|
||||
/**
|
||||
* Create XML to represent whether there are 'AT' inputs.
|
||||
* @return {!Element} XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
mutationToDom: function() {
|
||||
var container = Blockly.utils.xml.createElement('mutation');
|
||||
@@ -253,7 +253,7 @@ Blockly.Blocks['text_getSubstring'] = {
|
||||
/**
|
||||
* Parse XML to restore the 'AT' inputs.
|
||||
* @param {!Element} xmlElement XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
domToMutation: function(xmlElement) {
|
||||
var isAt1 = (xmlElement.getAttribute('at1') == 'true');
|
||||
@@ -267,7 +267,7 @@ Blockly.Blocks['text_getSubstring'] = {
|
||||
* @param {number} n Specify first or second input (1 or 2).
|
||||
* @param {boolean} isAt True if the input should exist.
|
||||
* @private
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
updateAt_: function(n, isAt) {
|
||||
// Create or delete an input for the numeric index.
|
||||
@@ -320,7 +320,7 @@ Blockly.Blocks['text_getSubstring'] = {
|
||||
Blockly.Blocks['text_changeCase'] = {
|
||||
/**
|
||||
* Block for changing capitalization.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
var OPERATORS = [
|
||||
@@ -341,7 +341,7 @@ Blockly.Blocks['text_changeCase'] = {
|
||||
Blockly.Blocks['text_trim'] = {
|
||||
/**
|
||||
* Block for trimming spaces.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
var OPERATORS = [
|
||||
@@ -362,7 +362,7 @@ Blockly.Blocks['text_trim'] = {
|
||||
Blockly.Blocks['text_print'] = {
|
||||
/**
|
||||
* Block for print statement.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
@@ -385,7 +385,7 @@ Blockly.Blocks['text_print'] = {
|
||||
Blockly.Blocks['text_prompt_ext'] = {
|
||||
/**
|
||||
* Block for prompt function (external message).
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
var TYPES = [
|
||||
@@ -412,7 +412,7 @@ Blockly.Blocks['text_prompt_ext'] = {
|
||||
* Modify this block to have the correct output type.
|
||||
* @param {string} newOp Either 'TEXT' or 'NUMBER'.
|
||||
* @private
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
updateType_: function(newOp) {
|
||||
this.outputConnection.setCheck(newOp == 'NUMBER' ? 'Number' : 'String');
|
||||
@@ -420,7 +420,7 @@ Blockly.Blocks['text_prompt_ext'] = {
|
||||
/**
|
||||
* Create XML to represent the output type.
|
||||
* @return {!Element} XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
mutationToDom: function() {
|
||||
var container = Blockly.utils.xml.createElement('mutation');
|
||||
@@ -430,7 +430,7 @@ Blockly.Blocks['text_prompt_ext'] = {
|
||||
/**
|
||||
* Parse XML to restore the output type.
|
||||
* @param {!Element} xmlElement XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
domToMutation: function(xmlElement) {
|
||||
this.updateType_(xmlElement.getAttribute('type'));
|
||||
@@ -441,7 +441,7 @@ Blockly.Blocks['text_prompt'] = {
|
||||
/**
|
||||
* Block for prompt function (internal message).
|
||||
* The 'text_prompt_ext' block is preferred as it is more flexible.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
this.mixin(Blockly.Constants.Text.QUOTE_IMAGE_MIXIN);
|
||||
@@ -477,7 +477,7 @@ Blockly.Blocks['text_prompt'] = {
|
||||
Blockly.Blocks['text_count'] = {
|
||||
/**
|
||||
* Block for counting how many times one string appears within another string.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
@@ -506,7 +506,7 @@ Blockly.Blocks['text_count'] = {
|
||||
Blockly.Blocks['text_replace'] = {
|
||||
/**
|
||||
* Block for replacing one string with another in the text.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
@@ -540,7 +540,7 @@ Blockly.Blocks['text_replace'] = {
|
||||
Blockly.Blocks['text_reverse'] = {
|
||||
/**
|
||||
* Block for reversing a string.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
@@ -602,7 +602,7 @@ Blockly.Constants.Text.QUOTE_IMAGE_MIXIN = {
|
||||
/**
|
||||
* Inserts appropriate quote images before and after the named field.
|
||||
* @param {string} fieldName The name of the field to wrap with quotes.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
quoteField_: function(fieldName) {
|
||||
for (var i = 0, input; input = this.inputList[i]; i++) {
|
||||
@@ -623,7 +623,7 @@ Blockly.Constants.Text.QUOTE_IMAGE_MIXIN = {
|
||||
* @param {boolean} open If the image should be open quote (“ in LTR).
|
||||
* Otherwise, a closing quote is used (” in LTR).
|
||||
* @return {!Blockly.FieldImage} The new field.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
newQuote_: function(open) {
|
||||
var isLeft = this.RTL ? !open : open;
|
||||
@@ -640,7 +640,7 @@ Blockly.Constants.Text.QUOTE_IMAGE_MIXIN = {
|
||||
|
||||
/**
|
||||
* Wraps TEXT field with images of double quote characters.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
Blockly.Constants.Text.TEXT_QUOTES_EXTENSION = function() {
|
||||
this.mixin(Blockly.Constants.Text.QUOTE_IMAGE_MIXIN);
|
||||
@@ -657,7 +657,7 @@ Blockly.Constants.Text.TEXT_JOIN_MUTATOR_MIXIN = {
|
||||
/**
|
||||
* Create XML to represent number of text inputs.
|
||||
* @return {!Element} XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
mutationToDom: function() {
|
||||
var container = Blockly.utils.xml.createElement('mutation');
|
||||
@@ -667,7 +667,7 @@ Blockly.Constants.Text.TEXT_JOIN_MUTATOR_MIXIN = {
|
||||
/**
|
||||
* Parse XML to restore the text inputs.
|
||||
* @param {!Element} xmlElement XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
domToMutation: function(xmlElement) {
|
||||
this.itemCount_ = parseInt(xmlElement.getAttribute('items'), 10);
|
||||
@@ -677,7 +677,7 @@ Blockly.Constants.Text.TEXT_JOIN_MUTATOR_MIXIN = {
|
||||
* Populate the mutator's dialog with this block's components.
|
||||
* @param {!Blockly.Workspace} workspace Mutator's workspace.
|
||||
* @return {!Blockly.Block} Root block in mutator.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
decompose: function(workspace) {
|
||||
var containerBlock = workspace.newBlock('text_create_join_container');
|
||||
@@ -694,7 +694,7 @@ Blockly.Constants.Text.TEXT_JOIN_MUTATOR_MIXIN = {
|
||||
/**
|
||||
* Reconfigure this block based on the mutator dialog's components.
|
||||
* @param {!Blockly.Block} containerBlock Root block in mutator.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
compose: function(containerBlock) {
|
||||
var itemBlock = containerBlock.getInputTargetBlock('STACK');
|
||||
@@ -722,7 +722,7 @@ Blockly.Constants.Text.TEXT_JOIN_MUTATOR_MIXIN = {
|
||||
/**
|
||||
* Store pointers to any connected child blocks.
|
||||
* @param {!Blockly.Block} containerBlock Root block in mutator.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
saveConnections: function(containerBlock) {
|
||||
var itemBlock = containerBlock.getInputTargetBlock('STACK');
|
||||
@@ -738,7 +738,7 @@ Blockly.Constants.Text.TEXT_JOIN_MUTATOR_MIXIN = {
|
||||
/**
|
||||
* Modify this block to have the correct number of inputs.
|
||||
* @private
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
updateShape_: function() {
|
||||
if (this.itemCount_ && this.getInput('EMPTY')) {
|
||||
@@ -767,7 +767,7 @@ Blockly.Constants.Text.TEXT_JOIN_MUTATOR_MIXIN = {
|
||||
|
||||
/**
|
||||
* Performs final setup of a text_join block.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
Blockly.Constants.Text.TEXT_JOIN_EXTENSION = function() {
|
||||
// Add the quote mixin for the itemCount_ = 0 case.
|
||||
@@ -786,7 +786,7 @@ Blockly.Extensions.register('text_append_tooltip',
|
||||
|
||||
/**
|
||||
* Update the tooltip of 'text_append' block to reference the variable.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
Blockly.Constants.Text.TEXT_INDEXOF_TOOLTIP_EXTENSION = function() {
|
||||
// Assign 'this' to a variable for use in the tooltip closure below.
|
||||
@@ -807,7 +807,7 @@ Blockly.Constants.Text.TEXT_CHARAT_MUTATOR_MIXIN = {
|
||||
/**
|
||||
* Create XML to represent whether there is an 'AT' input.
|
||||
* @return {!Element} XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
mutationToDom: function() {
|
||||
var container = Blockly.utils.xml.createElement('mutation');
|
||||
@@ -817,7 +817,7 @@ Blockly.Constants.Text.TEXT_CHARAT_MUTATOR_MIXIN = {
|
||||
/**
|
||||
* Parse XML to restore the 'AT' input.
|
||||
* @param {!Element} xmlElement XML storage element.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
domToMutation: function(xmlElement) {
|
||||
// Note: Until January 2013 this block did not have mutations,
|
||||
@@ -829,7 +829,7 @@ Blockly.Constants.Text.TEXT_CHARAT_MUTATOR_MIXIN = {
|
||||
* Create or delete an input for the numeric index.
|
||||
* @param {boolean} isAt True if the input should exist.
|
||||
* @private
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
updateAt_: function(isAt) {
|
||||
// Destroy old 'AT' and 'ORDINAL' inputs.
|
||||
@@ -855,7 +855,7 @@ Blockly.Constants.Text.TEXT_CHARAT_MUTATOR_MIXIN = {
|
||||
|
||||
/**
|
||||
* Does the initial mutator update of text_charAt and adds the tooltip
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
Blockly.Constants.Text.TEXT_CHARAT_EXTENSION = function() {
|
||||
var dropdown = this.getField('WHERE');
|
||||
|
||||
@@ -97,7 +97,7 @@ Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN = {
|
||||
/**
|
||||
* Add menu option to create getter/setter block for this setter/getter.
|
||||
* @param {!Array} options List of menu options to add to.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
customContextMenu: function(options) {
|
||||
if (!this.isInFlyout) {
|
||||
|
||||
@@ -93,7 +93,7 @@ Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MI
|
||||
/**
|
||||
* Add menu option to create getter/setter block for this setter/getter.
|
||||
* @param {!Array} options List of menu options to add to.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
customContextMenu: function(options) {
|
||||
// Getter blocks have the option to create a setter block, and vice versa.
|
||||
@@ -146,7 +146,7 @@ Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MI
|
||||
* Called whenever anything on the workspace changes.
|
||||
* Set the connection type for this block.
|
||||
* @param {!Blockly.Events.Abstract} _e Change event.
|
||||
* @this Blockly.Block
|
||||
* @this {Blockly.Block}
|
||||
*/
|
||||
onchange: function(_e) {
|
||||
var id = this.getFieldValue('VAR');
|
||||
|
||||
Reference in New Issue
Block a user