mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
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:
committed by
GitHub
parent
a87dcc66fb
commit
b4cfe263fa
@@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user