mirror of
https://github.com/google/blockly.git
synced 2026-01-09 18:10:08 +01:00
Migrate core/events/events_ui_base.js named requires
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user