Block to change size
@this Blockly.Block
15434
function() {
    this.jsonInit({
      "message0": Blockly.Msg.LOOKS_CHANGESIZEBY,
      "args0": [
        {
          "type": "field_dropdown",
          "name": "TYPE",
          "options": [
            [Blockly.Msg.LOOKS_SETSIZETO_SIZE, 'size'],
            [Blockly.Msg.LOOKS_SETSIZETO_STRETCH_X, 'stretch x'],
            [Blockly.Msg.LOOKS_SETSIZETO_STRETCH_Y, 'stretch y']
          ]
        },
        {
          "type": "input_value",
          "name": "CHANGE"
        }
      ],
      "category": Blockly.Categories.looks,
      "extensions": ["colours_looks", "shape_statement"]
    });
  }
336268
public void grow() {
		if( tailBlockSize >= blockLength ) {
			tailBlockSize = 0;
			blocks.grow();
		}

		BlockIndexLength s = sets.grow();
		s.block = blocks.size-1;
		s.start = tailBlockSize;
		s.length = 0;

		tail = s;
	}
1067986
function() {
    this.setColour(120);
    this.appendDummyInput()
        .appendField('name')
        .appendField(new Blockly.FieldTextInput('math_foo'), 'NAME');
    this.appendStatementInput('INPUTS')
        .setCheck('Input')
        .appendField('inputs');
    var dropdown = new Blockly.FieldDropdown([
        ['automatic inputs', 'AUTO'],
        ['external inputs', 'EXT'],
        ['inline inputs', 'INT']]);
    this.appendDummyInput()
        .appendField(dropdown, 'INLINE');
    dropdown = new Blockly.FieldDropdown([
        ['no connections', 'NONE'],
        ['← left output', 'LEFT'],
        ['↕ top+bottom connections', 'BOTH'],
        ['↑ top connection', 'TOP'],
        ['↓ bottom connection', 'BOTTOM']],
        function(option) {
          this.sourceBlock_.updateShape_(option);
        });
    this.appendDummyInput()
        .appendField(dropdown, 'CONNECTIONS');
    this.appendValueInput('COLOUR')
        .setCheck('Colour')
        .appendField('colour');
    this.setTooltip('Build a custom block by plugging\n' +
        'fields, inputs and other blocks here.');
    this.setHelpUrl(
        'https://developers.google.com/blockly/custom-blocks/block-factory');
  }
141290
function( oldChild, newChild ) {
		var size = oldChild.config[ this._dimension ];
		lm.items.AbstractContentItem.prototype.replaceChild.call( this, oldChild, newChild );
		newChild.config[ this._dimension ] = size;
		this.callDownwards( 'setSize' );
		this.emitBubblingEvent( 'stateChanged' );
	}
241851
function triggerResize() {
  try {
    window.dispatchEvent(new Event("resize"));
  } catch (e) {
    var evt = window.document.createEvent("UIEvents");
    evt.initUIEvent("resize", true, false, window, 0);
    window.dispatchEvent(evt);
  }
}
1292722
function (width, height) {
            this._updateFrameWidth(width);
            this._frame.resize(this._frameWidth, height);
            this.innerWidth = this._frame.innerWidth;
            this.innerHeight = this._frame.innerHeight;
        }
1004822
function() {
    this.setHelpUrl(Blockly.Msg.MATH_NUMBER_HELPURL);
    this.setColour(Blockly.Blocks.math.HUE);
    this.appendDummyInput()
        .appendField(new Blockly.FieldTextInput('0',
        Blockly.FieldTextInput.numberValidator), 'NUM');
    this.setOutput(true, 'Number');
    // Assign 'this' to a variable for use in the tooltip closure below.
    var thisBlock = this;
    // Number block is trivial.  Use tooltip of parent block if it exists.
    this.setTooltip(function() {
      var parent = thisBlock.getParent();
      return (parent && parent.tooltip) || Blockly.Msg.MATH_NUMBER_TOOLTIP;
    });
  }
1004251
function() {
    if (this.itemCount_ && this.getInput('EMPTY')) {
      this.removeInput('EMPTY');
    } else if (!this.itemCount_ && !this.getInput('EMPTY')) {
      this.appendDummyInput('EMPTY')
          .appendField(Blockly.Msg.LISTS_CREATE_EMPTY_TITLE);
    }
    // Add new inputs.
    for (var i = 0; i < this.itemCount_; i++) {
      if (!this.getInput('ADD' + i)) {
        var input = this.appendValueInput('ADD' + i);
        if (i == 0) {
          input.appendField(Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH);
        }
      }
    }
    // Remove deleted inputs.
    while (this.getInput('ADD' + i)) {
      this.removeInput('ADD' + i);
      i++;
    }
  }
