Skip to content

Commit

Permalink
refactor: Remove remaining references to Blockly.* from goog.modules (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcallen authored Sep 21, 2021
1 parent 66e6b62 commit e795508
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 15 deletions.
4 changes: 2 additions & 2 deletions core/block_svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ BlockSvg.prototype.checkAndDelete = function() {
if (this.workspace.isFlyout) {
return;
}
Blockly.Events.setGroup(true);
Events.setGroup(true);
this.workspace.hideChaff();
if (this.outputConnection) {
// Do not attempt to heal rows
Expand All @@ -983,7 +983,7 @@ BlockSvg.prototype.checkAndDelete = function() {
} else {
this.dispose(/* heal */ true, true);
}
Blockly.Events.setGroup(false);
Events.setGroup(false);
};

/**
Expand Down
5 changes: 3 additions & 2 deletions core/blockly.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
goog.module('Blockly');
goog.module.declareLegacyNamespace();

const Blocks = goog.require('Blockly.Blocks');
/* eslint-disable-next-line no-unused-vars */
const ICopyable = goog.requireType('Blockly.ICopyable');
const Size = goog.require('Blockly.utils.Size');
Expand Down Expand Up @@ -237,12 +238,12 @@ const defineBlocksWithJsonArray = function(jsonArray) {
'Block definition #' + i +
' in JSON array is missing a type attribute. Skipping.');
} else {
if (Blockly.Blocks[typename]) {
if (Blocks[typename]) {
console.warn(
'Block definition #' + i + ' in JSON array' +
' overwrites prior definition of "' + typename + '".');
}
Blockly.Blocks[typename] = {init: jsonInitFactory(elem)};
Blocks[typename] = {init: jsonInitFactory(elem)};
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion core/contextmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const WidgetDiv = goog.require('Blockly.WidgetDiv');
const Xml = goog.require('Blockly.Xml');
const aria = goog.require('Blockly.utils.aria');
const browserEvents = goog.require('Blockly.browserEvents');
const clipboard = goog.require('Blockly.clipboard');
const deprecation = goog.require('Blockly.utils.deprecation');
const dom = goog.require('Blockly.utils.dom');
const internalConstants = goog.require('Blockly.internalConstants');
Expand Down Expand Up @@ -302,7 +303,7 @@ const commentDuplicateOption = function(comment) {
text: Msg['DUPLICATE_COMMENT'],
enabled: true,
callback: function() {
Blockly.duplicate(comment);
clipboard.duplicate(comment);
}
};
return duplicateOption;
Expand Down
4 changes: 2 additions & 2 deletions core/dropdowndiv.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ DropDownDiv.createDom = function() {
}
const containerDiv = document.createElement('div');
containerDiv.className = 'blocklyDropDownDiv';
const parentDiv = Blockly.parentContainer || document.body;
const parentDiv = common.getParentContainer() || document.body;
parentDiv.appendChild(containerDiv);

DropDownDiv.DIV_ = containerDiv;
Expand Down Expand Up @@ -387,7 +387,7 @@ DropDownDiv.show = function(
div.style.direction = rtl ? 'rtl' : 'ltr';

const mainWorkspace =
/** @type {!WorkspaceSvg} */ (Blockly.getMainWorkspace());
/** @type {!WorkspaceSvg} */ (common.getMainWorkspace());
DropDownDiv.rendererClassName_ = mainWorkspace.getRenderer().getClassName();
DropDownDiv.themeClassName_ = mainWorkspace.getTheme().getClassName();
dom.addClass(div, DropDownDiv.rendererClassName_);
Expand Down
3 changes: 2 additions & 1 deletion core/renderers/common/drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const RenderInfo = goog.requireType('Blockly.blockRendering.RenderInfo');
/* eslint-disable-next-line no-unused-vars */
const Row = goog.requireType('Blockly.blockRendering.Row');
const Types = goog.require('Blockly.blockRendering.Types');
const blockRendering = goog.require('Blockly.blockRendering');
const svgPaths = goog.require('Blockly.utils.svgPaths');


Expand Down Expand Up @@ -73,7 +74,7 @@ Drawer.prototype.draw = function() {
if (this.info_.RTL) {
this.block_.pathObject.flipRTL();
}
if (Blockly.blockRendering.isDebuggerEnabled()) {
if (blockRendering.isDebuggerEnabled()) {
this.block_.renderingDebugger.drawDebug(this.block_, this.info_);
}
this.recordSizeOnBlock_();
Expand Down
2 changes: 1 addition & 1 deletion core/workspace_svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -2674,7 +2674,7 @@ WorkspaceSvg.prototype.hideChaff = function(opt_onlyClosePopups) {

var onlyClosePopups = !!opt_onlyClosePopups;
var autoHideables = this.getComponentManager().getComponents(
Blockly.ComponentManager.Capability.AUTOHIDEABLE, true);
ComponentManager.Capability.AUTOHIDEABLE, true);
autoHideables.forEach(
(autoHideable) => autoHideable.autoHide(onlyClosePopups));
};
Expand Down
6 changes: 3 additions & 3 deletions tests/deps.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions tests/deps.mocha.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e795508

Please sign in to comment.