diff --git a/core/options.js b/core/options.js index 489a0dfb3..4262125ac 100644 --- a/core/options.js +++ b/core/options.js @@ -363,3 +363,19 @@ Blockly.Options.parseThemeOptions_ = function(options) { return Blockly.Theme.defineTheme(theme.name || ('builtin' + Blockly.utils.IdGenerator.getNextUniqueId()), theme); }; + +/** + * Parse the provided toolbox tree into a consistent DOM format. + * @param {?Node|?string} toolboxDef DOM tree of blocks, or text representation + * of same. + * @return {?Node} DOM tree of blocks, or null. + * @deprecated Use Blockly.utils.toolbox.parseToolboxTree. (2020 September 28) + */ +Blockly.Options.parseToolboxTree = function(toolboxDef) { + Blockly.utils.deprecation.warn( + 'Blockly.Options.parseToolboxTree', + 'September 2020', + 'September 2021', + 'Blockly.utils.toolbox.parseToolboxTree'); + return Blockly.utils.toolbox.parseToolboxTree(toolboxDef); +}; diff --git a/core/toolbox/toolbox_item.js b/core/toolbox/toolbox_item.js index 550b47aea..31ef3b611 100644 --- a/core/toolbox/toolbox_item.js +++ b/core/toolbox/toolbox_item.js @@ -34,7 +34,7 @@ Blockly.ToolboxItem = function(toolboxItemDef, toolbox, opt_parent) { * @type {string} * @protected */ - this.id_ = toolboxItemDef['id'] || Blockly.utils.IdGenerator.getNextUniqueId(); + this.id_ = toolboxItemDef['toolboxitemid'] || Blockly.utils.IdGenerator.getNextUniqueId(); /** * The parent of the category. diff --git a/demos/blockfactory/workspacefactory/wfactory_controller.js b/demos/blockfactory/workspacefactory/wfactory_controller.js index cfecbbbc4..6d243ca15 100644 --- a/demos/blockfactory/workspacefactory/wfactory_controller.js +++ b/demos/blockfactory/workspacefactory/wfactory_controller.js @@ -398,7 +398,7 @@ WorkspaceFactoryController.prototype.updatePreview = function() { // Only update the toolbox if not in read only mode. if (!this.model.options['readOnly']) { // Get toolbox XML. - var tree = Blockly.Options.parseToolboxTree( + var tree = Blockly.utils.toolbox.parseToolboxTree( this.generator.generateToolboxXml()); // No categories, creates a simple flyout. @@ -1084,7 +1084,7 @@ WorkspaceFactoryController.prototype.setStandardOptionsAndUpdate = function() { WorkspaceFactoryController.prototype.generateNewOptions = function() { this.model.setOptions(this.readOptions_()); - this.reinjectPreview(Blockly.Options.parseToolboxTree( + this.reinjectPreview(Blockly.utils.toolbox.parseToolboxTree( this.generator.generateToolboxXml())); }; diff --git a/tests/mocha/index.html b/tests/mocha/index.html index 08a7fb642..d144f4865 100644 --- a/tests/mocha/index.html +++ b/tests/mocha/index.html @@ -146,10 +146,10 @@ - + - +