mirror of
https://github.com/google/blockly.git
synced 2026-01-09 18:10:08 +01:00
Remove three functions deprecated in 2015
We’ve had four years of console warnings, and this next release is known to be breaking. Each is trivial to fix in code.
This commit is contained in:
@@ -207,20 +207,6 @@ Blockly.Block = function(workspace, prototypeName, opt_id) {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Obtain a newly created block.
|
||||
* @param {!Blockly.Workspace} workspace The block's workspace.
|
||||
* @param {?string} prototypeName Name of the language object containing
|
||||
* type-specific functions for this block.
|
||||
* @return {!Blockly.Block} The created block.
|
||||
* @deprecated December 2015
|
||||
*/
|
||||
Blockly.Block.obtain = function(workspace, prototypeName) {
|
||||
console.warn('Deprecated call to Blockly.Block.obtain, ' +
|
||||
'use workspace.newBlock instead.');
|
||||
return workspace.newBlock(prototypeName);
|
||||
};
|
||||
|
||||
/**
|
||||
* Optional text data that round-trips beween blocks and XML.
|
||||
* Has no effect. May be used by 3rd parties for meta information.
|
||||
|
||||
@@ -377,21 +377,6 @@ Blockly.hideChaff = function(opt_allowToolbox) {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* When something in Blockly's workspace changes, call a function.
|
||||
* @param {!Function} func Function to call.
|
||||
* @return {!Array.<!Array>} Opaque data that can be passed to
|
||||
* removeChangeListener.
|
||||
* @deprecated April 2015
|
||||
*/
|
||||
Blockly.addChangeListener = function(func) {
|
||||
// Backwards compatibility from before there could be multiple workspaces.
|
||||
console.warn(
|
||||
'Deprecated call to Blockly.addChangeListener, ' +
|
||||
'use workspace.addChangeListener instead.');
|
||||
return Blockly.getMainWorkspace().addChangeListener(func);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the main workspace. Returns the last used main workspace (based on
|
||||
* focus). Try not to use this function, particularly if there are multiple
|
||||
|
||||
@@ -528,14 +528,3 @@ Blockly.inject.loadSounds_ = function(pathToMedia, workspace) {
|
||||
Blockly.bindEventWithChecks_(document, 'touchstart', null, unbindSounds,
|
||||
true));
|
||||
};
|
||||
|
||||
/**
|
||||
* Modify the block tree on the existing toolbox.
|
||||
* @param {Node|string} tree DOM tree of blocks, or text representation of same.
|
||||
* @deprecated April 2015
|
||||
*/
|
||||
Blockly.updateToolbox = function(tree) {
|
||||
console.warn('Deprecated call to Blockly.updateToolbox, ' +
|
||||
'use workspace.updateToolbox instead.');
|
||||
Blockly.getMainWorkspace().updateToolbox(tree);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user