diff --git a/core/events/events_ui.js b/core/events/events_ui.js index 5504b61d6..b191b986f 100644 --- a/core/events/events_ui.js +++ b/core/events/events_ui.js @@ -14,23 +14,23 @@ goog.module('Blockly.Events.Ui'); goog.module.declareLegacyNamespace(); -goog.require('Blockly.Events'); -goog.require('Blockly.Events.UiBase'); -goog.require('Blockly.registry'); -goog.require('Blockly.utils.object'); - -goog.requireType('Blockly.Block'); +/* eslint-disable-next-line no-unused-vars */ +const Block = goog.requireType('Blockly.Block'); +const Events = goog.require('Blockly.Events'); +const UiBase = goog.require('Blockly.Events.UiBase'); +const object = goog.require('Blockly.utils.object'); +const registry = goog.require('Blockly.registry'); /** * Class for a UI event. - * @param {?Blockly.Block=} opt_block The affected block. Null for UI events + * @param {?Block=} opt_block The affected block. Null for UI events * that do not have an associated block. Undefined for a blank event. * @param {string=} opt_element One of 'selected', 'comment', 'mutatorOpen', * etc. * @param {*=} opt_oldValue Previous value of element. * @param {*=} opt_newValue New value of element. - * @extends {Blockly.Events.UiBase} + * @extends {UiBase} * @deprecated December 2020. Instead use a more specific UI event. * @constructor */ @@ -44,13 +44,13 @@ const Ui = function(opt_block, opt_element, opt_oldValue, this.oldValue = typeof opt_oldValue == 'undefined' ? '' : opt_oldValue; this.newValue = typeof opt_newValue == 'undefined' ? '' : opt_newValue; }; -Blockly.utils.object.inherits(Ui, Blockly.Events.UiBase); +object.inherits(Ui, UiBase); /** * Type of this event. * @type {string} */ -Ui.prototype.type = Blockly.Events.UI; +Ui.prototype.type = Events.UI; /** * Encode the event as JSON. @@ -79,6 +79,6 @@ Ui.prototype.fromJson = function(json) { this.blockId = json['blockId']; }; -Blockly.registry.register(Blockly.registry.Type.EVENT, Blockly.Events.UI, +registry.register(registry.Type.EVENT, Events.UI, Ui); exports = Ui; diff --git a/core/events/events_ui_base.js b/core/events/events_ui_base.js index 9d54f0dcf..5bcf7270c 100644 --- a/core/events/events_ui_base.js +++ b/core/events/events_ui_base.js @@ -14,8 +14,8 @@ goog.module('Blockly.Events.UiBase'); goog.module.declareLegacyNamespace(); -goog.require('Blockly.Events.Abstract'); -goog.require('Blockly.utils.object'); +const Abstract = goog.require('Blockly.Events.Abstract'); +const object = goog.require('Blockly.utils.object'); /** @@ -26,7 +26,7 @@ goog.require('Blockly.utils.object'); * UI events do not undo or redo. * @param {string=} opt_workspaceId The workspace identifier for this event. * Undefined for a blank event. - * @extends {Blockly.Events.Abstract} + * @extends {Abstract} * @constructor */ const UiBase = function(opt_workspaceId) { @@ -47,7 +47,7 @@ const UiBase = function(opt_workspaceId) { // UI events do not undo or redo. this.recordUndo = false; }; -Blockly.utils.object.inherits(UiBase, Blockly.Events.Abstract); +object.inherits(UiBase, Abstract); /** * Whether or not the event is a UI event.