Remove underscore from fromJson_

This commit is contained in:
Mark Gibson
2018-02-07 18:18:35 +00:00
parent 6ab7cd25f5
commit 2308ae8c22
11 changed files with 20 additions and 20 deletions

View File

@@ -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.

View File

@@ -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']);
};

View File

@@ -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');
};

View File

@@ -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']);
};

View File

@@ -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']);
};

View File

@@ -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']);
};

View File

@@ -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 =

View File

@@ -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']);
};

View File

@@ -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']);
};

View File

@@ -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') {

View File

@@ -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'];