mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Remove underscore from fromJson_
This commit is contained in:
@@ -1224,35 +1224,35 @@ Blockly.Block.prototype.interpolate_ = function(message, args, lastDummyAlign) {
|
||||
input = this.appendDummyInput(element['name']);
|
||||
break;
|
||||
case 'field_label':
|
||||
field = Blockly.FieldLabel.fromJson_(element);
|
||||
field = Blockly.FieldLabel.fromJson(element);
|
||||
break;
|
||||
case 'field_input':
|
||||
field = Blockly.FieldTextInput.fromJson_(element);
|
||||
field = Blockly.FieldTextInput.fromJson(element);
|
||||
break;
|
||||
case 'field_angle':
|
||||
field = Blockly.FieldAngle.fromJson_(element);
|
||||
field = Blockly.FieldAngle.fromJson(element);
|
||||
break;
|
||||
case 'field_checkbox':
|
||||
field = Blockly.FieldCheckbox.fromJson_(element);
|
||||
field = Blockly.FieldCheckbox.fromJson(element);
|
||||
break;
|
||||
case 'field_colour':
|
||||
field = Blockly.FieldColour.fromJson_(element);
|
||||
field = Blockly.FieldColour.fromJson(element);
|
||||
break;
|
||||
case 'field_variable':
|
||||
field = Blockly.FieldVariable.fromJson_(element);
|
||||
field = Blockly.FieldVariable.fromJson(element);
|
||||
break;
|
||||
case 'field_dropdown':
|
||||
field = Blockly.FieldDropdown.fromJson_(element);
|
||||
field = Blockly.FieldDropdown.fromJson(element);
|
||||
break;
|
||||
case 'field_image':
|
||||
field = Blockly.FieldImage.fromJson_(element);
|
||||
field = Blockly.FieldImage.fromJson(element);
|
||||
break;
|
||||
case 'field_number':
|
||||
field = Blockly.FieldNumber.fromJson_(element);
|
||||
field = Blockly.FieldNumber.fromJson(element);
|
||||
break;
|
||||
case 'field_date':
|
||||
if (Blockly.FieldDate) {
|
||||
field = Blockly.FieldDate.fromJson_(element);
|
||||
field = Blockly.FieldDate.fromJson(element);
|
||||
break;
|
||||
}
|
||||
// Fall through if FieldDate is not compiled in.
|
||||
|
||||
@@ -59,7 +59,7 @@ goog.inherits(Blockly.FieldAngle, Blockly.FieldTextInput);
|
||||
* @returns {!Blockly.FieldAngle} The new field instance.
|
||||
* @package
|
||||
*/
|
||||
Blockly.FieldAngle.fromJson_ = function(options) {
|
||||
Blockly.FieldAngle.fromJson = function(options) {
|
||||
return new Blockly.FieldAngle(options['angle']);
|
||||
};
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ goog.inherits(Blockly.FieldCheckbox, Blockly.Field);
|
||||
* @returns {!Blockly.FieldCheckbox} The new field instance.
|
||||
* @package
|
||||
*/
|
||||
Blockly.FieldCheckbox.fromJson_ = function(options) {
|
||||
Blockly.FieldCheckbox.fromJson = function(options) {
|
||||
return new Blockly.FieldCheckbox(options['checked'] ? 'TRUE' : 'FALSE');
|
||||
};
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ goog.inherits(Blockly.FieldColour, Blockly.Field);
|
||||
* @returns {!Blockly.FieldColour} The new field instance.
|
||||
* @package
|
||||
*/
|
||||
Blockly.FieldColour.fromJson_ = function(options) {
|
||||
Blockly.FieldColour.fromJson = function(options) {
|
||||
return new Blockly.FieldColour(options['colour']);
|
||||
};
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ goog.inherits(Blockly.FieldDate, Blockly.Field);
|
||||
* @returns {!Blockly.FieldDate} The new field instance.
|
||||
* @package
|
||||
*/
|
||||
Blockly.FieldDate.fromJson_ = function(options) {
|
||||
Blockly.FieldDate.fromJson = function(options) {
|
||||
return new Blockly.FieldDate(options['date']);
|
||||
};
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ goog.inherits(Blockly.FieldDropdown, Blockly.Field);
|
||||
* @returns {!Blockly.FieldDropdown} The new field instance.
|
||||
* @package
|
||||
*/
|
||||
Blockly.FieldDropdown.fromJson_ = function(options) {
|
||||
Blockly.FieldDropdown.fromJson = function(options) {
|
||||
return new Blockly.FieldDropdown(options['options']);
|
||||
};
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ goog.inherits(Blockly.FieldImage, Blockly.Field);
|
||||
* @returns {!Blockly.FieldImage} The new field instance.
|
||||
* @package
|
||||
*/
|
||||
Blockly.FieldImage.fromJson_ = function(options) {
|
||||
Blockly.FieldImage.fromJson = function(options) {
|
||||
var src = Blockly.utils.replaceMessageReferences(options['src']);
|
||||
var width = Number(Blockly.utils.replaceMessageReferences(options['width']));
|
||||
var height =
|
||||
|
||||
@@ -53,7 +53,7 @@ goog.inherits(Blockly.FieldLabel, Blockly.Field);
|
||||
* @returns {!Blockly.FieldLabel} The new field instance.
|
||||
* @package
|
||||
*/
|
||||
Blockly.FieldLabel.fromJson_ = function(options) {
|
||||
Blockly.FieldLabel.fromJson = function(options) {
|
||||
var text = Blockly.utils.replaceMessageReferences(options['text']);
|
||||
return new Blockly.FieldLabel(text, options['class']);
|
||||
};
|
||||
|
||||
@@ -60,7 +60,7 @@ goog.inherits(Blockly.FieldNumber, Blockly.FieldTextInput);
|
||||
* @returns {!Blockly.FieldNumber} The new field instance.
|
||||
* @package
|
||||
*/
|
||||
Blockly.FieldNumber.fromJson_ = function(options) {
|
||||
Blockly.FieldNumber.fromJson = function(options) {
|
||||
return new Blockly.FieldNumber(options['value'],
|
||||
options['min'], options['max'], options['precision']);
|
||||
};
|
||||
|
||||
@@ -58,7 +58,7 @@ goog.inherits(Blockly.FieldTextInput, Blockly.Field);
|
||||
* @returns {!Blockly.FieldTextInput} The new field instance.
|
||||
* @package
|
||||
*/
|
||||
Blockly.FieldTextInput.fromJson_ = function(options) {
|
||||
Blockly.FieldTextInput.fromJson = function(options) {
|
||||
var text = Blockly.utils.replaceMessageReferences(options['text']);
|
||||
var field = new Blockly.FieldTextInput(text, options['class']);
|
||||
if (typeof options['spellcheck'] === 'boolean') {
|
||||
|
||||
@@ -69,7 +69,7 @@ goog.inherits(Blockly.FieldVariable, Blockly.FieldDropdown);
|
||||
* @returns {!Blockly.FieldVariable} The new field instance.
|
||||
* @package
|
||||
*/
|
||||
Blockly.FieldVariable.fromJson_ = function(options) {
|
||||
Blockly.FieldVariable.fromJson = function(options) {
|
||||
var varname = Blockly.utils.replaceMessageReferences(options['variable']);
|
||||
var variableTypes = options['variableTypes'];
|
||||
var defaultType = options['defaultType'];
|
||||
|
||||
Reference in New Issue
Block a user