Removing (most) Closure from BlockFactory (#1925)

Replacing all Closure goog. library calls from BlockFactory, with the exception of the ColorPicker and the test for the warning about running without Closure. This includes (almost) all goog.provide and goog.require statements.
This commit is contained in:
Andrew n marshall
2018-06-15 15:29:41 -07:00
committed by GitHub
parent a87dcc66fb
commit b4cfe263fa
17 changed files with 88 additions and 216 deletions

View File

@@ -32,10 +32,7 @@
/**
* Namespace for FactoryUtils.
*/
goog.provide('FactoryUtils');
goog.require('BlockDefinitionExtractor');
var FactoryUtils = FactoryUtils || Object.create(null);
/**
* Get block definition code for the current block.
@@ -768,7 +765,7 @@ FactoryUtils.getBlockTypeFromJsDefinition = function(blockDef) {
*/
FactoryUtils.generateCategoryXml = function(blocks, categoryName) {
// Create category DOM element.
var categoryElement = goog.dom.createDom('category');
var categoryElement = document.createElement('category');
categoryElement.setAttribute('name', categoryName);
// For each block, add block element to category.
@@ -892,7 +889,7 @@ FactoryUtils.injectCode = function(code, id) {
pre.textContent = code;
code = pre.textContent;
code = PR.prettyPrintOne(code, 'js');
pre.innerHTML = code;
pre.textContent = code;
};
/**