mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
Use Blockly.blocks.* for blocks modules, leaving the Blockly.Blocks name for the block dictionary object. This resolves a problem with advanced compilation of Blockly Games, where, in the compressed output, (the minified name of) Blockly.Blocks gets overwritten, with the dictionary object defined in core/blocks.js being replaced by an empty namespace object created by the provides of Blockly.Blocks.* in blocks/*.js. Without this fix, some block definitions end up being created in the dictionary and some on the namespace object—with chaos predictably ensuing.
31 lines
897 B
JavaScript
31 lines
897 B
JavaScript
/**
|
|
* @license
|
|
* Copyright 2019 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
goog.provide('Main');
|
|
// Core
|
|
// Either require 'Blockly.requires', or just the components you use:
|
|
goog.require('Blockly');
|
|
goog.require('Blockly.geras.Renderer');
|
|
goog.require('Blockly.VerticalFlyout');
|
|
// Blocks
|
|
goog.require('Blockly.Constants.Logic');
|
|
goog.require('Blockly.Constants.Loops');
|
|
goog.require('Blockly.Constants.Math');
|
|
goog.require('Blockly.Constants.TestBlocks');
|
|
goog.require('Blockly.Constants.Text');
|
|
goog.require('Blockly.Constants.Lists');
|
|
goog.require('Blockly.Constants.Colour');
|
|
goog.require('Blockly.Constants.Variables');
|
|
goog.require('Blockly.Constants.VariablesDynamic');
|
|
goog.require('Blockly.blocks.procedures');
|
|
|
|
Main.init = function() {
|
|
Blockly.inject('blocklyDiv', {
|
|
'toolbox': document.getElementById('toolbox')
|
|
});
|
|
};
|
|
window.addEventListener('load', Main.init);
|