400177
function widthChangeFormFun() {
    this.createFromDivs();
    $('#' + this.options.id + '_grid').css('display', 'none');
    $('#' + this.options.id + '_form').css('display', 'block');
    this.showType = 'form';
    if (typeof this.options.afterCreate == 'function') {
        this.options.afterCreate.call(this);
    }
}
902573
function() {
    // Assign 'this' to a variable for use in the closures below.
    var thisBlock = this;
    var dropdown = new Blockly.FieldDropdown(
        [[Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT, 'SPLIT'],
         [Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST, 'JOIN']],
        function(newMode) {
          thisBlock.updateType_(newMode);
        });
    this.setHelpUrl(Blockly.Msg.LISTS_SPLIT_HELPURL);
    this.setColour(Blockly.Blocks.lists.HUE);
    this.appendValueInput('INPUT')
        .setCheck('String')
        .appendField(dropdown, 'MODE');
    this.appendValueInput('DELIM')
        .setCheck('String')
        .appendField(Blockly.Msg.LISTS_SPLIT_WITH_DELIMITER);
    this.setInputsInline(true);
    this.setOutput(true, 'Array');
    this.setTooltip(function() {
      var mode = thisBlock.getFieldValue('MODE');
      if (mode == 'SPLIT') {
        return Blockly.Msg.LISTS_SPLIT_TOOLTIP_SPLIT;
      } else if (mode == 'JOIN') {
        return Blockly.Msg.LISTS_SPLIT_TOOLTIP_JOIN;
      }
      throw 'Unknown mode: ' + mode;
    });
  }
1281618
function() {
    this.jsonInit({
      "message0": "%1",
      "args0": [
        {
          "type": "field_variable",
          "name": "CLONE_NAME_OPTION",
          "variableTypes": [Blockly.CLONE_NAME_VARIABLE_TYPE],
          "variable": Blockly.Msg.DEFAULT_CLONE_NAME
        }
      ],
      "colour": Blockly.Colours.control.secondary,
      "colourSecondary": Blockly.Colours.control.secondary,
      "colourTertiary": Blockly.Colours.control.tertiary,
      "extensions": ["output_string"]
    });
  }
1331496
private void setLastBlockSize(INodeFileUnderConstruction pendingFile) {
    Block block = pendingFile.getLastBlock();
    if (block != null) {
      block.setNumBytes(pendingFile.getPreferredBlockSize());
    }
  }
801970
private void updateSize()
	{
		int length = frames.getLength();

		if (head.getExtendedHeader())
		{
			length += ext_head.getSize();
		}

		head.setTagSize(length);

		if (head.getFooter())
		{
			foot.setTagSize(length);
		}
	}
411793
function(){
    this.width = this.container.width();
    this.height = this.container.height();
    this.resize();
    this.canvas.setSize(this.width, this.height);
    this.applyTransform();
  }
1198404
function wrapChildrenInDefaultBlock(
    opts: Options,
    change: Change,
    node: Node
): Change {
    change.wrapBlockByKey(node.nodes.first().key, opts.typeDefault, {
        normalize: false
    });

    const wrapper = change.value.document.getDescendant(node.key).nodes.first();

    // Add in the remaining items
    node.nodes.rest().forEach((child, index) =>
        change.moveNodeByKey(child.key, wrapper.key, index + 1, {
            normalize: false
        })
    );

    return change;
}
1373727
private void updateSize(IoBuffer data) {
        this.widthInfo = data.getShort();
        this.heightInfo = data.getShort();
        // extract width and height of the frame
        this.width = this.widthInfo & 0xfff;
        this.height = this.heightInfo & 0xfff;
        // calculate size of blocks
        this.blockWidth = this.widthInfo & 0xf000;
        this.blockWidth = (this.blockWidth >> 12) + 1;
        this.blockWidth <<= 4;

        this.blockHeight = this.heightInfo & 0xf000;
        this.blockHeight = (this.blockHeight >> 12) + 1;
        this.blockHeight <<= 4;

        int xblocks = this.width / this.blockWidth;
        if ((this.width % this.blockWidth) != 0) {
            // partial block
            xblocks += 1;
        }

        int yblocks = this.height / this.blockHeight;
        if ((this.height % this.blockHeight) != 0) {
            // partial block
            yblocks += 1;
        }

        this.blockCount = xblocks * yblocks;

        int blockSize = maxCompressedSize(this.blockWidth * this.blockHeight * 3);
        int totalBlockSize = blockSize * this.blockCount;
        if (this.totalBlockDataSize != totalBlockSize) {
            log.info("Allocating memory for {} compressed blocks.", this.blockCount);
            this.blockDataSize = blockSize;
            this.totalBlockDataSize = totalBlockSize;
            this.blockData = new byte[blockSize * this.blockCount];
            this.blockSize = new int[blockSize * this.blockCount];
            // Reset the sizes to zero
            for (int idx = 0; idx < this.blockCount; idx++) {
                this.blockSize[idx] = 0;
            }
        }
    }
259666
protected void updateCoreLength() {
		if (getBlockSets().size() == 0) {
			throw new IndexOutOfBoundsException(
					"Empty MultipleAlignment: blockSets size == 0.");
		} // Otherwise try to calculate it from the BlockSet information
		else {
			coreLength = 0;
			for (BlockSet blockSet : blockSets)
				coreLength += blockSet.getCoreLength();
		}
	}