mirror of
https://github.com/google/blockly.git
synced 2026-01-12 03:17:09 +01:00
Migrate core/field_label_serializable.js named requires
This commit is contained in:
@@ -14,10 +14,10 @@
|
||||
goog.module('Blockly.FieldLabelSerializable');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
goog.require('Blockly.FieldLabel');
|
||||
goog.require('Blockly.fieldRegistry');
|
||||
goog.require('Blockly.utils');
|
||||
goog.require('Blockly.utils.object');
|
||||
const FieldLabel = goog.require('Blockly.FieldLabel');
|
||||
const fieldRegistry = goog.require('Blockly.fieldRegistry');
|
||||
const {inherits} = goog.require('Blockly.utils.object');
|
||||
const {replaceMessageReferences} = goog.require('Blockly.utils');
|
||||
|
||||
|
||||
/**
|
||||
@@ -28,7 +28,7 @@ goog.require('Blockly.utils.object');
|
||||
* @param {Object=} opt_config A map of options used to configure the field.
|
||||
* See the [field creation documentation]{@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/label-serializable#creation}
|
||||
* for a list of properties this parameter supports.
|
||||
* @extends {Blockly.FieldLabel}
|
||||
* @extends {FieldLabel}
|
||||
* @constructor
|
||||
*
|
||||
*/
|
||||
@@ -36,8 +36,8 @@ const FieldLabelSerializable = function(opt_value, opt_class, opt_config) {
|
||||
FieldLabelSerializable.superClass_.constructor.call(
|
||||
this, opt_value, opt_class, opt_config);
|
||||
};
|
||||
Blockly.utils.object.inherits(FieldLabelSerializable,
|
||||
Blockly.FieldLabel);
|
||||
inherits(FieldLabelSerializable,
|
||||
FieldLabel);
|
||||
|
||||
/**
|
||||
* Construct a FieldLabelSerializable from a JSON arg object,
|
||||
@@ -48,7 +48,7 @@ Blockly.utils.object.inherits(FieldLabelSerializable,
|
||||
* @nocollapse
|
||||
*/
|
||||
FieldLabelSerializable.fromJson = function(options) {
|
||||
const text = Blockly.utils.replaceMessageReferences(options['text']);
|
||||
const text = replaceMessageReferences(options['text']);
|
||||
// `this` might be a subclass of FieldLabelSerializable if that class doesn't
|
||||
// override the static fromJson method.
|
||||
return new this(text, undefined, options);
|
||||
@@ -68,7 +68,7 @@ FieldLabelSerializable.prototype.EDITABLE = false;
|
||||
*/
|
||||
FieldLabelSerializable.prototype.SERIALIZABLE = true;
|
||||
|
||||
Blockly.fieldRegistry.register(
|
||||
fieldRegistry.register(
|
||||
'field_label_serializable', FieldLabelSerializable);
|
||||
|
||||
exports = FieldLabelSerializable;
|
||||
|
||||
Reference in New Issue
Block a user